From c9bd737758aeac52342b838a677591dd463cb073 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Jun 2024 15:14:36 +0000 Subject: [PATCH] deploy: d3ef2a2b55152ac536346bbd4d158b053660d8a3 --- 404.html | 6 +- adoption/all/index.html | 4 +- adoption/custodial/index.html | 4 +- adoption/desktop/index.html | 4 +- adoption/exchange/index.html | 4 +- adoption/hardware/index.html | 4 +- adoption/infrastructure/index.html | 4 +- adoption/mobile/index.html | 4 +- adoption/web/index.html | 4 +- assets/js/{19.fa54ae34.js => 19.09984b8f.js} | 2 +- assets/js/{21.aa6ad25b.js => 21.ace15d2d.js} | 2 +- assets/js/{31.00e676e0.js => 31.dadf64cd.js} | 2 +- assets/js/{34.0cca050d.js => 34.530523dd.js} | 2 +- assets/js/{35.114fe51f.js => 35.e3cc4111.js} | 2 +- assets/js/{36.f5632206.js => 36.fa4b2252.js} | 2 +- assets/js/{37.4c491801.js => 37.a5bff0bd.js} | 2 +- assets/js/{38.109014d3.js => 38.2ace5b2d.js} | 2 +- assets/js/{40.1dca96ab.js => 40.3dbbc631.js} | 2 +- assets/js/{41.dd41fb56.js => 41.802e975e.js} | 2 +- assets/js/{42.78dc17a2.js => 42.86af1298.js} | 2 +- assets/js/{46.8a620891.js => 46.5ba99f9c.js} | 2 +- assets/js/{47.5dee4bad.js => 47.70dc63ea.js} | 2 +- assets/js/{48.d82a543b.js => 48.274276ff.js} | 2 +- assets/js/{49.c37e1b0c.js => 49.c5e899f8.js} | 2 +- assets/js/{50.525b80bb.js => 50.23919774.js} | 2 +- assets/js/{51.4769671b.js => 51.503dcbd1.js} | 2 +- assets/js/{56.6f4a5401.js => 56.8c98f09e.js} | 2 +- assets/js/{57.64bfd1b2.js => 57.17897a36.js} | 2 +- assets/js/{62.f686b521.js => 62.029da30e.js} | 2 +- assets/js/{63.2b67542d.js => 63.08ff5987.js} | 2 +- assets/js/{66.dc7e2efd.js => 66.62fed6f7.js} | 2 +- assets/js/{67.2683e61c.js => 67.c17340ef.js} | 2 +- assets/js/{69.21c85af3.js => 69.5afcde3f.js} | 2 +- assets/js/{71.2e4adfaf.js => 71.9f464778.js} | 2 +- assets/js/{72.3dd57922.js => 72.1c2cf134.js} | 2 +- assets/js/{74.8a409e4e.js => 74.ae6867a4.js} | 2 +- assets/js/{75.e1920f80.js => 75.fc268886.js} | 2 +- assets/js/{78.74419356.js => 78.1816ce47.js} | 2 +- assets/js/{80.b1938c71.js => 80.b9017867.js} | 2 +- assets/js/{82.d0dc05bc.js => 82.a858da93.js} | 2 +- assets/js/{88.4bca1259.js => 88.c63c0587.js} | 2 +- assets/js/{89.351dd0b1.js => 89.01f3740b.js} | 2 +- assets/js/{90.ebb1edf1.js => 90.d19e45ae.js} | 2 +- assets/js/{91.bd284082.js => 91.cc301224.js} | 2 +- assets/js/{92.20a48c5f.js => 92.c93a606e.js} | 2 +- .../js/{app.fa26e167.js => app.f121eb03.js} | 4 +- bdk-cli/compiler/index.html | 6 +- bdk-cli/concept/index.html | 6 +- bdk-cli/installation/index.html | 6 +- bdk-cli/interface/index.html | 6 +- bdk-cli/introduction/index.html | 6 +- bdk-cli/playground/index.html | 6 +- bdk-cli/regtest/index.html | 6 +- blog/2020/12/hello-world/index.html | 6 +- blog/2020/12/release-v0.2.0/index.html | 6 +- .../index.html | 6 +- .../index.html | 6 +- .../index.html | 6 +- blog/2021/01/release-v0.3.0/index.html | 6 +- blog/2021/02/release-v0.4.0/index.html | 6 +- blog/2021/03/release-v0.5.0/index.html | 6 +- blog/2021/04/release-v0.6.0/index.html | 6 +- blog/2021/05/release-v0.7.0/index.html | 6 +- blog/2021/06/release-v0.8.0/index.html | 6 +- blog/2021/07/release-v0.9.0/index.html | 6 +- .../index.html | 6 +- .../index.html | 6 +- blog/_2023-q4-update/index.html | 6 +- blog/_2024-q1-update/index.html | 6 +- blog/author/Alekos Filini/index.html | 4 +- blog/author/Alekos Filini/page/2/index.html | 4 +- blog/author/Bitcoin Zavior/index.html | 4 +- .../C\303\251sar Alvarez Vallero/index.html" | 4 +- blog/author/Daniela Brozzoni/index.html | 4 +- blog/author/Gabriele Domenichini/index.html | 4 +- blog/author/Lloyd Fournier/index.html | 4 +- blog/author/Rajarshi Maitra/index.html | 4 +- blog/author/Riccardo Casatta/index.html | 8 +- blog/author/Sandipan Dey/index.html | 4 +- blog/author/Steve Myers/index.html | 4 +- blog/author/Wszdexdrf/index.html | 4 +- blog/author/index.html | 6 +- blog/author/rorp/index.html | 4 +- blog/author/thunderbiscuit/index.html | 4 +- blog/author/waterst0ne/index.html | 4 +- blog/bdk-cli-basics-multisig-2of3/index.html | 6 +- blog/bdk-cli-basics/index.html | 6 +- blog/bdk-core-pt1/index.html | 6 +- blog/bdk-rn-making-of/index.html | 6 +- blog/bdk-with-tor/index.html | 6 +- blog/bindings-scope/index.html | 6 +- blog/bitcoin-core-rpc-demo/index.html | 6 +- blog/compact-filters-demo/index.html | 6 +- blog/descriptor-based-paper-wallet/index.html | 6 +- blog/descriptors-in-the-wild/index.html | 6 +- blog/exploring-bdk-flutter/index.html | 6 +- blog/exploring-bdk-rn/index.html | 6 +- blog/getting-started-with-rust-hwi/index.html | 6 +- blog/hidden-power-of-bitcoin/index.html | 6 +- .../index.html | 6 +- blog/index.html | 4 +- blog/miniscript-vulnerability/index.html | 6 +- blog/page/2/index.html | 4 +- blog/page/3/index.html | 6 +- blog/page/4/index.html | 6 +- blog/road-to-bdk-1/index.html | 6 +- blog/spending-policy-demo/index.html | 6 +- blog/tags/Android/index.html | 4 +- blog/tags/Architecture/index.html | 4 +- blog/tags/BDK-RN/index.html | 4 +- blog/tags/BDK/index.html | 4 +- blog/tags/BIP157/index.html | 4 +- blog/tags/Bitcoin Core/index.html | 4 +- blog/tags/Development/index.html | 4 +- blog/tags/Flutter/index.html | 4 +- blog/tags/Hardware Wallets/index.html | 4 +- blog/tags/Neutrino/index.html | 4 +- blog/tags/RPC/index.html | 4 +- blog/tags/React Native/index.html | 4 +- blog/tags/Wallet/index.html | 4 +- blog/tags/architecture/index.html | 4 +- blog/tags/basics/index.html | 4 +- blog/tags/bdk-cli/index.html | 4 +- blog/tags/bdk-rn/index.html | 4 +- blog/tags/bdk/index.html | 4 +- blog/tags/bindings/index.html | 4 +- blog/tags/bitcoin-cli/index.html | 4 +- blog/tags/bitcoin/index.html | 4 +- blog/tags/blockchain/index.html | 4 +- blog/tags/coin selection/index.html | 4 +- blog/tags/compact_filters/index.html | 4 +- blog/tags/descriptor/index.html | 4 +- blog/tags/development/index.html | 4 +- blog/tags/fee/index.html | 8 +- blog/tags/getting started/index.html | 4 +- blog/tags/guide/index.html | 4 +- blog/tags/iOS/index.html | 4 +- blog/tags/index.html | 6 +- blog/tags/machine learning/index.html | 8 +- blog/tags/miniscript/index.html | 4 +- blog/tags/mobile/index.html | 4 +- blog/tags/multi-sig/index.html | 4 +- blog/tags/novice/index.html | 4 +- blog/tags/paper wallets/index.html | 4 +- blog/tags/project/index.html | 4 +- blog/tags/release/index.html | 4 +- blog/tags/rust/index.html | 4 +- blog/tags/security/index.html | 4 +- blog/tags/summer of bitcoin/index.html | 4 +- blog/tags/taproot/index.html | 4 +- blog/tags/tor/index.html | 4 +- blog/tags/tutorial/index.html | 4 +- blog/tags/wallet/index.html | 4 +- .../index.html | 6 +- blog/why-bindings/index.html | 6 +- case-studies/index.html | 4 +- descriptors/index.html | 6 +- .../bdk_bitcoind_rpc/struct.BlockEvent.html | 12 +- .../bdk_bitcoind_rpc/struct.Emitter.html | 2 +- docs-rs/bdk/nightly/latest/bdk_chain/all.html | 2 +- .../bdk_chain/constant.BIP32_MAX_INDEX.html | 2 +- .../bdk_chain/constant.COINBASE_MATURITY.html | 2 +- .../bdk/nightly/latest/bdk_chain/index.html | 4 +- .../indexed_tx_graph/trait.Indexer.html | 2 +- .../keychain/constant.DEFAULT_LOOKAHEAD.html | 2 + .../keychain/enum.InsertDescriptorError.html | 37 + .../latest/bdk_chain/keychain/index.html | 4 +- .../bdk_chain/keychain/sidebar-items.js | 2 +- .../bdk_chain/keychain/struct.Balance.html | 4 +- .../bdk_chain/keychain/struct.ChangeSet.html | 30 +- .../keychain/struct.KeychainTxOutIndex.html | 194 ++-- .../keychain/struct.NoSuchKeychain.html | 23 + .../constant.DEFAULT_LOOKAHEAD.html | 11 + .../enum.InsertDescriptorError.html | 11 + .../txout_index/struct.NoSuchKeychain.html | 11 + .../bdk_chain/keychain/type.Indexed.html | 2 + .../keychain/type.KeychainIndexed.html | 2 + .../latest/bdk_chain/spk_client/index.html | 2 +- .../spk_client/struct.FullScanRequest.html | 22 +- .../spk_client/struct.FullScanResult.html | 2 +- .../spk_client/struct.SyncRequest.html | 24 +- .../spk_client/struct.SyncResult.html | 2 +- .../latest/bdk_chain/struct.SpkIterator.html | 16 +- .../bdk_chain/struct.SpkTxOutIndex.html | 4 +- .../latest/bdk_chain/trait.Append.html | 2 +- .../bdk/nightly/latest/bdk_esplora/index.html | 2 +- .../bdk_esplora/trait.EsploraAsyncExt.html | 30 +- .../latest/bdk_esplora/trait.EsploraExt.html | 30 +- .../latest/bdk_file_store/struct.Store.html | 4 +- .../bdk/nightly/latest/bdk_persist/index.html | 2 +- .../bdk_persist/struct.CombinedChangeSet.html | 14 +- .../latest/bdk_persist/struct.Persist.html | 2 +- .../latest/bdk_sqlite/struct.Store.html | 4 +- .../descriptor/enum.Descriptor.html | 4 +- .../descriptor/error/enum.Error.html | 4 +- .../bdk_wallet/descriptor/error/index.html | 2 +- .../descriptor/policy/enum.PolicyError.html | 2 +- .../bdk/nightly/latest/bdk_wallet/index.html | 2 +- .../latest/bdk_wallet/keys/enum.KeyError.html | 2 +- .../latest/bdk_wallet/struct.LocalOutput.html | 4 +- .../wallet/enum.ApplyBlockError.html | 4 +- .../fn.wallet_name_from_descriptor.html | 2 +- .../latest/bdk_wallet/wallet/index.html | 2 +- .../bdk_wallet/wallet/struct.Balance.html | 14 +- .../bdk_wallet/wallet/struct.Update.html | 14 +- .../bdk_wallet/wallet/struct.Wallet.html | 144 +-- .../bdk_wallet/wallet/type.ChangeSet.html | 6 +- .../type.ChangeSet.html | 2 +- .../latest/example_cli/fn.create_tx.html | 4 +- .../example_cli/fn.handle_commands.html | 6 +- .../nightly/latest/example_cli/fn.init.html | 4 +- .../latest/example_cli/fn.planned_utxos.html | 4 +- .../bdk/nightly/latest/example_cli/index.html | 2 +- .../example_cli/struct.CreateTxChange.html | 4 +- .../latest/example_cli/struct.Init.html | 6 +- .../example_cli/type.KeychainChangeSet.html | 2 +- .../example_cli/type.KeychainTxGraph.html | 6 +- .../latest/example_cli/type.PlannedUtxo.html | 2 +- .../latest/example_electrum/fn.main.html | 2 +- .../latest/example_electrum/index.html | 2 +- .../example_electrum/type.ChangeSet.html | 2 +- .../latest/example_esplora/fn.main.html | 2 +- .../nightly/latest/example_esplora/index.html | 2 +- .../example_esplora/type.ChangeSet.html | 2 +- docs-rs/bdk/nightly/latest/search-index.js | 4 +- .../bdk_chain/bdk_chain-desc-0-.js | 2 +- .../latest/src/bdk_chain/keychain.rs.html | 12 +- .../bdk_chain/keychain/txout_index.rs.html | 952 ++++++++---------- .../nightly/latest/src/bdk_chain/lib.rs.html | 2 + .../latest/src/bdk_chain/spk_client.rs.html | 12 +- .../latest/src/bdk_chain/spk_iter.rs.html | 16 +- .../src/bdk_chain/spk_txout_index.rs.html | 4 +- .../latest/src/bdk_esplora/async_ext.rs.html | 4 +- .../src/bdk_esplora/blocking_ext.rs.html | 4 +- .../src/bdk_wallet/descriptor/error.rs.html | 2 - .../latest/src/bdk_wallet/wallet/mod.rs.html | 74 +- .../example_bitcoind_rpc_polling/main.rs.html | 4 +- .../latest/src/example_cli/lib.rs.html | 20 +- .../latest/src/example_electrum/main.rs.html | 20 +- .../latest/src/example_esplora/main.rs.html | 18 +- .../bdk_chain/tx_data_traits/trait.Append.js | 2 +- .../persist/trait.PersistBackend.js | 4 +- .../trait.impl/core/clone/trait.Clone.js | 2 +- .../latest/trait.impl/core/cmp/trait.Eq.js | 2 +- .../trait.impl/core/cmp/trait.PartialEq.js | 2 +- .../trait.impl/core/convert/trait.AsRef.js | 2 +- .../trait.impl/core/convert/trait.From.js | 4 +- .../trait.impl/core/error/trait.Error.js | 2 +- .../latest/trait.impl/core/fmt/trait.Debug.js | 2 +- .../trait.impl/core/fmt/trait.Display.js | 2 +- .../trait.impl/core/marker/trait.Freeze.js | 2 +- .../trait.impl/core/marker/trait.Send.js | 2 +- .../core/marker/trait.StructuralPartialEq.js | 2 +- .../trait.impl/core/marker/trait.Sync.js | 2 +- .../trait.impl/core/marker/trait.Unpin.js | 2 +- .../panic/unwind_safe/trait.RefUnwindSafe.js | 2 +- .../panic/unwind_safe/trait.UnwindSafe.js | 2 +- .../collections/btree/map/struct.BTreeMap.js | 2 +- .../indexed_tx_graph/struct.IndexedTxGraph.js | 2 +- .../changeset/struct.CombinedChangeSet.js | 2 +- .../bdk_wallet/descriptor/enum.Descriptor.js | 2 +- .../latest/type.impl/std/primitive.tuple.js | 1 + examples/index.html | 6 +- foundation/about/index.html | 4 +- foundation/grantees/index.html | 4 +- foundation/grants/index.html | 4 +- foundation/index.html | 4 +- foundation/supporters/index.html | 4 +- getting-started/index.html | 6 +- index.html | 4 +- sitemap.xml | 2 +- 271 files changed, 1378 insertions(+), 1304 deletions(-) rename assets/js/{19.fa54ae34.js => 19.09984b8f.js} (99%) rename assets/js/{21.aa6ad25b.js => 21.ace15d2d.js} (98%) rename assets/js/{31.00e676e0.js => 31.dadf64cd.js} (99%) rename assets/js/{34.0cca050d.js => 34.530523dd.js} (99%) rename assets/js/{35.114fe51f.js => 35.e3cc4111.js} (98%) rename assets/js/{36.f5632206.js => 36.fa4b2252.js} (80%) rename assets/js/{37.4c491801.js => 37.a5bff0bd.js} (92%) rename assets/js/{38.109014d3.js => 38.2ace5b2d.js} (87%) rename assets/js/{40.1dca96ab.js => 40.3dbbc631.js} (86%) rename assets/js/{41.dd41fb56.js => 41.802e975e.js} (97%) rename assets/js/{42.78dc17a2.js => 42.86af1298.js} (89%) rename assets/js/{46.8a620891.js => 46.5ba99f9c.js} (99%) rename assets/js/{47.5dee4bad.js => 47.70dc63ea.js} (98%) rename assets/js/{48.d82a543b.js => 48.274276ff.js} (99%) rename assets/js/{49.c37e1b0c.js => 49.c5e899f8.js} (99%) rename assets/js/{50.525b80bb.js => 50.23919774.js} (99%) rename assets/js/{51.4769671b.js => 51.503dcbd1.js} (99%) rename assets/js/{56.6f4a5401.js => 56.8c98f09e.js} (99%) rename assets/js/{57.64bfd1b2.js => 57.17897a36.js} (99%) rename assets/js/{62.f686b521.js => 62.029da30e.js} (99%) rename assets/js/{63.2b67542d.js => 63.08ff5987.js} (99%) rename assets/js/{66.dc7e2efd.js => 66.62fed6f7.js} (99%) rename assets/js/{67.2683e61c.js => 67.c17340ef.js} (99%) rename assets/js/{69.21c85af3.js => 69.5afcde3f.js} (98%) rename assets/js/{71.2e4adfaf.js => 71.9f464778.js} (99%) rename assets/js/{72.3dd57922.js => 72.1c2cf134.js} (99%) rename assets/js/{74.8a409e4e.js => 74.ae6867a4.js} (99%) rename assets/js/{75.e1920f80.js => 75.fc268886.js} (99%) rename assets/js/{78.74419356.js => 78.1816ce47.js} (99%) rename assets/js/{80.b1938c71.js => 80.b9017867.js} (99%) rename assets/js/{82.d0dc05bc.js => 82.a858da93.js} (96%) rename assets/js/{88.4bca1259.js => 88.c63c0587.js} (97%) rename assets/js/{89.351dd0b1.js => 89.01f3740b.js} (99%) rename assets/js/{90.ebb1edf1.js => 90.d19e45ae.js} (98%) rename assets/js/{91.bd284082.js => 91.cc301224.js} (90%) rename assets/js/{92.20a48c5f.js => 92.c93a606e.js} (98%) rename assets/js/{app.fa26e167.js => app.f121eb03.js} (70%) create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/constant.DEFAULT_LOOKAHEAD.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/enum.InsertDescriptorError.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.NoSuchKeychain.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/constant.DEFAULT_LOOKAHEAD.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/enum.InsertDescriptorError.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/struct.NoSuchKeychain.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.Indexed.html create mode 100644 docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.KeychainIndexed.html diff --git a/404.html b/404.html index ebdbc706e0..9ad59a3190 100644 --- a/404.html +++ b/404.html @@ -15,7 +15,7 @@ - + @@ -39,7 +39,7 @@ Blog GitHub - (opens new window)

404 - Not Found

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

404 - Not Found

How did we get here?
Take me home.
- + diff --git a/adoption/all/index.html b/adoption/all/index.html index c35edc800a..cdea81eb39 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 70bc3371aa..61ea879d09 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 39f8604f91..a57350d136 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 507fd31f77..3bf208a9ad 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 86e9e200fd..dbbecf4f33 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 de490e4883..115342a918 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 077fbf1ce9..499818a064 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 9beb74cfac..d1df68ed52 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.fa54ae34.js b/assets/js/19.09984b8f.js similarity index 99% rename from assets/js/19.fa54ae34.js rename to assets/js/19.09984b8f.js index d4024654b6..6c67837073 100644 --- a/assets/js/19.fa54ae34.js +++ b/assets/js/19.09984b8f.js @@ -1 +1 @@ -(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 +(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 diff --git a/assets/js/21.aa6ad25b.js b/assets/js/21.ace15d2d.js similarity index 98% rename from assets/js/21.aa6ad25b.js rename to assets/js/21.ace15d2d.js index c861a4b143..dadb41c55d 100644 --- a/assets/js/21.aa6ad25b.js +++ b/assets/js/21.ace15d2d.js @@ -1 +1 @@ -(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 +(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"},413: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 diff --git a/assets/js/31.00e676e0.js b/assets/js/31.dadf64cd.js similarity index 99% rename from assets/js/31.00e676e0.js rename to assets/js/31.dadf64cd.js index bc94982ce2..025736f127 100644 --- a/assets/js/31.00e676e0.js +++ b/assets/js/31.dadf64cd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{352:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN-Architecture.42fbc351.png"},353:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN.370f20c3.png"},354:function(t,e,a){t.exports=a.p+"assets/img/android_folder.0ff999be.png"},406:function(t,e,a){"use strict";a.r(e);var n=a(7),s=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("The "),e("strong",[t._v("BitcoinDevkit")]),t._v("'s "),e("strong",[t._v("React Native")]),t._v(" library ("),e("code",[t._v("bdk-rn")]),t._v(") makes it easy to develop bitcoin applications for both Android and iOS mobile platforms. Using "),e("code",[t._v("bdk-rn")]),t._v(", knowledge of the underlying bitcoin and BDK API is not required and using "),e("code",[t._v("bdk-rn")]),t._v(" is similar to using any other RN module. The goal is "),e("strong",[t._v("Rapid Bitcoin Application Development")]),t._v(" by doing the heavy lifting in advance and providing a reusable library for other developers to use. Developers simply install using "),e("code",[t._v("yarn add")]),t._v(" and start using it in a React Native Project. The native code, Rust lang implementation, configuration and other setup details are all taken care of by "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("p",[t._v("This article is "),e("strong",[t._v("NOT a guide on how to use bdk-rn")]),t._v(" to build a bitcoin application, rather this is an insight into how "),e("code",[t._v("bdk-rn")]),t._v(" was developed. For help on how to use "),e("code",[t._v("bdk-rn")]),t._v(" to develop a bitcoin wallet or application please refer to the user guide in the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),e("OutboundLink")],1),t._v(" on Github. There will be "),e("code",[t._v("how to guides")]),t._v(" published shortly on getting started with "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"react-native-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#react-native-architecture"}},[t._v("#")]),t._v(" React Native Architecture")]),t._v(" "),e("p",[t._v("At a high level, RN consists of the UI front which is essentially JavaScript which interacts with the native iOS and Android platforms over a bridge. When communicating over the bridge values from JS are converted to native and vice versa.")]),t._v(" "),e("p",[t._v("The native part of RN consists of Android as well as iOS modules and components. The Android and iOS sections are full fledged native projects which interact with the JS side over the native bridge. A RN project has all the build configuraiton required to build both Android and iOS projects.")]),t._v(" "),e("p",[t._v("For the purpose of making "),e("code",[t._v("bdk-rn")]),t._v(", "),e("code",[t._v("bdk-kotlin")]),t._v(" is used as the native Android module and "),e("code",[t._v("bdk-swift")]),t._v(" as the native iOS module. These are configured and wrapped in a RN Project as part of the platform specific native modules within the RN Project. This RN Project is then built to be a reusable React Native module.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(352),alt:""}})]),t._v(" "),e("h2",{attrs:{id:"native-integration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#native-integration"}},[t._v("#")]),t._v(" Native Integration")]),t._v(" "),e("p",[t._v("In order to communicate to native modules on Android and iOS, React Native provides React Context API for Java/Kotlin as well as Swift. React Context API are used to build the interface to the native bridge allowing communication from JS to native modules.")]),t._v(" "),e("p",[t._v("bdk-rn uses React Context API plus some native code to wrap and enhance bdk-kotlin and bdk-swift APIs. The native code calls and interacts with the Android and iOS native modules which interface with the underlying mobile platform.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"20%"},attrs:{src:a(353)}}),t._v(" "),e("h2",{attrs:{id:"android-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#android-module"}},[t._v("#")]),t._v(" Android Module")]),t._v(" "),e("p",[t._v("We will go into the details of how the BDK Android Module is integrated, we wont cover iOS.")]),t._v(" "),e("p",[t._v("Starting off with a basic RN project. This project will be enhanced with bdk-kotlin and bdk-swift binaries and native code. For now lets go into the details for Android, iOS has similar steps to be done in Swift.")]),t._v(" "),e("p",[t._v("The Android native project is located under the root project folder.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"120%"},attrs:{src:a(354)}}),t._v(" "),e("p",[t._v("Here we need to add a dependency in "),e("code",[t._v("build.gradle")]),t._v(" for bdk-kotlin's android native binary. This will enable bdk-kotlin to be downloaded and available as one of the native modules.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: build.gradle")]),t._v("\n\nrepositories "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mavenCentral")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ndependencies "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//noinspection GradleDynamicVersion")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'com.facebook.react:react-native:+'")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// bitcoindevkit")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'org.bitcoindevkit:bdk-android:0.7.1'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We will create an Android native module which will interact with "),e("code",[t._v("bdk-android")]),t._v(".\nThis is done by adding a new Kotlin file "),e("code",[t._v("BdkRnModule.kt")]),t._v(" inside "),e("code",[t._v("android/app/src/main/java/com/bdkrn/")]),t._v(" folder")]),t._v(" "),e("p",[t._v("This will be part of the native code for bdk-rn module.Here a new class will be created to encapsulate the interaction with bitcoindevkit's android native binary.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SuppressLint\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Log\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Arguments\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Promise "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" Result\n")])])]),e("p",[e("code",[t._v("org.bitcoindevkit")]),t._v(" will also need to be imported here")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" org"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bitcoindevkit"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Wallet "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" BdkWallet\n")])])]),e("p",[t._v("To use React Context API "),e("code",[t._v("com.facebook.react.bridge.*")]),t._v(" also needs to be imported")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("\n")])])]),e("p",[t._v("A new class needs to be defined here which will implement the React Context API")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\t"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ReactContextBaseJavaModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BdkRnModule"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("With the base imports and class defined, we can start writing methods.\nThis will demonstrate how bdk native module will be called and how values will be returned to JS over the native bridge")]),t._v(" "),e("p",[t._v("Lets create a method that can be called from JaveScript, to do so we use the "),e("code",[t._v("@ReactMethod")]),t._v(" directive which is part of the React Context API. This will expose the method so that it can be called from JavaScript.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We need one more file to complete our native framework. A new Kotlin file, "),e("code",[t._v("BdkRnPackage.kt")]),t._v(" is required to package all our native code into a new android module, here we specify the name of the file we just crated as the module name("),e("code",[t._v("BdkRnModule")]),t._v("). This can be done by adding the following code:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnPackage.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactPackage\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NativeModule\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactApplicationContext\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("uimanager"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ViewManager\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" BdkRnPackage "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactPackage "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNativeModules")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n MutableList"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NativeModule"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mutableListOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),e("p",[t._v("Now lets add code for creating a wallet in BdkRnModule.kt")]),t._v(" "),e("p",[t._v("The methods used here are for bdk-kotlin and available in the bdk-kotlin documentation.")]),t._v(" "),e("p",[t._v("We first create a key info object")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create key info with a new mnemonic")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ExtendedKeyInfo "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateExtendedKey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WordCount"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("WORDS12"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// more code to follow...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create descriptor and change descriptor")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create databaseConfig and blockchainconfig")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create wallet")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Then key info used to create a wallet descriptor and change descriptor:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" descriptor"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')])]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(' "'),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("84")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*)\"\n\nval changeDescriptor: String = descriptor.replace(\"/84'/1'/0'/0/*\",\"/84'/1'/0'/1/*\")\n")])])])]),e("p",[t._v("To create a wallet with bdk we need to specify wallet descriptor, network, a database config, blockchain config. We intend to use bitcoin testnet and want to use default memory for data. For bitcoin node we will use a public electrum server. We will need to define these parameters to create a wallet.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" network "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" `Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET`\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" databaseConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DatabaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Memory\nblockchainConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n BlockchainConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("Electrum")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ElectrumConfig")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 5u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 10u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once done we can use these parameters to create a BDK wallet using the native android BDK library:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" BdkWallet "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n descriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n changeDescriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("setNetwork")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n databaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n config\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once we have a wallet initialised, we can call methods on it to sync, generate a new address and to get balance")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[t._v("wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ProgressLog"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxAddress"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("To return a value from the native android code to React Native’s Javascript side over the JS Native bridge we will use "),e("code",[t._v("com.facebook.react.bridge.Promise")]),t._v(". To return balance information to JS, the following code can be used")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" balance"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nresult"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("At this point we have an Android native module and it can be invoked from JS by calling "),e("code",[t._v("createWallet")]),t._v(" and it will return the balance.")]),t._v(" "),e("p",[t._v("This project can be imported into any RN project to reuse the defined "),e("code",[t._v("createWallet")]),t._v(" method without the need to carry out the setup described above.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// any js file in React Native")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a wallet and retrieve current balance")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nconsole"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n")])])]),e("p",[t._v("The actual "),e("code",[t._v("bdk-rn")]),t._v(" module has organised the native code into granular methods for different stages of creating a wallet and for different interactions and use cases for a bitcoin application, like generating, mnemonic, keys, creating wallet for different networks, creating descriptors, creating or restoring wallet, fetching balance, fetching transactions and many other methods. Please refer to the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("user guide in the readme"),e("OutboundLink")],1),t._v(" on Github for the complete API. The set of APIs available will grow in the near future as more APIs are added. This article can also be used as a guide to add new methods to the existing bdk-rn project.")]),t._v(" "),e("p",[t._v("The objective of "),e("code",[t._v("bdk-rn")]),t._v(" is to enable React Native developers to quickly start developing applications without the need to package BDK as described above.")]),t._v(" "),e("p",[t._v("Be on the lookout for user guides and tutorials on how to build bitcoin applications using "),e("code",[t._v("bdk-rn")]),t._v(" and "),e("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"references"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References")]),t._v(" "),e("p",[t._v("Creating native modules for Android and iOS: "),e("a",{attrs:{href:"https://reactnative.dev/docs/native-modules-intro",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://reactnative.dev/docs/native-modules-intro"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("React Native Architecture: "),e("a",{attrs:{href:"https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-Android API: "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-RN: "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/LtbLightning/bdk-rn"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"feedback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feedback"}},[t._v("#")]),t._v(" Feedback")]),t._v(" "),e("p",[t._v("The best way to give feedback on this would be to comment on the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoindevkit.org/pull/107",target:"_blank",rel:"noopener noreferrer"}},[t._v("pull request"),e("OutboundLink")],1),t._v(" for this blog post.\nThanks in advance.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{352:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN-Architecture.42fbc351.png"},353:function(t,e,a){t.exports=a.p+"assets/img/BDK-RN.370f20c3.png"},354:function(t,e,a){t.exports=a.p+"assets/img/android_folder.0ff999be.png"},407:function(t,e,a){"use strict";a.r(e);var n=a(7),s=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("The "),e("strong",[t._v("BitcoinDevkit")]),t._v("'s "),e("strong",[t._v("React Native")]),t._v(" library ("),e("code",[t._v("bdk-rn")]),t._v(") makes it easy to develop bitcoin applications for both Android and iOS mobile platforms. Using "),e("code",[t._v("bdk-rn")]),t._v(", knowledge of the underlying bitcoin and BDK API is not required and using "),e("code",[t._v("bdk-rn")]),t._v(" is similar to using any other RN module. The goal is "),e("strong",[t._v("Rapid Bitcoin Application Development")]),t._v(" by doing the heavy lifting in advance and providing a reusable library for other developers to use. Developers simply install using "),e("code",[t._v("yarn add")]),t._v(" and start using it in a React Native Project. The native code, Rust lang implementation, configuration and other setup details are all taken care of by "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("p",[t._v("This article is "),e("strong",[t._v("NOT a guide on how to use bdk-rn")]),t._v(" to build a bitcoin application, rather this is an insight into how "),e("code",[t._v("bdk-rn")]),t._v(" was developed. For help on how to use "),e("code",[t._v("bdk-rn")]),t._v(" to develop a bitcoin wallet or application please refer to the user guide in the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("readme"),e("OutboundLink")],1),t._v(" on Github. There will be "),e("code",[t._v("how to guides")]),t._v(" published shortly on getting started with "),e("code",[t._v("bdk-rn")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"react-native-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#react-native-architecture"}},[t._v("#")]),t._v(" React Native Architecture")]),t._v(" "),e("p",[t._v("At a high level, RN consists of the UI front which is essentially JavaScript which interacts with the native iOS and Android platforms over a bridge. When communicating over the bridge values from JS are converted to native and vice versa.")]),t._v(" "),e("p",[t._v("The native part of RN consists of Android as well as iOS modules and components. The Android and iOS sections are full fledged native projects which interact with the JS side over the native bridge. A RN project has all the build configuraiton required to build both Android and iOS projects.")]),t._v(" "),e("p",[t._v("For the purpose of making "),e("code",[t._v("bdk-rn")]),t._v(", "),e("code",[t._v("bdk-kotlin")]),t._v(" is used as the native Android module and "),e("code",[t._v("bdk-swift")]),t._v(" as the native iOS module. These are configured and wrapped in a RN Project as part of the platform specific native modules within the RN Project. This RN Project is then built to be a reusable React Native module.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(352),alt:""}})]),t._v(" "),e("h2",{attrs:{id:"native-integration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#native-integration"}},[t._v("#")]),t._v(" Native Integration")]),t._v(" "),e("p",[t._v("In order to communicate to native modules on Android and iOS, React Native provides React Context API for Java/Kotlin as well as Swift. React Context API are used to build the interface to the native bridge allowing communication from JS to native modules.")]),t._v(" "),e("p",[t._v("bdk-rn uses React Context API plus some native code to wrap and enhance bdk-kotlin and bdk-swift APIs. The native code calls and interacts with the Android and iOS native modules which interface with the underlying mobile platform.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"20%"},attrs:{src:a(353)}}),t._v(" "),e("h2",{attrs:{id:"android-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#android-module"}},[t._v("#")]),t._v(" Android Module")]),t._v(" "),e("p",[t._v("We will go into the details of how the BDK Android Module is integrated, we wont cover iOS.")]),t._v(" "),e("p",[t._v("Starting off with a basic RN project. This project will be enhanced with bdk-kotlin and bdk-swift binaries and native code. For now lets go into the details for Android, iOS has similar steps to be done in Swift.")]),t._v(" "),e("p",[t._v("The Android native project is located under the root project folder.")]),t._v(" "),e("img",{staticStyle:{display:"block",margin:"0 auto",zoom:"120%"},attrs:{src:a(354)}}),t._v(" "),e("p",[t._v("Here we need to add a dependency in "),e("code",[t._v("build.gradle")]),t._v(" for bdk-kotlin's android native binary. This will enable bdk-kotlin to be downloaded and available as one of the native modules.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: build.gradle")]),t._v("\n\nrepositories "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mavenCentral")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ndependencies "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//noinspection GradleDynamicVersion")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'com.facebook.react:react-native:+'")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// bitcoindevkit")]),t._v("\n implementation "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'org.bitcoindevkit:bdk-android:0.7.1'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We will create an Android native module which will interact with "),e("code",[t._v("bdk-android")]),t._v(".\nThis is done by adding a new Kotlin file "),e("code",[t._v("BdkRnModule.kt")]),t._v(" inside "),e("code",[t._v("android/app/src/main/java/com/bdkrn/")]),t._v(" folder")]),t._v(" "),e("p",[t._v("This will be part of the native code for bdk-rn module.Here a new class will be created to encapsulate the interaction with bitcoindevkit's android native binary.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SuppressLint\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" android"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Log\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Arguments\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Promise "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" Result\n")])])]),e("p",[e("code",[t._v("org.bitcoindevkit")]),t._v(" will also need to be imported here")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" org"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bitcoindevkit"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Wallet "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" BdkWallet\n")])])]),e("p",[t._v("To use React Context API "),e("code",[t._v("com.facebook.react.bridge.*")]),t._v(" also needs to be imported")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("\n")])])]),e("p",[t._v("A new class needs to be defined here which will implement the React Context API")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\t"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ReactContextBaseJavaModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getName")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BdkRnModule"')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("With the base imports and class defined, we can start writing methods.\nThis will demonstrate how bdk native module will be called and how values will be returned to JS over the native bridge")]),t._v(" "),e("p",[t._v("Lets create a method that can be called from JaveScript, to do so we use the "),e("code",[t._v("@ReactMethod")]),t._v(" directive which is part of the React Context API. This will expose the method so that it can be called from JavaScript.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("We need one more file to complete our native framework. A new Kotlin file, "),e("code",[t._v("BdkRnPackage.kt")]),t._v(" is required to package all our native code into a new android module, here we specify the name of the file we just crated as the module name("),e("code",[t._v("BdkRnModule")]),t._v("). This can be done by adding the following code:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnPackage.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactPackage\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NativeModule\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bridge"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ReactApplicationContext\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" com"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("facebook"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("react"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("uimanager"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ViewManager\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" BdkRnPackage "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactPackage "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createNativeModules")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ReactApplicationContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n MutableList"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NativeModule"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mutableListOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkRnModule")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reactContext"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),e("p",[t._v("Now lets add code for creating a wallet in BdkRnModule.kt")]),t._v(" "),e("p",[t._v("The methods used here are for bdk-kotlin and available in the bdk-kotlin documentation.")]),t._v(" "),e("p",[t._v("We first create a key info object")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File: BdkRnModule.kt")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token annotation builtin"}},[t._v("@ReactMethod")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fun")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Promise"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create key info with a new mnemonic")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ExtendedKeyInfo "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateExtendedKey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WordCount"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("WORDS12"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')])]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// more code to follow...")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create descriptor and change descriptor")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create databaseConfig and blockchainconfig")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create wallet")]),t._v("\n \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Then key info used to create a wallet descriptor and change descriptor:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" descriptor"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')])]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" keys"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xprv "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(' "'),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("84")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("'"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*)\"\n\nval changeDescriptor: String = descriptor.replace(\"/84'/1'/0'/0/*\",\"/84'/1'/0'/1/*\")\n")])])])]),e("p",[t._v("To create a wallet with bdk we need to specify wallet descriptor, network, a database config, blockchain config. We intend to use bitcoin testnet and want to use default memory for data. For bitcoin node we will use a public electrum server. We will need to define these parameters to create a wallet.")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" network "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" `Network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TESTNET`\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" databaseConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DatabaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Memory\nblockchainConfig "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n BlockchainConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("Electrum")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("ElectrumConfig")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string-literal singleline"}},[e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 5u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 10u"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once done we can use these parameters to create a BDK wallet using the native android BDK library:")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" BdkWallet "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("BdkWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n descriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n changeDescriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("setNetwork")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n databaseConfig"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n config\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("Once we have a wallet initialised, we can call methods on it to sync, generate a new address and to get balance")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[t._v("wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ProgressLog"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxAddress"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNewAddress")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nwallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("To return a value from the native android code to React Native’s Javascript side over the JS Native bridge we will use "),e("code",[t._v("com.facebook.react.bridge.Promise")]),t._v(". To return balance information to JS, the following code can be used")]),t._v(" "),e("div",{staticClass:"language-kotlin extra-class"},[e("pre",{pre:!0,attrs:{class:"language-kotlin"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" balance"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLong")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nresult"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("At this point we have an Android native module and it can be invoked from JS by calling "),e("code",[t._v("createWallet")]),t._v(" and it will return the balance.")]),t._v(" "),e("p",[t._v("This project can be imported into any RN project to reuse the defined "),e("code",[t._v("createWallet")]),t._v(" method without the need to carry out the setup described above.")]),t._v(" "),e("div",{staticClass:"language-javascript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-javascript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// any js file in React Native")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BdkRn "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-rn'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a wallet and retrieve current balance")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" BdkRn"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("createWallet")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nconsole"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" balance "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n")])])]),e("p",[t._v("The actual "),e("code",[t._v("bdk-rn")]),t._v(" module has organised the native code into granular methods for different stages of creating a wallet and for different interactions and use cases for a bitcoin application, like generating, mnemonic, keys, creating wallet for different networks, creating descriptors, creating or restoring wallet, fetching balance, fetching transactions and many other methods. Please refer to the "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn#usage",target:"_blank",rel:"noopener noreferrer"}},[t._v("user guide in the readme"),e("OutboundLink")],1),t._v(" on Github for the complete API. The set of APIs available will grow in the near future as more APIs are added. This article can also be used as a guide to add new methods to the existing bdk-rn project.")]),t._v(" "),e("p",[t._v("The objective of "),e("code",[t._v("bdk-rn")]),t._v(" is to enable React Native developers to quickly start developing applications without the need to package BDK as described above.")]),t._v(" "),e("p",[t._v("Be on the lookout for user guides and tutorials on how to build bitcoin applications using "),e("code",[t._v("bdk-rn")]),t._v(" and "),e("code",[t._v("bdk-flutter")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"references"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#references"}},[t._v("#")]),t._v(" References")]),t._v(" "),e("p",[t._v("Creating native modules for Android and iOS: "),e("a",{attrs:{href:"https://reactnative.dev/docs/native-modules-intro",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://reactnative.dev/docs/native-modules-intro"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("React Native Architecture: "),e("a",{attrs:{href:"https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-Android API: "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://bitcoindevkit.org/bdk-jvm/bdk-jvm/org.bitcoindevkit/index.html"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("BDK-RN: "),e("a",{attrs:{href:"https://github.com/LtbLightning/bdk-rn",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/LtbLightning/bdk-rn"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"feedback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feedback"}},[t._v("#")]),t._v(" Feedback")]),t._v(" "),e("p",[t._v("The best way to give feedback on this would be to comment on the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoindevkit.org/pull/107",target:"_blank",rel:"noopener noreferrer"}},[t._v("pull request"),e("OutboundLink")],1),t._v(" for this blog post.\nThanks in advance.")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/34.0cca050d.js b/assets/js/34.530523dd.js similarity index 99% rename from assets/js/34.0cca050d.js rename to assets/js/34.530523dd.js index 0b35df4d50..00767c39cf 100644 --- a/assets/js/34.0cca050d.js +++ b/assets/js/34.530523dd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{350:function(t,e,a){t.exports=a.p+"assets/img/descriptor-tracker.5942c853.jpg"},351:function(t,e,a){t.exports=a.p+"assets/img/checkpoints.a4179787.jpg"},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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{350:function(t,e,a){t.exports=a.p+"assets/img/descriptor-tracker.5942c853.jpg"},351:function(t,e,a){t.exports=a.p+"assets/img/checkpoints.a4179787.jpg"},404:function(t,e,a){"use strict";a.r(e);var s=a(7),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("The Bitcoin Devkit (BDK) lets you do a lot of useful things through convenient high level\nabstractions. It works great when these abstractions map nicely onto what you are trying to do. My\ngoal is to develop a new "),e("code",[t._v("bdk_core")]),t._v(" library for when they don't. I want "),e("code",[t._v("bdk_core")]),t._v(" to expose all the\nuseful "),e("em",[t._v("mechanisms")]),t._v(" that BDK has inside it without them being tied to any particular usage "),e("em",[t._v("policy")]),t._v("\nand with very minimal dependencies.")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("bdk_core")]),t._v(' idea is still "in the lab". We\'re not sure yet whether '),e("code",[t._v("bdk_core")]),t._v(" will just be what's\nleft of "),e("code",[t._v("bdk")]),t._v(" once we spin off all the components that have extra dependencies into their own crates\nand refine it a bit. In that case "),e("code",[t._v("bdk_core")]),t._v(" will just be called "),e("code",[t._v("bdk v1.0.0")]),t._v(" or something. Or it might\nbe that "),e("code",[t._v("bdk")]),t._v(" lives on with its current APIs and uses stuff "),e("code",[t._v("bdk_core")]),t._v(" to implement it internally.")]),t._v(" "),e("h2",{attrs:{id:"the-separation-of-policy-and-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#the-separation-of-policy-and-mechanism"}},[t._v("#")]),t._v(" The separation of policy and mechanism")]),t._v(" "),e("p",[t._v("My guiding principle for "),e("code",[t._v("bdk_core")]),t._v(" is the "),e("em",[t._v("separation of policy and mechanism")]),t._v(". This is\nwhat I mean by these terms:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("mechanism")]),t._v(": How you do a particular thing. Mechanism code is functional and doesn't change much.")]),t._v(" "),e("li",[e("em",[t._v("policy")]),t._v(": What you want to do. Policy code composes mechanisms to achieve something in\nan application.")])]),t._v(" "),e("p",[t._v("Here's a nice passage about why the designers of the "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/X_Window_System",target:"_blank",rel:"noopener noreferrer"}},[t._v("X window system"),e("OutboundLink")],1),t._v(" applied this principle. X has\nbeen around since 1984 and doesn't look like it's going anywhere so it probably has a lot to teach us.\nFrom "),e("em",[e("a",{attrs:{href:"https://en.wikipedia.org/wiki/The_Art_of_Unix_Programming",target:"_blank",rel:"noopener noreferrer"}},[t._v("The Art of UNIX Programming"),e("OutboundLink")],1)]),t._v(":")]),t._v(" "),e("blockquote",[e("p",[t._v("...we observed that the designers of X made a basic decision to implement “mechanism, not policy”—to\nmake X a generic graphics engine and leave decisions about user-interface style to toolkits and\nother levels of the system. We justified this by pointing out that policy and mechanism tend to\nmutate on different timescales, with policy changing much faster than mechanism. Fashions in the\nlook and feel of GUI toolkits may come and go, but raster operations and compositing are forever.")])]),t._v(" "),e("blockquote",[e("p",[t._v("Thus, hardwiring policy and mechanism together has two bad effects: It makes policy rigid and\nharder to change in response to user requirements, and it means that trying to change policy has a\nstrong tendency to destabilize the mechanisms.")])]),t._v(" "),e("blockquote",[e("p",[t._v("On the other hand, by separating the two we make it\npossible to experiment with new policy without breaking mechanisms. We also make it much easier to\nwrite good tests for the mechanism (policy, because it ages so quickly, often does not justify the\ninvestment).")])]),t._v(" "),e("ul",[e("li",[t._v("[ ] > This design rule has wide application outside the GUI context. In general, it implies that we")])]),t._v(" "),e("blockquote",[e("p",[t._v("should look for ways to separate interfaces from engines.")])]),t._v(" "),e("p",[t._v("You'll notice we have a similar situation in Bitcoin engineering. We have mechanism code like\nsigning algorithms, key derivation, transaction construction logic, etc., that don't change much. But\nhow these compose together in applications changes quickly over time and between applications.")]),t._v(" "),e("p",[t._v("The main culprit of policy and mechanism conflation in "),e("code",[t._v("bdk")]),t._v(" is the main "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Wallet")]),e("OutboundLink")],1),t._v(" type.\nWallets do all of the following:")]),t._v(" "),e("ol",[e("li",[t._v("Store one or two descriptors (external and optional internal).")]),t._v(" "),e("li",[t._v("Keep track of which addresses you've given out so you only give out fresh ones from each descriptor.")]),t._v(" "),e("li",[t._v("Keep a list of transactions associated with the addresses in the wallet.")]),t._v(" "),e("li",[t._v("Given a source of blockchain data it can update its internal list of transactions.")]),t._v(" "),e("li",[t._v("Given some parameters it can build a PSBT from transaction outputs.")]),t._v(" "),e("li",[t._v("Given a PSBT it can sign it with its "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/signer/index.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Signers")]),e("OutboundLink")],1),t._v(".")])]),t._v(" "),e("p",[t._v("All of that is very useful but it is bound together with the particular policies and opinions of "),e("code",[t._v("Wallet")]),t._v(".\nIf "),e("code",[t._v("Wallet")]),t._v("'s policy is not your policy it's going to be tricky to get it to do what you want.\nHere are some examples:")]),t._v(" "),e("ol",[e("li",[t._v("In order to control how the "),e("code",[t._v("Wallet")]),t._v(" will select coins for a transaction internally you have to\npass in something implementing the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("CoinSelectionAlgorithm")]),e("OutboundLink")],1),t._v(" trait. A coin selection algorithm\nis clearly mechanism code but the policy of "),e("code",[t._v("Wallet")]),t._v(" restricts that mechanism's interface. We\nhave "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/281",target:"_blank",rel:"noopener noreferrer"}},[t._v("very old issues"),e("OutboundLink")],1),t._v(" related to what the\ninterface of this trait should be and we don't have a clear way forward. In "),e("code",[t._v("bdk_core")]),t._v(" I want to\npurely provide the coin selection mechanisms for figuring out whether you need to select more\nUTXOs or whether you need a change output etc. How you use that mechanism will be up to you.")]),t._v(" "),e("li",[t._v("Another trait that has a similar structure is the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/signer/index.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Signer")]),e("OutboundLink")],1),t._v(" trait. You have to pass in signers\nso your wallet can sign PSBTs but you have little control over how the wallet chooses which\nsigners to use in any given situation. Right now the wallet will just iterate through all the\nsigners and ask them to sign. This is not always appropriate. In "),e("code",[t._v("bdk_core")]),t._v(" I want to provide\nfunctions for populating PSBTs given something that can sign. You'll be in control of when they\nget called.")])]),t._v(" "),e("h2",{attrs:{id:"a-syncing-mechansim-without-the-policy"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-syncing-mechansim-without-the-policy"}},[t._v("#")]),t._v(" A syncing mechansim without the policy")]),t._v(" "),e("p",[t._v("Syncing in "),e("code",[t._v("bdk")]),t._v(" is the place where the design of "),e("code",[t._v("Wallet")]),t._v(" is most restrictive. The "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.WalletSync.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("WalletSync")]),e("OutboundLink")],1),t._v("\ntrait forces you to sync all addresses in a wallet in one big batch. But this is not always what you\nwant to do. I spoke to a developer who wanted to sync his wallet slowly over time with each address\nbeing queried over a different Tor connection. It would be really difficult to implement\n"),e("code",[t._v("WalletSync")]),t._v(" with such a strategy. Another example where "),e("code",[t._v("WalletSync")]),t._v(" isn't the right fit is the\n"),e("a",{attrs:{href:"https://l2.technology/sensei",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sensei"),e("OutboundLink")],1),t._v(" project which uses BDK but incrementally updates the database whenever new information\ncomes in from the blockchain.")]),t._v(" "),e("p",[t._v("Even if syncing all addresses at the same time is roughly what you want to do "),e("code",[t._v("WalletSync")]),t._v(" still\ngets in the way since it defines whether you do it synchronously or asynchrononusly. Applications\ncan control this through "),e("code",[t._v("bdk")]),t._v("'s "),e("code",[t._v("async-interface")]),t._v(" feature flag which internally changes the trait\ndefinition through macros. Another annoyance is that when using "),e("code",[t._v("async-interface")]),t._v(" the future that\ngets returned from "),e("code",[t._v("WalletSync")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/165",target:"_blank",rel:"noopener noreferrer"}},[t._v("cannot be "),e("code",[t._v("Send")]),e("OutboundLink")],1),t._v("\nbecause of how "),e("code",[t._v("Wallet")]),t._v(" handles database mutability internally, meaning you can't spawn the future\ninto a new thread.")]),t._v(" "),e("h3",{attrs:{id:"a-general-syncing-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-general-syncing-mechanism"}},[t._v("#")]),t._v(" A general syncing mechanism")]),t._v(" "),e("p",[t._v("So what is the most general syncing mechanism that solves these problems? These are the things I\nthink it has to do regardless of where the blockchain data comes from or how it's stored:")]),t._v(" "),e("ol",[e("li",[t._v("Generate and store addresses.")]),t._v(" "),e("li",[t._v("Index transaction data, e.g. transaction outputs we own, when/if they were spent, etc.")]),t._v(" "),e("li",[t._v("Keep track of which addresses have been given out and which have been used.")]),t._v(" "),e("li",[t._v('Be able to "roll back" our view of the above data if a reorg makes some of it stale.')]),t._v(" "),e("li",[t._v("Keep track of transactions related our addresses in our mempool.")])]),t._v(" "),e("p",[t._v("Let's talk about how to implement a mechanism that does all that.")]),t._v(" "),e("h3",{attrs:{id:"how-to-store-and-index-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-to-store-and-index-transactions"}},[t._v("#")]),t._v(" How to store and index transactions")]),t._v(" "),e("p",[t._v("Different persistent storage backends have different APIs and their own indexing strategies. That's\nwhy the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("Database")]),e("OutboundLink")],1),t._v(" trait exists in BDK, to make a clean API to the different storage engines. It's\nimportant to note that the database in BDK only holds public data that could always be retrieved\nfrom the chain. It's just a cache. Despite this we support different backends. Right now it is a\nlot of work to add a new index to the data since you have to add it to every backend and you might have\nto apply schema changes (we still "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/359",target:"_blank",rel:"noopener noreferrer"}},[t._v("don't have a standard approach to\nthis"),e("OutboundLink")],1),t._v(").")]),t._v(" "),e("p",[t._v("Thomas Eizinger "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/165#issuecomment-1047483895",target:"_blank",rel:"noopener noreferrer"}},[t._v("suggested"),e("OutboundLink")],1),t._v("\ndoing everything in memory and only writing to persistent storage when it was convenient. It took me\nsome time but I came around to this idea. It would allow us to get rid of the "),e("code",[t._v("Database")]),t._v(" trait (at\nleast at the "),e("code",[t._v("bdk_core")]),t._v(" level) and greatly simplify what the persistent storage layer has to do.\nWhenever the data is loaded from persistent storage we can just do the indexing in memory and\npresent it to the application.")]),t._v(" "),e("p",[e("em",[t._v("But wait! Wouldn't this mean we'd use way more memory than we need to?")]),t._v(" Yes but memory is cheap.\nConsider that if we say the average transaction size is 300 bytes then with all our indexes each\ntransaction might cost 1kb of memory (pessimistically). This means we could index one thousand\ntransactions in a single megabyte! My iPhone has 4gb of memory so it could index a million\ntransactions with plenty of memory to spare. "),e("em",[t._v("But what if some users can't afford an iPhone?")]),t._v(" Then\nthey also couldn't have afforded to have made a million Bitcoin transactions! "),e("em",[t._v("But what about memory\nconstrained devices like hardware wallets!?")]),t._v(" Those devices typically don't store and retrieve\ntransactions. They're usually just signing devices. Perhaps one day someone will build a memory\nconstrained device that needs to do this work but until then I think this is a fine approach to\ntake.")]),t._v(" "),e("p",[t._v("For now I'm calling this thing that does the in-memory indexing of transactions related to a single\ndescriptor a "),e("code",[t._v("DescriptorTracker")]),t._v(". Here's a diagram that communicates how I imagine it relates to the\nother components.")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(350),alt:""}})]),t._v(" "),e("h3",{attrs:{id:"rolling-back-rolling-forward-and-syncing-to-disk"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rolling-back-rolling-forward-and-syncing-to-disk"}},[t._v("#")]),t._v(" Rolling back, rolling forward and syncing to disk")]),t._v(" "),e("p",[t._v("State changes in blockchains are clearly delineated. They all happen in blocks! Every view of the\nblockchain, whether you're getting it through compact block filters, an electrum server or something\nwacky like a utreexo bridge will have a concept of blocks and transactions in them. For a wallet we\nonly need a very sparse view of the blockchain that includes at which block a set of transactions\nexisted. That way, if a block disappears we know that all those transactions might disappear too.")]),t._v(" "),e("p",[t._v("With "),e("code",[t._v("bdk_core")]),t._v(" I want to introduce the concept of a "),e("em",[t._v("checkpoint")]),t._v(", which is a block height and hash and\na set of txids that were present at that height "),e("strong",[t._v("but not present in the previous checkpoint")]),t._v(". In\nthis way we create an append-only data structure that can easily be rolled back to a previous height\nif there is a reorg. After rolling back we can then roll forward and apply the new blocks.")]),t._v(" "),e("p",[t._v("Here's an example of how this idea works:")]),t._v(" "),e("figure",[e("img",{attrs:{src:a(351),alt:""}})]),t._v(" "),e("p",[t._v("There are a few edge cases I'd like to cover:")]),t._v(" "),e("ol",[e("li",[t._v("What if when gathering new data from the chain to update a "),e("code",[t._v("DescriptorTracker")]),t._v(" we find an old transaction that belongs to an earlier checkpoint that we had missed form our earlier syncs?")]),t._v(" "),e("li",[t._v("What if when we go to write to persistent storage from a "),e("code",[t._v("DescriptorTracker")]),t._v(" we find that it has some transactions the tracker doesn't? Should we try and reconcile the two sets of transactions?")])]),t._v(" "),e("p",[t._v("I think the correct approach is to treat the chain data as the source of truth for the\n"),e("code",[t._v("DescriptorTracker")]),t._v(" and the "),e("code",[t._v("DescriptorTracker")]),t._v(" as the source of truth for persistent storage. That\nis in the case of (1) we should just rollback the "),e("code",[t._v("DescriptorTracker")]),t._v(" and insert the old but\nrecently discovered transaction in the right place. In the case of (2) we should roll back the\npersistent storage to the point where it differs and apply changes from there. This implies that you\nshould only keep one instance of a "),e("code",[t._v("DescriptorTracker")]),t._v(" for a descriptor in your application and only\nupdate persistent storage by first applying the changes to the tracker.")]),t._v(" "),e("h2",{attrs:{id:"examples"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[t._v("#")]),t._v(" Examples")]),t._v(" "),e("p",[t._v("Here are some examples of what I think this may end up looking like in code. Keep in mind that if\nthis looks complicated it will probably be more complicated in practice! This doesn't mean that we\ncan't create simplifying abstractions and tools around these primitives to cover common policies. I hope we can implement "),e("code",[t._v("Wallet")]),t._v(" with "),e("code",[t._v("DescriptorTracker")]),t._v("s internally.")]),t._v(" "),e("h3",{attrs:{id:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"}},[t._v("#")]),t._v(" Doing an initial sync of a descriptor that may already contain coins")]),t._v(" "),e("p",[t._v("When we first sync a descriptor that may already contain coins we want to iterate over all the\nscripts of the wallet and then stop if there's a big enough gap (e.g. 20). In this example we use an\nstateless "),e("a",{attrs:{href:"https://mempool.space/docs/api/rest",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora-like API"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" esplora "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("fetch_related_transactions")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// iterate over all addresses in a descriptor")]),t._v("\n scripts"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_scripts")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// stop if you find a gap of 20 unused addresses")]),t._v("\n stop_gap"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\ntracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// now we want to persist this disk")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n start_checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Note that the db_update type is the same as the `update` above.")]),t._v("\nmy_db"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("db_update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#doing-a-sync-of-a-wallet-after-you-already-have-syncd"}},[t._v("#")]),t._v(" Doing a sync of a wallet after you already have sync'd")]),t._v(" "),e("p",[t._v("Now imagine you just want to check if any UTXOs in your wallet have been spent. In this case we've\nalready sync'd before so we need to load that data into the tracker from disk first (rather than\ngoing straight to the blockchain). Then we just ask esplora for transactions related to these\ntransaction outputs.")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" init_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" my_db"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get up to speed with what was on disk.")]),t._v("\ntracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("init_update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the latest checkpoint")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" checkpoint "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_checkpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" esplora "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch transactions spending any utxos we have")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("fetch_related_transactions")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n tx_outs"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_unspent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" update "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// now we want to persist this disk")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_update "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Params")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// this call could fail if tracker no longer has this checkpoint.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// In this case we'd ask persistent_storage for an earlier checkpoint and try again.")]),t._v("\n start_checkpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" persistent_storage"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_checkpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n persistent_storage"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_update")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("db_update"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Err")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk_esplora"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("StaleCheckpoint")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// here we should call fetch related transactions with an earlier checkpoint.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// In practice this logic will be called in a loop")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h3",{attrs:{id:"updating-state-when-you-get-the-data-in-real-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#updating-state-when-you-get-the-data-in-real-time"}},[t._v("#")]),t._v(" Updating state when you get the data in real time")]),t._v(" "),e("p",[t._v("If you have an event based view of the blockchain that feeds you block connected or block\ndisconnected events then I imagine the API would look something like this.\nThere's quite a bit left out here but I hope you get the idea.")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a descriptor tracker the external addresses of a BIP86 key")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tracker "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTracker")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)\"")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain_events "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/* get a Stream of blockchain block connected/disconnected events */")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("loop")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain_event "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" blockchain_events"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" blockchain_event "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockChainEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Connected")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("new_block"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply_block")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("new_block"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("modified"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" modified "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// update persistent storage from tracker")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Err")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApplyBlockError")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OutOfOrder")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the block event we got was not the next block we expected.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// How to recover from this will depend on the application and block source")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockchainEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Disconnected")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("disconnected_height"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" disconnected_hash"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// this might invalidate a checkpoint")]),t._v("\n tracker"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("disconnect_block")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("disconnected_height"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" disconnected_hash"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Now apply to persistent storage")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h2",{attrs:{id:"feedback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#feedback"}},[t._v("#")]),t._v(" Feedback")]),t._v(" "),e("p",[t._v("The best way to give feedback on this would be to comment on the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bitcoindevkit.org/pull/100",target:"_blank",rel:"noopener noreferrer"}},[t._v("pull request"),e("OutboundLink")],1),t._v(" for this blog post.\nThanks in advance.")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/35.114fe51f.js b/assets/js/35.e3cc4111.js similarity index 98% rename from assets/js/35.114fe51f.js rename to assets/js/35.e3cc4111.js index 961324efb3..c486397194 100644 --- a/assets/js/35.114fe51f.js +++ b/assets/js/35.e3cc4111.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{318:function(t,a,s){},377:function(t,a,s){"use strict";s(318)},437:function(t,a,s){"use strict";s.r(a);s(377);var e=s(7),i=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"all"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#all"}},[t._v("#")]),t._v(" All")]),t._v(" "),a("p",[t._v("Explore the ecosystem of projects that are built with the BDK family of libraries.")]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/block-logo.gif"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://bitkey.build/",target:"_blank"}},[t._v("Bitkey")])]),t._v(" "),a("p",[t._v("\n Bitkey is the safe, easy way to own and manage bitcoin. It’s a mobile app, hardware device, and a set of recovery tools, for simple, secure self-custody.\n ")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/peach-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h2",[a("a",{attrs:{href:"https://peachbitcoin.com/",target:"_blank"}},[t._v("Peach Bitcoin")])]),t._v(" "),a("p",[t._v("Connecting Bitcoin buyers and sellers directly together. Buy or sell bitcoin peer-to-peer anywhere, at anytime.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.anchorwatch.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/anchorwatch-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.anchorwatch.com/",target:"_blank"}},[t._v("AnchorWatch")])]),t._v(" "),a("p",[t._v("Protect your bitcoin with regulated insurance and enterprise-grade multi-institutional custody.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mutiny-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.mutinywallet.com/",target:"_blank"}},[t._v("Mutiny Wallet")])]),t._v(" "),a("p",[t._v("Mutiny is a self-custodial lightning wallet that runs in the browser.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/foundation-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://foundationdevices.com/",target:"_blank"}},[t._v("Envoy By Foundation")])]),t._v(" "),a("p",[t._v("A Bitcoin wallet with powerful account management and privacy features. Use alongside your Passport hardware wallet to take true ownership of your Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://mempool.space/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/mempool-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://mempool.space/",target:"_blank"}},[t._v("mempool.space")])]),t._v(" "),a("p",[t._v("Explore the full Bitcoin ecosystem.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.caravanmultisig.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/caravan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.caravanmultisig.com/#/",target:"_blank"}},[t._v("Caravan")])]),t._v(" "),a("p",[t._v("Caravan is a multi-sig coordinator application, and an Unchained-sponsored open source project.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bull-bitcoin-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.bullbitcoin.com/",target:"_blank"}},[t._v("Bull Bitcoin")])]),t._v(" "),a("p",[t._v("A self-custodial Bitcoin Wallet and Exchange app that lets users buy, sell, spend and get paid with Bitcoin. Bitcoins are automatically sent from the exchange to the user's wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lava-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.lava.xyz/",target:"_blank"}},[t._v("Lava")])]),t._v(" "),a("p",[t._v("The Future of Finance Available Today. Functional, safe and simple.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/ldk-node-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/lightningdevkit/ldk-node",target:"_blank"}},[t._v("LDK Node")])]),t._v(" "),a("p",[t._v("A ready-to-go Lightning node library built using LDK and BDK.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/padawan-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.goldenraven.padawanwallet",target:"_blank"}},[t._v("Padawan Wallet")])]),t._v(" "),a("p",[t._v("Padawan is a testnet-only bitcoin wallet packed with tutorials to learn how to use bitcoin on mobile.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/seba-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[t._v("Seba Bank")])]),t._v(" "),a("p",[t._v("From everyday banking to crypto custody and trading, get the most out of your assets with a regulated global crypto bank.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://bitmask.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/bitmask-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://bitmask.app/",target:"_blank"}},[t._v("BitMask Wallet")])]),t._v(" "),a("p",[t._v("Your Gateway to DeepWeb3 on Bitcoin. A browser extension for decentralized applications on Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[a("img",{staticStyle:{"max-height":"130px"},attrs:{src:"/img/case-studies-logos/smart-vaults-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://www.smartvaults.io/",target:"_blank"}},[t._v("Smart Vaults")])]),t._v(" "),a("p",[t._v("Determine who, how, and when your Bitcoin can be accessed.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/galoy-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://galoy.io/",target:"_blank"}},[t._v("Galoy")])]),t._v(" "),a("p",[t._v("Bitcoin-native banking infrastructure for organizations.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/iris-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.iriswallet.testnet",target:"_blank"}},[t._v("Iris Wallet")])]),t._v(" "),a("p",[t._v("Open-source wallet for Bitcoin and RGB assets.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/spotbit-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/BlockchainCommons/spotbit",target:"_blank"}},[t._v("Spotbit")])]),t._v(" "),a("p",[t._v("Spotbit is a portable API for Bitcoin price data and candles.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/StackmateNetwork",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/stackmate-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/StackmateNetwork",target:"_blank"}},[t._v("Stackmate")])]),t._v(" "),a("p",[t._v("A multi-purpose Bitcoin Wallet.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lipa-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lipa.swiss/en",target:"_blank"}},[t._v("Lipa")])]),t._v(" "),a("p",[t._v("The Swiss app for cashless payments with Bitcoin.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/lexe-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://lexe.app/",target:"_blank"}},[t._v("Lexe Wallet")])]),t._v(" "),a("p",[t._v("Lexe is a self-custodial Bitcoin and Lightning wallet that can receive payments 24/7.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/10101-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://10101.finance/",target:"_blank"}},[t._v("10101")])]),t._v(" "),a("p",[t._v("Decentralised finance. For real. BTC trading without counterparty risk in one easy and fast app.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/liana-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://wizardsardine.com/liana/",target:"_blank"}},[t._v("Liana")])]),t._v(" "),a("p",[t._v("Never lose your coins. Liana is a simple Bitcoin wallet with built-in loss protection and inheritance.")])])]),t._v(" "),a("div",{staticClass:"project"},[a("div",{staticClass:"project-logo"},[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[a("img",{attrs:{src:"/img/case-studies-logos/utreexod-130.png"}})])]),t._v(" "),a("div",{staticClass:"tagline"},[a("h3",[a("a",{attrs:{href:"https://github.com/utreexo/utreexod",target:"_blank"}},[t._v("utreexod")])]),t._v(" "),a("p",[t._v("A fully validating Bitcoin node with Utreexo support.")])])]),t._v(" "),a("a",{staticClass:"nav-link external action-button",attrs:{href:"https://github.com/orgs/bitcoindevkit/discussions/64",target:"_blank",rel:"noopener noreferrer"}},[t._v("\n Add your project\n "),a("span",[a("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[a("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),t._v(" "),a("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),t._v(" "),a("span",{staticClass:"sr-only"},[t._v("(opens new window)")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/36.f5632206.js b/assets/js/36.fa4b2252.js similarity index 80% rename from assets/js/36.f5632206.js rename to assets/js/36.fa4b2252.js index 93c21ed1b0..ec21a5f00e 100644 --- a/assets/js/36.f5632206.js +++ b/assets/js/36.fa4b2252.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{317:function(t,s,a){},376:function(t,s,a){"use strict";a(317)},436:function(t,s,a){"use strict";a.r(s);a(376);var i=a(7),e=Object(i.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"custodial"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#custodial"}},[this._v("#")]),this._v(" Custodial")]),this._v(" "),t("div",{staticClass:"project"},[t("div",{staticClass:"project-logo"},[t("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[t("img",{attrs:{src:"/img/case-studies-logos/seba-130.png"}})])]),this._v(" "),t("div",{staticClass:"tagline"},[t("h3",[t("a",{attrs:{href:"https://www.seba.swiss/",target:"_blank"}},[this._v("Seba Bank")])]),this._v(" "),t("p",[this._v("From everyday banking to crypto custody and trading, get the most out of your assets with a regulated global crypto bank.")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/37.4c491801.js b/assets/js/37.a5bff0bd.js similarity index 92% rename from assets/js/37.4c491801.js rename to assets/js/37.a5bff0bd.js index e719b7f2b2..e8e98b54d2 100644 --- a/assets/js/37.4c491801.js +++ b/assets/js/37.a5bff0bd.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{320:function(t,a,s){},379:function(t,a,s){"use strict";s(320)},439:function(t,a,s){"use strict";s.r(a);s(379);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/38.109014d3.js b/assets/js/38.2ace5b2d.js similarity index 87% rename from assets/js/38.109014d3.js rename to assets/js/38.2ace5b2d.js index 34f3a6deee..f03a48b233 100644 --- a/assets/js/38.109014d3.js +++ b/assets/js/38.2ace5b2d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{320:function(t,a,s){},379:function(t,a,s){"use strict";s(320)},439:function(t,a,s){"use strict";s.r(a);s(379);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:"exchange"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#exchange"}},[t._v("#")]),t._v(" Exchange")]),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://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.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{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 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:"exchange"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#exchange"}},[t._v("#")]),t._v(" Exchange")]),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://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.")])])])])}),[],!1,null,null,null);a.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/40.1dca96ab.js b/assets/js/40.3dbbc631.js similarity index 86% rename from assets/js/40.1dca96ab.js rename to assets/js/40.3dbbc631.js index 5c25f4eb46..3994d3438e 100644 --- a/assets/js/40.1dca96ab.js +++ b/assets/js/40.3dbbc631.js @@ -1 +1 @@ -(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 +(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 diff --git a/assets/js/41.dd41fb56.js b/assets/js/41.802e975e.js similarity index 97% rename from assets/js/41.dd41fb56.js rename to assets/js/41.802e975e.js index 7bd4f15fb6..910da5500f 100644 --- a/assets/js/41.dd41fb56.js +++ b/assets/js/41.802e975e.js @@ -1 +1 @@ -(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 +(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 diff --git a/assets/js/42.78dc17a2.js b/assets/js/42.86af1298.js similarity index 89% rename from assets/js/42.78dc17a2.js rename to assets/js/42.86af1298.js index aed0026745..72e59f6657 100644 --- a/assets/js/42.78dc17a2.js +++ b/assets/js/42.86af1298.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{324:function(t,a,s){},383:function(t,a,s){"use strict";s(324)},443: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 diff --git a/assets/js/46.8a620891.js b/assets/js/46.5ba99f9c.js similarity index 99% rename from assets/js/46.8a620891.js rename to assets/js/46.5ba99f9c.js index ec54614572..861107ab36 100644 --- a/assets/js/46.8a620891.js +++ b/assets/js/46.5ba99f9c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{400:function(e,t,r){"use strict";r.r(t);var n=r(7),o=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h3",{attrs:{id:"this-post"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#this-post"}},[e._v("#")]),e._v(" This Post")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://spiral.xyz",target:"_blank",rel:"noopener noreferrer"}},[e._v("Spiral"),t("OutboundLink")],1),e._v(" team has graciously supported BDK financially (and spiritually) for the past four years and since early 2022 the BDK team has let folks know what we've been up to via the "),t("a",{attrs:{href:"https://spiral.xyz/blog/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Spiral blog"),t("OutboundLink")],1),e._v(". As of last summer we are grateful to also have received a generous "),t("a",{attrs:{href:"https://opensats.org/blog/bitcoin-and-nostr-grants-august-2023",target:"_blank",rel:"noopener noreferrer"}},[e._v("OpenSats grant"),t("OutboundLink")],1),e._v(" supporting our project. To keep our current and future financial supporters, open source contributors, and downstream users updated on our progress, starting this year we will be publishing a quarterly BDK project updates here on our blog.")]),e._v(" "),t("h3",{attrs:{id:"end-of-year-review"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#end-of-year-review"}},[e._v("#")]),e._v(" End of Year Review")]),e._v(" "),t("p",[e._v("The BDK project is made up of a core suite of "),t("a",{attrs:{href:"https://www.rust-lang.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust"),t("OutboundLink")],1),e._v(" libraries ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk?tab=readme-ov-file#architecture",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-*"),t("OutboundLink")],1),e._v(") that work together to provide everything an application developer needs to incorporate on-chain bitcoin wallet functionality into their project. Wrapped around the BDK core libraries is our "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-ffi"),t("OutboundLink")],1),e._v(" bindings libraries that let Kotlin (desktop/android), Swift (desktop/iOS), and Python developers use BDK seamlessly in their projects. And wrapped around all of this software is documentation and examples. For over a year the BDK team has been working on a major "),t("a",{attrs:{href:"https://bitcoindevkit.org/blog/tags/architecture/",target:"_blank",rel:"noopener noreferrer"}},[e._v("re-architecture"),t("OutboundLink")],1),e._v(" of the BDK libraries to improve blockchain syncing, embedded device support ("),t("a",{attrs:{href:"https://docs.rust-embedded.org/book/intro/no-std.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("no-std"),t("OutboundLink")],1),e._v("), update key 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(", "),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 finally to provide a stable 1.0 API that our users can rely on for their production applications.")]),e._v(" "),t("p",[e._v("The team is currently working on the 1.0.0-alpha release train. The purposed of these alpha releases is to give early adopters (including our own "),t("code",[e._v("bdk-ffi")]),e._v(" contributors) a chance to try-out new BDK features and updated APIs and provide feedback. Once we have a stable, feature complete 1.0.0 BDK that our alpha users love we'll begin publishing 1.0.0-beta releases. With our beta releases we will finish updating tutorials and examples and performance testing, and ask all BDK users to start migrating and testing their applications with BDK 1.0.0. When our key contributors and users are satisfied that we have shaken out any final 1.0.0-beta issues we'll publish our BDK 1.0.0 release. Once 1.0.0 is out subsequent releases will use "),t("a",{attrs:{href:"https://semver.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("semantic versioning"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("For those keeping score, we'd originally planned to have the BDK 1.0.0 release out last year, but (spoiler) that didn't happen. As I'm sure our kind readers understand making safe, feature rich, easy to use bitcoin software isn't easy, reviewing it is even harder, and we, like every project in the space are short-handed. But with every release, as we build the software we also on-board new contributors and build the team that will deliver BDK 1.0.0, 1.1.0, 2.0.0, and beyond.")]),e._v(" "),t("h3",{attrs:{id:"core-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#core-bdk"}},[e._v("#")]),e._v(" Core BDK")]),e._v(" "),t("p",[e._v("For Q4 2023 we "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pulls?page=1&q=is%3Apr+merged%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("merged 33 PRs"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues?q=is%3Aissue+closed%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("closed 32 issues"),t("OutboundLink")],1),e._v(", and completed two 1.0.0-alpha releases, "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.2",target:"_blank",rel:"noopener noreferrer"}},[e._v("1.0.0-alpha.2"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.3",target:"_blank",rel:"noopener noreferrer"}},[e._v("1.0.0-alpha.3"),t("OutboundLink")],1),e._v(". The primary deliverable of these releases was to further stabilize the "),t("code",[e._v("bdk_chain")]),e._v(" crate which provides the central logic for tracking and updating wallet keychains and scripts to be tracked and manages all of the related blockchain and transaction data. Additional PRs started this quarter lay the groundwork for the next phase of development focused on improving how we sync data via blockchain clients and save that data to persistent storage. We also made one maintenance release "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v0.29.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("0.29.0"),t("OutboundLink")],1),e._v(" that upgraded our "),t("code",[e._v("rust-bitcoin")]),e._v(" dependency to release to 0.30.")]),e._v(" "),t("h3",{attrs:{id:"bdk-ffi"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-ffi"}},[e._v("#")]),e._v(" BDK-FFI")]),e._v(" "),t("p",[e._v("In Q4 the BDK-FFI bindings for Kotlin, Swift, and Python saw "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/pulls?page=1&q=is%3Apr+merged%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("23 PRs merged"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/issues?q=is%3Aissue+closed%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("15 issues closed"),t("OutboundLink")],1),e._v(". One maintenance release was completed, "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v0.31.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("v0.31.0"),t("OutboundLink")],1),e._v(", which updated the language bindings dependency to the latest rust "),t("code",[e._v("bdk")]),e._v(" maintenance release 0.29.0 and in doing so updated the BDK FFI "),t("code",[e._v("rust-bitcoin")]),e._v(" dependency to version 0.30. This quarter the team took on the major task of creating the first language bindings based on the "),t("code",[e._v("bdk")]),e._v(" 1.0.0-alpha API. The resulting "),t("code",[e._v("bdk-ffi")]),e._v(" "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v1.0.0-alpha.2a",target:"_blank",rel:"noopener noreferrer"}},[e._v("v1.0.0-alpha2a"),t("OutboundLink")],1),e._v(" release is only able to expose part of the full "),t("code",[e._v("bdk")]),e._v(" 1.0.0 API but prepares the project for full support in future releases. As part of this work the current Kotlin API docs were removed, but fear not they will return in future alpha releases and be better than ever with not only API docs for Kotlin but also Swift and Python.")]),e._v(" "),t("h3",{attrs:{id:"bdk-contributors-spotlight"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-contributors-spotlight"}},[e._v("#")]),e._v(" BDK contributors spotlight")]),e._v(" "),t("p",[e._v("In this section we share what some of our hardworking contributors are doing to educate people about BDK, help on board new projects, and generally promote bitcoin and open source development around the world.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/danielabrozzoni/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Daniela Brozzoni"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("November 3: Gave a "),t("a",{attrs:{href:"https://bolt.fun",target:"_blank",rel:"noopener noreferrer"}},[e._v("bolt.fun"),t("OutboundLink")],1),e._v(" talk on open source development, "),t("a",{attrs:{href:"https://www.youtube.com/watch?v=P75nCR1owws",target:"_blank",rel:"noopener noreferrer"}},[e._v("YouTube"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("October 25-26: Joined a "),t("a",{attrs:{href:"https://planb.lugano.ch/contributing-to-free-and-open-source-projects/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Contributing to free and open source projects" panel'),t("OutboundLink")],1),e._v(" at "),t("a",{attrs:{href:"https://planb.lugano.ch/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Plan B"),t("OutboundLink")],1),e._v(" lugano.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/evanlinjin/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Evan Linjin"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("November 15: Worked with "),t("a",{attrs:{href:"https://wizardsardine.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("wizardsardine"),t("OutboundLink")],1),e._v(" team to "),t("a",{attrs:{href:"https://twitter.com/darosior/status/1724842410839093562",target:"_blank",rel:"noopener noreferrer"}},[e._v("extract and integrate BDK coin-selection into the Liana wallet"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("December 3: Spoke at the "),t("a",{attrs:{href:"https://twitter.com/TaiwanBitdevs/status/1726537941688967238",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Tech Summit Taipei"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("December 13: Gave a talk about Bitcoin and BDK at "),t("a",{attrs:{href:"https://twitter.com/JCBA_org/status/1735100779172856170",target:"_blank",rel:"noopener noreferrer"}},[e._v("Taipei Blockchain Week"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Thunderbiscuit"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("November 8: Created the educational "),t("a",{attrs:{href:"https://opcodeexplained.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Opcode Explained"),t("OutboundLink")],1),e._v(" website to help... explain bitcoin opcodes!")]),e._v(" "),t("p",[e._v("November 15: Joined the panel on the "),t("a",{attrs:{href:"https://bitcoin.review/podcast/episode-55/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Review Podcast Episode 55"),t("OutboundLink")],1),e._v(" to talked about his "),t("a",{attrs:{href:"https://github.com/thunderbiscuit/padawan-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("padawan-wallet"),t("OutboundLink")],1),e._v(" project.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/reez/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Matthew Ramsden"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("October 11: Spoke at the "),t("a",{attrs:{href:"https://www.meetup.com/bitcoinpark/events/291768716/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Park OpenHouse"),t("OutboundLink")],1),e._v(" on the topic "),t("a",{attrs:{href:"https://podcasts.apple.com/us/podcast/open-house-exploring-the-lightning-network-ldk/id1646515985?i=1000631904227",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Exploring the Lightning Network"'),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("November 8: Created a video for the "),t("a",{attrs:{href:"https://www.youtube.com/@bitcoindevelopers",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Developers"),t("OutboundLink")],1),e._v(" channel on YouTube titled "),t("a",{attrs:{href:"https://www.youtube.com/watch?v=rcU3LU6iZCs",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Lightning Development with Swift: Make Your First Lightning App with LDK Node Swift"'),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[t("strong",[e._v("Other current and future contributors...")])]),e._v(" "),t("p",[e._v("If you are a contributor to BDK and doing something fun that's BDK and/or bitcoin related let us know! Tag "),t("a",{attrs:{href:"https://twitter.com/bitcoindevkit/",target:"_blank",rel:"noopener noreferrer"}},[e._v("@bitcoindevkit"),t("OutboundLink")],1),e._v(" on X, "),t("a",{attrs:{href:"https://primal.net/profile/npub1ke470rdgnxg4gjs9cw3tv0dp690wl68f5xak5smflpsksedadd7qtf8jfm",target:"_blank",rel:"noopener noreferrer"}},[e._v("notmandatory"),t("OutboundLink")],1),e._v(" on nostr, or send us an email: blog at bitcoindevkit dot org.")])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{402:function(e,t,r){"use strict";r.r(t);var n=r(7),o=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h3",{attrs:{id:"this-post"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#this-post"}},[e._v("#")]),e._v(" This Post")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://spiral.xyz",target:"_blank",rel:"noopener noreferrer"}},[e._v("Spiral"),t("OutboundLink")],1),e._v(" team has graciously supported BDK financially (and spiritually) for the past four years and since early 2022 the BDK team has let folks know what we've been up to via the "),t("a",{attrs:{href:"https://spiral.xyz/blog/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Spiral blog"),t("OutboundLink")],1),e._v(". As of last summer we are grateful to also have received a generous "),t("a",{attrs:{href:"https://opensats.org/blog/bitcoin-and-nostr-grants-august-2023",target:"_blank",rel:"noopener noreferrer"}},[e._v("OpenSats grant"),t("OutboundLink")],1),e._v(" supporting our project. To keep our current and future financial supporters, open source contributors, and downstream users updated on our progress, starting this year we will be publishing a quarterly BDK project updates here on our blog.")]),e._v(" "),t("h3",{attrs:{id:"end-of-year-review"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#end-of-year-review"}},[e._v("#")]),e._v(" End of Year Review")]),e._v(" "),t("p",[e._v("The BDK project is made up of a core suite of "),t("a",{attrs:{href:"https://www.rust-lang.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("rust"),t("OutboundLink")],1),e._v(" libraries ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk?tab=readme-ov-file#architecture",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-*"),t("OutboundLink")],1),e._v(") that work together to provide everything an application developer needs to incorporate on-chain bitcoin wallet functionality into their project. Wrapped around the BDK core libraries is our "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk-ffi"),t("OutboundLink")],1),e._v(" bindings libraries that let Kotlin (desktop/android), Swift (desktop/iOS), and Python developers use BDK seamlessly in their projects. And wrapped around all of this software is documentation and examples. For over a year the BDK team has been working on a major "),t("a",{attrs:{href:"https://bitcoindevkit.org/blog/tags/architecture/",target:"_blank",rel:"noopener noreferrer"}},[e._v("re-architecture"),t("OutboundLink")],1),e._v(" of the BDK libraries to improve blockchain syncing, embedded device support ("),t("a",{attrs:{href:"https://docs.rust-embedded.org/book/intro/no-std.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("no-std"),t("OutboundLink")],1),e._v("), update key 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(", "),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 finally to provide a stable 1.0 API that our users can rely on for their production applications.")]),e._v(" "),t("p",[e._v("The team is currently working on the 1.0.0-alpha release train. The purposed of these alpha releases is to give early adopters (including our own "),t("code",[e._v("bdk-ffi")]),e._v(" contributors) a chance to try-out new BDK features and updated APIs and provide feedback. Once we have a stable, feature complete 1.0.0 BDK that our alpha users love we'll begin publishing 1.0.0-beta releases. With our beta releases we will finish updating tutorials and examples and performance testing, and ask all BDK users to start migrating and testing their applications with BDK 1.0.0. When our key contributors and users are satisfied that we have shaken out any final 1.0.0-beta issues we'll publish our BDK 1.0.0 release. Once 1.0.0 is out subsequent releases will use "),t("a",{attrs:{href:"https://semver.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("semantic versioning"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("For those keeping score, we'd originally planned to have the BDK 1.0.0 release out last year, but (spoiler) that didn't happen. As I'm sure our kind readers understand making safe, feature rich, easy to use bitcoin software isn't easy, reviewing it is even harder, and we, like every project in the space are short-handed. But with every release, as we build the software we also on-board new contributors and build the team that will deliver BDK 1.0.0, 1.1.0, 2.0.0, and beyond.")]),e._v(" "),t("h3",{attrs:{id:"core-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#core-bdk"}},[e._v("#")]),e._v(" Core BDK")]),e._v(" "),t("p",[e._v("For Q4 2023 we "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pulls?page=1&q=is%3Apr+merged%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("merged 33 PRs"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues?q=is%3Aissue+closed%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("closed 32 issues"),t("OutboundLink")],1),e._v(", and completed two 1.0.0-alpha releases, "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.2",target:"_blank",rel:"noopener noreferrer"}},[e._v("1.0.0-alpha.2"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.3",target:"_blank",rel:"noopener noreferrer"}},[e._v("1.0.0-alpha.3"),t("OutboundLink")],1),e._v(". The primary deliverable of these releases was to further stabilize the "),t("code",[e._v("bdk_chain")]),e._v(" crate which provides the central logic for tracking and updating wallet keychains and scripts to be tracked and manages all of the related blockchain and transaction data. Additional PRs started this quarter lay the groundwork for the next phase of development focused on improving how we sync data via blockchain clients and save that data to persistent storage. We also made one maintenance release "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v0.29.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("0.29.0"),t("OutboundLink")],1),e._v(" that upgraded our "),t("code",[e._v("rust-bitcoin")]),e._v(" dependency to release to 0.30.")]),e._v(" "),t("h3",{attrs:{id:"bdk-ffi"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-ffi"}},[e._v("#")]),e._v(" BDK-FFI")]),e._v(" "),t("p",[e._v("In Q4 the BDK-FFI bindings for Kotlin, Swift, and Python saw "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/pulls?page=1&q=is%3Apr+merged%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("23 PRs merged"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/issues?q=is%3Aissue+closed%3A2023-10-01..2023-12-31",target:"_blank",rel:"noopener noreferrer"}},[e._v("15 issues closed"),t("OutboundLink")],1),e._v(". One maintenance release was completed, "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v0.31.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("v0.31.0"),t("OutboundLink")],1),e._v(", which updated the language bindings dependency to the latest rust "),t("code",[e._v("bdk")]),e._v(" maintenance release 0.29.0 and in doing so updated the BDK FFI "),t("code",[e._v("rust-bitcoin")]),e._v(" dependency to version 0.30. This quarter the team took on the major task of creating the first language bindings based on the "),t("code",[e._v("bdk")]),e._v(" 1.0.0-alpha API. The resulting "),t("code",[e._v("bdk-ffi")]),e._v(" "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v1.0.0-alpha.2a",target:"_blank",rel:"noopener noreferrer"}},[e._v("v1.0.0-alpha2a"),t("OutboundLink")],1),e._v(" release is only able to expose part of the full "),t("code",[e._v("bdk")]),e._v(" 1.0.0 API but prepares the project for full support in future releases. As part of this work the current Kotlin API docs were removed, but fear not they will return in future alpha releases and be better than ever with not only API docs for Kotlin but also Swift and Python.")]),e._v(" "),t("h3",{attrs:{id:"bdk-contributors-spotlight"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-contributors-spotlight"}},[e._v("#")]),e._v(" BDK contributors spotlight")]),e._v(" "),t("p",[e._v("In this section we share what some of our hardworking contributors are doing to educate people about BDK, help on board new projects, and generally promote bitcoin and open source development around the world.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/danielabrozzoni/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Daniela Brozzoni"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("November 3: Gave a "),t("a",{attrs:{href:"https://bolt.fun",target:"_blank",rel:"noopener noreferrer"}},[e._v("bolt.fun"),t("OutboundLink")],1),e._v(" talk on open source development, "),t("a",{attrs:{href:"https://www.youtube.com/watch?v=P75nCR1owws",target:"_blank",rel:"noopener noreferrer"}},[e._v("YouTube"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("October 25-26: Joined a "),t("a",{attrs:{href:"https://planb.lugano.ch/contributing-to-free-and-open-source-projects/",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Contributing to free and open source projects" panel'),t("OutboundLink")],1),e._v(" at "),t("a",{attrs:{href:"https://planb.lugano.ch/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Plan B"),t("OutboundLink")],1),e._v(" lugano.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/evanlinjin/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Evan Linjin"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("November 15: Worked with "),t("a",{attrs:{href:"https://wizardsardine.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("wizardsardine"),t("OutboundLink")],1),e._v(" team to "),t("a",{attrs:{href:"https://twitter.com/darosior/status/1724842410839093562",target:"_blank",rel:"noopener noreferrer"}},[e._v("extract and integrate BDK coin-selection into the Liana wallet"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("December 3: Spoke at the "),t("a",{attrs:{href:"https://twitter.com/TaiwanBitdevs/status/1726537941688967238",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Tech Summit Taipei"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("December 13: Gave a talk about Bitcoin and BDK at "),t("a",{attrs:{href:"https://twitter.com/JCBA_org/status/1735100779172856170",target:"_blank",rel:"noopener noreferrer"}},[e._v("Taipei Blockchain Week"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/thunderbiscuit/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Thunderbiscuit"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("November 8: Created the educational "),t("a",{attrs:{href:"https://opcodeexplained.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Opcode Explained"),t("OutboundLink")],1),e._v(" website to help... explain bitcoin opcodes!")]),e._v(" "),t("p",[e._v("November 15: Joined the panel on the "),t("a",{attrs:{href:"https://bitcoin.review/podcast/episode-55/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Review Podcast Episode 55"),t("OutboundLink")],1),e._v(" to talked about his "),t("a",{attrs:{href:"https://github.com/thunderbiscuit/padawan-wallet",target:"_blank",rel:"noopener noreferrer"}},[e._v("padawan-wallet"),t("OutboundLink")],1),e._v(" project.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/reez/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Matthew Ramsden"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("October 11: Spoke at the "),t("a",{attrs:{href:"https://www.meetup.com/bitcoinpark/events/291768716/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Park OpenHouse"),t("OutboundLink")],1),e._v(" on the topic "),t("a",{attrs:{href:"https://podcasts.apple.com/us/podcast/open-house-exploring-the-lightning-network-ldk/id1646515985?i=1000631904227",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Exploring the Lightning Network"'),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("November 8: Created a video for the "),t("a",{attrs:{href:"https://www.youtube.com/@bitcoindevelopers",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin Developers"),t("OutboundLink")],1),e._v(" channel on YouTube titled "),t("a",{attrs:{href:"https://www.youtube.com/watch?v=rcU3LU6iZCs",target:"_blank",rel:"noopener noreferrer"}},[e._v('"Lightning Development with Swift: Make Your First Lightning App with LDK Node Swift"'),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[t("strong",[e._v("Other current and future contributors...")])]),e._v(" "),t("p",[e._v("If you are a contributor to BDK and doing something fun that's BDK and/or bitcoin related let us know! Tag "),t("a",{attrs:{href:"https://twitter.com/bitcoindevkit/",target:"_blank",rel:"noopener noreferrer"}},[e._v("@bitcoindevkit"),t("OutboundLink")],1),e._v(" on X, "),t("a",{attrs:{href:"https://primal.net/profile/npub1ke470rdgnxg4gjs9cw3tv0dp690wl68f5xak5smflpsksedadd7qtf8jfm",target:"_blank",rel:"noopener noreferrer"}},[e._v("notmandatory"),t("OutboundLink")],1),e._v(" on nostr, or send us an email: blog at bitcoindevkit dot org.")])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/47.5dee4bad.js b/assets/js/47.70dc63ea.js similarity index 98% rename from assets/js/47.5dee4bad.js rename to assets/js/47.70dc63ea.js index 757156a73a..c289322578 100644 --- a/assets/js/47.5dee4bad.js +++ b/assets/js/47.70dc63ea.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{401:function(e,t,r){"use strict";r.r(t);var a=r(7),n=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("br"),e._v(" "),t("h3",{attrs:{id:"core-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#core-bdk"}},[e._v("#")]),e._v(" Core BDK")]),e._v(" "),t("p",[e._v("The majority of BDK rust library work this quarter was towards finishing new and improved electrum, esplora and Bitcoin Core RPC (block-by-block) syncing APIs. Bug fixes and improvements were also completed for the transaction builder and other wallet APIs. Six bi-weekly 1.0.0-alpha releases were made ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.3",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.3"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.4",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.4"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.5",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.5"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.6",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.6"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.7",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.7"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.8",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.8"),t("OutboundLink")],1),e._v("). For the quarter "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pulls?q=is%3Apr+merged%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("54 PRs"),t("OutboundLink")],1),e._v(" were merged and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues?q=is%3Aissue+closed%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("55 issues"),t("OutboundLink")],1),e._v(" were closed.")]),e._v(" "),t("h3",{attrs:{id:"bdk-ffi"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-ffi"}},[e._v("#")]),e._v(" BDK-FFI")]),e._v(" "),t("p",[e._v("For the language binding libraries (Kotlin, Swift, Python) the focus was on small bug fixes for the pre-1.0 releases ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v0.31.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("0.30.0"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v0.31.1",target:"_blank",rel:"noopener noreferrer"}},[e._v("0.30.1"),t("OutboundLink")],1),e._v(") and creating the first 1.0.0-alpha bindings release ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v1.0.0-alpha.7",target:"_blank",rel:"noopener noreferrer"}},[e._v("1.0.0-alpha.7"),t("OutboundLink")],1),e._v("). For the quarter "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/pulls?q=is%3Apr+merged%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("23 PRs"),t("OutboundLink")],1),e._v(" were merged and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/issues?q=is%3Aissue+closed%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("8 issues"),t("OutboundLink")],1),e._v(" closed.")]),e._v(" "),t("h3",{attrs:{id:"plans-for-next-quarter"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#plans-for-next-quarter"}},[e._v("#")]),e._v(" Plans for Next Quarter")]),e._v(" "),t("p",[e._v("The focus for Q2 development is completing our first 1.0.0 beta release and improving user docs and testing for it. The team will also work on updating all language bindings (Kotlin/Swift/Python) to use new rust lib 1.0.0 beta APIs.")]),e._v(" "),t("h3",{attrs:{id:"bdk-contributors-spotlight"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-contributors-spotlight"}},[e._v("#")]),e._v(" BDK contributors spotlight")]),e._v(" "),t("p",[e._v("In this section we share what some of our hardworking contributors are doing to educate people about BDK, help on board new projects, and generally promote bitcoin and open source development around the world.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/evanlinjin/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Evan Linjin"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("February 22: Gave a talk on "),t("a",{attrs:{href:"https://btcplusplus.dev/conf/ba24/talks",target:"_blank",rel:"noopener noreferrer"}},[e._v("BDK 1.0 at BTC++"),t("OutboundLink")],1),e._v(" in Buena Aires, Argentina.")]),e._v(" "),t("p",[t("strong",[e._v("Other current and future contributors...")])]),e._v(" "),t("p",[e._v("If you are a contributor to BDK and doing something fun that's BDK and/or bitcoin related let us know! Tag "),t("a",{attrs:{href:"https://twitter.com/bitcoindevkit/",target:"_blank",rel:"noopener noreferrer"}},[e._v("@bitcoindevkit"),t("OutboundLink")],1),e._v(" on X, "),t("a",{attrs:{href:"https://primal.net/profile/npub1ke470rdgnxg4gjs9cw3tv0dp690wl68f5xak5smflpsksedadd7qtf8jfm",target:"_blank",rel:"noopener noreferrer"}},[e._v("notmandatory"),t("OutboundLink")],1),e._v(" on nostr, or send us an email: blog at bitcoindevkit dot org.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{400:function(e,t,r){"use strict";r.r(t);var a=r(7),n=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("br"),e._v(" "),t("h3",{attrs:{id:"core-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#core-bdk"}},[e._v("#")]),e._v(" Core BDK")]),e._v(" "),t("p",[e._v("The majority of BDK rust library work this quarter was towards finishing new and improved electrum, esplora and Bitcoin Core RPC (block-by-block) syncing APIs. Bug fixes and improvements were also completed for the transaction builder and other wallet APIs. Six bi-weekly 1.0.0-alpha releases were made ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.3",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.3"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.4",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.4"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.5",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.5"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.6",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.6"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.7",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.7"),t("OutboundLink")],1),e._v(", "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v1.0.0-alpha.8",target:"_blank",rel:"noopener noreferrer"}},[e._v("alpha.8"),t("OutboundLink")],1),e._v("). For the quarter "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pulls?q=is%3Apr+merged%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("54 PRs"),t("OutboundLink")],1),e._v(" were merged and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues?q=is%3Aissue+closed%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("55 issues"),t("OutboundLink")],1),e._v(" were closed.")]),e._v(" "),t("h3",{attrs:{id:"bdk-ffi"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-ffi"}},[e._v("#")]),e._v(" BDK-FFI")]),e._v(" "),t("p",[e._v("For the language binding libraries (Kotlin, Swift, Python) the focus was on small bug fixes for the pre-1.0 releases ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v0.31.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("0.30.0"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v0.31.1",target:"_blank",rel:"noopener noreferrer"}},[e._v("0.30.1"),t("OutboundLink")],1),e._v(") and creating the first 1.0.0-alpha bindings release ("),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/releases/tag/v1.0.0-alpha.7",target:"_blank",rel:"noopener noreferrer"}},[e._v("1.0.0-alpha.7"),t("OutboundLink")],1),e._v("). For the quarter "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/pulls?q=is%3Apr+merged%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("23 PRs"),t("OutboundLink")],1),e._v(" were merged and "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi/issues?q=is%3Aissue+closed%3A2024-01-01..2024-03-31+",target:"_blank",rel:"noopener noreferrer"}},[e._v("8 issues"),t("OutboundLink")],1),e._v(" closed.")]),e._v(" "),t("h3",{attrs:{id:"plans-for-next-quarter"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#plans-for-next-quarter"}},[e._v("#")]),e._v(" Plans for Next Quarter")]),e._v(" "),t("p",[e._v("The focus for Q2 development is completing our first 1.0.0 beta release and improving user docs and testing for it. The team will also work on updating all language bindings (Kotlin/Swift/Python) to use new rust lib 1.0.0 beta APIs.")]),e._v(" "),t("h3",{attrs:{id:"bdk-contributors-spotlight"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bdk-contributors-spotlight"}},[e._v("#")]),e._v(" BDK contributors spotlight")]),e._v(" "),t("p",[e._v("In this section we share what some of our hardworking contributors are doing to educate people about BDK, help on board new projects, and generally promote bitcoin and open source development around the world.")]),e._v(" "),t("p",[t("strong",[t("a",{attrs:{href:"https://github.com/evanlinjin/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Evan Linjin"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("February 22: Gave a talk on "),t("a",{attrs:{href:"https://btcplusplus.dev/conf/ba24/talks",target:"_blank",rel:"noopener noreferrer"}},[e._v("BDK 1.0 at BTC++"),t("OutboundLink")],1),e._v(" in Buena Aires, Argentina.")]),e._v(" "),t("p",[t("strong",[e._v("Other current and future contributors...")])]),e._v(" "),t("p",[e._v("If you are a contributor to BDK and doing something fun that's BDK and/or bitcoin related let us know! Tag "),t("a",{attrs:{href:"https://twitter.com/bitcoindevkit/",target:"_blank",rel:"noopener noreferrer"}},[e._v("@bitcoindevkit"),t("OutboundLink")],1),e._v(" on X, "),t("a",{attrs:{href:"https://primal.net/profile/npub1ke470rdgnxg4gjs9cw3tv0dp690wl68f5xak5smflpsksedadd7qtf8jfm",target:"_blank",rel:"noopener noreferrer"}},[e._v("notmandatory"),t("OutboundLink")],1),e._v(" on nostr, or send us an email: blog at bitcoindevkit dot org.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/48.d82a543b.js b/assets/js/48.274276ff.js similarity index 99% rename from assets/js/48.d82a543b.js rename to assets/js/48.274276ff.js index 33f726960b..1a50df4baf 100644 --- a/assets/js/48.d82a543b.js +++ b/assets/js/48.274276ff.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{402:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("BDK wallet developer library can be used to easily deploy wallets with various kinds of blockchain backend support, like "),s("a",{attrs:{href:"https://github.com/romanz/electrs",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("electrum")]),s("OutboundLink")],1),t._v(", "),s("a",{attrs:{href:"https://github.com/Blockstream/esplora",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("esplora")]),s("OutboundLink")],1),t._v(", "),s("code",[t._v("compact-filters")]),t._v(" ("),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP157"),s("OutboundLink")],1),t._v(") etc. With the latest release of BDK "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v0.10.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.10.0")]),s("OutboundLink")],1),t._v(", BDK now supports Bitcoin Core as a blockchain backend. BDK talks with Bitcoin Core using rust-bitcoin's "),s("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoincore-rpc",target:"_blank",rel:"noopener noreferrer"}},[t._v("bitcoincore-rpc"),s("OutboundLink")],1),t._v(" library.")]),t._v(" "),s("p",[t._v("This allows wallet devs to quickly deploy their wallet that can talk to a bitcoin full node (home raspi nodes) out of the box. Wallet devs don't need to worry about connecting to a full node with correct RPC calls, all of that is handled by BDK under the hood. All they need is to identify the full node's RPC IP address and the correct RPC credentials.")]),t._v(" "),s("p",[t._v("In this tutorial we will see how to write a very simplistic wallet code that can connect to a bitcoin core node and maintain its balance and make transactions.")]),t._v(" "),s("p",[t._v("Unlike other tutorials, we will not use "),s("code",[t._v("bdk-cli")]),t._v(" tools, but instead write rust code directly using "),s("code",[t._v("BDK")]),t._v(" devkit. In the end we will end up with our own simple bitcoin wallet.")]),t._v(" "),s("h2",{attrs:{id:"prerequisite"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite"}},[t._v("#")]),t._v(" Prerequisite")]),t._v(" "),s("p",[t._v("To run with this tutorial you would need to have a bitcoin core node running in regtest mode. Get the bitcoin core binary either from the "),s("a",{attrs:{href:"https://bitcoincore.org/bin/bitcoin-core-0.21.1/",target:"_blank",rel:"noopener noreferrer"}},[t._v("bitcoin core repo"),s("OutboundLink")],1),t._v(" or "),s("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/v0.21.1/doc/build-unix.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("build from source"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("Then configure the node with a following "),s("code",[t._v("bitcoin.conf")]),t._v(" file")]),t._v(" "),s("div",{staticClass:"language-txt extra-class"},[s("pre",{pre:!0,attrs:{class:"language-txt"}},[s("code",[t._v("regtest=1\nfallbackfee=0.0001\nserver=1\ntxindex=1\nrpcuser=admin\nrpcpassword=password\n")])])]),s("p",[t._v("Apart from that, you would need to install rust in your system. Grab the installation one-liner from "),s("a",{attrs:{href:"https://www.rust-lang.org/tools/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"setting-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),s("p",[t._v("Create a new cargo binary repository.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" ~/tutorial\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" tutorial\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" new bdk-example\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-example\n")])])]),s("p",[t._v("This will create a new project folder named "),s("code",[t._v("bdk-example")]),t._v(" with "),s("code",[t._v("src/main.rs")]),t._v(" and a "),s("code",[t._v("cargo.toml")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ tree "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-L")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(".")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(".")]),t._v("\n├── Cargo.toml\n└── src\n └── main.rs\n\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" directory, "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" files\n")])])]),s("p",[t._v("Opening "),s("code",[t._v("main.rs")]),t._v(" you will see some predefined code like this")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Hello, world!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Try running "),s("code",[t._v("cargo run")]),t._v(' and if everything is set, you should see "Hello, world!" printed in your terminal')]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n Compiling bdk-example v0.1.0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("/home/raj/github-repo/tutorial/bdk-example"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n Finished dev "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("unoptimized + debuginfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(".95s\n Running "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("target/debug/bdk-example"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v("\nHello, world"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("\n")])])]),s("p",[t._v("Of course we will not use the given "),s("code",[t._v("println!()")]),t._v(" statement, but we will put our main code in the "),s("code",[t._v("main()")]),t._v(" function.")]),t._v(" "),s("p",[s("code",[t._v("cargo new")]),t._v(" will also produce a skeleton "),s("code",[t._v("Cargo.toml")]),t._v(" file like this")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("package")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-example"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.1.0"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("edition")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),s("h2",{attrs:{id:"setting-dependencies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-dependencies"}},[t._v("#")]),t._v(" Setting dependencies")]),t._v(" "),s("p",[t._v("Once the rust binary is compiled and running, we now need to specify the dependencies we need to work on our library.")]),t._v(" "),s("p",[t._v("Remember that BDK provides almost everything we would need to build a wallet out of the box. So we don't need any more dependencies apart from BDK. We will use another small rust crate called "),s("a",{attrs:{href:"https://crates.io/crates/dirs-next",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("dirs_next")]),s("OutboundLink")],1),t._v(" to find our home directory and store wallet files in a subfolder there.")]),t._v(" "),s("p",[t._v("Add the dependencies into "),s("code",[t._v("Cargo.toml")]),t._v(" like below")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("package")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-example"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.1.0"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("edition")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.10"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all-keys"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"key-value-db"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rpc"')]),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 key property"}},[t._v("dirs-next")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2.0"')]),t._v("\n")])])]),s("p",[t._v("We disabled the default BDK feature (which specifies blockchain backend as an electrum server) and we requested the following features:")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("all-keys")]),t._v(": Adds BIP39 key derivation capabilities")]),t._v(" "),s("li",[s("strong",[t._v("key-value-db")]),t._v(": Adds a persistence storage capability")]),t._v(" "),s("li",[s("strong",[t._v("rpc")]),t._v(": Adds the RPC blockchain backend capability.")])]),t._v(" "),s("p",[t._v("Now that we have the dependencies added, we can import them in the "),s("code",[t._v("main.rs")]),t._v(" file to use in our code.\nAdd the following imports at the start of "),s("code",[t._v("main.rs")])]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("secp256k1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoincore_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcApi")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wallet_name_from_descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip39"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("With this we are now ready to add our wallet code.")]),t._v(" "),s("h2",{attrs:{id:"getting-descriptors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-descriptors"}},[t._v("#")]),t._v(" Getting Descriptors")]),t._v(" "),s("p",[t._v("BDK is a descriptor based wallet library. That means when we specify our wallet key-chain we need to tell BDK about it in the format of a descriptor. You can read up on descriptors more "),s("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(". A descriptor string looks like this\n"),s("code",[t._v("\"wpkh([b8b575c2/84'/1'/0'/0]tprv8icWtRzy9CWgFxpGMLSdAeE4wWyz39XGc6SwykeTo13tYm14JkVVQAf7jz8WDDarCgNJrG3aEPJEqchDWeJdiaWpS3FwbLB9SzsN57V7qxB/*)\"")]),t._v(".")]),t._v(" "),s("p",[t._v("This describes a SegwitV0 descriptor of a key derived at path "),s("code",[t._v("m/84'/1'/0'/0")]),t._v(". If you already have a descriptor from other sources, you can use that. Otherwise, BDK has your back. BDK can be used to generate a fresh master key with mnemonic, and then derive child keys from it given a specific path. Putting the key in a descriptor is as simple as wrapping it with a "),s("code",[t._v("wpkh()")]),t._v(" string.")]),t._v(" "),s("p",[t._v("We will use a dedicated function that will create fresh receive and change descriptors from BDK for our purpose. It will also generate the mnemonic word list for later regenerating the wallet. But we will ignore that for our scope.")]),t._v(" "),s("p",[t._v("Add a function named "),s("code",[t._v("get-descriptor()")]),t._v(" below the "),s("code",[t._v("main()")]),t._v(" function as shown")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token 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 comment"}},[t._v("// generate fresh descriptor strings and return them via (receive, change) tuple")]),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("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a new secp context")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" secp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// You can also set a password to unlock the mnemonic")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"random password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate a fresh mnemonic, and from there a privatekey")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Words12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("English")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_extended_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_xprv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create derived privkey from the above master privkey")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// We use the following derivation paths for receive and change keys")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// receive: "m/84h/1h/0h/0"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// change: "m/84h/1h/0h/1" ')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" keys "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Vec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("derive_priv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fingerprint")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv_desc_key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n derived_xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_descriptor_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap the derived key with the wpkh() string to produce a descriptor string")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),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 punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" derived_xprv_desc_key "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" desc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('")"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("desc"),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 \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Return the keys as a tuple")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" keys"),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 function"}},[t._v("clone")]),s("span",{pre:!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("p",[t._v("To check that the above added function is working as expected, call it in the main function and print the descriptors")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recv: {:#?}, \\nchng: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Running the binary should produce the following result")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\nrecv: "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh([89df6a67/84'/1'/0'/0]tprv8iSRXyLtTKJN9qt1jyPVqwhDMEaYztXunPaRQznaH1z8gj8e2g7RnF2ZoHP56VEXwMn76AiV1Je6nJmZbFistwAQCrRGmSrsoKfdqfTDNA1/*)\"")]),t._v(", \nchng: "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh([89df6a67/84'/1'/0'/1]tprv8iSRXyLtTKJNCECQxBJ19cgx2ueS7mC7GNq7VqTWY3RNPMBY7DfTb9HUnXpJqa14jCJNRmi4yGxfoTVS4WLBXDkvTLq4vujeAD9NfDtSxGP/*)\"")]),t._v("\n")])])]),s("p",[t._v("Voila! Now we have nice descriptors strings handy to use for our BDK wallet construction.")]),t._v(" "),s("h2",{attrs:{id:"talking-to-bitcoin-core-programmatically"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#talking-to-bitcoin-core-programmatically"}},[t._v("#")]),t._v(" Talking to Bitcoin Core Programmatically")]),t._v(" "),s("p",[t._v("Like all other tutorials we will use two wallets to send coins back and forth. A Bitcoin Core wallet accessible via "),s("code",[t._v("bitcoin-cli")]),t._v(" command line tools, and a BDK wallet maintained by BDK library.")]),t._v(" "),s("p",[t._v("But unlike other tutorials, we won't be using "),s("code",[t._v("bitcoin-cli")]),t._v(" to talk to the Core wallet (we can, but let's spice things up). Instead, we will use the "),s("code",[t._v("bitcoin-rpc")]),t._v(" library, to talk with our core node listening at "),s("code",[t._v("127.0.0.1:18443")]),t._v(", from inside our main function. This will allow us to write code, that will handle both the core and BDK wallet, from inside of the same function, and we won't have to switch terminals!")]),t._v(" "),s("p",[t._v("Remember we imported "),s("code",[t._v("use bdk::bitcoincore_rpc::{Auth as rpc_auth, Client, RpcApi};")]),t._v("? Thats exactly for this purpose.")]),t._v(" "),s("p",[t._v("Start the "),s("code",[t._v("bitcoind")]),t._v(" node.")]),t._v(" "),s("p",[t._v("you should see bitcoind listening at port 18443")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("netstat")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-nptl")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("grep")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("18443")]),t._v(" \ntcp "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),t._v(".0.0:18443 "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),t._v(".0.0:* LISTEN "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("135532")]),t._v("/bitcoind \n")])])]),s("p",[t._v("Lets create a core rpc interface in our main function.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a RPC interface")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 keyword"}},[t._v("let")]),t._v(" core_rpc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://127.0.0.1:18443/wallet/test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_blockchain_info")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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("We have provided our RPC authentication "),s("code",[t._v("username")]),t._v(" and "),s("code",[t._v("password")]),t._v(" (same as provided in "),s("code",[t._v("bitcoin.conf")]),t._v(" file).\nWe have provided the RPC address of our local bitcoin node, with the path to a wallet file, named "),s("code",[t._v("test")]),t._v(". And then asked the rpc client to give us the current blockchain info.\nIf everything goes well, running "),s("code",[t._v("cargo run")]),t._v(" you should see an output like below:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nGetBlockchainInfoResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n chain: "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"regtest"')]),t._v(",\n blocks: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n headers: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n best_block_hash: 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206,\n difficulty: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00000000046565423739069247")]),t._v(",\n median_time: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1296688602")]),t._v(",\n verification_progress: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(",\n initial_block_download: true,\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\n")])])]),s("p",[t._v("Thats it. Now we can programmatically talk to our core node.")]),t._v(" "),s("h2",{attrs:{id:"get-some-balance-in-core-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-some-balance-in-core-wallet"}},[t._v("#")]),t._v(" Get some balance in core wallet.")]),t._v(" "),s("p",[t._v("We have told our rpc client that we would use a wallet named "),s("code",[t._v("test")]),t._v(". But currently, our core node doesn't have such a wallet. So let's create the wallet and fund it with some test coins.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the test wallet ")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get a new address")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_new_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate 101 blocks and use the above address as coinbase")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("101")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// fetch the new balance")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Show balance")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"core balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This will create a wallet in bitcoin core named "),s("code",[t._v("test")]),t._v(". generate 101 blocks and use a new address from the wallet as coinbase wallet. Because required coinbase maturity in bitcoin is 100 blocks, by generating 101 blocks, we will have the balance of the first coinbase block reward available for use.\nThe last "),s("code",[t._v("println!()")]),t._v(" statement will show the new updated balance as 50 BTC.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\ncore balance: Amount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50.00000000")]),t._v(" BTC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n")])])]),s("p",[t._v("Great! We now have 50 regtest BTC to play with.")]),t._v(" "),s("h2",{attrs:{id:"setup-the-bdk-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setup-the-bdk-wallet"}},[t._v("#")]),t._v(" Setup the BDK wallet")]),t._v(" "),s("p",[t._v("Now that we are done setting up the core wallet. The last remaining step is to setup the BDK wallet. For this we will use the previous descriptor generation function and write code as below.")]),t._v(" "),s("p",[s("strong",[t._v("Note")]),t._v(": You might want to comment out the previous code in "),s("code",[t._v("main()")]),t._v(", as running them again will create more coins in core, which isn't an issue, but might be confusing.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get receive and change descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use deterministic wallet name derived from descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wallet_name_from_descriptor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the datadir to store wallet data")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" datadir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("dirs_next"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("home_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('".bdk-example"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" database "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_tree "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open_tree")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set RPC username, password and url")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n username"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" rpc_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:18443"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Setup the RPC configuration")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n skip_blocks"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use the above configuration to create a RPC blockchain backend")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("rpc_config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Combine everything and finally create the BDK wallet structure")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" db_tree"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch a fresh address to receive coins")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk address: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("That's a lot of code. They are divided into logical sections. Let's discuss each step one by one.")]),t._v(" "),s("ul",[s("li",[t._v("First we used our previous "),s("code",[t._v("get_descriptors()")]),t._v(" function to generate two descriptor strings. One for generating receive addresses and one for change addresses.")]),t._v(" "),s("li",[t._v("Then we used a special function from BDK called "),s("code",[t._v("wallet_name_from_descriptor()")]),t._v(" to derive a name of the wallet from our descriptors. This allows us to have wallet names deterministically linked with descriptors. So in future if we use a different descriptor, the wallet will automatically have a different name. This allows us to not mix wallet names with same descriptor, and given the descriptors we can always determine what was the name we used. It is recommended to derive wallet names like this while using a core backend. Note that this wallet will be created inside the core node. So just like we accessed the "),s("code",[t._v("test")]),t._v(" wallet, we could also access this wallet.")]),t._v(" "),s("li",[t._v("Then we created a data directory at path "),s("code",[t._v("/home/username/.bdk-example")]),t._v(". We use "),s("code",[t._v("dirs_next")]),t._v(" to find our home path, and then appended that with "),s("code",[t._v(".bdk-example")]),t._v(". All the BDK wallet files will be created and maintained in that directory. In the Database we instructed BDK to create a new "),s("code",[t._v("Tree")]),t._v(" with "),s("code",[t._v("wallet_name")]),t._v(", so given a descriptor, BDK will always know which DB Tree to refer ("),s("code",[t._v("Tree")]),t._v(" is a "),s("code",[t._v("sled")]),t._v(" specific term).")]),t._v(" "),s("li",[t._v("Then like we did previously, we created the rpc username/password authentication, and specified the rpc url. Note that we cannot use the same "),s("code",[t._v("rpc_auth")]),t._v(" we used before for "),s("code",[t._v("core_rpc")]),t._v(" as BDK auth and bitcoin-rpc auth are slightly separate structures.")]),t._v(" "),s("li",[t._v("We combined all this information and created an "),s("code",[t._v("RpcConfig")]),t._v(" structure.")]),t._v(" "),s("li",[t._v("We used the rpc configuration to create a "),s("code",[t._v("RpcBlockchain")]),t._v(" structure.")]),t._v(" "),s("li",[t._v("Finally we used the Descriptors, Database, and Blockchain to create our final BDK "),s("code",[t._v("wallet")]),t._v(" structure.")])]),t._v(" "),s("p",[t._v("Now that we have our wallet cooked, in the end, we instructed it to sync with the bitcoin core backend, and fetch us a new address.")]),t._v(" "),s("p",[t._v("If all goes well, you should see an address printed in the terminal.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n Finished dev "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("unoptimized + debuginfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(".99s\n Running "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("target/debug/bdk-example"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v("\nbdk address: bcrt1q9vkmujggvzs0rd4z6069v3v0jucje7ua7ap308\n")])])]),s("h2",{attrs:{id:"sending-sats-around"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sending-sats-around"}},[t._v("#")]),t._v(" Sending Sats Around")]),t._v(" "),s("p",[t._v("Now that we have covered all the groundwork, we have all we need to send coins back and forth between core and BDK wallet.")]),t._v(" "),s("p",[t._v("We will keep things simple here and make the following actions")]),t._v(" "),s("ul",[s("li",[t._v("Send 10 BTC from Core to BDK")]),t._v(" "),s("li",[t._v("Send back 5 BTC from BDK to Core")]),t._v(" "),s("li",[t._v("Display balance of two wallets")])]),t._v(" "),s("p",[t._v("In the last line of previous section we got a new address from BDK wallet. We will start from there. Without further discussion lets jump straight into code.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch a fresh address to receive coins")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Send 10 BTC from Core to BDK")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("send_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_btc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a transaction builder")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tx_builder "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set recipient of the transaction")]),t._v("\n tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("set_recipients")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500000000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Finalise the transaction and extract PSBT")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set signing option")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" signopt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n assume_height"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sign the above psbt with signing option")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signopt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Extract the final transaction")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tx "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("extract_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Broadcast the transaction")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcast")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tx"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch and display wallet balances")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" bdk_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_sat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"core wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BDK wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bdk_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The above code segment is mostly straightforward. The only new thing added is "),s("code",[t._v("wallet.build_tx()")]),t._v(" which returns a "),s("code",[t._v("TxBuilder")]),t._v(". BDK allows us to have very fine grained control of cooking up transactions. Almost everything that is possible to do with a Bitcoin transaction can be done in BDK. Here we have a very simple vanilla transaction with no added magic. To get full list of capabilities that "),s("code",[t._v("TxBuilder")]),t._v(" supports scour its implementation "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/38d1d0b0e29d38cd370c740d798d96a3c9fcaa1f/src/wallet/tx_builder.rs#L123-L153",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("Finally to step through what we did above:")]),t._v(" "),s("ul",[s("li",[t._v("We asked core wallet to send 10 BTC to bdk wallet address.")]),t._v(" "),s("li",[t._v("We confirmed the transaction, and synced the wallet.")]),t._v(" "),s("li",[t._v("We asked BDK to create a transaction sending 5 BTC to core wallet address.")]),t._v(" "),s("li",[t._v("We signed and broadcast the transaction. BDK will use the same core node to broadcast the transaction to network.")]),t._v(" "),s("li",[t._v("We confirmed the transaction by mining a block, and synced the wallet.")]),t._v(" "),s("li",[t._v("We fetched and displayed balance of both core and BDK wallet.")])]),t._v(" "),s("p",[t._v("If all goes well, you should see the final updated balance as below:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n Compiling bdk-example v0.1.0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("/home/raj/github-repo/bdk-example/bdk-example"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n Finished dev "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("unoptimized + debuginfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(".57s\n Running "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("target/debug/bdk-example"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v("\ncore wallet balance: Amount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("144.99998590")]),t._v(" BTC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nBDK wallet balance: Amount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.99999859")]),t._v(" BTC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("Voila! We have ~145 BTC (150 - 5) in core wallet and 5 BTC (10 - 5) in BDK wallet. The slight deficiency in the amount are due to transaction fees. Because we are using regtest, the fee is some standard value hardcoded in core node.")]),t._v(" "),s("p",[t._v("Check out the data directory where BDK has created the wallet data files.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ls")]),t._v(" ~/.bdk-example/\nblobs conf db snap.0000000000023CAB\n")])])]),s("p",[t._v("And finally, this is what the final "),s("code",[t._v("main.rs")]),t._v(" file looks like.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("secp256k1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoincore_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcApi")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wallet_name_from_descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip39"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a RPC interface")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 keyword"}},[t._v("let")]),t._v(" core_rpc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://127.0.0.1:18443/wallet/test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the test wallet ")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get a new address")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_new_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate 101 blocks and use the above address as coinbase")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("101")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get receive and change descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use deterministic wallet name derived from descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wallet_name_from_descriptor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the datadir to store wallet data")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" datadir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("dirs_next"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("home_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('".bdk-example"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" database "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_tree "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open_tree")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set RPC username and password")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n username"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set RPC url")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" rpc_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:18443"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Setup the RPC configuration")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n skip_blocks"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use the above configuration to create a RPC blockchain backend")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("rpc_config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Combine everything and finally create the BDK wallet structure")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" db_tree"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch a fresh address to receive coins")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Send 10 BTC from Core to BDK")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("send_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_btc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a transaction builder")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tx_builder "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set recipient of the transaction")]),t._v("\n tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("set_recipients")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500000000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Finalise the transaction and extract PSBT")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set signing option")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" signopt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n assume_height"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sign the above psbt with signing option")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signopt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Extract the final transaction")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tx "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("extract_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Broadcast the transaction")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcast")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tx"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch and display wallet balances")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" bdk_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_sat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"core wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BDK wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bdk_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// generate fresh descriptor strings and return them via (receive, change) tupple ")]),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("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a new secp context")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" secp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// You can also set a password to unlock the mnemonic")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"random password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate a fresh menmonic, and from their, a fresh private key xprv")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Words12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("English")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_extended_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_xprv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive our descriptors to use")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// We use the following paths for recieve and change descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// recieve: "m/84h/1h/0h/0"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// change: "m/84h/1h/0h/1" ')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" keys "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Vec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("derive_priv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fingerprint")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv_desc_key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n derived_xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_descriptor_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap the derived key with the wpkh() string to produce a descriptor string")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),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 punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" derived_xprv_desc_key "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" desc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('")"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("desc"),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 \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Return the keys as a tupple")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" keys"),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 function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"conclusion"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[t._v("#")]),t._v(" Conclusion")]),t._v(" "),s("p",[t._v("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).")]),t._v(" "),s("p",[t._v("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.")]),t._v(" "),s("p",[t._v("To find and explore more about the BDK capabilities and how it can fit your development need refer the following resources.")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[t._v("source code"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("dev docs"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://discord.com/invite/d7NkDKm",target:"_blank",rel:"noopener noreferrer"}},[t._v("community"),s("OutboundLink")],1)])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{401:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("BDK wallet developer library can be used to easily deploy wallets with various kinds of blockchain backend support, like "),s("a",{attrs:{href:"https://github.com/romanz/electrs",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("electrum")]),s("OutboundLink")],1),t._v(", "),s("a",{attrs:{href:"https://github.com/Blockstream/esplora",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("esplora")]),s("OutboundLink")],1),t._v(", "),s("code",[t._v("compact-filters")]),t._v(" ("),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP157"),s("OutboundLink")],1),t._v(") etc. With the latest release of BDK "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/releases/tag/v0.10.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.10.0")]),s("OutboundLink")],1),t._v(", BDK now supports Bitcoin Core as a blockchain backend. BDK talks with Bitcoin Core using rust-bitcoin's "),s("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-bitcoincore-rpc",target:"_blank",rel:"noopener noreferrer"}},[t._v("bitcoincore-rpc"),s("OutboundLink")],1),t._v(" library.")]),t._v(" "),s("p",[t._v("This allows wallet devs to quickly deploy their wallet that can talk to a bitcoin full node (home raspi nodes) out of the box. Wallet devs don't need to worry about connecting to a full node with correct RPC calls, all of that is handled by BDK under the hood. All they need is to identify the full node's RPC IP address and the correct RPC credentials.")]),t._v(" "),s("p",[t._v("In this tutorial we will see how to write a very simplistic wallet code that can connect to a bitcoin core node and maintain its balance and make transactions.")]),t._v(" "),s("p",[t._v("Unlike other tutorials, we will not use "),s("code",[t._v("bdk-cli")]),t._v(" tools, but instead write rust code directly using "),s("code",[t._v("BDK")]),t._v(" devkit. In the end we will end up with our own simple bitcoin wallet.")]),t._v(" "),s("h2",{attrs:{id:"prerequisite"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite"}},[t._v("#")]),t._v(" Prerequisite")]),t._v(" "),s("p",[t._v("To run with this tutorial you would need to have a bitcoin core node running in regtest mode. Get the bitcoin core binary either from the "),s("a",{attrs:{href:"https://bitcoincore.org/bin/bitcoin-core-0.21.1/",target:"_blank",rel:"noopener noreferrer"}},[t._v("bitcoin core repo"),s("OutboundLink")],1),t._v(" or "),s("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/v0.21.1/doc/build-unix.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("build from source"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("Then configure the node with a following "),s("code",[t._v("bitcoin.conf")]),t._v(" file")]),t._v(" "),s("div",{staticClass:"language-txt extra-class"},[s("pre",{pre:!0,attrs:{class:"language-txt"}},[s("code",[t._v("regtest=1\nfallbackfee=0.0001\nserver=1\ntxindex=1\nrpcuser=admin\nrpcpassword=password\n")])])]),s("p",[t._v("Apart from that, you would need to install rust in your system. Grab the installation one-liner from "),s("a",{attrs:{href:"https://www.rust-lang.org/tools/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"setting-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),s("p",[t._v("Create a new cargo binary repository.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" ~/tutorial\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" tutorial\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" new bdk-example\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-example\n")])])]),s("p",[t._v("This will create a new project folder named "),s("code",[t._v("bdk-example")]),t._v(" with "),s("code",[t._v("src/main.rs")]),t._v(" and a "),s("code",[t._v("cargo.toml")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ tree "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-L")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(".")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(".")]),t._v("\n├── Cargo.toml\n└── src\n └── main.rs\n\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" directory, "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" files\n")])])]),s("p",[t._v("Opening "),s("code",[t._v("main.rs")]),t._v(" you will see some predefined code like this")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Hello, world!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Try running "),s("code",[t._v("cargo run")]),t._v(' and if everything is set, you should see "Hello, world!" printed in your terminal')]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n Compiling bdk-example v0.1.0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("/home/raj/github-repo/tutorial/bdk-example"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n Finished dev "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("unoptimized + debuginfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(".95s\n Running "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("target/debug/bdk-example"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v("\nHello, world"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("\n")])])]),s("p",[t._v("Of course we will not use the given "),s("code",[t._v("println!()")]),t._v(" statement, but we will put our main code in the "),s("code",[t._v("main()")]),t._v(" function.")]),t._v(" "),s("p",[s("code",[t._v("cargo new")]),t._v(" will also produce a skeleton "),s("code",[t._v("Cargo.toml")]),t._v(" file like this")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("package")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-example"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.1.0"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("edition")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),s("h2",{attrs:{id:"setting-dependencies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-dependencies"}},[t._v("#")]),t._v(" Setting dependencies")]),t._v(" "),s("p",[t._v("Once the rust binary is compiled and running, we now need to specify the dependencies we need to work on our library.")]),t._v(" "),s("p",[t._v("Remember that BDK provides almost everything we would need to build a wallet out of the box. So we don't need any more dependencies apart from BDK. We will use another small rust crate called "),s("a",{attrs:{href:"https://crates.io/crates/dirs-next",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("dirs_next")]),s("OutboundLink")],1),t._v(" to find our home directory and store wallet files in a subfolder there.")]),t._v(" "),s("p",[t._v("Add the dependencies into "),s("code",[t._v("Cargo.toml")]),t._v(" like below")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("package")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("name")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-example"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.1.0"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("edition")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.10"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"all-keys"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"key-value-db"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rpc"')]),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 key property"}},[t._v("dirs-next")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2.0"')]),t._v("\n")])])]),s("p",[t._v("We disabled the default BDK feature (which specifies blockchain backend as an electrum server) and we requested the following features:")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("all-keys")]),t._v(": Adds BIP39 key derivation capabilities")]),t._v(" "),s("li",[s("strong",[t._v("key-value-db")]),t._v(": Adds a persistence storage capability")]),t._v(" "),s("li",[s("strong",[t._v("rpc")]),t._v(": Adds the RPC blockchain backend capability.")])]),t._v(" "),s("p",[t._v("Now that we have the dependencies added, we can import them in the "),s("code",[t._v("main.rs")]),t._v(" file to use in our code.\nAdd the following imports at the start of "),s("code",[t._v("main.rs")])]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("secp256k1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoincore_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcApi")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wallet_name_from_descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip39"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("With this we are now ready to add our wallet code.")]),t._v(" "),s("h2",{attrs:{id:"getting-descriptors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-descriptors"}},[t._v("#")]),t._v(" Getting Descriptors")]),t._v(" "),s("p",[t._v("BDK is a descriptor based wallet library. That means when we specify our wallet key-chain we need to tell BDK about it in the format of a descriptor. You can read up on descriptors more "),s("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(". A descriptor string looks like this\n"),s("code",[t._v("\"wpkh([b8b575c2/84'/1'/0'/0]tprv8icWtRzy9CWgFxpGMLSdAeE4wWyz39XGc6SwykeTo13tYm14JkVVQAf7jz8WDDarCgNJrG3aEPJEqchDWeJdiaWpS3FwbLB9SzsN57V7qxB/*)\"")]),t._v(".")]),t._v(" "),s("p",[t._v("This describes a SegwitV0 descriptor of a key derived at path "),s("code",[t._v("m/84'/1'/0'/0")]),t._v(". If you already have a descriptor from other sources, you can use that. Otherwise, BDK has your back. BDK can be used to generate a fresh master key with mnemonic, and then derive child keys from it given a specific path. Putting the key in a descriptor is as simple as wrapping it with a "),s("code",[t._v("wpkh()")]),t._v(" string.")]),t._v(" "),s("p",[t._v("We will use a dedicated function that will create fresh receive and change descriptors from BDK for our purpose. It will also generate the mnemonic word list for later regenerating the wallet. But we will ignore that for our scope.")]),t._v(" "),s("p",[t._v("Add a function named "),s("code",[t._v("get-descriptor()")]),t._v(" below the "),s("code",[t._v("main()")]),t._v(" function as shown")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token 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 comment"}},[t._v("// generate fresh descriptor strings and return them via (receive, change) tuple")]),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("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a new secp context")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" secp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// You can also set a password to unlock the mnemonic")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"random password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate a fresh mnemonic, and from there a privatekey")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Words12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("English")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_extended_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_xprv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create derived privkey from the above master privkey")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// We use the following derivation paths for receive and change keys")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// receive: "m/84h/1h/0h/0"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// change: "m/84h/1h/0h/1" ')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" keys "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Vec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("derive_priv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fingerprint")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv_desc_key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n derived_xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_descriptor_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap the derived key with the wpkh() string to produce a descriptor string")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),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 punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" derived_xprv_desc_key "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" desc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('")"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("desc"),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 \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Return the keys as a tuple")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" keys"),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 function"}},[t._v("clone")]),s("span",{pre:!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("p",[t._v("To check that the above added function is working as expected, call it in the main function and print the descriptors")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"recv: {:#?}, \\nchng: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Running the binary should produce the following result")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\nrecv: "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh([89df6a67/84'/1'/0'/0]tprv8iSRXyLtTKJN9qt1jyPVqwhDMEaYztXunPaRQznaH1z8gj8e2g7RnF2ZoHP56VEXwMn76AiV1Je6nJmZbFistwAQCrRGmSrsoKfdqfTDNA1/*)\"")]),t._v(", \nchng: "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh([89df6a67/84'/1'/0'/1]tprv8iSRXyLtTKJNCECQxBJ19cgx2ueS7mC7GNq7VqTWY3RNPMBY7DfTb9HUnXpJqa14jCJNRmi4yGxfoTVS4WLBXDkvTLq4vujeAD9NfDtSxGP/*)\"")]),t._v("\n")])])]),s("p",[t._v("Voila! Now we have nice descriptors strings handy to use for our BDK wallet construction.")]),t._v(" "),s("h2",{attrs:{id:"talking-to-bitcoin-core-programmatically"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#talking-to-bitcoin-core-programmatically"}},[t._v("#")]),t._v(" Talking to Bitcoin Core Programmatically")]),t._v(" "),s("p",[t._v("Like all other tutorials we will use two wallets to send coins back and forth. A Bitcoin Core wallet accessible via "),s("code",[t._v("bitcoin-cli")]),t._v(" command line tools, and a BDK wallet maintained by BDK library.")]),t._v(" "),s("p",[t._v("But unlike other tutorials, we won't be using "),s("code",[t._v("bitcoin-cli")]),t._v(" to talk to the Core wallet (we can, but let's spice things up). Instead, we will use the "),s("code",[t._v("bitcoin-rpc")]),t._v(" library, to talk with our core node listening at "),s("code",[t._v("127.0.0.1:18443")]),t._v(", from inside our main function. This will allow us to write code, that will handle both the core and BDK wallet, from inside of the same function, and we won't have to switch terminals!")]),t._v(" "),s("p",[t._v("Remember we imported "),s("code",[t._v("use bdk::bitcoincore_rpc::{Auth as rpc_auth, Client, RpcApi};")]),t._v("? Thats exactly for this purpose.")]),t._v(" "),s("p",[t._v("Start the "),s("code",[t._v("bitcoind")]),t._v(" node.")]),t._v(" "),s("p",[t._v("you should see bitcoind listening at port 18443")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("netstat")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-nptl")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("grep")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("18443")]),t._v(" \ntcp "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),t._v(".0.0:18443 "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),t._v(".0.0:* LISTEN "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("135532")]),t._v("/bitcoind \n")])])]),s("p",[t._v("Lets create a core rpc interface in our main function.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a RPC interface")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 keyword"}},[t._v("let")]),t._v(" core_rpc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://127.0.0.1:18443/wallet/test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_blockchain_info")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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("We have provided our RPC authentication "),s("code",[t._v("username")]),t._v(" and "),s("code",[t._v("password")]),t._v(" (same as provided in "),s("code",[t._v("bitcoin.conf")]),t._v(" file).\nWe have provided the RPC address of our local bitcoin node, with the path to a wallet file, named "),s("code",[t._v("test")]),t._v(". And then asked the rpc client to give us the current blockchain info.\nIf everything goes well, running "),s("code",[t._v("cargo run")]),t._v(" you should see an output like below:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nGetBlockchainInfoResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n chain: "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"regtest"')]),t._v(",\n blocks: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n headers: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n best_block_hash: 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206,\n difficulty: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00000000046565423739069247")]),t._v(",\n median_time: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1296688602")]),t._v(",\n verification_progress: "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(",\n initial_block_download: true,\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\n")])])]),s("p",[t._v("Thats it. Now we can programmatically talk to our core node.")]),t._v(" "),s("h2",{attrs:{id:"get-some-balance-in-core-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-some-balance-in-core-wallet"}},[t._v("#")]),t._v(" Get some balance in core wallet.")]),t._v(" "),s("p",[t._v("We have told our rpc client that we would use a wallet named "),s("code",[t._v("test")]),t._v(". But currently, our core node doesn't have such a wallet. So let's create the wallet and fund it with some test coins.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the test wallet ")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get a new address")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_new_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate 101 blocks and use the above address as coinbase")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("101")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// fetch the new balance")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Show balance")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"core balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("This will create a wallet in bitcoin core named "),s("code",[t._v("test")]),t._v(". generate 101 blocks and use a new address from the wallet as coinbase wallet. Because required coinbase maturity in bitcoin is 100 blocks, by generating 101 blocks, we will have the balance of the first coinbase block reward available for use.\nThe last "),s("code",[t._v("println!()")]),t._v(" statement will show the new updated balance as 50 BTC.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\ncore balance: Amount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50.00000000")]),t._v(" BTC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n")])])]),s("p",[t._v("Great! We now have 50 regtest BTC to play with.")]),t._v(" "),s("h2",{attrs:{id:"setup-the-bdk-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setup-the-bdk-wallet"}},[t._v("#")]),t._v(" Setup the BDK wallet")]),t._v(" "),s("p",[t._v("Now that we are done setting up the core wallet. The last remaining step is to setup the BDK wallet. For this we will use the previous descriptor generation function and write code as below.")]),t._v(" "),s("p",[s("strong",[t._v("Note")]),t._v(": You might want to comment out the previous code in "),s("code",[t._v("main()")]),t._v(", as running them again will create more coins in core, which isn't an issue, but might be confusing.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get receive and change descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use deterministic wallet name derived from descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wallet_name_from_descriptor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the datadir to store wallet data")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" datadir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("dirs_next"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("home_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('".bdk-example"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" database "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_tree "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open_tree")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set RPC username, password and url")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n username"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" rpc_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:18443"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Setup the RPC configuration")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n skip_blocks"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use the above configuration to create a RPC blockchain backend")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("rpc_config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Combine everything and finally create the BDK wallet structure")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" db_tree"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch a fresh address to receive coins")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk address: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("That's a lot of code. They are divided into logical sections. Let's discuss each step one by one.")]),t._v(" "),s("ul",[s("li",[t._v("First we used our previous "),s("code",[t._v("get_descriptors()")]),t._v(" function to generate two descriptor strings. One for generating receive addresses and one for change addresses.")]),t._v(" "),s("li",[t._v("Then we used a special function from BDK called "),s("code",[t._v("wallet_name_from_descriptor()")]),t._v(" to derive a name of the wallet from our descriptors. This allows us to have wallet names deterministically linked with descriptors. So in future if we use a different descriptor, the wallet will automatically have a different name. This allows us to not mix wallet names with same descriptor, and given the descriptors we can always determine what was the name we used. It is recommended to derive wallet names like this while using a core backend. Note that this wallet will be created inside the core node. So just like we accessed the "),s("code",[t._v("test")]),t._v(" wallet, we could also access this wallet.")]),t._v(" "),s("li",[t._v("Then we created a data directory at path "),s("code",[t._v("/home/username/.bdk-example")]),t._v(". We use "),s("code",[t._v("dirs_next")]),t._v(" to find our home path, and then appended that with "),s("code",[t._v(".bdk-example")]),t._v(". All the BDK wallet files will be created and maintained in that directory. In the Database we instructed BDK to create a new "),s("code",[t._v("Tree")]),t._v(" with "),s("code",[t._v("wallet_name")]),t._v(", so given a descriptor, BDK will always know which DB Tree to refer ("),s("code",[t._v("Tree")]),t._v(" is a "),s("code",[t._v("sled")]),t._v(" specific term).")]),t._v(" "),s("li",[t._v("Then like we did previously, we created the rpc username/password authentication, and specified the rpc url. Note that we cannot use the same "),s("code",[t._v("rpc_auth")]),t._v(" we used before for "),s("code",[t._v("core_rpc")]),t._v(" as BDK auth and bitcoin-rpc auth are slightly separate structures.")]),t._v(" "),s("li",[t._v("We combined all this information and created an "),s("code",[t._v("RpcConfig")]),t._v(" structure.")]),t._v(" "),s("li",[t._v("We used the rpc configuration to create a "),s("code",[t._v("RpcBlockchain")]),t._v(" structure.")]),t._v(" "),s("li",[t._v("Finally we used the Descriptors, Database, and Blockchain to create our final BDK "),s("code",[t._v("wallet")]),t._v(" structure.")])]),t._v(" "),s("p",[t._v("Now that we have our wallet cooked, in the end, we instructed it to sync with the bitcoin core backend, and fetch us a new address.")]),t._v(" "),s("p",[t._v("If all goes well, you should see an address printed in the terminal.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n Finished dev "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("unoptimized + debuginfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(".99s\n Running "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("target/debug/bdk-example"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v("\nbdk address: bcrt1q9vkmujggvzs0rd4z6069v3v0jucje7ua7ap308\n")])])]),s("h2",{attrs:{id:"sending-sats-around"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sending-sats-around"}},[t._v("#")]),t._v(" Sending Sats Around")]),t._v(" "),s("p",[t._v("Now that we have covered all the groundwork, we have all we need to send coins back and forth between core and BDK wallet.")]),t._v(" "),s("p",[t._v("We will keep things simple here and make the following actions")]),t._v(" "),s("ul",[s("li",[t._v("Send 10 BTC from Core to BDK")]),t._v(" "),s("li",[t._v("Send back 5 BTC from BDK to Core")]),t._v(" "),s("li",[t._v("Display balance of two wallets")])]),t._v(" "),s("p",[t._v("In the last line of previous section we got a new address from BDK wallet. We will start from there. Without further discussion lets jump straight into code.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch a fresh address to receive coins")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Send 10 BTC from Core to BDK")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("send_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_btc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a transaction builder")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tx_builder "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set recipient of the transaction")]),t._v("\n tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("set_recipients")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500000000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Finalise the transaction and extract PSBT")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set signing option")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" signopt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n assume_height"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sign the above psbt with signing option")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signopt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Extract the final transaction")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tx "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("extract_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Broadcast the transaction")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcast")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tx"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch and display wallet balances")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" bdk_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_sat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"core wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BDK wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bdk_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The above code segment is mostly straightforward. The only new thing added is "),s("code",[t._v("wallet.build_tx()")]),t._v(" which returns a "),s("code",[t._v("TxBuilder")]),t._v(". BDK allows us to have very fine grained control of cooking up transactions. Almost everything that is possible to do with a Bitcoin transaction can be done in BDK. Here we have a very simple vanilla transaction with no added magic. To get full list of capabilities that "),s("code",[t._v("TxBuilder")]),t._v(" supports scour its implementation "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/38d1d0b0e29d38cd370c740d798d96a3c9fcaa1f/src/wallet/tx_builder.rs#L123-L153",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("Finally to step through what we did above:")]),t._v(" "),s("ul",[s("li",[t._v("We asked core wallet to send 10 BTC to bdk wallet address.")]),t._v(" "),s("li",[t._v("We confirmed the transaction, and synced the wallet.")]),t._v(" "),s("li",[t._v("We asked BDK to create a transaction sending 5 BTC to core wallet address.")]),t._v(" "),s("li",[t._v("We signed and broadcast the transaction. BDK will use the same core node to broadcast the transaction to network.")]),t._v(" "),s("li",[t._v("We confirmed the transaction by mining a block, and synced the wallet.")]),t._v(" "),s("li",[t._v("We fetched and displayed balance of both core and BDK wallet.")])]),t._v(" "),s("p",[t._v("If all goes well, you should see the final updated balance as below:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" run\n Compiling bdk-example v0.1.0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("/home/raj/github-repo/bdk-example/bdk-example"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n Finished dev "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("unoptimized + debuginfo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(".57s\n Running "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("target/debug/bdk-example"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v("\ncore wallet balance: Amount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("144.99998590")]),t._v(" BTC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nBDK wallet balance: Amount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.99999859")]),t._v(" BTC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("Voila! We have ~145 BTC (150 - 5) in core wallet and 5 BTC (10 - 5) in BDK wallet. The slight deficiency in the amount are due to transaction fees. Because we are using regtest, the fee is some standard value hardcoded in core node.")]),t._v(" "),s("p",[t._v("Check out the data directory where BDK has created the wallet data files.")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("$ "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ls")]),t._v(" ~/.bdk-example/\nblobs conf db snap.0000000000023CAB\n")])])]),s("p",[t._v("And finally, this is what the final "),s("code",[t._v("main.rs")]),t._v(" file looks like.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("secp256k1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoincore_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcApi")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wallet_name_from_descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip39"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("miniscript"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a RPC interface")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 keyword"}},[t._v("let")]),t._v(" core_rpc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://127.0.0.1:18443/wallet/test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" rpc_auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the test wallet ")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get a new address")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_new_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate 101 blocks and use the above address as coinbase")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("101")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get receive and change descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use deterministic wallet name derived from descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wallet_name_from_descriptor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create the datadir to store wallet data")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" datadir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("dirs_next"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("home_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('".bdk-example"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" database "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("sled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("datadir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" db_tree "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open_tree")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set RPC username and password")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" auth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Auth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("UserPass")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n username"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"admin"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set RPC url")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" rpc_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:18443"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Setup the RPC configuration")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" rpc_config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" rpc_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n auth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wallet_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n skip_blocks"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use the above configuration to create a RPC blockchain backend")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RpcBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("rpc_config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Combine everything and finally create the BDK wallet structure")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("receive_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("change_desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" db_tree"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch a fresh address to receive coins")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Send 10 BTC from Core to BDK")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("send_to_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_btc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a transaction builder")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tx_builder "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set recipient of the transaction")]),t._v("\n tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("set_recipients")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500000000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Finalise the transaction and extract PSBT")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tx_builder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set signing option")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" signopt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n assume_height"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sign the above psbt with signing option")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signopt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Extract the final transaction")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tx "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("extract_tx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Broadcast the transaction")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcast")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tx"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Confirm transaction by generating some blocks")]),t._v("\n core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_to_address")]),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(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("core_address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Sync the BDK wallet")]),t._v("\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("NoopProgress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fetch and display wallet balances")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" core_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" core_rpc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" bdk_balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Amount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_sat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"core wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" core_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BDK wallet balance: {:#?}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bdk_balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// generate fresh descriptor strings and return them via (receive, change) tupple ")]),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("get_descriptors")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a new secp context")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" secp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secp256k1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// You can also set a password to unlock the mnemonic")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" password "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"random password"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Generate a fresh menmonic, and from their, a fresh private key xprv")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratedKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MnemonicType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Words12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Language")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("English")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mnemonic "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedKey")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_extended_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" xkey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_xprv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Regtest")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive our descriptors to use")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// We use the following paths for recieve and change descriptor")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// recieve: "m/84h/1h/0h/0"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// change: "m/84h/1h/0h/1" ')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" keys "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Vec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m/84h/1h/0h/1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("derive_priv")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fingerprint")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("secp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" deriv_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" derived_xprv_desc_key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n derived_xprv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into_descriptor_key")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap the derived key with the wpkh() string to produce a descriptor string")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Secret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),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 punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" derived_xprv_desc_key "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" desc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh("')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("key"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n desc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('")"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("desc"),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 \n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Return the keys as a tupple")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" keys"),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 function"}},[t._v("clone")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"conclusion"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[t._v("#")]),t._v(" Conclusion")]),t._v(" "),s("p",[t._v("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).")]),t._v(" "),s("p",[t._v("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.")]),t._v(" "),s("p",[t._v("To find and explore more about the BDK capabilities and how it can fit your development need refer the following resources.")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[t._v("source code"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("dev docs"),s("OutboundLink")],1)]),t._v(" "),s("li",[s("a",{attrs:{href:"https://discord.com/invite/d7NkDKm",target:"_blank",rel:"noopener noreferrer"}},[t._v("community"),s("OutboundLink")],1)])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/49.c37e1b0c.js b/assets/js/49.c5e899f8.js similarity index 99% rename from assets/js/49.c37e1b0c.js rename to assets/js/49.c5e899f8.js index 8d69b09125..c42833db8f 100644 --- a/assets/js/49.c37e1b0c.js +++ b/assets/js/49.c5e899f8.js @@ -1 +1 @@ -(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 +(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{403:function(t,e,s){"use strict";s.r(e);var a=s(7),r=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"}},[t._v("#")]),t._v(" 2-of-3 Multi-Signature Descriptor Wallet using bdk-cli")]),t._v(" "),e("h2",{attrs:{id:"overview-of-the-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#overview-of-the-tutorial"}},[t._v("#")]),t._v(" Overview of the tutorial")]),t._v(" "),e("ul",[e("li",[t._v("The purpose of this tutorial is to continue learning "),e("code",[t._v("bdk-cli")]),t._v(" as our tool to manage a 2 of 3 multi-signature wallet.")]),t._v(" "),e("li",[t._v("Generate a receive address with a spending Policy of 2 out of 3 escrow aka multi-signature.")]),t._v(" "),e("li",[t._v("Intro to more complex but standard policies to create custom encumberances aka custom spending conditions for transactions.")])]),t._v(" "),e("p",[t._v("Note that to complete this tutorial, you'll need to enable the "),e("code",[t._v("compiler")]),t._v(" and "),e("code",[t._v("electrum")]),t._v(" flags when installing or building bdk-cli, for example by installing using:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("compiler,electrum\n")])])]),e("h2",{attrs:{id:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"}},[t._v("#")]),t._v(" Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables")]),t._v(" "),e("blockquote",[e("p",[t._v("Create three private keys and each in their own environment variable")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_00=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_01=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export XPRV_02=$(bdk-cli key generate | jq -r '.xprv')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/FwgUdwK.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"1a-verify-xprv-environment-variables-are-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-verify-xprv-environment-variables-are-active"}},[t._v("#")]),t._v(" 1a: Verify XPRV environment variables are Active")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZerGPbO.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"}},[t._v("#")]),t._v(" Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables")]),t._v(" "),e("blockquote",[e("p",[t._v("Generate the three individual Public Keys aka XPUBs using our Private key and descriptor path.")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_00=$(bdk-cli key derive --xprv $XPRV_00 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_01=$(bdk-cli key derive --xprv $XPRV_01 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export XPUB_02=$(bdk-cli key derive --xprv $XPRV_02 --path "m/84\'/1\'/0\'/0" | jq -r ".xpub")')])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/xT3KRh4.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"2a-verify-xpub-environment-variables"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2a-verify-xpub-environment-variables"}},[t._v("#")]),t._v(" 2a: Verify XPUB environment variables")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep XPUB")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/SzAip9E.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-create-single-wallet-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-create-single-wallet-descriptors"}},[t._v("#")]),t._v(" Step 3: Create Single-Wallet Descriptors")]),t._v(" "),e("blockquote",[e("p",[t._v("Create the wallet Descriptor for each wallet")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_00="$XPRV_00/84h/1h/0h/0/*"')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_01="$XPRV_01/84h/1h/0h/0/*"')])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export DESCRIPTOR_02="$XPRV_02/84h/1h/0h/0/*"')])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/mFrWt6b.png",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-4-create-multi-sig-descriptor-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-multi-sig-descriptor-wallets"}},[t._v("#")]),t._v(" Step 4: Create Multi-Sig-Descriptor Wallets")]),t._v(" "),e("blockquote",[e("p",[t._v("This is how you create the 2-of-3 multi-sig output descriptor. You will need (one PrivateKey and two Xpubs) It consists of using the "),e("code",[t._v("compiler")]),t._v(" function to parse "),e("code",[t._v("policy")]),t._v(" to "),e("code",[t._v("mini-script")]),t._v(" .")])]),t._v(" "),e("ul",[e("li",[t._v("When creating the descriptor the order matters so be aware of that when following tutorial if you are for any reason changing the order of the policy.")])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-0"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-0"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 0")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_00=$(bdk-cli compile \"thresh(2,pk($DESCRIPTOR_00),pk($XPUB_01),pk($XPUB_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-1"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-1"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 1")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_01=$(bdk-cli compile \"thresh(2,pk($XPUB_00),pk($DESCRIPTOR_01),pk($XPUB_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("h4",{attrs:{id:"multi-sig-wallet-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-wallet-2"}},[t._v("#")]),t._v(" Multi-Sig-Wallet 2")]),t._v(" "),e("ul",[e("li",[t._v("[ ] ▶️ "),e("code",[t._v("export MULTI_DESCRIPTOR_02=$(bdk-cli compile \"thresh(2,pk($XPUB_00),pk($XPUB_01),pk($DESCRIPTOR_02))\" | jq -r '.descriptor')")])])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/Yb8RmFS.gif",alt:""}})]),t._v(" "),e("h4",{attrs:{id:"multi-sig-2-of-3-policy-gets-compiled-to-miniscript"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#multi-sig-2-of-3-policy-gets-compiled-to-miniscript"}},[t._v("#")]),t._v(" multi-sig 2 of 3 policy gets compiled to miniscript")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# policy")]),t._v("\nthresh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPRV_A"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPUB_B"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",pk"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("XPUB_C"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v(" \n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# miniscript")]),t._v("\nwsh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multi"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",XPRV_KEY,PUBKEY_B,XPUB_C"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"4a-verify-multi-sig-descriptor-environment-variables-are-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#4a-verify-multi-sig-descriptor-environment-variables-are-active"}},[t._v("#")]),t._v(" 4a: Verify Multi-Sig-Descriptor environment variables are active")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep MULTI")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/aAgtlsi.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"}},[t._v("#")]),t._v(" Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 get_new_address")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 get_new_address")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd02 --descriptor $MULTI_DESCRIPTOR_02 get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/w1fxPSn.gif",alt:""}})]),t._v(" "),e("p",[t._v("🔴 Did you generate the same address for all three? Good! Else, something might be incorrect.")]),t._v(" "),e("h2",{attrs:{id:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 6: Send Testnet Bitcoin to the newly created receive-address")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://testnet-faucet.mempool.co",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet link:1"),e("OutboundLink")],1),t._v(" "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet link:2"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"step-7-sync-one-of-the-multi-sig-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sync-one-of-the-multi-sig-wallets"}},[t._v("#")]),t._v(" Step 7: Sync one of the Multi-Sig Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sync")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/GuefgeI.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-8-check-balance-multi-sig-wallets"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-check-balance-multi-sig-wallets"}},[t._v("#")]),t._v(" Step 8: Check Balance Multi-Sig Wallets")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 get_balance")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/zNciCqF.gif",alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("Every wallet has access to sync and view balance.")])]),t._v(" "),e("h2",{attrs:{id:"step-9-check-multi-sig-policies-on-descriptor-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-9-check-multi-sig-policies-on-descriptor-wallet"}},[t._v("#")]),t._v(" Step 9: Check Multi-Sig Policies on Descriptor Wallet")]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 policies")])]),t._v(" "),e("p",[t._v("The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"external"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contribution"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"conditions"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"items"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"n"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sorted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIAL"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"seaxtqqn"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"keys"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"7cdf2d46"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fc7870cd"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"26b03333"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satisfaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"items"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"n"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sorted"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" false,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIAL"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"threshold"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"type"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MULTISIG"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"internal"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n")])])]),e("h3",{attrs:{id:"spendingpolicyrequired-for-complex-descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spendingpolicyrequired-for-complex-descriptors"}},[t._v("#")]),t._v(" SpendingPolicyRequired for complex descriptors")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--external_policy")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("seaxtqqn"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(': [0,1]}"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-rootnode-"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("children "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#0 and #1 of root node>")]),t._v("\n")])])]),e("blockquote",[e("p",[t._v("Save the \"id\": We will need to use this ''id'' later.")])]),t._v(" "),e("p",[t._v("More info on "),e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/interface/",target:"_blank",rel:"noopener noreferrer"}},[t._v("external policies here"),e("OutboundLink")],1)]),t._v(" "),e("h2",{attrs:{id:"step-10-create-a-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-10-create-a-transaction-psbt"}},[t._v("#")]),t._v(" Step 10: Create a Transaction (PSBT)")]),t._v(" "),e("ul",[e("li",[t._v("1st Create a PSBT using the first wallet")]),t._v(" "),e("li",[t._v("2nd Sign the PSBT with the first wallet")]),t._v(" "),e("li",[t._v("3rd Sign PSBT with the second wallet")]),t._v(" "),e("li",[t._v("Broadcast PSBT")])]),t._v(" "),e("h3",{attrs:{id:"export-unsigned-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#export-unsigned-psbt-to-environment-variable"}},[t._v("#")]),t._v(" Export UNSIGNED_PSBT to environment variable")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v('export UNSIGNED_PSBT=$(bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 create_tx --send_all --to mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt:0 --external_policy "{\\"CHANGE_ID_HERE\\": [0,1]}" | jq -r \'.psbt\')')])]),t._v(" "),e("h3",{attrs:{id:"verify-unsigned-psbt-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-unsigned-psbt-environment-variable"}},[t._v("#")]),t._v(" Verify UNSIGNED_PSBT environment variable")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("env | grep UNSIGNED")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/djHaRDq.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-11-sign-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-11-sign-the-transaction"}},[t._v("#")]),t._v(" Step 11: SIGN the Transaction")]),t._v(" "),e("h3",{attrs:{id:"1st-wallet-signs-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1st-wallet-signs-the-transaction"}},[t._v("#")]),t._v(" 1st Wallet Signs the transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sign --psbt $UNSIGNED_PSBT")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export ONESIG_PSBT=$(bdk-cli wallet --wallet wallet_name_msd00 --descriptor $MULTI_DESCRIPTOR_00 sign --psbt $UNSIGNED_PSBT | jq -r '.psbt')")])]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("env | grep ONESIG")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "is_finalized": false,\n "psbt": "cHNidP8BAFUBAAAAAdYCtva/7Rkt+fgFu3mxAdaPh4uTbgBL3HmYZgcEKWygAAAAAAD/////AQqGAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA6gIAAAAAAQFLyGFJFK884DGBM1WgskRZ6gKp/7oZ+Z30u0+wF3pZYAEAAAAA/v///wKghgEAAAAAACIAINHcOQLE6GpJ3J+FOzn/be+HApxW8sZtGqfA3TBW+NYX91hoOAAAAAAWABTPQDZx2wYYIn+ug2pZBmWBn0Tu/gJHMEQCIHu6GmRMDgPZyTx+klFMA9VujR3qDA/Y08kSkRvOaChjAiBAtExtGAYLuQ/DDJzCqLlNZ1bMB3MV+nxsLfTdI9YcYwEhA0b8lz+kt0xHfR/tjUKOc2Nt2L61pDd5vJ/lsKi8pw9MmFUjAAEBK6CGAQAAAAAAIgAg0dw5AsToakncn4U7Of9t74cCnFbyxm0ap8DdMFb41hciAgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDUgwRQIhAJdILr7G3UzYylyr2fA13MFsz/jG4+iZlKeEkX79d082AiA99UF0/uFyXBVNUmuGaxdHL7wlhzqfbgGLMREN0z/O6QEBBWlSIQIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDSEDzsDXexRPSxeXiLJoS0i2fQlOoOGHmo+Dhaeaq3oHV6YhAjGKA2Dqg+QeMICBAifYslQF2WrehLEQ0iEOpp/+eQ0NU64iBgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDRh83y1GVAAAgAEAAIAAAACAAAAAAAAAAAAiBgIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDRgmsDMzVAAAgAEAAIAAAACAAAAAAAAAAAAiBgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXphj8eHDNVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/0w4sK5y.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"2nd-wallet-signs-the-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#2nd-wallet-signs-the-transaction"}},[t._v("#")]),t._v(" 2nd Wallet Signs the transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 sign --psbt $ONESIG_PSBT")])]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("export SECONDSIG_PSBT=$(bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 sign --psbt $ONESIG_PSBT | jq -r '.psbt')")])]),t._v(" "),e("p",[t._v("▶️"),e("code",[t._v("env | grep SECONDSIG")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "is_finalized": true,\n "psbt": "cHNidP8BAFUBAAAAAdYCtva/7Rkt+fgFu3mxAdaPh4uTbgBL3HmYZgcEKWygAAAAAAD/////AQqGAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA6gIAAAAAAQFLyGFJFK884DGBM1WgskRZ6gKp/7oZ+Z30u0+wF3pZYAEAAAAA/v///wKghgEAAAAAACIAINHcOQLE6GpJ3J+FOzn/be+HApxW8sZtGqfA3TBW+NYX91hoOAAAAAAWABTPQDZx2wYYIn+ug2pZBmWBn0Tu/gJHMEQCIHu6GmRMDgPZyTx+klFMA9VujR3qDA/Y08kSkRvOaChjAiBAtExtGAYLuQ/DDJzCqLlNZ1bMB3MV+nxsLfTdI9YcYwEhA0b8lz+kt0xHfR/tjUKOc2Nt2L61pDd5vJ/lsKi8pw9MmFUjAAEBK6CGAQAAAAAAIgAg0dw5AsToakncn4U7Of9t74cCnFbyxm0ap8DdMFb41hciAgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDUgwRQIhAJdILr7G3UzYylyr2fA13MFsz/jG4+iZlKeEkX79d082AiA99UF0/uFyXBVNUmuGaxdHL7wlhzqfbgGLMREN0z/O6QEiAgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXpkgwRQIhAO2aRERcublhAzToshkZRMg2I8GaE7mM2ECr0vYyuscmAiB5KK4ETlvrLqL0QbcRbGqrSwIa9lVuOqP3f5qCnGRMaQEBBWlSIQIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDSEDzsDXexRPSxeXiLJoS0i2fQlOoOGHmo+Dhaeaq3oHV6YhAjGKA2Dqg+QeMICBAifYslQF2WrehLEQ0iEOpp/+eQ0NU64iBgIjUCIdnyr6rDtuNhVNt4ZBDcvYLawfoJbzbPyxc/WNDRh83y1GVAAAgAEAAIAAAACAAAAAAAAAAAAiBgIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDRgmsDMzVAAAgAEAAIAAAACAAAAAAAAAAAAiBgPOwNd7FE9LF5eIsmhLSLZ9CU6g4Yeaj4OFp5qregdXphj8eHDNVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCP3+AAQASDBFAiEAl0guvsbdTNjKXKvZ8DXcwWzP+Mbj6JmUp4SRfv13TzYCID31QXT+4XJcFU1Sa4ZrF0cvvCWHOp9uAYsxEQ3TP87pAUgwRQIhAO2aRERcublhAzToshkZRMg2I8GaE7mM2ECr0vYyuscmAiB5KK4ETlvrLqL0QbcRbGqrSwIa9lVuOqP3f5qCnGRMaQFpUiECI1AiHZ8q+qw7bjYVTbeGQQ3L2C2sH6CW82z8sXP1jQ0hA87A13sUT0sXl4iyaEtItn0JTqDhh5qPg4Wnmqt6B1emIQIxigNg6oPkHjCAgQIn2LJUBdlq3oSxENIhDqaf/nkNDVOuAAA="\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/OdLHnJ3.gif",alt:""}})]),t._v(" "),e("h2",{attrs:{id:"step-12-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-12-broadcast-transaction"}},[t._v("#")]),t._v(" Step 12: Broadcast Transaction")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name_msd01 --descriptor $MULTI_DESCRIPTOR_01 broadcast --psbt $SECONDSIG_PSBT")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "txid": "61da2451874a483aa8d1d0787c7680d157639f284840de8885098cac43f6cc2f"\n}\n')])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/M7s0Fd6.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"verify-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verify-transaction"}},[t._v("#")]),t._v(" Verify Transaction")]),t._v(" "),e("p",[t._v("Verify transcation in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/50.525b80bb.js b/assets/js/50.23919774.js similarity index 99% rename from assets/js/50.525b80bb.js rename to assets/js/50.23919774.js index 030a260572..e88166247c 100644 --- a/assets/js/50.525b80bb.js +++ b/assets/js/50.23919774.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{404:function(t,e,a){"use strict";a.r(e);var s=a(7),n=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"tutorial-goals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial-goals"}},[t._v("#")]),t._v(" Tutorial Goals")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The goal for this tutorial is to introduce you to "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),e("OutboundLink")],1),t._v(", a powerful command-line program. You will be exposed to many of the basic skills that go into creating and managing bitcoin wallets.")])]),t._v(" "),e("li",[e("p",[t._v("If you've read most of the "),e("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook",target:"_blank",rel:"noopener noreferrer"}},[t._v('"Mastering Bitcoin"'),e("OutboundLink")],1),t._v(" book, this tutorial could serve as a stepping stone into your Bitcoin wallet development journey.")])]),t._v(" "),e("li",[e("p",[t._v("This short tutorial will expose you to the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk library")]),t._v(" "),e("OutboundLink")],1),t._v(" and the practical knowledge needed for bitcoin wallet development. As a consequence you will deepen your technical understanding about bitcoin and the bdk library.")])]),t._v(" "),e("li",[e("p",[t._v("BDK also has "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[t._v("language-bindings"),e("OutboundLink")],1),t._v(" for "),e("strong",[t._v("Kotlin/Java, Swift, Python")]),t._v(" which enable the use of BDK's "),e("strong",[t._v("Rust")]),t._v(" library as an API. You can later use these similar steps to create your own bitcoin mobile, desktop or even WebApp by using the bdk-ffi language bindings.")])])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"a-few-things-before-you-begin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-few-things-before-you-begin"}},[t._v("#")]),t._v(" A few things before you begin:")]),t._v(" "),e("ul",[e("li",[t._v("Three things to look out for in each step of the tutorial:\n"),e("ul",[e("li",[e("ol",[e("li",[t._v("▶️ / 🔶 - Commands for the Terminal or Shell")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"2"}},[e("li",[t._v("👍 - Preview of the command output. Note, not all commands will output code.")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"3"}},[e("li",[t._v("Preview Video of the tutorial for reference of what things should look like in action.")])])])])])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"outline-of-tutorial-and-installation-notes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#outline-of-tutorial-and-installation-notes"}},[t._v("#")]),t._v(" Outline of Tutorial and Installation notes:")]),t._v(" "),e("h3",{attrs:{id:"brief-outline-of-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#brief-outline-of-tutorial"}},[t._v("#")]),t._v(" Brief Outline of Tutorial")]),t._v(" "),e("ul",[e("li",[t._v("Step 1: Creating a mnemonic word list + XPRV (Extended Private Key)")]),t._v(" "),e("li",[t._v("Step 2: Generate testnet Receive Address")]),t._v(" "),e("li",[t._v("Step 3: Send funds to newly generated address")]),t._v(" "),e("li",[t._v("Step 4: Sync Wallet")]),t._v(" "),e("li",[t._v("Step 5: Check Balance of Wallet")]),t._v(" "),e("li",[t._v("Step 6: Create a Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 7: Sign the Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 8: Broadcast Transaction")])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"rust-and-cargo-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rust-and-cargo-installation"}},[t._v("#")]),t._v(" Rust and Cargo installation:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://rustup.rs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rust and Cargo Installation"),e("OutboundLink")],1)])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"bdk-cli-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli-installation"}},[t._v("#")]),t._v(" "),e("code",[t._v("bdk-cli")]),t._v(" installation:")]),t._v(" "),e("ul",[e("li",[t._v("Download the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli.git",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk-cli")]),t._v(" github repository locally"),e("OutboundLink")],1),t._v(" "),e("ul",[e("li",[t._v("Enter the folder "),e("code",[t._v("cd bdk-cli")])]),t._v(" "),e("li",[t._v("Install "),e("code",[t._v("cargo install --path . --features electrum,repl,compiler")])]),t._v(" "),e("li",[t._v("Once installation is done exit and reopen your terminal (command-line interface)")])])])]),t._v(" "),e("h3",{attrs:{id:"emoji-legend"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#emoji-legend"}},[t._v("#")]),t._v(" Emoji Legend:")]),t._v(" "),e("p",[t._v("▶️ : Unix/Linux Commands to copied and pasted\n🔶 : Windows Powershell Commands to copied and pasted\n👍 : Output/ preview of code")]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-0-check-version-of-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-0-check-version-of-bdk-cli"}},[t._v("#")]),t._v(" Step 0: Check Version of bdk-cli")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli -V")]),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("bdk-cli 0.6.0\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/IcuyeMS.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"preview-of-bdk-cli-help-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preview-of-bdk-cli-help-menu"}},[t._v("#")]),t._v(" Preview of bdk-cli help menu")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli --help")]),e("br"),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("The BDK Command Line Wallet App\n\nbdk-cli is a light weight "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("command")]),t._v(" line bitcoin wallet, powered by BDK. This app can be used as a playground as well as\ntesting environment to simulate various wallet testing situations. If you are planning to use BDK "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" your wallet, bdk-\ncli is also a great intro tool to get familiar with the BDK API.\n\nBut this is not just any toy. bdk-cli is also a fully functioning bitcoin wallet with taproot support"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("\n\nFor "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("more")]),t._v(" information checkout "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("https://bitcoindevkit.org/"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nUSAGE:\n bdk-cli "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("OPTIONS"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("SUBCOMMAND"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nFLAGS:\n -h, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v(" Prints "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" information\n -V, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--version")]),t._v(" Prints version information\n\nOPTIONS:\n -d, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--datadir")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("DATADIR"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the wallet data directory. Default value "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(' "~/.bdk-bitcoin\n -n, '),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--network")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NETWORK"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the network "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("default: testnet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("possible values: bitcoin, testnet, signet, regtest"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\nSUBCOMMANDS:\n compile Compile a miniscript policy to an output descriptor\n "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" Prints this message or the "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" of the given subcommand"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n key Subcommands "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" Key operations\n repl Options to configure a SOCKS5 proxy "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" a blockchain client connection\n wallet Wallet subcommands that can be issued without a blockchain backend\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-1-seed-generate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-seed-generate"}},[t._v("#")]),t._v(" Step 1: Seed Generate")]),t._v(" "),e("h3",{attrs:{id:"1a-mnemonic-word-list-xprv-extended-private-key-"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-mnemonic-word-list-xprv-extended-private-key-"}},[t._v("#")]),t._v(" 1a: Mnemonic word-list + XPRV (Extended Private Key) 🔑")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli key generate | tee key.json")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v('bdk-cli key generate | Out-File -FilePath "key.json"')])]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"42b15d2f"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mnemonic"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"party salon worth satoshi envelope suggest garlic dry add pitch throw clap keen narrow antique oyster ketchup purchase gasp visual work venue fog crater"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xprv"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPdwpamtjqMFpYRTafnE1bN2SphLEybCtRKakk6S1TgQCsZgiBwJuJNWe3jYdgVCTsKf9weMxj6tW4zNNKWptykszJpS2L8wE"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ii62Hul.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1b-save-xprv-extended-private-key-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1b-save-xprv-extended-private-key-into-environment-variable"}},[t._v("#")]),t._v(" 1b: Save XPRV (Extended Private Key) into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("export XPRV_00=$(cat key.json | jq -r .xprv)")])]),t._v(" "),e("p",[t._v("Windows Powershell:")]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$json = Get-Content -Path .\\key.json | ConvertFrom-Json")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$mykeyValue = $json.xprv")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('XPRV',$mykeyValue, 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/KYW2Cdo.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1c-verify-environment-variable-xprv-00-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1c-verify-environment-variable-xprv-00-is-active"}},[t._v("#")]),t._v(" 1c: Verify environment variable XPRV_00 is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZahbJwe.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1d-create-descriptor-and-save-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1d-create-descriptor-and-save-into-environment-variable"}},[t._v("#")]),t._v(" 1d: Create Descriptor and Save into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export my_descriptor="wpkh($XPRV_00/84h/1h/0h/0/*)"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('my_descriptor', \"wpkh($env:XPRV/84h/1h/0h/0/*)\", 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/UV4Vgsq.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1e-verify-environment-variable-my-descriptor-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1e-verify-environment-variable-my-descriptor-is-active"}},[t._v("#")]),t._v(" 1e: Verify environment variable my_descriptor is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep my_descriptor")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:my_descriptor")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/s7ZeRQN.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-2-generate-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-receive-address"}},[t._v("#")]),t._v(" Step 2: Generate Receive-Address")]),t._v(" "),e("p",[t._v("Linux/Terminal:")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_new_address")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/P8PjTAo.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tb1qrh4sq5va0unqtxyfv8al9lz3sna3988cj59uya"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 3: Send testnet bitcoin to the newly created receive-address")]),t._v(" "),e("p",[t._v("Use a faucet to send funds to your newly created address. Here is a link to one: "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet"),e("OutboundLink")],1)]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-4-sync-the-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-sync-the-wallet"}},[t._v("#")]),t._v(" Step 4: Sync the wallet")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sync")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sync")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/WFYBgVB.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-check-the-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-check-the-balance"}},[t._v("#")]),t._v(" Step 5: Check the balance")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_balance")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_balance")])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Note: The balance will only show after the transaction has been confirmed in a block at least once.")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmed"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"immature"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"trusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"untrusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/v8MAYB2.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-6-create-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-create-transaction-psbt"}},[t._v("#")]),t._v(" Step 6: Create Transaction (PSBT)")]),t._v(" "),e("p",[t._v("To create a PSBT (partially-signed-bitcoin-transaction) run the command:")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor create_tx --to tb1qw2c3lxufxqe2x9s4rdzh65tpf4d7fssjgh8nv6:50000")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor create_tx --to tb1qjk6n943uwhqhdf7en600tnwxpslvwtr0udsehp:0 --send_all")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/EUCovcJ.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"details"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmation_time"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fee"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("113")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"received"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sent"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("123000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"029173d76253e3441f9dc26f91e6ef30dff486848e91a7941f0cacd0af25ee30"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"6a-export-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#6a-export-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 6a: export PSBT to environment-variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export PSBT="PASTE_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('PSBT',\"PASTE_PSBT_HERE\",'Process')")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/CEDKcPZ.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-7-sign-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sign-transaction-psbt"}},[t._v("#")]),t._v(" Step 7: Sign Transaction (PSBT)")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sign --psbt $PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sign --psbt $env:PSBT")])]),t._v(" "),e("ul",[e("li",[t._v("DON'T FORGET to COPY the PSBT for the next step")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/f4o4Ce8.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"is_finalized"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" true,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiAgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6S0gwRQIhALWkBRSJzxuf0od4tPu3qFmEfJ2Y+/QBGtfjSFObWsPeAiA4QJx8Rk5pacrjHv5EOdw6RNHXcdtepFs+m0/Za/h0UQEiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCGwCSDBFAiEAtaQFFInPG5/Sh3i0+7eoWYR8nZj79AEa1+NIU5taw94CIDhAnHxGTmlpyuMe/kQ53DpE0ddx216kWz6bT9lr+HRRASED/NBaWlmEMxswpzSPW5V23outWKQJraHszEcaVbwSeksAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"7a-export-signed-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#7a-export-signed-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 7a: export signed psbt to environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export SIGNED_PSBT="Paste_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v('$env:PSBTSIGNED = "STRINGHERE"')]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/VJsl8zR.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-8-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-broadcast-transaction"}},[t._v("#")]),t._v(" Step 8: Broadcast Transaction")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor broadcast --psbt $SIGNED_PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor broadcast --psbt $env:PSBTSIGNED")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/yQZZk0d.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a0877b7ce91ea6d141ba63277673f5bdf0edfdd45f91a39ba1a1ace15f839b52"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("Verify transaction in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Run sync one more time and see that the balance has decreased.")])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"resources"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[t._v("#")]),t._v(" Resources")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP-32: Hierarchical Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 39 - Mnemonic code for generating deterministic keys"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 44 - Multi-Account Hierarchy for Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 84 - Derivation scheme for P2WPKH based accounts"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 174 - Partially Signed Bitcoin Transaction Format"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://blog.summerofbitcoin.org/miniscript-policy-descriptors-hidden-powers-of-bitcoin/",target:"_blank",rel:"noopener noreferrer"}},[t._v("What are Descriptors and miniscript?"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoin.stackexchange.com/questions/97242/bip39-tool-bip32-extended-private-key-vs-bip32-root-key",target:"_blank",rel:"noopener noreferrer"}},[t._v("Master Private Key and Extended Private Key"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://min.sc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Minsc A Miniscript-based scripting language for Bitcoin contracts"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{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("h2",{attrs:{id:"tutorial-goals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tutorial-goals"}},[t._v("#")]),t._v(" Tutorial Goals")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The goal for this tutorial is to introduce you to "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),e("OutboundLink")],1),t._v(", a powerful command-line program. You will be exposed to many of the basic skills that go into creating and managing bitcoin wallets.")])]),t._v(" "),e("li",[e("p",[t._v("If you've read most of the "),e("a",{attrs:{href:"https://github.com/bitcoinbook/bitcoinbook",target:"_blank",rel:"noopener noreferrer"}},[t._v('"Mastering Bitcoin"'),e("OutboundLink")],1),t._v(" book, this tutorial could serve as a stepping stone into your Bitcoin wallet development journey.")])]),t._v(" "),e("li",[e("p",[t._v("This short tutorial will expose you to the "),e("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk library")]),t._v(" "),e("OutboundLink")],1),t._v(" and the practical knowledge needed for bitcoin wallet development. As a consequence you will deepen your technical understanding about bitcoin and the bdk library.")])]),t._v(" "),e("li",[e("p",[t._v("BDK also has "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[t._v("language-bindings"),e("OutboundLink")],1),t._v(" for "),e("strong",[t._v("Kotlin/Java, Swift, Python")]),t._v(" which enable the use of BDK's "),e("strong",[t._v("Rust")]),t._v(" library as an API. You can later use these similar steps to create your own bitcoin mobile, desktop or even WebApp by using the bdk-ffi language bindings.")])])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"a-few-things-before-you-begin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#a-few-things-before-you-begin"}},[t._v("#")]),t._v(" A few things before you begin:")]),t._v(" "),e("ul",[e("li",[t._v("Three things to look out for in each step of the tutorial:\n"),e("ul",[e("li",[e("ol",[e("li",[t._v("▶️ / 🔶 - Commands for the Terminal or Shell")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"2"}},[e("li",[t._v("👍 - Preview of the command output. Note, not all commands will output code.")])])]),t._v(" "),e("li",[e("ol",{attrs:{start:"3"}},[e("li",[t._v("Preview Video of the tutorial for reference of what things should look like in action.")])])])])])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"outline-of-tutorial-and-installation-notes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#outline-of-tutorial-and-installation-notes"}},[t._v("#")]),t._v(" Outline of Tutorial and Installation notes:")]),t._v(" "),e("h3",{attrs:{id:"brief-outline-of-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#brief-outline-of-tutorial"}},[t._v("#")]),t._v(" Brief Outline of Tutorial")]),t._v(" "),e("ul",[e("li",[t._v("Step 1: Creating a mnemonic word list + XPRV (Extended Private Key)")]),t._v(" "),e("li",[t._v("Step 2: Generate testnet Receive Address")]),t._v(" "),e("li",[t._v("Step 3: Send funds to newly generated address")]),t._v(" "),e("li",[t._v("Step 4: Sync Wallet")]),t._v(" "),e("li",[t._v("Step 5: Check Balance of Wallet")]),t._v(" "),e("li",[t._v("Step 6: Create a Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 7: Sign the Transaction (PSBT)")]),t._v(" "),e("li",[t._v("Step 8: Broadcast Transaction")])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"rust-and-cargo-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rust-and-cargo-installation"}},[t._v("#")]),t._v(" Rust and Cargo installation:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://rustup.rs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rust and Cargo Installation"),e("OutboundLink")],1)])]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"bdk-cli-installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bdk-cli-installation"}},[t._v("#")]),t._v(" "),e("code",[t._v("bdk-cli")]),t._v(" installation:")]),t._v(" "),e("ul",[e("li",[t._v("Download the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli.git",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk-cli")]),t._v(" github repository locally"),e("OutboundLink")],1),t._v(" "),e("ul",[e("li",[t._v("Enter the folder "),e("code",[t._v("cd bdk-cli")])]),t._v(" "),e("li",[t._v("Install "),e("code",[t._v("cargo install --path . --features electrum,repl,compiler")])]),t._v(" "),e("li",[t._v("Once installation is done exit and reopen your terminal (command-line interface)")])])])]),t._v(" "),e("h3",{attrs:{id:"emoji-legend"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#emoji-legend"}},[t._v("#")]),t._v(" Emoji Legend:")]),t._v(" "),e("p",[t._v("▶️ : Unix/Linux Commands to copied and pasted\n🔶 : Windows Powershell Commands to copied and pasted\n👍 : Output/ preview of code")]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-0-check-version-of-bdk-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-0-check-version-of-bdk-cli"}},[t._v("#")]),t._v(" Step 0: Check Version of bdk-cli")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli -V")]),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("bdk-cli 0.6.0\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/IcuyeMS.gif",alt:""}})]),t._v(" "),e("h3",{attrs:{id:"preview-of-bdk-cli-help-menu"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preview-of-bdk-cli-help-menu"}},[t._v("#")]),t._v(" Preview of bdk-cli help menu")]),t._v(" "),e("p",[t._v("▶️ / 🔶 "),e("code",[t._v("bdk-cli --help")]),e("br"),t._v("\n👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[t._v("The BDK Command Line Wallet App\n\nbdk-cli is a light weight "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("command")]),t._v(" line bitcoin wallet, powered by BDK. This app can be used as a playground as well as\ntesting environment to simulate various wallet testing situations. If you are planning to use BDK "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" your wallet, bdk-\ncli is also a great intro tool to get familiar with the BDK API.\n\nBut this is not just any toy. bdk-cli is also a fully functioning bitcoin wallet with taproot support"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("\n\nFor "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("more")]),t._v(" information checkout "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("https://bitcoindevkit.org/"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nUSAGE:\n bdk-cli "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("OPTIONS"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("SUBCOMMAND"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\nFLAGS:\n -h, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v(" Prints "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" information\n -V, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--version")]),t._v(" Prints version information\n\nOPTIONS:\n -d, "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--datadir")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("DATADIR"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the wallet data directory. Default value "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(' "~/.bdk-bitcoin\n -n, '),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--network")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("NETWORK"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Sets the network "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("default: testnet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("possible values: bitcoin, testnet, signet, regtest"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\nSUBCOMMANDS:\n compile Compile a miniscript policy to an output descriptor\n "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" Prints this message or the "),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("help")]),t._v(" of the given subcommand"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n key Subcommands "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" Key operations\n repl Options to configure a SOCKS5 proxy "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" a blockchain client connection\n wallet Wallet subcommands that can be issued without a blockchain backend\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-1-seed-generate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-1-seed-generate"}},[t._v("#")]),t._v(" Step 1: Seed Generate")]),t._v(" "),e("h3",{attrs:{id:"1a-mnemonic-word-list-xprv-extended-private-key-"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1a-mnemonic-word-list-xprv-extended-private-key-"}},[t._v("#")]),t._v(" 1a: Mnemonic word-list + XPRV (Extended Private Key) 🔑")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli key generate | tee key.json")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v('bdk-cli key generate | Out-File -FilePath "key.json"')])]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fingerprint"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"42b15d2f"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mnemonic"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"party salon worth satoshi envelope suggest garlic dry add pitch throw clap keen narrow antique oyster ketchup purchase gasp visual work venue fog crater"')]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xprv"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPdwpamtjqMFpYRTafnE1bN2SphLEybCtRKakk6S1TgQCsZgiBwJuJNWe3jYdgVCTsKf9weMxj6tW4zNNKWptykszJpS2L8wE"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ii62Hul.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1b-save-xprv-extended-private-key-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1b-save-xprv-extended-private-key-into-environment-variable"}},[t._v("#")]),t._v(" 1b: Save XPRV (Extended Private Key) into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("export XPRV_00=$(cat key.json | jq -r .xprv)")])]),t._v(" "),e("p",[t._v("Windows Powershell:")]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$json = Get-Content -Path .\\key.json | ConvertFrom-Json")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("$mykeyValue = $json.xprv")])]),t._v(" "),e("p",[t._v("🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('XPRV',$mykeyValue, 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/KYW2Cdo.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1c-verify-environment-variable-xprv-00-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1c-verify-environment-variable-xprv-00-is-active"}},[t._v("#")]),t._v(" 1c: Verify environment variable XPRV_00 is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep XPRV")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:XPRV")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/ZahbJwe.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1d-create-descriptor-and-save-into-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1d-create-descriptor-and-save-into-environment-variable"}},[t._v("#")]),t._v(" 1d: Create Descriptor and Save into environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export my_descriptor="wpkh($XPRV_00/84h/1h/0h/0/*)"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('my_descriptor', \"wpkh($env:XPRV/84h/1h/0h/0/*)\", 'Process')")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/UV4Vgsq.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"1e-verify-environment-variable-my-descriptor-is-active"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#1e-verify-environment-variable-my-descriptor-is-active"}},[t._v("#")]),t._v(" 1e: Verify environment variable my_descriptor is active")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("env | grep my_descriptor")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("$env:my_descriptor")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/s7ZeRQN.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-2-generate-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-2-generate-receive-address"}},[t._v("#")]),t._v(" Step 2: Generate Receive-Address")]),t._v(" "),e("p",[t._v("Linux/Terminal:")]),t._v(" "),e("p",[t._v("▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_new_address")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_new_address")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/P8PjTAo.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"address"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tb1qrh4sq5va0unqtxyfv8al9lz3sna3988cj59uya"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"}},[t._v("#")]),t._v(" Step 3: Send testnet bitcoin to the newly created receive-address")]),t._v(" "),e("p",[t._v("Use a faucet to send funds to your newly created address. Here is a link to one: "),e("a",{attrs:{href:"https://bitcoinfaucet.uo1.net",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin Testnet Faucet"),e("OutboundLink")],1)]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-4-sync-the-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-4-sync-the-wallet"}},[t._v("#")]),t._v(" Step 4: Sync the wallet")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sync")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶 "),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sync")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/WFYBgVB.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-5-check-the-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-5-check-the-balance"}},[t._v("#")]),t._v(" Step 5: Check the balance")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor get_balance")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor get_balance")])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Note: The balance will only show after the transaction has been confirmed in a block at least once.")])]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful:")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"satoshi"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmed"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"immature"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"trusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"untrusted_pending"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/v8MAYB2.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-6-create-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-6-create-transaction-psbt"}},[t._v("#")]),t._v(" Step 6: Create Transaction (PSBT)")]),t._v(" "),e("p",[t._v("To create a PSBT (partially-signed-bitcoin-transaction) run the command:")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor create_tx --to tb1qw2c3lxufxqe2x9s4rdzh65tpf4d7fssjgh8nv6:50000")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor create_tx --to tb1qjk6n943uwhqhdf7en600tnwxpslvwtr0udsehp:0 --send_all")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/EUCovcJ.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"details"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirmation_time"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fee"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("113")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"received"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sent"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("123000")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transaction"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" null,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"029173d76253e3441f9dc26f91e6ef30dff486848e91a7941f0cacd0af25ee30"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(",\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAAAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"6a-export-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#6a-export-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 6a: export PSBT to environment-variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export PSBT="PASTE_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("[System.Environment]::SetEnvironmentVariable('PSBT',\"PASTE_PSBT_HERE\",'Process')")]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/CEDKcPZ.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-7-sign-transaction-psbt"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-7-sign-transaction-psbt"}},[t._v("#")]),t._v(" Step 7: Sign Transaction (PSBT)")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor sign --psbt $PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor sign --psbt $env:PSBT")])]),t._v(" "),e("ul",[e("li",[t._v("DON'T FORGET to COPY the PSBT for the next step")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/f4o4Ce8.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"is_finalized"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" true,\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"psbt"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cHNidP8BAFUBAAAAAak8uMR3UGkAGUKWsq8Mv45qg2fdD93JQRIsa2P0wFloAQAAAAD/////AQfgAQAAAAAAGXapFDRKD0jKFQ7CuQOBdmC5tosTpnAmiKwAAAAAAAEA3gIAAAAAAQFY9sVfEEbyjrHXSlxXDxL+71WOMnsPpVElwk+3E/J9vAAAAAAA/v///wIYZRIAAAAAABYAFBKYf7yF+ss6EFdw2rDZTfdLhep8eOABAAAAAAAWABQd6wBRnX8mBZiJYfvy/FGE+xKc+AJHMEQCIFSIkvEUI9yUgEw4JocRs1aiVsBlKKXrOQaQb3XFqR21AiBqiEVzCVVSRGjckyPDgAQBnOdSzBYR6Rw6KFcCP+E27wEhAwIlXdfM2WYnYa36Hp4MS6YkplBAgBsb1tYG9NiWFWTKzPYhAAEBH3jgAQAAAAAAFgAUHesAUZ1/JgWYiWH78vxRhPsSnPgiAgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6S0gwRQIhALWkBRSJzxuf0od4tPu3qFmEfJ2Y+/QBGtfjSFObWsPeAiA4QJx8Rk5pacrjHv5EOdw6RNHXcdtepFs+m0/Za/h0UQEiBgP80FpaWYQzGzCnNI9blXbei61YpAmtoezMRxpVvBJ6SxgTizKsVAAAgAEAAIAAAACAAAAAAAAAAAABBwABCGwCSDBFAiEAtaQFFInPG5/Sh3i0+7eoWYR8nZj79AEa1+NIU5taw94CIDhAnHxGTmlpyuMe/kQ53DpE0ddx216kWz6bT9lr+HRRASED/NBaWlmEMxswpzSPW5V23outWKQJraHszEcaVbwSeksAAA=="')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("hr"),t._v(" "),e("h3",{attrs:{id:"7a-export-signed-psbt-to-environment-variable"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#7a-export-signed-psbt-to-environment-variable"}},[t._v("#")]),t._v(" 7a: export signed psbt to environment variable")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v('export SIGNED_PSBT="Paste_PSBT_HERE"')])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v('$env:PSBTSIGNED = "STRINGHERE"')]),t._v(" "),e("img",{attrs:{src:"https://i.imgur.com/VJsl8zR.gif",alt:""}})]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"step-8-broadcast-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#step-8-broadcast-transaction"}},[t._v("#")]),t._v(" Step 8: Broadcast Transaction")]),t._v(" "),e("p",[t._v("Linux/Terminal:\n▶️ "),e("code",[t._v("bdk-cli wallet --wallet wallet_name --descriptor $my_descriptor broadcast --psbt $SIGNED_PSBT")])]),t._v(" "),e("p",[t._v("Windows Powershell:\n🔶\n"),e("code",[t._v("bdk-cli wallet --descriptor $env:my_descriptor broadcast --psbt $env:PSBTSIGNED")])]),t._v(" "),e("figure",[e("img",{attrs:{src:"https://i.imgur.com/yQZZk0d.gif",alt:""}})]),t._v(" "),e("p",[t._v("👍 The output below confirms the command was successful.")]),t._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txid"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a0877b7ce91ea6d141ba63277673f5bdf0edfdd45f91a39ba1a1ace15f839b52"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("Verify transaction in the memory pool on testnet "),e("a",{attrs:{href:"https://mempool.space/testnet",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mempool-testnet!"),e("OutboundLink")],1)])]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),e("p",[t._v("Run sync one more time and see that the balance has decreased.")])]),t._v(" "),e("hr"),t._v(" "),e("h2",{attrs:{id:"resources"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[t._v("#")]),t._v(" Resources")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP-32: Hierarchical Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 39 - Mnemonic code for generating deterministic keys"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 44 - Multi-Account Hierarchy for Deterministic Wallets"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 84 - Derivation scheme for P2WPKH based accounts"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP: 174 - Partially Signed Bitcoin Transaction Format"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://blog.summerofbitcoin.org/miniscript-policy-descriptors-hidden-powers-of-bitcoin/",target:"_blank",rel:"noopener noreferrer"}},[t._v("What are Descriptors and miniscript?"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoin.stackexchange.com/questions/97242/bip39-tool-bip32-extended-private-key-vs-bip32-root-key",target:"_blank",rel:"noopener noreferrer"}},[t._v("Master Private Key and Extended Private Key"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://min.sc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Minsc A Miniscript-based scripting language for Bitcoin contracts"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/51.4769671b.js b/assets/js/51.503dcbd1.js similarity index 99% rename from assets/js/51.4769671b.js rename to assets/js/51.503dcbd1.js index 4917ad0b80..e07a348e10 100644 --- a/assets/js/51.4769671b.js +++ b/assets/js/51.503dcbd1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{407:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("It’s easy to underestimate the importance of privacy tech for Bitcoin,\nespecially when connecting to third party services. They can learn your\nIP address and associate the transactions you sent over it. You can only\nhope that this information will not be leaked anytime in the future with\nunpredictable consequences. In order to use Bitcoin privately, you need\nto encrypt and anonymize the data you send over the Internet.")]),t._v(" "),s("p",[t._v("Tor is one of the must-have privacy preserving tools for the Internet in\ngeneral, and for Bitcoin in particular. Tor network consists of nodes that\nuse clever cryptographic methods to encrypt user data and transfer them as\nanonymously as possible.")]),t._v(" "),s("p",[t._v("In this article we show how to integrate Tor with your BDK application.")]),t._v(" "),s("h2",{attrs:{id:"prerequisite"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite"}},[t._v("#")]),t._v(" Prerequisite")]),t._v(" "),s("p",[t._v("First, you would need to have a Tor daemon up and running.")]),t._v(" "),s("p",[t._v("On Mac OS X you can install with Homebrew.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("brew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\nbrew services start tor\n")])])]),s("p",[t._v("On Ubuntu or other Debian-based distributions.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\n")])])]),s("p",[t._v("In some cases you'll need to wait a minute or two for the bootstrapping to finish.\nIn general, Tor is not the fastest network, so if any of the examples below fail\ndue to timeout, simply restart it.")]),t._v(" "),s("p",[t._v("At the very end of the article we’ll show how to integrate Tor directly to\nyour application.")]),t._v(" "),s("p",[t._v("By default, Tor creates a "),s("a",{attrs:{href:"https://en.wikipedia.org/wiki/SOCKS",target:"_blank",rel:"noopener noreferrer"}},[t._v("SOCKS5"),s("OutboundLink")],1),t._v(" proxy\nendpoint and listens on port 9050. Your application should connect to the\nproxy on "),s("code",[t._v("localhost:9050")]),t._v(" and use it for its network activities.")]),t._v(" "),s("h2",{attrs:{id:"setting-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),s("p",[t._v("Create a new cargo project.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" ~/tutorial\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" tutorial\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" new bdk-tor\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-tor\n")])])]),s("p",[t._v("Open "),s("code",[t._v("src/main.rs")]),t._v(" file remove all its contents and add these lines.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add additional imports here")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" network "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Syncing the wallet..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The wallet synced. Height: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this code we create a testnet wallet with "),s("code",[t._v("create_wallet()")]),t._v(" function and\ntry to sync it with a specific blockchain client implementation. We create a\nblockchain client using "),s("code",[t._v("create_blockchain()")]),t._v(" function. We’ll implement it\nlater for each type of blockchain client supported by BDK.")]),t._v(" "),s("h2",{attrs:{id:"electrumblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#electrumblockchain"}},[t._v("#")]),t._v(" ElectrumBlockchain")]),t._v(" "),s("p",[t._v("The Electrum client is enabled by default so the "),s("code",[t._v("Cargo.toml")]),t._v(" dependencies\nsection will look like this.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("And the imports look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("electrum_client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Here is the implementation of "),s("code",[t._v("create_blockchain()")]),t._v(" function for the\nElectrum client.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("socks5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n credentials"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" client "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we create an instance of "),s("code",[t._v("Socks5Config")]),t._v(" which defines the\nTor proxy parameters for "),s("code",[t._v("ElectrumBlockchain")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"blocking-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blocking-esplorablockchain"}},[t._v("#")]),t._v(" Blocking EsploraBlockchain")]),t._v(" "),s("p",[t._v("The blocking version of "),s("code",[t._v("EsploraBlockchain")]),t._v(" uses "),s("code",[t._v("ureq")]),t._v(" crate to send HTTP\nrequests to Eslora backends. By default, its SOCKS5 feature is disabled,\nso we need to enable it in "),s("code",[t._v("Cargo.toml")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-blocking"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("And "),s("code",[t._v("create_blockchain()")]),t._v(" implementation is")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("proxy()")]),t._v(" method of the config builder to set the Tor proxy\naddress. Please note, that unlike the previous examples, the Esplora client\nbuilder requires not just a proxy address, but a URL\n“socks5://127.0.0.1:9050”.")]),t._v(" "),s("h2",{attrs:{id:"asynchronous-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asynchronous-esplorablockchain"}},[t._v("#")]),t._v(" Asynchronous EsploraBlockchain")]),t._v(" "),s("p",[t._v("There’s no need in enabling SOCKS5 for the asynchronous Esplora client,\nso we are good to go without additional dependencies.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-async"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are the same as in previous example.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" is almost identical.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5h://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("There are two notable differences though. First, we call "),s("code",[t._v("build_async()")]),t._v(" to\ncreate an asynchronous Esplora client. Second the SOCKS5 URL scheme is\n“socks5h”. It’s not a typo. The async client supports two SOCKS5 schemes\n“socks5” and “socks5h”. The difference between them is that the former\nmakes the client to resolve domain names, and the latter does not, so the\nclient passes them to the proxy as is. A regular DNS resolver cannot\nresolve Tor onion addresses, so we should use “socks5h” here.")]),t._v(" "),s("h2",{attrs:{id:"compactfiltersblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compactfiltersblockchain"}},[t._v("#")]),t._v(" CompactFiltersBlockchain")]),t._v(" "),s("p",[t._v("Add these lines to the dependencies section of "),s("code",[t._v("Cargo.toml")]),t._v(" file to enable\nBIP-157/BIP-158 compact filter support.")]),t._v(" "),s("p",[t._v("It can take a while to sync a wallet using compact filters over Tor, so be\npatient.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compact_filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now add the required imports into "),s("code",[t._v("src/main.rs")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("sync"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("compact_filters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" function will look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"neutrino.testnet3.suredbits.com:18333"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mempool "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("connect_proxy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" mempool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("peer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./wallet-filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("Peer::connect_proxy()")]),t._v(" which accepts the address to the SOCKS5\nproxy and performs all the heavy lifting for us.")]),t._v(" "),s("h2",{attrs:{id:"integrated-tor-daemon"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#integrated-tor-daemon"}},[t._v("#")]),t._v(" Integrated Tor daemon")]),t._v(" "),s("p",[t._v("As an application developer you don’t have to rely on your users to install\nand start Tor to use your application. Using "),s("code",[t._v("libtor")]),t._v(" crate you can bundle\nTor daemon with your app.")]),t._v(" "),s("p",[s("code",[t._v("libtor")]),t._v(" builds a Tor binary from the source files. Since Tor is written in C\nyou'll need a C compiler and build tools.")]),t._v(" "),s("p",[t._v("Install these packages on Mac OS X:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("xcode-select "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--install")]),t._v("\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" automake\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" libtool\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" openssl\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" pkg-config\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("LDFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-L/opt/homebrew/opt/openssl/lib"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("CPPFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-I/opt/homebrew/opt/openssl/include"')]),t._v("\n")])])]),s("p",[t._v("Or these packages on Ubuntu or another Debian-based Linux distribution:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf automake clang "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" libtool openssl pkg-config\n")])])]),s("p",[t._v("Then add these dependencies to the "),s("code",[t._v("Cargo.toml")]),t._v(" file.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("libtor")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"47.8.0+0.4.7.x"')]),t._v("\n")])])]),s("p",[t._v("This is an example of how we can use "),s("code",[t._v("libtor")]),t._v(" to start a Tor daemon.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("prelude"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("time"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HiddenServiceVersion")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_port "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("19050")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" data_dir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("temp_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("display")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-tor"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" log_file_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"log"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Staring Tor in {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("truncate_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataDirectory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogTo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Notice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SocksPort")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ExitPolicy reject *:*"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BridgeRelay 0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_background")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("started "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("panic!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"It took too long to start Tor. See {} for details"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sleep")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_millis")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find_string_in_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Bootstrapped 100%"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Tor started"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("First, we create a Tor object, and then we call "),s("code",[t._v("start_background()")]),t._v(" method\nto start it in the background. After that, we continuously try to find\n“Bootstrapped 100%” string in the log file. Once we find it, Tor is\nready to proxy our connections. We use port 19050 because, the user can\nhave their own instance of Tor running already.")]),t._v(" "),s("p",[t._v("Next you can modify "),s("code",[t._v("create_blockchain()")]),t._v(" like this")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we start Tor first, then use the address returned by\n"),s("code",[t._v("start_tor()")]),t._v(" function as proxy address.")]),t._v(" "),s("p",[t._v("We omitted "),s("code",[t._v("find_string_in_log()")]),t._v(" and "),s("code",[t._v("truncate_log()")]),t._v(" for brevity. You\ncan find their implementations in "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/master/examples/esplora_backend_with_tor.rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora_backend_with_tor.rs"),s("OutboundLink")],1)])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{406:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("It’s easy to underestimate the importance of privacy tech for Bitcoin,\nespecially when connecting to third party services. They can learn your\nIP address and associate the transactions you sent over it. You can only\nhope that this information will not be leaked anytime in the future with\nunpredictable consequences. In order to use Bitcoin privately, you need\nto encrypt and anonymize the data you send over the Internet.")]),t._v(" "),s("p",[t._v("Tor is one of the must-have privacy preserving tools for the Internet in\ngeneral, and for Bitcoin in particular. Tor network consists of nodes that\nuse clever cryptographic methods to encrypt user data and transfer them as\nanonymously as possible.")]),t._v(" "),s("p",[t._v("In this article we show how to integrate Tor with your BDK application.")]),t._v(" "),s("h2",{attrs:{id:"prerequisite"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prerequisite"}},[t._v("#")]),t._v(" Prerequisite")]),t._v(" "),s("p",[t._v("First, you would need to have a Tor daemon up and running.")]),t._v(" "),s("p",[t._v("On Mac OS X you can install with Homebrew.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("brew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\nbrew services start tor\n")])])]),s("p",[t._v("On Ubuntu or other Debian-based distributions.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" tor\n")])])]),s("p",[t._v("In some cases you'll need to wait a minute or two for the bootstrapping to finish.\nIn general, Tor is not the fastest network, so if any of the examples below fail\ndue to timeout, simply restart it.")]),t._v(" "),s("p",[t._v("At the very end of the article we’ll show how to integrate Tor directly to\nyour application.")]),t._v(" "),s("p",[t._v("By default, Tor creates a "),s("a",{attrs:{href:"https://en.wikipedia.org/wiki/SOCKS",target:"_blank",rel:"noopener noreferrer"}},[t._v("SOCKS5"),s("OutboundLink")],1),t._v(" proxy\nendpoint and listens on port 9050. Your application should connect to the\nproxy on "),s("code",[t._v("localhost:9050")]),t._v(" and use it for its network activities.")]),t._v(" "),s("h2",{attrs:{id:"setting-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),s("p",[t._v("Create a new cargo project.")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" ~/tutorial\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" tutorial\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" new bdk-tor\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" bdk-tor\n")])])]),s("p",[t._v("Open "),s("code",[t._v("src/main.rs")]),t._v(" file remove all its contents and add these lines.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("database"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("template"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add additional imports here")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" network "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xpriv "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Syncing the wallet..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The wallet synced. Height: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Bip84")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("xpriv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("network"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this code we create a testnet wallet with "),s("code",[t._v("create_wallet()")]),t._v(" function and\ntry to sync it with a specific blockchain client implementation. We create a\nblockchain client using "),s("code",[t._v("create_blockchain()")]),t._v(" function. We’ll implement it\nlater for each type of blockchain client supported by BDK.")]),t._v(" "),s("h2",{attrs:{id:"electrumblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#electrumblockchain"}},[t._v("#")]),t._v(" ElectrumBlockchain")]),t._v(" "),s("p",[t._v("The Electrum client is enabled by default so the "),s("code",[t._v("Cargo.toml")]),t._v(" dependencies\nsection will look like this.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("And the imports look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("electrum_client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Here is the implementation of "),s("code",[t._v("create_blockchain()")]),t._v(" function for the\nElectrum client.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigBuilder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("socks5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Socks5Config")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n credentials"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" client "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("client"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we create an instance of "),s("code",[t._v("Socks5Config")]),t._v(" which defines the\nTor proxy parameters for "),s("code",[t._v("ElectrumBlockchain")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"blocking-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blocking-esplorablockchain"}},[t._v("#")]),t._v(" Blocking EsploraBlockchain")]),t._v(" "),s("p",[t._v("The blocking version of "),s("code",[t._v("EsploraBlockchain")]),t._v(" uses "),s("code",[t._v("ureq")]),t._v(" crate to send HTTP\nrequests to Eslora backends. By default, its SOCKS5 feature is disabled,\nso we need to enable it in "),s("code",[t._v("Cargo.toml")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-blocking"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("And "),s("code",[t._v("create_blockchain()")]),t._v(" implementation is")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("proxy()")]),t._v(" method of the config builder to set the Tor proxy\naddress. Please note, that unlike the previous examples, the Esplora client\nbuilder requires not just a proxy address, but a URL\n“socks5://127.0.0.1:9050”.")]),t._v(" "),s("h2",{attrs:{id:"asynchronous-esplorablockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asynchronous-esplorablockchain"}},[t._v("#")]),t._v(" Asynchronous EsploraBlockchain")]),t._v(" "),s("p",[t._v("There’s no need in enabling SOCKS5 for the asynchronous Esplora client,\nso we are good to go without additional dependencies.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"use-esplora-async"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("The imports are the same as in previous example.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("esplora"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" is almost identical.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/testnet/api"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"socks5h://127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchainConfig")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n base_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n proxy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n concurrency"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n stop_gap"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timeout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EsploraBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("There are two notable differences though. First, we call "),s("code",[t._v("build_async()")]),t._v(" to\ncreate an asynchronous Esplora client. Second the SOCKS5 URL scheme is\n“socks5h”. It’s not a typo. The async client supports two SOCKS5 schemes\n“socks5” and “socks5h”. The difference between them is that the former\nmakes the client to resolve domain names, and the latter does not, so the\nclient passes them to the proxy as is. A regular DNS resolver cannot\nresolve Tor onion addresses, so we should use “socks5h” here.")]),t._v(" "),s("h2",{attrs:{id:"compactfiltersblockchain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compactfiltersblockchain"}},[t._v("#")]),t._v(" CompactFiltersBlockchain")]),t._v(" "),s("p",[t._v("Add these lines to the dependencies section of "),s("code",[t._v("Cargo.toml")]),t._v(" file to enable\nBIP-157/BIP-158 compact filter support.")]),t._v(" "),s("p",[t._v("It can take a while to sync a wallet using compact filters over Tor, so be\npatient.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("default-features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("features")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compact_filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Now add the required imports into "),s("code",[t._v("src/main.rs")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("sync"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("compact_filters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GetHeight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[s("code",[t._v("create_blockchain()")]),t._v(" function will look like this.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"neutrino.testnet3.suredbits.com:18333"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:9050"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" mempool "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arc")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Mempool")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Connecting to {} via {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" peer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Peer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("connect_proxy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("peer_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("None")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" mempool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CompactFiltersBlockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("vec!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("peer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./wallet-filters"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Here we use "),s("code",[t._v("Peer::connect_proxy()")]),t._v(" which accepts the address to the SOCKS5\nproxy and performs all the heavy lifting for us.")]),t._v(" "),s("h2",{attrs:{id:"integrated-tor-daemon"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#integrated-tor-daemon"}},[t._v("#")]),t._v(" Integrated Tor daemon")]),t._v(" "),s("p",[t._v("As an application developer you don’t have to rely on your users to install\nand start Tor to use your application. Using "),s("code",[t._v("libtor")]),t._v(" crate you can bundle\nTor daemon with your app.")]),t._v(" "),s("p",[s("code",[t._v("libtor")]),t._v(" builds a Tor binary from the source files. Since Tor is written in C\nyou'll need a C compiler and build tools.")]),t._v(" "),s("p",[t._v("Install these packages on Mac OS X:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("xcode-select "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--install")]),t._v("\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" automake\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" libtool\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" openssl\nbrew "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" pkg-config\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("LDFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-L/opt/homebrew/opt/openssl/lib"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("CPPFLAGS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-I/opt/homebrew/opt/openssl/include"')]),t._v("\n")])])]),s("p",[t._v("Or these packages on Ubuntu or another Debian-based Linux distribution:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sudo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("apt")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" autoconf automake clang "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" libtool openssl pkg-config\n")])])]),s("p",[t._v("Then add these dependencies to the "),s("code",[t._v("Cargo.toml")]),t._v(" file.")]),t._v(" "),s("div",{staticClass:"language-toml extra-class"},[s("pre",{pre:!0,attrs:{class:"language-toml"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token table class-name"}},[t._v("dependencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("bdk")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("version")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^0.26"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token key property"}},[t._v("libtor")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"47.8.0+0.4.7.x"')]),t._v("\n")])])]),s("p",[t._v("This is an example of how we can use "),s("code",[t._v("libtor")]),t._v(" to start a Tor daemon.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("prelude"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("time"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("libtor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HiddenServiceVersion")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_port "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("19050")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" data_dir "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("env"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("temp_dir")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("display")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bdk-tor"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" log_file_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{}/{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"log"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Staring Tor in {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("truncate_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DataDirectory")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data_dir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogTo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogLevel")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Notice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("LogDestination")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("File")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("as_str")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SocksPort")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ExitPolicy reject *:*"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TorFlag")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Custom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BridgeRelay 0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_background")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("started "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" tries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("120")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("panic!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"It took too long to start Tor. See {} for details"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("thread"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sleep")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Duration")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_millis")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n started "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find_string_in_log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("log_file_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Bootstrapped 100%"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("into")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Tor started"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("format!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1:{}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" socks_port"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("First, we create a Tor object, and then we call "),s("code",[t._v("start_background()")]),t._v(" method\nto start it in the background. After that, we continuously try to find\n“Bootstrapped 100%” string in the log file. Once we find it, Tor is\nready to proxy our connections. We use port 19050 because, the user can\nhave their own instance of Tor running already.")]),t._v(" "),s("p",[t._v("Next you can modify "),s("code",[t._v("create_blockchain()")]),t._v(" like this")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("create_blockchain")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ssl://electrum.blockstream.info:60002"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" socks_addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start_tor")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("In this example we start Tor first, then use the address returned by\n"),s("code",[t._v("start_tor()")]),t._v(" function as proxy address.")]),t._v(" "),s("p",[t._v("We omitted "),s("code",[t._v("find_string_in_log()")]),t._v(" and "),s("code",[t._v("truncate_log()")]),t._v(" for brevity. You\ncan find their implementations in "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/master/examples/esplora_backend_with_tor.rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("esplora_backend_with_tor.rs"),s("OutboundLink")],1)])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/56.6f4a5401.js b/assets/js/56.8c98f09e.js similarity index 99% rename from assets/js/56.6f4a5401.js rename to assets/js/56.8c98f09e.js index 5c98263227..3e11c2514e 100644 --- a/assets/js/56.6f4a5401.js +++ b/assets/js/56.8c98f09e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{413:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 1 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("Introduction: what is fee estimation?")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-problem"}},[e._v("The problem")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-challenges-and-the-solution"}},[e._v("The challenges and the solution")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-question"}},[e._v("The question")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-data-logger"}},[e._v("The data logger")])])])])]),e._v(" "),t("h2",{attrs:{id:"introduction-what-is-fee-estimation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("#")]),e._v(" Introduction: what is fee estimation?")]),e._v(" "),t("p",[e._v("Fee estimation is the process of selecting the fee rate"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" for a bitcoin transaction being created, according to two main factors:")]),e._v(" "),t("ul",[t("li",[e._v("The current congestion of the Bitcoin network.")]),e._v(" "),t("li",[e._v("The urgency, or lack thereof, for the transaction confirmation, i.e, its inclusion in a block.")])]),e._v(" "),t("p",[e._v("A fee rate should be adequate to the above factors: a fee too high would be a waste of money, because the same result could have been achieved with a lower expense. On the other hand, a fee rate too low would wait for a confirmation longer than planned or, even worse, the transaction could not be confirmed at all.")]),e._v(" "),t("h2",{attrs:{id:"the-problem"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-problem"}},[e._v("#")]),e._v(" The problem")]),e._v(" "),t("p",[e._v("Bitcoin Core offers fee estimation through the "),t("a",{attrs:{href:"https://bitcoincore.org/en/doc/0.20.0/rpc/util/estimatesmartfee/",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("estimatesmartfee")]),t("OutboundLink")],1),e._v(" RPC method, and there are also a lot of third-party "),t("a",{attrs:{href:"https://b10c.me/blog/003-a-list-of-public-bitcoin-feerate-estimation-apis/",target:"_blank",rel:"noopener noreferrer"}},[e._v("fee estimators"),t("OutboundLink")],1),e._v(" online, so do we need yet another estimator?")]),e._v(" "),t("p",[e._v("The model used by Bitcoin Core is not well suited for light-clients such as mobile wallets, even when running in pruned mode. Online estimators are lacking in terms of:")]),e._v(" "),t("ul",[t("li",[e._v("Privacy: Contacting the server leaks your IP (unless you are using Tor or a VPN), and the request timing may be used to correlate the request to a transaction broadcasted to the network soon thereafter.")]),e._v(" "),t("li",[e._v("Security: A malicious estimator could provide a high fee rate leading to a waste of money, or a low fee rate hampering the transaction confirmation.")])]),e._v(" "),t("p",[e._v("Replace By Fee (RBF) and Child Pays For Parent (CPFP) are techniques that can somewhat minimize the fee estimation problem, because one could simply underestimate the fee rate and then raise it when necessary, however:")]),e._v(" "),t("ul",[t("li",[e._v("RBF and CPFP may leak more information, such as patterns that may allow to detect the kind of wallet used, or which one of the transaction outputs is the change.")]),e._v(" "),t("li",[e._v('Requires additional interaction: the client must come back "online" to perform the fee bump. Sometimes this might be impractical or risky, for instance when using an offline signer or a multisignature with geographically distributed keys.')])]),e._v(" "),t("p",[e._v("Thus, this work is an effort to build a "),t("strong",[e._v("good fee estimator for purely peer to peer light clients")]),e._v(" such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones, or at least determine whether the approach we take is infeasible and open the discussion\nfor other, better, models.")]),e._v(" "),t("p",[e._v("In the meantime, another sub-goal is pursued: attract the interest of data scientists; Indeed the initial step for this analysis consists in constructing a data set, which could also also help kickstart other studies on fee estimation or, more broadly, on the Bitcoin mempool.")]),e._v(" "),t("h4",{attrs:{id:"the-challenges-and-the-solution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-challenges-and-the-solution"}},[e._v("#")]),e._v(" The challenges and the solution")]),e._v(" "),t("p",[e._v("The hardest part of doing fee estimation on a light client is the lack of information: for example, Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" uses up to the last 1008 blocks and knows everything about the mempool"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(", such as the fee rate of every transaction it contains, but a light-client does not.")]),e._v(" "),t("p",[e._v("Also, there are other factors that may help doing fee estimation, such as the day of the week (the mempool usually empties during the "),t("a",{attrs:{href:"https://www.blockchainresearchlab.org/2020/03/30/a-week-with-bitcoin-transaction-timing-and-transaction-fees/",target:"_blank",rel:"noopener noreferrer"}},[e._v("weekend"),t("OutboundLink")],1),e._v(") or the time of the day to anticipate recurring daily events\n(such as the batch of "),t("a",{attrs:{href:"https://b10c.me/mempool-observations/2-bitmex-broadcast-13-utc/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitmex withdrawals"),t("OutboundLink")],1),e._v(").")]),e._v(" "),t("p",[e._v("The idea is to apply Machine Learning (ML) techniques"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" to discover patterns over what a light-client knows and see if they are enough to achieve consistently good estimations.")]),e._v(" "),t("h4",{attrs:{id:"the-question"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-question"}},[e._v("#")]),e._v(" The question")]),e._v(" "),t("p",[e._v('We are going to use a DNN (Deep Neural Network), a ML technique in the supervised learning branch. The "ELI5" is: give a lot of example inputs and the desired output to a black box; if there are correlations between inputs and outputs,\nand there are enough examples, the black box will eventually start predicting the correct output even with inputs it has never seen before.')]),e._v(" "),t("p",[e._v("To define our inputs and outputs, we need to start from the question we want to answer. For a fee estimator this is:")]),e._v(" "),t("p",[t("em",[e._v('"Which minimum fee rate should I use if I want this transaction to be confirmed in at most '),t("code",[e._v("n")]),e._v(' blocks?"')])]),e._v(" "),t("p",[e._v("This can be translated to a table with many rows like:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("other_information")]),e._v(" "),t("th",[e._v("fee_rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("100.34")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("84.33")])]),e._v(" "),t("tr",[t("td",[e._v("10")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("44.44")])])])]),e._v(" "),t("p",[e._v("where the "),t("code",[e._v("fee_rate")]),e._v(' column is the output we want, also called the "'),t("em",[e._v("target")]),e._v('" or "'),t("em",[e._v("label")]),e._v('" in ML terminology, and the other columns are our inputs.')]),e._v(" "),t("p",[e._v("Can we build this table just by looking at the Bitcoin blockchain? Unfortunately, we can't:\nThe main thing that's missing is an indication of when the node first saw a transaction that has been later confirmed in a block. With that knowledge we can say that the fee rate of that transaction was the exact value required to confirm\nwithin the number of blocks it actually took to be confirmed. For instance, if we see transaction "),t("code",[e._v("t")]),e._v(" when the blockchain is at height "),t("code",[e._v("1000")]),e._v(" and then we notice that "),t("code",[e._v("t")]),e._v(" has been included in block "),t("code",[e._v("1006")]),e._v(", we can deduce that the\nfee rate paid by "),t("code",[e._v("t")]),e._v(" was the exact value required to get confirmed within the next "),t("code",[e._v("6")]),e._v(" blocks.")]),e._v(" "),t("p",[e._v("So to build our model, we first need to gather these data, and machine learning needs a "),t("em",[e._v("lot")]),e._v(" of data to work well.")]),e._v(" "),t("h4",{attrs:{id:"the-data-logger"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-data-logger"}},[e._v("#")]),e._v(" The data logger")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" is built with the purpose of collecting all the data we need, and it's MIT licensed open source software written in Rust.")]),e._v(" "),t("p",[e._v("We need to register the moment in time when transactions enter in the node's mempool; to be efficient and precise we should not only call the RPC endpoints but listen to "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" events. Luckily, the just released bitcoin core 0.21.0 added a new "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" topic "),t("code",[e._v("zmqpubsequence")]),e._v(" notifying mempool events (and block events). The logger is also listening to "),t("code",[e._v("zmqpubrawtx")]),e._v(" and "),t("code",[e._v("zmqpubrawblock")]),e._v(" topics, to make less RPC calls.")]),e._v(" "),t("p",[e._v("We are not only interested in the timestamp of the transaction entering the mempool, but also how many blocks it will take until the same transaction is confirmed.\nIn the final dataset this field is called "),t("code",[e._v("confirms_in")]),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v("; if "),t("code",[e._v("confirms_in = 1")]),e._v(" it means the transaction is confirmed in the first block created after it has been seen for the first time.")]),e._v(" "),t("p",[e._v("Another critical piece of information logged by the data logger is the "),t("code",[e._v("fee_rate")]),e._v(" of the transaction, since the absolute fee value paid by a bitcoin transaction is not available nor derivable given only the transaction itself, as the inputs don't have explicit amounts.")]),e._v(" "),t("p",[e._v("All these data (apart from the time of the transaction entering in the mempool) can actually be reconstructed simply by looking at the blockchain. However, querying the bitcoin node can be fairly slow, and during the model training iterations we want to recreate the ML dataset rapidly"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn5",id:"fnref5"}},[e._v("[5]")])]),e._v(", for example whenever we need to modify or add a new field.")]),e._v(" "),t("p",[e._v("For these reasons, the logger is split into two parts: a process listening to the events sent by our node, which creates raw logs, and then a second process that uses these logs to create the final CSV dataset.\nRaw logs are self-contained: for example, they contain all the previous transaction output values for every relevant transaction. This causes some redundancy, but in this case it's better to trade some efficiency for more performance\nwhen recreating the dataset.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/high-level-graph.svg",alt:"High level graph"}})]),e._v(" "),t("p",[e._v("My logger instance started collecting data on the 18th of December 2020, and as of today (25th January 2020), the raw logs are about 16GB.")]),e._v(" "),t("p",[e._v("I expect (or at least hope) the raw logs, the CSV dataset, or the data logger will be useful also for other projects as well, like monitoring the propagation of transactions or other works involving raw mempool data. We will share raw logs data through torrent soon.")]),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(" we are going to talk about the dataset.")],1),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("The transaction fee rate is the ratio between the absolute fee expressed in satoshi, over the weight of the transaction measured in virtual bytes. The weight of the transaction is similar to the byte size, however a part of the transaction (the segwit part) is discounted, their byte size is considered less because it creates less burden for the network. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("mempool is the set of transactions that are valid by consensus rules (for example, they are spending existing bitcoin), broadcasted in the bitcoin peer to peer network, but they are not yet part of the blockchain. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("DISCLAIMER: I am not an expert data-scientist! "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Conceptually similar to bitcoin core "),t("code",[e._v("estimatesmartfee")]),e._v(' parameter called "blocks target", however, '),t("code",[e._v("confirms_in")]),e._v(" is the real value not the desired target. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn5"}},[t("p",[e._v("16GB of compressed raw logs are processed and a compressed CSV produced in about 5 minutes. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref5"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{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 1 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("Introduction: what is fee estimation?")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-problem"}},[e._v("The problem")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-challenges-and-the-solution"}},[e._v("The challenges and the solution")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-question"}},[e._v("The question")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-data-logger"}},[e._v("The data logger")])])])])]),e._v(" "),t("h2",{attrs:{id:"introduction-what-is-fee-estimation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction-what-is-fee-estimation"}},[e._v("#")]),e._v(" Introduction: what is fee estimation?")]),e._v(" "),t("p",[e._v("Fee estimation is the process of selecting the fee rate"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(" for a bitcoin transaction being created, according to two main factors:")]),e._v(" "),t("ul",[t("li",[e._v("The current congestion of the Bitcoin network.")]),e._v(" "),t("li",[e._v("The urgency, or lack thereof, for the transaction confirmation, i.e, its inclusion in a block.")])]),e._v(" "),t("p",[e._v("A fee rate should be adequate to the above factors: a fee too high would be a waste of money, because the same result could have been achieved with a lower expense. On the other hand, a fee rate too low would wait for a confirmation longer than planned or, even worse, the transaction could not be confirmed at all.")]),e._v(" "),t("h2",{attrs:{id:"the-problem"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-problem"}},[e._v("#")]),e._v(" The problem")]),e._v(" "),t("p",[e._v("Bitcoin Core offers fee estimation through the "),t("a",{attrs:{href:"https://bitcoincore.org/en/doc/0.20.0/rpc/util/estimatesmartfee/",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("estimatesmartfee")]),t("OutboundLink")],1),e._v(" RPC method, and there are also a lot of third-party "),t("a",{attrs:{href:"https://b10c.me/blog/003-a-list-of-public-bitcoin-feerate-estimation-apis/",target:"_blank",rel:"noopener noreferrer"}},[e._v("fee estimators"),t("OutboundLink")],1),e._v(" online, so do we need yet another estimator?")]),e._v(" "),t("p",[e._v("The model used by Bitcoin Core is not well suited for light-clients such as mobile wallets, even when running in pruned mode. Online estimators are lacking in terms of:")]),e._v(" "),t("ul",[t("li",[e._v("Privacy: Contacting the server leaks your IP (unless you are using Tor or a VPN), and the request timing may be used to correlate the request to a transaction broadcasted to the network soon thereafter.")]),e._v(" "),t("li",[e._v("Security: A malicious estimator could provide a high fee rate leading to a waste of money, or a low fee rate hampering the transaction confirmation.")])]),e._v(" "),t("p",[e._v("Replace By Fee (RBF) and Child Pays For Parent (CPFP) are techniques that can somewhat minimize the fee estimation problem, because one could simply underestimate the fee rate and then raise it when necessary, however:")]),e._v(" "),t("ul",[t("li",[e._v("RBF and CPFP may leak more information, such as patterns that may allow to detect the kind of wallet used, or which one of the transaction outputs is the change.")]),e._v(" "),t("li",[e._v('Requires additional interaction: the client must come back "online" to perform the fee bump. Sometimes this might be impractical or risky, for instance when using an offline signer or a multisignature with geographically distributed keys.')])]),e._v(" "),t("p",[e._v("Thus, this work is an effort to build a "),t("strong",[e._v("good fee estimator for purely peer to peer light clients")]),e._v(" such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones, or at least determine whether the approach we take is infeasible and open the discussion\nfor other, better, models.")]),e._v(" "),t("p",[e._v("In the meantime, another sub-goal is pursued: attract the interest of data scientists; Indeed the initial step for this analysis consists in constructing a data set, which could also also help kickstart other studies on fee estimation or, more broadly, on the Bitcoin mempool.")]),e._v(" "),t("h4",{attrs:{id:"the-challenges-and-the-solution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-challenges-and-the-solution"}},[e._v("#")]),e._v(" The challenges and the solution")]),e._v(" "),t("p",[e._v("The hardest part of doing fee estimation on a light client is the lack of information: for example, Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" uses up to the last 1008 blocks and knows everything about the mempool"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn2",id:"fnref2"}},[e._v("[2]")])]),e._v(", such as the fee rate of every transaction it contains, but a light-client does not.")]),e._v(" "),t("p",[e._v("Also, there are other factors that may help doing fee estimation, such as the day of the week (the mempool usually empties during the "),t("a",{attrs:{href:"https://www.blockchainresearchlab.org/2020/03/30/a-week-with-bitcoin-transaction-timing-and-transaction-fees/",target:"_blank",rel:"noopener noreferrer"}},[e._v("weekend"),t("OutboundLink")],1),e._v(") or the time of the day to anticipate recurring daily events\n(such as the batch of "),t("a",{attrs:{href:"https://b10c.me/mempool-observations/2-bitmex-broadcast-13-utc/",target:"_blank",rel:"noopener noreferrer"}},[e._v("bitmex withdrawals"),t("OutboundLink")],1),e._v(").")]),e._v(" "),t("p",[e._v("The idea is to apply Machine Learning (ML) techniques"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn3",id:"fnref3"}},[e._v("[3]")])]),e._v(" to discover patterns over what a light-client knows and see if they are enough to achieve consistently good estimations.")]),e._v(" "),t("h4",{attrs:{id:"the-question"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-question"}},[e._v("#")]),e._v(" The question")]),e._v(" "),t("p",[e._v('We are going to use a DNN (Deep Neural Network), a ML technique in the supervised learning branch. The "ELI5" is: give a lot of example inputs and the desired output to a black box; if there are correlations between inputs and outputs,\nand there are enough examples, the black box will eventually start predicting the correct output even with inputs it has never seen before.')]),e._v(" "),t("p",[e._v("To define our inputs and outputs, we need to start from the question we want to answer. For a fee estimator this is:")]),e._v(" "),t("p",[t("em",[e._v('"Which minimum fee rate should I use if I want this transaction to be confirmed in at most '),t("code",[e._v("n")]),e._v(' blocks?"')])]),e._v(" "),t("p",[e._v("This can be translated to a table with many rows like:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("other_information")]),e._v(" "),t("th",[e._v("fee_rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("100.34")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("84.33")])]),e._v(" "),t("tr",[t("td",[e._v("10")]),e._v(" "),t("td",[e._v("...")]),e._v(" "),t("td",[e._v("44.44")])])])]),e._v(" "),t("p",[e._v("where the "),t("code",[e._v("fee_rate")]),e._v(' column is the output we want, also called the "'),t("em",[e._v("target")]),e._v('" or "'),t("em",[e._v("label")]),e._v('" in ML terminology, and the other columns are our inputs.')]),e._v(" "),t("p",[e._v("Can we build this table just by looking at the Bitcoin blockchain? Unfortunately, we can't:\nThe main thing that's missing is an indication of when the node first saw a transaction that has been later confirmed in a block. With that knowledge we can say that the fee rate of that transaction was the exact value required to confirm\nwithin the number of blocks it actually took to be confirmed. For instance, if we see transaction "),t("code",[e._v("t")]),e._v(" when the blockchain is at height "),t("code",[e._v("1000")]),e._v(" and then we notice that "),t("code",[e._v("t")]),e._v(" has been included in block "),t("code",[e._v("1006")]),e._v(", we can deduce that the\nfee rate paid by "),t("code",[e._v("t")]),e._v(" was the exact value required to get confirmed within the next "),t("code",[e._v("6")]),e._v(" blocks.")]),e._v(" "),t("p",[e._v("So to build our model, we first need to gather these data, and machine learning needs a "),t("em",[e._v("lot")]),e._v(" of data to work well.")]),e._v(" "),t("h4",{attrs:{id:"the-data-logger"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-data-logger"}},[e._v("#")]),e._v(" The data logger")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" is built with the purpose of collecting all the data we need, and it's MIT licensed open source software written in Rust.")]),e._v(" "),t("p",[e._v("We need to register the moment in time when transactions enter in the node's mempool; to be efficient and precise we should not only call the RPC endpoints but listen to "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" events. Luckily, the just released bitcoin core 0.21.0 added a new "),t("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZMQ"),t("OutboundLink")],1),e._v(" topic "),t("code",[e._v("zmqpubsequence")]),e._v(" notifying mempool events (and block events). The logger is also listening to "),t("code",[e._v("zmqpubrawtx")]),e._v(" and "),t("code",[e._v("zmqpubrawblock")]),e._v(" topics, to make less RPC calls.")]),e._v(" "),t("p",[e._v("We are not only interested in the timestamp of the transaction entering the mempool, but also how many blocks it will take until the same transaction is confirmed.\nIn the final dataset this field is called "),t("code",[e._v("confirms_in")]),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn4",id:"fnref4"}},[e._v("[4]")])]),e._v("; if "),t("code",[e._v("confirms_in = 1")]),e._v(" it means the transaction is confirmed in the first block created after it has been seen for the first time.")]),e._v(" "),t("p",[e._v("Another critical piece of information logged by the data logger is the "),t("code",[e._v("fee_rate")]),e._v(" of the transaction, since the absolute fee value paid by a bitcoin transaction is not available nor derivable given only the transaction itself, as the inputs don't have explicit amounts.")]),e._v(" "),t("p",[e._v("All these data (apart from the time of the transaction entering in the mempool) can actually be reconstructed simply by looking at the blockchain. However, querying the bitcoin node can be fairly slow, and during the model training iterations we want to recreate the ML dataset rapidly"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn5",id:"fnref5"}},[e._v("[5]")])]),e._v(", for example whenever we need to modify or add a new field.")]),e._v(" "),t("p",[e._v("For these reasons, the logger is split into two parts: a process listening to the events sent by our node, which creates raw logs, and then a second process that uses these logs to create the final CSV dataset.\nRaw logs are self-contained: for example, they contain all the previous transaction output values for every relevant transaction. This causes some redundancy, but in this case it's better to trade some efficiency for more performance\nwhen recreating the dataset.")]),e._v(" "),t("figure",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/high-level-graph.svg",alt:"High level graph"}})]),e._v(" "),t("p",[e._v("My logger instance started collecting data on the 18th of December 2020, and as of today (25th January 2020), the raw logs are about 16GB.")]),e._v(" "),t("p",[e._v("I expect (or at least hope) the raw logs, the CSV dataset, or the data logger will be useful also for other projects as well, like monitoring the propagation of transactions or other works involving raw mempool data. We will share raw logs data through torrent soon.")]),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"}},[e._v("Part 2")]),e._v(" we are going to talk about the dataset.")],1),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("The transaction fee rate is the ratio between the absolute fee expressed in satoshi, over the weight of the transaction measured in virtual bytes. The weight of the transaction is similar to the byte size, however a part of the transaction (the segwit part) is discounted, their byte size is considered less because it creates less burden for the network. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn2"}},[t("p",[e._v("mempool is the set of transactions that are valid by consensus rules (for example, they are spending existing bitcoin), broadcasted in the bitcoin peer to peer network, but they are not yet part of the blockchain. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref2"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn3"}},[t("p",[e._v("DISCLAIMER: I am not an expert data-scientist! "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref3"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn4"}},[t("p",[e._v("Conceptually similar to bitcoin core "),t("code",[e._v("estimatesmartfee")]),e._v(' parameter called "blocks target", however, '),t("code",[e._v("confirms_in")]),e._v(" is the real value not the desired target. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref4"}},[e._v("↩︎")])])]),e._v(" "),t("li",{staticClass:"footnote-item",attrs:{id:"fn5"}},[t("p",[e._v("16GB of compressed raw logs are processed and a compressed CSV produced in about 5 minutes. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref5"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/57.64bfd1b2.js b/assets/js/57.17897a36.js similarity index 99% rename from assets/js/57.64bfd1b2.js rename to assets/js/57.17897a36.js index 24a089371c..b372e77770 100644 --- a/assets/js/57.64bfd1b2.js +++ b/assets/js/57.17897a36.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{415:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 2 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-dataset"}},[e._v("The dataset")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-mempool"}},[e._v("The mempool")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-outliers"}},[e._v("The outliers")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#recap"}},[e._v("Recap")])])])])]),e._v(" "),t("h2",{attrs:{id:"the-dataset"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-dataset"}},[e._v("#")]),e._v(" The dataset")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" is publicly available (~500MB gzip compressed, ~2GB as plain CSV).")]),e._v(" "),t("p",[e._v("The output of the model is the fee rate, expressed in "),t("code",[e._v("[satoshi/vbytes]")]),e._v(".")]),e._v(" "),t("p",[e._v("What about the inputs? Generally speaking, we have two main requirements for what can be included as input for our model:")]),e._v(" "),t("ul",[t("li",[e._v("It must be correlated to the output, even with a non-linear relation.")]),e._v(" "),t("li",[e._v("It must be available to a light client: for instance, assuming to have knowledge and an index of the last 1000 blocks is considered too much.")])]),e._v(" "),t("p",[e._v("To evaluate the approach we are taking, we also want to compare our model's results with another available estimation: for this reason the dataset includes data to compute the error agains Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" results, even though we are not going to use it for this model.")]),e._v(" "),t("p",[e._v("The dataset will contain only transactions that spend already confirmed inputs. If we wanted to include transactions with unconfirmed inputs as well, the fee rate would have to be computed as a whole;\nfor example if transaction "),t("code",[e._v("t2")]),e._v(" spends an unconfirmed input from "),t("code",[e._v("t1")]),e._v(" (while "),t("code",[e._v("t1")]),e._v(" only spends confirmed inputs, and all its other outputs are unspent), the aggregated fee rate would have to be used.\nSupposing "),t("code",[e._v("f()")]),e._v(" is extracts the absolute fee and "),t("code",[e._v("w()")]),e._v(" the transaction weight, the aggregated fee rate would be "),t("code",[e._v("(f(t1) + f(t2)) / (w(t1) + w(t2))")]),e._v(". Thus, as already said previously, to keep things simple the model simply discards all the transaction\nthat would need to perform this computation.")]),e._v(" "),t("p",[e._v("For the same reason the dataset has the "),t("code",[e._v("parent_in_cpfp")]),e._v(" flag. When a transaction has inputs confirmed (so it's not excluded by the previous rule) but one or more of its output have been spent by a transaction confirmed in the same block, "),t("code",[e._v("parent_in_cpfp")]),e._v(" is "),t("code",[e._v("1")]),e._v(".\nTransactions with "),t("code",[e._v("parent_in_cpfp = 1")]),e._v(" are included in the dataset but excluded by the current model, since the miner probably considered an aggregated fee rate while picking the transactions to build a block.")]),e._v(" "),t("h4",{attrs:{id:"the-mempool"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-mempool"}},[e._v("#")]),e._v(" The mempool")]),e._v(" "),t("p",[e._v("The most important input of our model is the current "),t("em",[e._v("status")]),e._v(' of the mempool itself. However, we cannot feed the model with a list of the fee rate of every unconfirmed transaction, because this array would have a variable length.\nTo overcome this, the transaction contained in the mempool are grouped in "buckets" which are basically subsets of the mempool where all the transactions contained in a bucket have a similar fee rate. In particular we only care about the\n'),t("em",[e._v("number")]),e._v(" of transaction in every "),t("em",[e._v("bucket")]),e._v(", not which transactions it contains.")]),e._v(" "),t("p",[e._v("The mempool buckets array is defined by two parameters, the "),t("code",[e._v("percentage_increment")]),e._v(" and the "),t("code",[e._v("array_max")]),e._v(" value.\nStarting from the minimum fee rate value "),t("code",[e._v("min_relay_fee=1.0")]),e._v(", the "),t("code",[e._v("ith")]),e._v(" element is: "),t("code",[e._v("a_i=min_relay_fee * (1+percentage_increment)^(i+1)")])]),e._v(" "),t("p",[e._v("For instance, choosing the mempool buckets array to have parameters "),t("code",[e._v("percentage_increment = 50%")]),e._v(" and "),t("code",[e._v("array_max = 500.0 sat/vbytes")]),e._v(" the buckets would be constructed like so:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("bucket")]),e._v(" "),t("th",[e._v("bucket min fee rate")]),e._v(" "),t("th",[e._v("bucket max fee rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("a_0")]),e._v(" "),t("td",[e._v("1.0")]),e._v(" "),t("td",[e._v("1.5")])]),e._v(" "),t("tr",[t("td",[e._v("a_1")]),e._v(" "),t("td",[e._v("1.5")]),e._v(" "),t("td",[e._v("2.25")])]),e._v(" "),t("tr",[t("td",[e._v("a_2")]),e._v(" "),t("td",[e._v("2.25")]),e._v(" "),t("td",[e._v("3.375")])]),e._v(" "),t("tr",[t("td",[e._v("a_15")]),e._v(" "),t("td",[e._v("437.89")]),e._v(" "),t("td",[e._v("inf")])])])]),e._v(" "),t("p",[e._v("The array stops at "),t("code",[e._v("a15")]),e._v(" because "),t("code",[e._v("a16")]),e._v(" would have a bucket min greater than "),t("code",[e._v("array_max")]),e._v(".")]),e._v(" "),t("p",[e._v("The model is for light-client such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones. In these clients the mempool is already available (it's needed to check for received transactions) but we can't compute fee rates of this transactions because previous confirmed inputs are not in the mempool!")]),e._v(" "),t("p",[e._v("Luckily, "),t("strong",[e._v("thanks to temporal locality "),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(", an important part of mempool transactions spend outputs created very recently")]),e._v(", for example in the last 6 blocks.\nThe blocks are available through the p2p network, and downloading the last 6 is considered a good compromise between resource consumption and accurate prediction. We need the model to be built with the same data available in the prediction phase, as a consequence "),t("em",[e._v("the mempool data in the dataset refers only to transactions having their inputs in the last 6 blocks")]),e._v(". However the "),t("code",[e._v("bitcoin-csv")]),e._v(" tool inside the "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" allows to configure this parameter.")]),e._v(" "),t("h4",{attrs:{id:"the-outliers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-outliers"}},[e._v("#")]),e._v(" The outliers")]),e._v(" "),t("p",[e._v("The dataset also contains the block percentile fee rate "),t("code",[e._v("q_k")]),e._v(", considering "),t("code",[e._v("r_i")]),e._v(" to be the rate of the "),t("code",[e._v("ith")]),e._v(" transaction in a block, "),t("code",[e._v("q_k")]),e._v(" is the fee rate value such that for each transaction in a block "),t("code",[e._v("r_i")]),e._v(" < "),t("code",[e._v("q_k")]),e._v(" returns the "),t("code",[e._v("k%")]),e._v(" transactions in the block that are paying lower fees.")]),e._v(" "),t("p",[e._v("Percentiles are not used to feed the model but to filter some outliers tx.\nRemoving this observations is controversial at best and considered cheating at worse. However, it should be considered that Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" doesn't even bother to give estimation for the next block, we think this is due to the fact that many transactions that are confirming in the next block are huge overestimation, or clearly errors like "),t("a",{attrs:{href:"https://blockstream.info/tx/33291156ab79e9b4a1019b618b0acfa18cbdf8fa6b71c43a9eed62a849b86f9a",target:"_blank",rel:"noopener noreferrer"}},[e._v("this one"),t("OutboundLink")],1),e._v(" we found when we started logging data.\nThese outliers are several for transactions confirming in the next block ("),t("code",[e._v("confirms_in=1")]),e._v("), less so for "),t("code",[e._v("confirms_in=2")]),e._v(", mostly disappeared for "),t("code",[e._v("confirms_in=3")]),e._v(" or more. It's counterintuitive that overestimation exists for "),t("code",[e._v("confirms_in>1")]),e._v(", by definition an overestimation is a fee rate way higher than needed, so how is possible that an overestimation doesn't enter the very next block? There are a couple of reasons why a block is discovered without containing a transaction with high fee rate:")]),e._v(" "),t("ul",[t("li",[e._v("network latency: my node saw the transaction but the miner didn't see that transaction yet,")]),e._v(" "),t("li",[e._v("block building latency: the miner saw the transaction, but didn't finish to rebuild the block template or decided it's more efficient to finish a cycle on the older block template.")])]),e._v(" "),t("p",[e._v("To keep the model balanced, when overestimation is filtered out, underestimation are filtered out as well. This also has the effect to remove some of the transactions possibly included because a fee is payed out-of-band.\nAnother reason to filter transactions is that the dataset is over-represented by transactions with low "),t("code",[e._v("confirms_in")]),e._v(": more than 50% of transactions get confirmed in the next block, so we think it's good to filter some of these transactions.")]),e._v(" "),t("p",[e._v("The applied filters are the following:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("lower")]),e._v(" "),t("th",[e._v("higher")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("q45")]),e._v(" "),t("td",[e._v("q55")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("q30")]),e._v(" "),t("td",[e._v("q70")])]),e._v(" "),t("tr",[t("td",[e._v("3")]),e._v(" "),t("td",[e._v("q1")]),e._v(" "),t("td",[e._v("q99")])])])]),e._v(" "),t("p",[e._v("Not yet convinced by the removal of these outliers? The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" contains all the observations, make your model 😃")]),e._v(" "),t("h4",{attrs:{id:"recap"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recap"}},[e._v("#")]),e._v(" Recap")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("column")]),e._v(" "),t("th",[e._v("used in the model")]),e._v(" "),t("th",[e._v("description")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("txid")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction hash, useful for debugging")])]),e._v(" "),t("tr",[t("td",[e._v("timestamp")]),e._v(" "),t("td",[e._v("converted")]),e._v(" "),t("td",[e._v("The time when the transaction has been added in the mempool, in the model is used in the form "),t("code",[e._v("day_of_week")]),e._v(" and "),t("code",[e._v("hour")])])]),e._v(" "),t("tr",[t("td",[e._v("current_height")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("The blockchain height seen by the node in this moment")])]),e._v(" "),t("tr",[t("td",[e._v("confirms_in")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("This transaction confirmed at block height "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate")]),e._v(" "),t("td",[e._v("target")]),e._v(" "),t("td",[e._v("This transaction fee rate measured in "),t("code",[e._v("[sat/vbytes]")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate_bytes")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("fee rate in satoshi / bytes, used to check Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" predictions")])]),e._v(" "),t("tr",[t("td",[e._v("block_avg_fee")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("block average fee rate "),t("code",[e._v("[sat/vbytes]")]),e._v(" of block "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("core_econ")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("bitcoin "),t("code",[e._v("estimatesmartfee")]),e._v(" result for "),t("code",[e._v("confirms_in")]),e._v(" block target and in economic mode. Could be not available "),t("code",[e._v("?")]),e._v(" when a block is connected more recently than the estimation has been requested, estimation are requested every 10 secs.")])]),e._v(" "),t("tr",[t("td",[e._v("core_cons")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Same as above but with conservative mode")])]),e._v(" "),t("tr",[t("td",[e._v("mempool_len")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Sum of the mempool transactions with fee rate available (sum of every "),t("code",[e._v("a*")]),e._v(" field)")])]),e._v(" "),t("tr",[t("td",[e._v("parent_in_cpfp")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("It's 1 when the transaction has outputs that are spent in the same block in which the transaction is confirmed (they are parent in a CPFP relations).")])]),e._v(" "),t("tr",[t("td",[e._v("q1-q30-...")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction confirming fast could be outliers, usually paying a lot more than required, this percentiles are used to filter those transactions,")])]),e._v(" "),t("tr",[t("td",[e._v("a1-a2-...")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("Contains the number of transaction in the mempool with known fee rate in the ith bucket.")])])])]),e._v(" "),t("p",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/the-good-the-bad-the-ugly.jpg",alt:"The good, the bad and the ugly"}})]),t("div",{attrs:{align:"center"}},[e._v('My biological neural network fired this, I think it\'s because a lot of chapters start with "The"')]),e._v(" "),t("br"),t("br"),t("p"),e._v(" "),t("p",[e._v("In the previous "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(" we talked about the problem.")],1),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(" we are going to talk about the model.")],1),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("In computer science temporal locality refers to the tendency to access recent data more often than older data. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{414:function(e,t,a){"use strict";a.r(t);var o=a(7),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("This post is part 2 of 3 of a series. ("),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(", "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(")")],1),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-dataset"}},[e._v("The dataset")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"#the-mempool"}},[e._v("The mempool")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#the-outliers"}},[e._v("The outliers")])]),e._v(" "),t("li",[t("a",{attrs:{href:"#recap"}},[e._v("Recap")])])])])]),e._v(" "),t("h2",{attrs:{id:"the-dataset"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-dataset"}},[e._v("#")]),e._v(" The dataset")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" is publicly available (~500MB gzip compressed, ~2GB as plain CSV).")]),e._v(" "),t("p",[e._v("The output of the model is the fee rate, expressed in "),t("code",[e._v("[satoshi/vbytes]")]),e._v(".")]),e._v(" "),t("p",[e._v("What about the inputs? Generally speaking, we have two main requirements for what can be included as input for our model:")]),e._v(" "),t("ul",[t("li",[e._v("It must be correlated to the output, even with a non-linear relation.")]),e._v(" "),t("li",[e._v("It must be available to a light client: for instance, assuming to have knowledge and an index of the last 1000 blocks is considered too much.")])]),e._v(" "),t("p",[e._v("To evaluate the approach we are taking, we also want to compare our model's results with another available estimation: for this reason the dataset includes data to compute the error agains Bitcoin Core's "),t("code",[e._v("estimatesmartfee")]),e._v(" results, even though we are not going to use it for this model.")]),e._v(" "),t("p",[e._v("The dataset will contain only transactions that spend already confirmed inputs. If we wanted to include transactions with unconfirmed inputs as well, the fee rate would have to be computed as a whole;\nfor example if transaction "),t("code",[e._v("t2")]),e._v(" spends an unconfirmed input from "),t("code",[e._v("t1")]),e._v(" (while "),t("code",[e._v("t1")]),e._v(" only spends confirmed inputs, and all its other outputs are unspent), the aggregated fee rate would have to be used.\nSupposing "),t("code",[e._v("f()")]),e._v(" is extracts the absolute fee and "),t("code",[e._v("w()")]),e._v(" the transaction weight, the aggregated fee rate would be "),t("code",[e._v("(f(t1) + f(t2)) / (w(t1) + w(t2))")]),e._v(". Thus, as already said previously, to keep things simple the model simply discards all the transaction\nthat would need to perform this computation.")]),e._v(" "),t("p",[e._v("For the same reason the dataset has the "),t("code",[e._v("parent_in_cpfp")]),e._v(" flag. When a transaction has inputs confirmed (so it's not excluded by the previous rule) but one or more of its output have been spent by a transaction confirmed in the same block, "),t("code",[e._v("parent_in_cpfp")]),e._v(" is "),t("code",[e._v("1")]),e._v(".\nTransactions with "),t("code",[e._v("parent_in_cpfp = 1")]),e._v(" are included in the dataset but excluded by the current model, since the miner probably considered an aggregated fee rate while picking the transactions to build a block.")]),e._v(" "),t("h4",{attrs:{id:"the-mempool"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-mempool"}},[e._v("#")]),e._v(" The mempool")]),e._v(" "),t("p",[e._v("The most important input of our model is the current "),t("em",[e._v("status")]),e._v(' of the mempool itself. However, we cannot feed the model with a list of the fee rate of every unconfirmed transaction, because this array would have a variable length.\nTo overcome this, the transaction contained in the mempool are grouped in "buckets" which are basically subsets of the mempool where all the transactions contained in a bucket have a similar fee rate. In particular we only care about the\n'),t("em",[e._v("number")]),e._v(" of transaction in every "),t("em",[e._v("bucket")]),e._v(", not which transactions it contains.")]),e._v(" "),t("p",[e._v("The mempool buckets array is defined by two parameters, the "),t("code",[e._v("percentage_increment")]),e._v(" and the "),t("code",[e._v("array_max")]),e._v(" value.\nStarting from the minimum fee rate value "),t("code",[e._v("min_relay_fee=1.0")]),e._v(", the "),t("code",[e._v("ith")]),e._v(" element is: "),t("code",[e._v("a_i=min_relay_fee * (1+percentage_increment)^(i+1)")])]),e._v(" "),t("p",[e._v("For instance, choosing the mempool buckets array to have parameters "),t("code",[e._v("percentage_increment = 50%")]),e._v(" and "),t("code",[e._v("array_max = 500.0 sat/vbytes")]),e._v(" the buckets would be constructed like so:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("bucket")]),e._v(" "),t("th",[e._v("bucket min fee rate")]),e._v(" "),t("th",[e._v("bucket max fee rate")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("a_0")]),e._v(" "),t("td",[e._v("1.0")]),e._v(" "),t("td",[e._v("1.5")])]),e._v(" "),t("tr",[t("td",[e._v("a_1")]),e._v(" "),t("td",[e._v("1.5")]),e._v(" "),t("td",[e._v("2.25")])]),e._v(" "),t("tr",[t("td",[e._v("a_2")]),e._v(" "),t("td",[e._v("2.25")]),e._v(" "),t("td",[e._v("3.375")])]),e._v(" "),t("tr",[t("td",[e._v("a_15")]),e._v(" "),t("td",[e._v("437.89")]),e._v(" "),t("td",[e._v("inf")])])])]),e._v(" "),t("p",[e._v("The array stops at "),t("code",[e._v("a15")]),e._v(" because "),t("code",[e._v("a16")]),e._v(" would have a bucket min greater than "),t("code",[e._v("array_max")]),e._v(".")]),e._v(" "),t("p",[e._v("The model is for light-client such as "),t("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[e._v("neutrino"),t("OutboundLink")],1),e._v(" based ones. In these clients the mempool is already available (it's needed to check for received transactions) but we can't compute fee rates of this transactions because previous confirmed inputs are not in the mempool!")]),e._v(" "),t("p",[e._v("Luckily, "),t("strong",[e._v("thanks to temporal locality "),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v(", an important part of mempool transactions spend outputs created very recently")]),e._v(", for example in the last 6 blocks.\nThe blocks are available through the p2p network, and downloading the last 6 is considered a good compromise between resource consumption and accurate prediction. We need the model to be built with the same data available in the prediction phase, as a consequence "),t("em",[e._v("the mempool data in the dataset refers only to transactions having their inputs in the last 6 blocks")]),e._v(". However the "),t("code",[e._v("bitcoin-csv")]),e._v(" tool inside the "),t("a",{attrs:{href:"https://github.com/RCasatta/bitcoin_logger",target:"_blank",rel:"noopener noreferrer"}},[e._v("data logger"),t("OutboundLink")],1),e._v(" allows to configure this parameter.")]),e._v(" "),t("h4",{attrs:{id:"the-outliers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-outliers"}},[e._v("#")]),e._v(" The outliers")]),e._v(" "),t("p",[e._v("The dataset also contains the block percentile fee rate "),t("code",[e._v("q_k")]),e._v(", considering "),t("code",[e._v("r_i")]),e._v(" to be the rate of the "),t("code",[e._v("ith")]),e._v(" transaction in a block, "),t("code",[e._v("q_k")]),e._v(" is the fee rate value such that for each transaction in a block "),t("code",[e._v("r_i")]),e._v(" < "),t("code",[e._v("q_k")]),e._v(" returns the "),t("code",[e._v("k%")]),e._v(" transactions in the block that are paying lower fees.")]),e._v(" "),t("p",[e._v("Percentiles are not used to feed the model but to filter some outliers tx.\nRemoving this observations is controversial at best and considered cheating at worse. However, it should be considered that Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" doesn't even bother to give estimation for the next block, we think this is due to the fact that many transactions that are confirming in the next block are huge overestimation, or clearly errors like "),t("a",{attrs:{href:"https://blockstream.info/tx/33291156ab79e9b4a1019b618b0acfa18cbdf8fa6b71c43a9eed62a849b86f9a",target:"_blank",rel:"noopener noreferrer"}},[e._v("this one"),t("OutboundLink")],1),e._v(" we found when we started logging data.\nThese outliers are several for transactions confirming in the next block ("),t("code",[e._v("confirms_in=1")]),e._v("), less so for "),t("code",[e._v("confirms_in=2")]),e._v(", mostly disappeared for "),t("code",[e._v("confirms_in=3")]),e._v(" or more. It's counterintuitive that overestimation exists for "),t("code",[e._v("confirms_in>1")]),e._v(", by definition an overestimation is a fee rate way higher than needed, so how is possible that an overestimation doesn't enter the very next block? There are a couple of reasons why a block is discovered without containing a transaction with high fee rate:")]),e._v(" "),t("ul",[t("li",[e._v("network latency: my node saw the transaction but the miner didn't see that transaction yet,")]),e._v(" "),t("li",[e._v("block building latency: the miner saw the transaction, but didn't finish to rebuild the block template or decided it's more efficient to finish a cycle on the older block template.")])]),e._v(" "),t("p",[e._v("To keep the model balanced, when overestimation is filtered out, underestimation are filtered out as well. This also has the effect to remove some of the transactions possibly included because a fee is payed out-of-band.\nAnother reason to filter transactions is that the dataset is over-represented by transactions with low "),t("code",[e._v("confirms_in")]),e._v(": more than 50% of transactions get confirmed in the next block, so we think it's good to filter some of these transactions.")]),e._v(" "),t("p",[e._v("The applied filters are the following:")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("confirms_in")]),e._v(" "),t("th",[e._v("lower")]),e._v(" "),t("th",[e._v("higher")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("1")]),e._v(" "),t("td",[e._v("q45")]),e._v(" "),t("td",[e._v("q55")])]),e._v(" "),t("tr",[t("td",[e._v("2")]),e._v(" "),t("td",[e._v("q30")]),e._v(" "),t("td",[e._v("q70")])]),e._v(" "),t("tr",[t("td",[e._v("3")]),e._v(" "),t("td",[e._v("q1")]),e._v(" "),t("td",[e._v("q99")])])])]),e._v(" "),t("p",[e._v("Not yet convinced by the removal of these outliers? The "),t("a",{attrs:{href:"https://storage.googleapis.com/bitcoin_log/dataset_18.csv.gz",target:"_blank",rel:"noopener noreferrer"}},[e._v("dataset"),t("OutboundLink")],1),e._v(" contains all the observations, make your model 😃")]),e._v(" "),t("h4",{attrs:{id:"recap"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recap"}},[e._v("#")]),e._v(" Recap")]),e._v(" "),t("table",[t("thead",[t("tr",[t("th",[e._v("column")]),e._v(" "),t("th",[e._v("used in the model")]),e._v(" "),t("th",[e._v("description")])])]),e._v(" "),t("tbody",[t("tr",[t("td",[e._v("txid")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction hash, useful for debugging")])]),e._v(" "),t("tr",[t("td",[e._v("timestamp")]),e._v(" "),t("td",[e._v("converted")]),e._v(" "),t("td",[e._v("The time when the transaction has been added in the mempool, in the model is used in the form "),t("code",[e._v("day_of_week")]),e._v(" and "),t("code",[e._v("hour")])])]),e._v(" "),t("tr",[t("td",[e._v("current_height")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("The blockchain height seen by the node in this moment")])]),e._v(" "),t("tr",[t("td",[e._v("confirms_in")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("This transaction confirmed at block height "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate")]),e._v(" "),t("td",[e._v("target")]),e._v(" "),t("td",[e._v("This transaction fee rate measured in "),t("code",[e._v("[sat/vbytes]")])])]),e._v(" "),t("tr",[t("td",[e._v("fee_rate_bytes")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("fee rate in satoshi / bytes, used to check Bitcoin Core "),t("code",[e._v("estimatesmartfee")]),e._v(" predictions")])]),e._v(" "),t("tr",[t("td",[e._v("block_avg_fee")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("block average fee rate "),t("code",[e._v("[sat/vbytes]")]),e._v(" of block "),t("code",[e._v("current_height+confirms_in")])])]),e._v(" "),t("tr",[t("td",[e._v("core_econ")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("bitcoin "),t("code",[e._v("estimatesmartfee")]),e._v(" result for "),t("code",[e._v("confirms_in")]),e._v(" block target and in economic mode. Could be not available "),t("code",[e._v("?")]),e._v(" when a block is connected more recently than the estimation has been requested, estimation are requested every 10 secs.")])]),e._v(" "),t("tr",[t("td",[e._v("core_cons")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Same as above but with conservative mode")])]),e._v(" "),t("tr",[t("td",[e._v("mempool_len")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Sum of the mempool transactions with fee rate available (sum of every "),t("code",[e._v("a*")]),e._v(" field)")])]),e._v(" "),t("tr",[t("td",[e._v("parent_in_cpfp")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("It's 1 when the transaction has outputs that are spent in the same block in which the transaction is confirmed (they are parent in a CPFP relations).")])]),e._v(" "),t("tr",[t("td",[e._v("q1-q30-...")]),e._v(" "),t("td",[e._v("no")]),e._v(" "),t("td",[e._v("Transaction confirming fast could be outliers, usually paying a lot more than required, this percentiles are used to filter those transactions,")])]),e._v(" "),t("tr",[t("td",[e._v("a1-a2-...")]),e._v(" "),t("td",[e._v("yes")]),e._v(" "),t("td",[e._v("Contains the number of transaction in the mempool with known fee rate in the ith bucket.")])])])]),e._v(" "),t("p",[t("img",{attrs:{src:"/img/fee-estimation-for-light-clients/the-good-the-bad-the-ugly.jpg",alt:"The good, the bad and the ugly"}})]),t("div",{attrs:{align:"center"}},[e._v('My biological neural network fired this, I think it\'s because a lot of chapters start with "The"')]),e._v(" "),t("br"),t("br"),t("p"),e._v(" "),t("p",[e._v("In the previous "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"}},[e._v("Part 1")]),e._v(" we talked about the problem.")],1),e._v(" "),t("p",[e._v("In the following "),t("RouterLink",{attrs:{to:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"}},[e._v("Part 3")]),e._v(" we are going to talk about the model.")],1),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("In computer science temporal locality refers to the tendency to access recent data more often than older data. "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/62.f686b521.js b/assets/js/62.029da30e.js similarity index 99% rename from assets/js/62.f686b521.js rename to assets/js/62.029da30e.js index c1bc13305f..c25321d198 100644 --- a/assets/js/62.f686b521.js +++ b/assets/js/62.029da30e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{419:function(t,a,e){"use strict";e.r(a);var s=e(7),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v('This article should serve as a "getting started" guide for developers who are considering integrating BDK in their projects: it tries to introduce the reader to the basic concepts behind the library and some of its modules and components that can be used to build a very simple functioning Bitcoin wallet. All the information written in this article are valid for the latest '),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("published version"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"design-goals"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#design-goals"}},[t._v("#")]),t._v(" Design Goals")]),t._v(" "),a("p",[t._v("The main goal of the library is to be a solid foundation for Bitcoin wallets of any kind, on any platform: in practice, this means that the library should be:")]),t._v(" "),a("ul",[a("li",[t._v("Very "),a("em",[t._v("well-reviewed")]),t._v(" and tested")]),t._v(" "),a("li",[a("em",[t._v("Lightweight")]),t._v(", so that it can be used easily on mobile devices as well")]),t._v(" "),a("li",[a("em",[t._v("Extendable")]),t._v(", so that it can be adapted to perfectly suit different use-cases")]),t._v(" "),a("li",[a("em",[t._v("Generalized")]),t._v(", meaning that it supports different types of Bitcoin scripts and wallets through the use of "),a("a",{attrs:{href:"/descriptors"}},[t._v("descriptors")])]),t._v(" "),a("li",[a("em",[t._v("Reasonably easy")]),t._v(' to use, exposing a "high level" interface to the user and hiding all the complexity inside')])]),t._v(" "),a("p",[t._v("These goals have a direct impact on the design of the internal components of the library, and as a consequence on the APIs that are exposed to the final user, which might in some cases feel counter-intuitive at first.\nThroughout the article, we will try to focus on those points and try to explain them as best as we can.")]),t._v(" "),a("h2",{attrs:{id:"the-wallet-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#the-wallet-structure"}},[t._v("#")]),t._v(" The "),a("code",[t._v("Wallet")]),t._v(" Structure")]),t._v(" "),a("p",[t._v("The "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet")]),a("OutboundLink")],1),t._v(" structure is in many ways the heart of the library: it represents an instance of a wallet and exposes some APIs to perform all the typical operations one might want to do with a Bitcoin wallet, such as generating a new address, listing the transactions received, creating a transaction, etc.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("Wallet")]),t._v(" instance can be constructed given at least one "),a("a",{attrs:{href:"/descriptors"}},[t._v("descriptor")]),t._v(" which would be used to derive both "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/enum.KeychainKind.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("External")]),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/enum.KeychainKind.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Internal")]),a("OutboundLink")],1),t._v(" addresses, or two if one prefers to keep them separated. "),a("code",[t._v("External")]),t._v(" addresses are the ones returned by the generic "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html#method.get_address",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet::get_address()")]),a("OutboundLink")],1),t._v(" call, while "),a("code",[t._v("Internal")]),t._v(" addresses are generated internally to receive the change whenever a new transaction is created. But they can be generated on demand too using "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html#method.get_internal_address",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet::get_internal_address()")]),a("OutboundLink")],1),t._v(" call.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("Wallet")]),t._v(" also needs at least one other component to function properly, its "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Database")]),a("OutboundLink")],1),t._v(": it will be used as a "),a("em",[t._v("cache")]),t._v(" to store the list of transactions synchronized with the blockchain, the UTXOs, the addresses generated, and a few other things. It's important to note that the "),a("code",[t._v("Database")]),t._v(" will never store any secret. Securely storing keys is explicitly left to the user of the library to implement, mainly because there isn't really one good way to do it, that would work reliably on every platform. On\nmobile devices, for instance, the OS' keychain could be used, to allow unlocking the secrets with the use of biometric data (FaceID or fingerprint), while on desktop platform there isn't generally a similar framework available and the user would have to implement something that meets their needs. It's not excluded that in the future we could provide a \"reference implementation\" of secure multi-platform storage for keys, but that would very likely be released as a separate module outside of the "),a("code",[t._v("Wallet")]),t._v(" structure, or potentially even as a separate library that could be reused for other applications as well.")]),t._v(" "),a("p",[t._v("Going back to our "),a("code",[t._v("Wallet")]),t._v(": given a descriptor and a "),a("code",[t._v("Database")]),t._v(' we can build an "air-gapped" or "Offline" wallet. Basically, we can make a wallet that physically can\'t connect to the Bitcoin network. It will still be able to generate addresses and sign '),a("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSBTs"),a("OutboundLink")],1),t._v(", but with a greatly reduced attack surface because a sizable part of the code that handles the logic to synchronize with the network would be entirely omitted in the final executable binary.")]),t._v(" "),a("p",[t._v("This is how a "),a("code",[t._v("Wallet")]),t._v(" can be created. Notice that we are using "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/memory/struct.MemoryDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("MemoryDatabase")]),a("OutboundLink")],1),t._v(" as our "),a("code",[t._v("Database")]),t._v(". We'll get to that in a second.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("database"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),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("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition 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(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Box")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("dyn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("error"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),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("let")]),t._v(" external_descriptor "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/0/*)\"")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" internal_descriptor "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/1/*)\"")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n external_descriptor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("internal_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 class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token 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("Once we have our "),a("code",[t._v("Wallet")]),t._v(" instance we can generate a new address and print it out:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[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 class-name"}},[t._v("New")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Generated Address: {}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),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("Building and running this code will print out:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("Generated Address: tb1q7w0t936xp5p994qx506xj53gjdcmzjr2mkqghn\n")])])]),a("p",[t._v("Before we've talked about the benefits of an air-gapped wallet, but we should also talk about the disadvantages: the biggest one is the fact that it cannot create new transactions because it doesn't know which UTXOs belong to the wallet. To get this information we generally need to "),a("code",[t._v("sync")]),t._v(" with the network, but this wallet can't physically do that.")]),t._v(" "),a("p",[t._v("To fix this we can add one more component in our code: a "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" backend. In particular, we are going to use the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ElectrumBlockchain")]),a("OutboundLink")],1),t._v(" which syncs with an "),a("code",[t._v("Electrum")]),t._v(" server, and then we will use this blockchain to "),a("code",[t._v("sync")]),t._v(" our wallet database with current state of the network since that's available out of the box in BDK and is pretty fast.")]),t._v(" "),a("p",[t._v("We can update our code to look something like this:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("database"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("electrum_client"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("wallet"),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("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),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(",")]),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\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" client "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),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(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("client"),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("Specifically here, we create an "),a("code",[t._v("ElectrumBlockchain")]),t._v(" and connect to Blockstream's public Electrum Testnet servers over SSL.")]),t._v(" "),a("p",[t._v("Now, since we are running in the "),a("code",[t._v("Testnet")]),t._v(" network, we can try to get some funds from a faucet online to this address we've generated. Once we have an incoming transaction we can do the first "),a("code",[t._v("sync")]),t._v(" of our wallet.\nThis is again something that might seem counterintuitive at first: why do we have to manually ask the "),a("code",[t._v("Wallet")]),t._v(" to "),a("em",[t._v("sync")]),t._v(" itself? Can't it do it periodically in background? The answer is that yes, that would definitely be possible, but it would remove some control on what's happening inside the wallet from the user. This can be especially problematic on mobile platforms, where the OS tries very aggressively to suspend apps in background to save battery. Having a thread running and trying to make network requests while the app is in background would very likely cause errors or potentially crashes somewhere. So, for this reason this operation has to be performed manually, to allow the user to call that function only at the right time.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\nwallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("SyncOptions")]),t._v(" determines some sync time behaviors, like progress update, etc. For this case the "),a("code",[t._v("default")]),t._v(" sync option with no progress update is adequate. This will make queries to the Electrum server and store the list of transactions and UTXOs in our "),a("code",[t._v("Database")]),t._v(". In this case, we are using a "),a("code",[t._v("MemoryDatabase")]),t._v(", so those data are only going to be kept in RAM and dropped once our "),a("code",[t._v("Wallet")]),t._v(" is dropped. This is very useful for playing around and experimenting, but not so great for real-world wallets: for that, you can use "),a("a",{attrs:{href:"https://docs.rs/sled/",target:"_blank",rel:"noopener noreferrer"}},[t._v("sled"),a("OutboundLink")],1),t._v(" which is supported out of the box, or even use a custom database. More on that later!")]),t._v(" "),a("p",[t._v("So, now that we've synced with the blockchain we can create our first transaction. First of all, we will print out the balance of our wallet to make sure that our wallet has seen the incoming transaction. Then we will create the actual transaction and we will specify some flags using the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/tx_builder/index.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("TxBuilder")]),a("OutboundLink")],1),t._v(". To finish it off, we will ask the wallet to sign the transaction and then broadcast it to the network.")]),t._v(" "),a("p",[t._v("Right now we will not get into details of all the available options in "),a("code",[t._v("TxBuilder")]),t._v(' since that is definitely out of the scope of a "getting started" guide. For now, you can just imagine the builder as your way to tell the library how to build transactions. We\'ll come back to this in a future article.')]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Wallet balance in SAT: {}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" faucet_address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tx_builder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),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("\ntx_builder\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("faucet_address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),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("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("trusted_pending "),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("confirmed"),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 number"}},[t._v("2")]),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("enable_rbf")]),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("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tx_details"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tx_builder"),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("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transaction details: {:#?}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tx_details"),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("In this case, we are sending back half the balance to the faucet's address and we are also enabling RBF since the default fees are at 1 satoshi/vbyte. With RBF we will be able to "),a("em",[t._v("bump the fees")]),t._v(" of the transaction, should it get stuck in the mempool due to the low fee rate.")]),t._v(" "),a("p",[t._v("All that's left to do once we have our unsigned PSBT is to sign it:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 macro property"}},[t._v("assert!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("finalized"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Tx has not been finalized"')]),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 macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transaction Signed: {}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" finalized"),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 then broadcast it:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" raw_transaction "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("extract_tx")]),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("let")]),t._v(" txid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" raw_transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("txid")]),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("\nblockchain"),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("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("raw_transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transaction sent! TXID: {txid}.\\nExplorer URL: https://blockstream.info/testnet/tx/{txid}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n txid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" txid\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("h2",{attrs:{id:"custom-database-and-blockchain-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-database-and-blockchain-types"}},[t._v("#")]),t._v(" Custom Database and Blockchain types")]),t._v(" "),a("p",[t._v("We briefly mentioned before that for our example we used the "),a("code",[t._v("MemoryDatabase")]),t._v(", but that it could also be swapped for a different one: this is one example of the "),a("em",[t._v("modularity")]),t._v(" of BDK. By default, some database types are already implemented in the library, namely the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/memory/struct.MemoryDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("MemoryDatabase"),a("OutboundLink")],1),t._v(" which only keeps data in RAM, the "),a("a",{attrs:{href:"https://docs.rs/sled/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sled"),a("OutboundLink")],1),t._v(" database that can store data on a filesystem, and the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/struct.SqliteDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("SqliteDatabase"),a("OutboundLink")],1),t._v(" that can store data into a SQLite database. But since the "),a("code",[t._v("Database")]),t._v(" trait is public, users of the library can also implement different database types more suitable for their use-case.")]),t._v(" "),a("p",[t._v("The same is true for the "),a("code",[t._v("Blockchain")]),t._v(" types: the library provides (through the use of opt-in features) implementations for the "),a("code",[t._v("Electrum")]),t._v(", "),a("code",[t._v("Esplora")]),t._v(", "),a("code",[t._v("CompactFilters")]),t._v(" ("),a("em",[t._v("Neutrino")]),t._v(") and Bitcoin Core "),a("code",[t._v("rpc")]),t._v(" backends. Those again can also be\nswapped with custom types if the user desires to do so.")]),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("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 "),a("a",{attrs:{href:"/descriptors"}},[t._v("descriptors")]),t._v(" with multiple keys and/or timelocks, using external signers, etc.")]),t._v(" "),a("p",[t._v("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 "),a("a",{attrs:{href:"https://discord.gg/d7NkDKm",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord Community"),a("OutboundLink")],1),t._v(" to chat with us directly!")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{422:function(t,a,e){"use strict";e.r(a);var s=e(7),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("p",[t._v('This article should serve as a "getting started" guide for developers who are considering integrating BDK in their projects: it tries to introduce the reader to the basic concepts behind the library and some of its modules and components that can be used to build a very simple functioning Bitcoin wallet. All the information written in this article are valid for the latest '),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("published version"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"design-goals"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#design-goals"}},[t._v("#")]),t._v(" Design Goals")]),t._v(" "),a("p",[t._v("The main goal of the library is to be a solid foundation for Bitcoin wallets of any kind, on any platform: in practice, this means that the library should be:")]),t._v(" "),a("ul",[a("li",[t._v("Very "),a("em",[t._v("well-reviewed")]),t._v(" and tested")]),t._v(" "),a("li",[a("em",[t._v("Lightweight")]),t._v(", so that it can be used easily on mobile devices as well")]),t._v(" "),a("li",[a("em",[t._v("Extendable")]),t._v(", so that it can be adapted to perfectly suit different use-cases")]),t._v(" "),a("li",[a("em",[t._v("Generalized")]),t._v(", meaning that it supports different types of Bitcoin scripts and wallets through the use of "),a("a",{attrs:{href:"/descriptors"}},[t._v("descriptors")])]),t._v(" "),a("li",[a("em",[t._v("Reasonably easy")]),t._v(' to use, exposing a "high level" interface to the user and hiding all the complexity inside')])]),t._v(" "),a("p",[t._v("These goals have a direct impact on the design of the internal components of the library, and as a consequence on the APIs that are exposed to the final user, which might in some cases feel counter-intuitive at first.\nThroughout the article, we will try to focus on those points and try to explain them as best as we can.")]),t._v(" "),a("h2",{attrs:{id:"the-wallet-structure"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#the-wallet-structure"}},[t._v("#")]),t._v(" The "),a("code",[t._v("Wallet")]),t._v(" Structure")]),t._v(" "),a("p",[t._v("The "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet")]),a("OutboundLink")],1),t._v(" structure is in many ways the heart of the library: it represents an instance of a wallet and exposes some APIs to perform all the typical operations one might want to do with a Bitcoin wallet, such as generating a new address, listing the transactions received, creating a transaction, etc.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("Wallet")]),t._v(" instance can be constructed given at least one "),a("a",{attrs:{href:"/descriptors"}},[t._v("descriptor")]),t._v(" which would be used to derive both "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/enum.KeychainKind.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("External")]),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/enum.KeychainKind.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Internal")]),a("OutboundLink")],1),t._v(" addresses, or two if one prefers to keep them separated. "),a("code",[t._v("External")]),t._v(" addresses are the ones returned by the generic "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html#method.get_address",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet::get_address()")]),a("OutboundLink")],1),t._v(" call, while "),a("code",[t._v("Internal")]),t._v(" addresses are generated internally to receive the change whenever a new transaction is created. But they can be generated on demand too using "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/struct.Wallet.html#method.get_internal_address",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet::get_internal_address()")]),a("OutboundLink")],1),t._v(" call.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("Wallet")]),t._v(" also needs at least one other component to function properly, its "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Database")]),a("OutboundLink")],1),t._v(": it will be used as a "),a("em",[t._v("cache")]),t._v(" to store the list of transactions synchronized with the blockchain, the UTXOs, the addresses generated, and a few other things. It's important to note that the "),a("code",[t._v("Database")]),t._v(" will never store any secret. Securely storing keys is explicitly left to the user of the library to implement, mainly because there isn't really one good way to do it, that would work reliably on every platform. On\nmobile devices, for instance, the OS' keychain could be used, to allow unlocking the secrets with the use of biometric data (FaceID or fingerprint), while on desktop platform there isn't generally a similar framework available and the user would have to implement something that meets their needs. It's not excluded that in the future we could provide a \"reference implementation\" of secure multi-platform storage for keys, but that would very likely be released as a separate module outside of the "),a("code",[t._v("Wallet")]),t._v(" structure, or potentially even as a separate library that could be reused for other applications as well.")]),t._v(" "),a("p",[t._v("Going back to our "),a("code",[t._v("Wallet")]),t._v(": given a descriptor and a "),a("code",[t._v("Database")]),t._v(' we can build an "air-gapped" or "Offline" wallet. Basically, we can make a wallet that physically can\'t connect to the Bitcoin network. It will still be able to generate addresses and sign '),a("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSBTs"),a("OutboundLink")],1),t._v(", but with a greatly reduced attack surface because a sizable part of the code that handles the logic to synchronize with the network would be entirely omitted in the final executable binary.")]),t._v(" "),a("p",[t._v("This is how a "),a("code",[t._v("Wallet")]),t._v(" can be created. Notice that we are using "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/memory/struct.MemoryDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("MemoryDatabase")]),a("OutboundLink")],1),t._v(" as our "),a("code",[t._v("Database")]),t._v(". We'll get to that in a second.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("database"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressIndex")]),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("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition 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(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Box")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("dyn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("error"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),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("let")]),t._v(" external_descriptor "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/0/*)\"")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" internal_descriptor "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/0'/0'/1/*)\"")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n external_descriptor"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("internal_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 class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token 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("Once we have our "),a("code",[t._v("Wallet")]),t._v(" instance we can generate a new address and print it out:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[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 class-name"}},[t._v("New")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Generated Address: {}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),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("Building and running this code will print out:")]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[t._v("Generated Address: tb1q7w0t936xp5p994qx506xj53gjdcmzjr2mkqghn\n")])])]),a("p",[t._v("Before we've talked about the benefits of an air-gapped wallet, but we should also talk about the disadvantages: the biggest one is the fact that it cannot create new transactions because it doesn't know which UTXOs belong to the wallet. To get this information we generally need to "),a("code",[t._v("sync")]),t._v(" with the network, but this wallet can't physically do that.")]),t._v(" "),a("p",[t._v("To fix this we can add one more component in our code: a "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" backend. In particular, we are going to use the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/blockchain/electrum/struct.ElectrumBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ElectrumBlockchain")]),a("OutboundLink")],1),t._v(" which syncs with an "),a("code",[t._v("Electrum")]),t._v(" server, and then we will use this blockchain to "),a("code",[t._v("sync")]),t._v(" our wallet database with current state of the network since that's available out of the box in BDK and is pretty fast.")]),t._v(" "),a("p",[t._v("We can update our code to look something like this:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("database"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("electrum_client"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("wallet"),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("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),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(",")]),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\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" client "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Client")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),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(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("client"),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("Specifically here, we create an "),a("code",[t._v("ElectrumBlockchain")]),t._v(" and connect to Blockstream's public Electrum Testnet servers over SSL.")]),t._v(" "),a("p",[t._v("Now, since we are running in the "),a("code",[t._v("Testnet")]),t._v(" network, we can try to get some funds from a faucet online to this address we've generated. Once we have an incoming transaction we can do the first "),a("code",[t._v("sync")]),t._v(" of our wallet.\nThis is again something that might seem counterintuitive at first: why do we have to manually ask the "),a("code",[t._v("Wallet")]),t._v(" to "),a("em",[t._v("sync")]),t._v(" itself? Can't it do it periodically in background? The answer is that yes, that would definitely be possible, but it would remove some control on what's happening inside the wallet from the user. This can be especially problematic on mobile platforms, where the OS tries very aggressively to suspend apps in background to save battery. Having a thread running and trying to make network requests while the app is in background would very likely cause errors or potentially crashes somewhere. So, for this reason this operation has to be performed manually, to allow the user to call that function only at the right time.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\nwallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SyncOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("SyncOptions")]),t._v(" determines some sync time behaviors, like progress update, etc. For this case the "),a("code",[t._v("default")]),t._v(" sync option with no progress update is adequate. This will make queries to the Electrum server and store the list of transactions and UTXOs in our "),a("code",[t._v("Database")]),t._v(". In this case, we are using a "),a("code",[t._v("MemoryDatabase")]),t._v(", so those data are only going to be kept in RAM and dropped once our "),a("code",[t._v("Wallet")]),t._v(" is dropped. This is very useful for playing around and experimenting, but not so great for real-world wallets: for that, you can use "),a("a",{attrs:{href:"https://docs.rs/sled/",target:"_blank",rel:"noopener noreferrer"}},[t._v("sled"),a("OutboundLink")],1),t._v(" which is supported out of the box, or even use a custom database. More on that later!")]),t._v(" "),a("p",[t._v("So, now that we've synced with the blockchain we can create our first transaction. First of all, we will print out the balance of our wallet to make sure that our wallet has seen the incoming transaction. Then we will create the actual transaction and we will specify some flags using the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/wallet/tx_builder/index.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("TxBuilder")]),a("OutboundLink")],1),t._v(". To finish it off, we will ask the wallet to sign the transaction and then broadcast it to the network.")]),t._v(" "),a("p",[t._v("Right now we will not get into details of all the available options in "),a("code",[t._v("TxBuilder")]),t._v(' since that is definitely out of the scope of a "getting started" guide. For now, you can just imagine the builder as your way to tell the library how to build transactions. We\'ll come back to this in a future article.')]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("std"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("FromStr")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Wallet balance in SAT: {}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" faucet_address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tx_builder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),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("\ntx_builder\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("faucet_address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),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("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("trusted_pending "),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("confirmed"),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 number"}},[t._v("2")]),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("enable_rbf")]),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("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tx_details"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tx_builder"),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("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transaction details: {:#?}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tx_details"),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("In this case, we are sending back half the balance to the faucet's address and we are also enabling RBF since the default fees are at 1 satoshi/vbyte. With RBF we will be able to "),a("em",[t._v("bump the fees")]),t._v(" of the transaction, should it get stuck in the mempool due to the low fee rate.")]),t._v(" "),a("p",[t._v("All that's left to do once we have our unsigned PSBT is to sign it:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),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("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),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 macro property"}},[t._v("assert!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("finalized"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Tx has not been finalized"')]),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 macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transaction Signed: {}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" finalized"),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 then broadcast it:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Blockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" raw_transaction "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" psbt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("extract_tx")]),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("let")]),t._v(" txid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" raw_transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("txid")]),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("\nblockchain"),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("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("raw_transaction"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transaction sent! TXID: {txid}.\\nExplorer URL: https://blockstream.info/testnet/tx/{txid}"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n txid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" txid\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("h2",{attrs:{id:"custom-database-and-blockchain-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-database-and-blockchain-types"}},[t._v("#")]),t._v(" Custom Database and Blockchain types")]),t._v(" "),a("p",[t._v("We briefly mentioned before that for our example we used the "),a("code",[t._v("MemoryDatabase")]),t._v(", but that it could also be swapped for a different one: this is one example of the "),a("em",[t._v("modularity")]),t._v(" of BDK. By default, some database types are already implemented in the library, namely the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/memory/struct.MemoryDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("MemoryDatabase"),a("OutboundLink")],1),t._v(" which only keeps data in RAM, the "),a("a",{attrs:{href:"https://docs.rs/sled/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sled"),a("OutboundLink")],1),t._v(" database that can store data on a filesystem, and the "),a("a",{attrs:{href:"https://docs.rs/bdk/latest/bdk/database/struct.SqliteDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("SqliteDatabase"),a("OutboundLink")],1),t._v(" that can store data into a SQLite database. But since the "),a("code",[t._v("Database")]),t._v(" trait is public, users of the library can also implement different database types more suitable for their use-case.")]),t._v(" "),a("p",[t._v("The same is true for the "),a("code",[t._v("Blockchain")]),t._v(" types: the library provides (through the use of opt-in features) implementations for the "),a("code",[t._v("Electrum")]),t._v(", "),a("code",[t._v("Esplora")]),t._v(", "),a("code",[t._v("CompactFilters")]),t._v(" ("),a("em",[t._v("Neutrino")]),t._v(") and Bitcoin Core "),a("code",[t._v("rpc")]),t._v(" backends. Those again can also be\nswapped with custom types if the user desires to do so.")]),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("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 "),a("a",{attrs:{href:"/descriptors"}},[t._v("descriptors")]),t._v(" with multiple keys and/or timelocks, using external signers, etc.")]),t._v(" "),a("p",[t._v("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 "),a("a",{attrs:{href:"https://discord.gg/d7NkDKm",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord Community"),a("OutboundLink")],1),t._v(" to chat with us directly!")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/63.2b67542d.js b/assets/js/63.08ff5987.js similarity index 99% rename from assets/js/63.2b67542d.js rename to assets/js/63.08ff5987.js index dc4e3cd5fa..d4c977b08d 100644 --- a/assets/js/63.2b67542d.js +++ b/assets/js/63.08ff5987.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{422: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:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("To send people BTC - we simply scan a QR Code "),e("em",[t._v("(or paste an address)")]),t._v(", enter some amount and "),e("em",[t._v("whoosh")]),t._v(" - sent!\nUsers might think, just like traditional currency, we can only exchange money using Bitcoin.\nAs it so happens, the underlying technology Bitcoin supports specify outputs not as addresses, but as programming scripts.\nThis opens us to a world of possibilities using Bitcoin.")]),t._v(" "),e("h2",{attrs:{id:"script"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#script"}},[t._v("#")]),t._v(" Script")]),t._v(" "),e("p",[t._v("Bitcoin supports "),e("a",{attrs:{href:"https://en.bitcoin.it/wiki/Script",target:"_blank",rel:"noopener noreferrer"}},[t._v("Script"),e("OutboundLink")],1),t._v(", a "),e("strong",[t._v("stack-based")]),t._v(" lightweight programming language.\nAny script written in "),e("strong",[t._v("Script")]),t._v(" "),e("em",[t._v("(pun intended)")]),t._v(" contains "),e("code",[t._v("OP_*")]),t._v(" codes and raw byte arrays that Bitcoin Full Nodes understand and process.\nCurrently, there are "),e("code",[t._v("117")]),t._v(" op-codes in use.\nYou can read more about these op-codes straight "),e("a",{attrs:{href:"https://en.bitcoin.it/wiki/Script",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("Script is intentionally left "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Turing_completeness",target:"_blank",rel:"noopener noreferrer"}},[t._v("Turing incomplete"),e("OutboundLink")],1),t._v(" which is why there is no "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Halting_problem",target:"_blank",rel:"noopener noreferrer"}},[t._v("halting problem"),e("OutboundLink")],1),t._v(" with scripts.\nThere are no loops and overall, it's a very constrained programming language.")]),t._v(" "),e("p",[t._v("A transaction is considered valid only when the Script returns "),e("code",[t._v("true")]),t._v(" at the end of execution.\nOutput Script (aka scriptpubkey) define the conditions under which coins associated with them can be spent. To spend a particular coin implies finding an input script (aka scriptsig) such that a script made out of concatenation of "),e("code",[t._v("scriptsig + scriptpubkey")]),t._v(" evaluates to "),e("code",[t._v("true")]),t._v(".")]),t._v(" "),e("p",[t._v("For example, a basic legacy "),e("code",[t._v("Pay-to-PubKey-Hash")]),t._v(" transaction would look like:")]),t._v(" "),e("div",{staticClass:"language-script extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("scriptPubKey: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG\nscriptSig: \n")])])]),e("h4",{attrs:{id:"examples-of-things-achievable-using-bitcoin-script"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples-of-things-achievable-using-bitcoin-script"}},[t._v("#")]),t._v(" Examples of things achievable using Bitcoin Script:")]),t._v(" "),e("ol",[e("li",[e("code",[t._v("Pay Someone (p2pkh/p2wpkh)")]),t._v(" - A specific public key must sign to spend the coins.")]),t._v(" "),e("li",[e("code",[t._v("Escrow (2-of-3-multisig)")]),t._v(" - Two parties need to sign together to spend the coins.")]),t._v(" "),e("li",[e("code",[t._v("Vault (locked)")]),t._v(" - A specific key will not be able to spend the coins until a timeout but another master key will always be able to spend them.")]),t._v(" "),e("li",[e("code",[t._v("HTLC")]),t._v(" - The receiver needs disclose a secret before a timeout, else the coins are transferred back to the payee.")])]),t._v(" "),e("h4",{attrs:{id:"motivation-for-policies"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#motivation-for-policies"}},[t._v("#")]),t._v(" Motivation for Policies")]),t._v(" "),e("p",[t._v("Unfortunately, due to its low-level and unusual stack-based nature, Script is pretty hard to reason about and use.\nDespite being around since Bitcoin's creation, writing and understanding Script is not trivial.\nThis is why the scripts for the above few examples are pretty lengthy and might not make sense at the first glance.\nWhen writing a script, we would want to know that if the logic we wrote is "),e("strong",[t._v("correct")]),t._v(", "),e("strong",[t._v("optimal")]),t._v(" and "),e("strong",[t._v("efficient in size")]),t._v(" (use lower "),e("a",{attrs:{href:"https://en.bitcoin.it/wiki/Weight_units",target:"_blank",rel:"noopener noreferrer"}},[t._v("weight"),e("OutboundLink")],1),t._v(").")]),t._v(" "),e("p",[t._v("The community wanted an easy alternative way of writing Script that would create the most optimized Script code.\nThis gave rise to "),e("strong",[t._v("Miniscript")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"miniscript"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#miniscript"}},[t._v("#")]),t._v(" Miniscript")]),t._v(" "),e("p",[e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Miniscript"),e("OutboundLink")],1),t._v(" tackles the above problems head-on.\nIt is an expressive way to create policies on Bitcoin Scripts in a structured and simple fashion.\nUsing Miniscript, it's difficult to go wrong.")]),t._v(" "),e("p",[t._v("Another very important goal of Miniscript is to replace any key used in a policy with another policy.\nThis is important because people might have multiple keys and complicated timelocks in their existing setup.\nWhile signing a new policy, they would want to use their existing setup to also generate addresses for this new setup.\nThis is accomplished using something called "),e("strong",[t._v("Output Descriptors")]),t._v(" which we will get into in next section.")]),t._v(" "),e("p",[t._v("Miniscript compiler compiles a "),e("strong",[t._v("spending policy")]),t._v(" down to Miniscript.\nIt doesn't contain any signature, it's mainly a combinator language for designing spending conditions.\nYou can try out the compiler online by using "),e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/#:~:text=Policy%20to%20Miniscript%20compiler",target:"_blank",rel:"noopener noreferrer"}},[t._v("this link"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h4",{attrs:{id:"fragments"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#fragments"}},[t._v("#")]),t._v(" Fragments")]),t._v(" "),e("p",[t._v("Here are some fragments which can be combined to create powerful expressions.")]),t._v(" "),e("ol",[e("li",[e("code",[t._v("pk(key)")]),t._v(" - Specifies a given public key")]),t._v(" "),e("li",[e("code",[t._v("thresh(k, expr_1, expr_2, ..., expr_n)")]),t._v(" - Specifies k of n multisig using expressions.")]),t._v(" "),e("li",[e("code",[t._v("older(T)")]),t._v(" - Timelock for T blocks")]),t._v(" "),e("li",[e("code",[t._v("and(expr_1, expr_2)")]),t._v(" - Both expressions should evaluate to true.")]),t._v(" "),e("li",[e("code",[t._v("or(expr_1, expr_2)")]),t._v(" - Any one of the expressions should evaluate to true.")]),t._v(" "),e("li",[e("code",[t._v("aor(expr_1, expr_2)")]),t._v(" - Similar to "),e("code",[t._v("or")]),t._v(" but "),e("code",[t._v("expr_1")]),t._v(" has a more probability to evaluate to true.")])]),t._v(" "),e("p",[t._v("Bitcoin Script allows us to use another alternate stack. The combinator functions use this second stack to evaluate expressions of "),e("code",[t._v("thresh")]),t._v(", "),e("code",[t._v("and")]),t._v(", "),e("code",[t._v("aor")]),t._v(" and "),e("code",[t._v("or")]),t._v(".\nThe complete Miniscript Reference can be found "),e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/#:~:text=Miniscript%20reference",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h4",{attrs:{id:"example-policies"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-policies"}},[t._v("#")]),t._v(" Example Policies")]),t._v(" "),e("p",[t._v("Here are the Miniscript Policies for the examples we looked at earlier.\nNote "),e("code",[t._v("A")]),t._v(", "),e("code",[t._v("B")]),t._v(", "),e("code",[t._v("C")]),t._v(" are placeholders for keys "),e("em",[t._v("("),e("code",[t._v("xpub")]),t._v("/"),e("code",[t._v("xprv")]),t._v(")")]),t._v(" involved in the tx.\nDescriptors are high level description of scriptpubkey (p2pkh, p2sh etc).\nAnd miniscripts are semantics that describes the actual redeemscript.\nIn general you have Descriptor(Miniscript) format.")]),t._v(" "),e("ol",[e("li",[t._v("Pay A (pay-to-public-key)")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("pk(A)\n")])])]),e("ol",{attrs:{start:"2"}},[e("li",[t._v("Escrow Account between A, B and third-party C.")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("thresh(2,pk(A),pk(B),pk(C))\n")])])]),e("ol",{attrs:{start:"3"}},[e("li",[t._v("Vault for A time-locked for T blocks with B as the master key.")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("aor(and(pk(A),time(T)),pk(B))\n")])])]),e("ol",{attrs:{start:"4"}},[e("li",[t._v("HTLC payment to B, which, if unspent for T blocks, returns to A.")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("aor(and(pk(A),time(T)),and(pk(B),hash(H))))\n")])])]),e("p",[t._v("The Miniscript Policy Compiler is written in Rust and is present in "),e("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[t._v("this repository"),e("OutboundLink")],1),t._v(".\nIn this blog, we will later use the same using "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[t._v("bitcoindevkit/bdk"),e("OutboundLink")],1),t._v(", a lightweight descriptor-based wallet library\nwith a "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("cli"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#descriptors"}},[t._v("#")]),t._v(" Descriptors")]),t._v(" "),e("p",[t._v('The Bitcoin scriptpubkey supports various schemes like P2PKH, P2SH, P2WPKH, P2TR (Segwit v1) etc.\nA Descriptor is a simple "description" of what scriptpubkey to be used for a given policy.\nIt can inclue a single pubkey within itself, or an entire miniscript policy.\nOn the other hand, Miniscript policies are used to derive the redeemscript (the actual executable script), whereas the descriptor describes how the redeemscript will be encumbered within the scriptpubkey.')]),t._v(" "),e("p",[t._v('In other words, a descriptor "describes" the procedure to create an '),e("em",[t._v("address")]),t._v(", given a "),e("em",[t._v("spending condition")]),t._v(".")]),t._v(" "),e("p",[t._v("They make it easier to deal with Multisig or complicated key setups.\nDescriptors are super portable and can be easily used by any wallet to determine the list of all addresses that can be generated from the same.\nThis feature creates a common stage for all Bitcoin apps and software.")]),t._v(" "),e("p",[t._v("The concept of descriptor came into existence in 2018 and since then, a lot of wallets have added support for descriptors.\nYou can read the descriptor doc from "),e("code",[t._v("bitcoin-core")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v('According to Bitcoin Core, Output Descriptors are "a simple language which can be used to describe collections of output scripts".\nThey bring in themselves, derivation paths, master xpub/xprv fingerprints and paths to generate addresses from.\nLet\'s understand this with an example of an Output Descriptor:')]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("\nDescriptor: pkh([d34db33f/44'/0'/0']xpub6ERaJH[...]LJRcEL/1/*)#ml40v0wf\n <1> <--------2---------\x3e<----------3---------\x3e<4> <---5---\x3e\n\nSections:\n1 - address type specifier (here, describing P2PK type addresses)\n2 - master key fingerprint and derivation path from master\n3 - xpub at m/44'/0'/0\n4 - path to deriving keys/addresses at\n5 - checksum for the descriptor\n")])])]),e("p",[t._v("A descriptor have three parts:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("address type specifier")]),t._v(" (item 1) : describes the type of address created by this descriptor.")]),t._v(" "),e("li",[e("em",[t._v("policy")]),t._v(" : the spending condition that locks funds into this address.")]),t._v(" "),e("li",[e("em",[t._v("checksum")]),t._v(" : for quick verification.")])]),t._v(" "),e("p",[t._v("The address type specifiers currently supported are "),e("code",[t._v("pk")]),t._v(", "),e("code",[t._v("pkh")]),t._v(", "),e("code",[t._v("sh")]),t._v(", "),e("code",[t._v("wpkh")]),t._v(", "),e("code",[t._v("wsh")]),t._v(" for corresponding address type and recently added "),e("code",[t._v("tr")]),t._v(" for taproot addresses.")]),t._v(" "),e("p",[t._v("There is a special address specifier called "),e("code",[t._v("combo")]),t._v(" that creates addresses of all types from spending policy policy.")]),t._v(" "),e("p",[t._v("After the address specifier, comes the "),e("em",[t._v("policy")]),t._v(' that describes how the funds in the address can be spent. The descriptor\nabove in the example has a simple spending policy of "spend by the correct private key". There can be more complicated policies,\nand we will touch them in later sections.')]),t._v(" "),e("p",[e("code",[t._v("multi")]),t._v(" is a special keyword that can be used as both "),e("em",[t._v("address type")]),t._v(" and "),e("em",[t._v("policy")]),t._v(".\nWhen used as an "),e("em",[t._v("address type")]),t._v(" like "),e("code",[t._v("multi(...)")]),t._v(", it will create an address from the raw multisig scriptpubkey.\nWhile when used as a "),e("em",[t._v("policy")]),t._v(" like "),e("code",[t._v("wsh(multi(...))")]),t._v(" it will create that specific address type from the multisig script.\nOf course we cannot use "),e("code",[t._v("pk(multi(...))")]),t._v(", "),e("code",[t._v("pkh(multi(...))")]),t._v(" or "),e("code",[t._v("wpkh(multi(...))")]),t._v(", because these address types cannot hold scripts (any scripts) inside them.")]),t._v(" "),e("p",[t._v("For example a descriptor like "),e("code",[t._v("wsh(multi(2, PKA, PKB, PKC))")]),t._v(" describes a P2WSH type address created by a "),e("code",[t._v("2-of-3")]),t._v(" multisig\nscript using "),e("code",[t._v("PKA")]),t._v(", "),e("code",[t._v("PKB")]),t._v(" and "),e("code",[t._v("PKC")]),t._v(" pubkeys.")]),t._v(" "),e("h2",{attrs:{id:"where-it-all-comes-together"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#where-it-all-comes-together"}},[t._v("#")]),t._v(" Where it all comes together...")]),t._v(" "),e("p",[t._v("In this section, we are going to make a descriptor-based wallet and derive addresses from "),e("code",[t._v("bitcoin-cli")]),t._v(" and then use "),e("code",[t._v("bdk-cli")]),t._v(" to confirm that the addresses generated for descriptor wallets are deterministic for a given descriptor.")]),t._v(" "),e("p",[t._v("We will also try to create a vault miniscript policy and push funds to the vault with a lock time of 2 months.\nDuring this time, we will try to break our vault and see our transactions failing.")]),t._v(" "),e("h4",{attrs:{id:"tools-and-armor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tools-and-armor"}},[t._v("#")]),t._v(" Tools and Armor")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://docs.docker.com/engine/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("docker"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/compiler/#installation",target:"_blank",rel:"noopener noreferrer"}},[t._v("miniscriptc"),e("OutboundLink")],1)])]),t._v(" "),e("h4",{attrs:{id:"setting-up"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),e("p",[t._v("We require "),e("code",[t._v("bitcoind")]),t._v(" to run in "),e("code",[t._v("regtest")]),t._v(" mode. Use the following config file, or any other config\nthat you are familiar with.")]),t._v(" "),e("div",{staticClass:"language-txt extra-class"},[e("pre",{pre:!0,attrs:{class:"language-txt"}},[e("code",[t._v("regtest=1\nfallbackfee=0.0001\nserver=1\n\nrpcuser=user\nrpcpassword=password\n")])])]),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Start Bitcoin Core")]),t._v("\nbitcoind\n")])])]),e("h3",{attrs:{id:"keys-and-generating-addresses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#keys-and-generating-addresses"}},[t._v("#")]),t._v(" Keys and Generating Addresses")]),t._v(" "),e("p",[t._v("Quick installation for "),e("code",[t._v("bdk-cli")]),t._v(" and "),e("code",[t._v("miniscriptc")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[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("rpc,compiler\n"),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 "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compiler"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--example")]),t._v(" miniscriptc\n")])])]),e("p",[t._v("Let us first generate an XPRV and create the wpkh wallet descriptor")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("EX_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh('),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$XPRV")]),t._v("/86'/1'/0'/0/*)\"")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("EX_DESC_CS")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("elcli getdescriptorinfo $EX_DESC "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.checksum'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("EX_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#$EX_DESC_CS")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Set this descriptor in a wallet in bitcoin-cli")]),t._v("\nbitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-named")]),t._v(" createwallet "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("wallet_name")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mywallet"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("descriptors")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("true\nbitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rpcwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mywallet"')]),t._v(" importdescriptors "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[{'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("desc"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(", "),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("timestamp"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("now"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(", "),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("active"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(": true, "),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("range"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(': [0,100]}]"')]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("echo")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),t._v("\n")])])]),e("p",[t._v("It should look something like this:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("wpkh(tprv8ZgxMBicQKsPeuazF16EdPZw84eHj55AU8ZKgZgdhu3sXcHnFgjzskfDvZdTaAFHYNCbKqrurFo9onSaT7zGT1i3u3j7LKhVZF5sJA39WPN/86'/1'/0'/0/*)#40hv8z77\n")])])]),e("p",[t._v("Now, we will generate 10 addresses using "),e("code",[t._v("bitcoin-cli")]),t._v(" and thereafter "),e("code",[t._v("bdk-cli")]),t._v(" using this above descriptor.\nNotice how both of them output the same set of addresses.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generation via bdk-cli")]),t._v("\nrepeat "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-n")]),t._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--descriptor")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-w")]),t._v(" mywallet get_new_address "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".address"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nbcrt1qc9wzxf8pthyexl00m23ug92pqrthagnzzf33wp\nbcrt1qgnh7e72q92fqujwg3qxlg5kplxkm6rep0nerur\nbcrt1qea6r8yvd0peupk29p94wm0xasvydgdsnyzkhez\nbcrt1qm99230tpqflq0f8kpkn5d2tee02hgqcsw5sd99\nbcrt1qd0afjfnl5udrsfkrj72rl34pss34yluma752qv\nbcrt1qj2aymplrzxcp4m7vcxrzq93g58pmgm4fpluesy\nbcrt1q4p4k63xglftez0h8yc7d4kmhsn5j5kecguu34j\nbcrt1q29z2uanskweur7qrzr43gyv3l028s0pnd9ptvp\nbcrt1qkzpeqz8sd73sucfythjxftez0e3ee30yhp9w67\nbcrt1qptwd6ggy8ttryck2f6yjf4la68apruc3fs7elz\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generation via bitcoin-cli")]),t._v("\nrepeat "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rpcwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mywallet"')]),t._v(" getnewaddress "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nbcrt1qc9wzxf8pthyexl00m23ug92pqrthagnzzf33wp\nbcrt1qgnh7e72q92fqujwg3qxlg5kplxkm6rep0nerur\nbcrt1qea6r8yvd0peupk29p94wm0xasvydgdsnyzkhez\nbcrt1qm99230tpqflq0f8kpkn5d2tee02hgqcsw5sd99\nbcrt1qd0afjfnl5udrsfkrj72rl34pss34yluma752qv\nbcrt1qj2aymplrzxcp4m7vcxrzq93g58pmgm4fpluesy\nbcrt1q4p4k63xglftez0h8yc7d4kmhsn5j5kecguu34j\nbcrt1q29z2uanskweur7qrzr43gyv3l028s0pnd9ptvp\nbcrt1qkzpeqz8sd73sucfythjxftez0e3ee30yhp9w67\nbcrt1qptwd6ggy8ttryck2f6yjf4la68apruc3fs7elz\n")])])]),e("p",[t._v("Notes:")]),t._v(" "),e("ul",[e("li",[t._v("The "),e("code",[t._v("repeat n {}")]),t._v(" syntax will only work in "),e("code",[t._v("zsh")]),t._v(", you can use other loops for your shell, or just manually repeat the code 10 times.")]),t._v(" "),e("li",[t._v("In case you get different outputs in either of the cases, try deleting "),e("code",[t._v("~/.bdk-bitcoin")]),t._v(" and retrying (thanks "),e("a",{attrs:{href:"https://twitter.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("@Steve"),e("OutboundLink")],1),t._v(" for this tip!)")])]),t._v(" "),e("p",[t._v("Note that both "),e("code",[t._v("bdk-cli")]),t._v(" and "),e("code",[t._v("bitcoin-cli")]),t._v(" produced the exact same addresses. So now we have definitive proof that descriptors can make wallets portable. That single string will be able to make any wallet generate the same set of addresses and hence they can sync and broadcast transactions in the same manner!")]),t._v(" "),e("h3",{attrs:{id:"making-a-multisig-descriptor-for-funds"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#making-a-multisig-descriptor-for-funds"}},[t._v("#")]),t._v(" Making a MultiSig Descriptor for Funds")]),t._v(" "),e("p",[t._v("In the real-life, most of us hold two kinds of savings accounts - one to store huge funds saved throughout our lifetime "),e("em",[t._v("(probably without internet banking functionalities)")]),t._v("\nand another for regular expenses.")]),t._v(" "),e("p",[t._v("In the Bitcoin world, to store huge funds, most people prefer to use a Multisig descriptor with a "),e("code",[t._v("2-of-3")]),t._v(" or "),e("code",[t._v("3-of-4")]),t._v(" setup.\nThey can have one key stored in their PC, one key stored in a hardware wallet, one key stored in writing in a secure vault and another key learnt by heart.\nIn case of a mishap like a house burning on fire or permanent memory loss, they would still be able to recover their funds by using the other keys.")]),t._v(" "),e("p",[t._v("Here's how a secure "),e("code",[t._v("2-of-3")]),t._v(" descriptor generation would look like:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xprv generation")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K2_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K3_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xpub generation")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $K1_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K2_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $K2_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K3_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $K3_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Descriptors for each key - Since we used BIP-84 generation paths for xpubs,")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# we need to append the same to the xprvs so that our wallet can understand ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# which path to generate addresses and xpubs from")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wsh(multi(2,'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_XPRV")]),t._v("/84'/1'/0'/0/*,"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K2_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K3_XPUB")]),t._v('))"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K2_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wsh(multi(2,'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K2_XPRV")]),t._v("/84'/1'/0'/0/*,"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K3_XPUB")]),t._v('))"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K3_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wsh(multi(2,'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K2_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K3_XPRV")]),t._v("/84'/1'/0'/0/*))\"")]),t._v("\n")])])]),e("p",[t._v("Lets create three bdk wallets aliases with above descriptors for easy future use\nand do initial sync to create the wallet files")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("k1wallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w K1 -d $K1_DESC'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("k2wallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w K2 -d $K2_DESC'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("k3wallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w K3 -d $K3_DESC'")]),t._v("\n\nk1wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk2wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk3wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("p",[t._v("Now, let us send some funds to an address generated by "),e("code",[t._v("k1wallet")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('# ask regtest to generate 101 blocks, so we get 50 regtest coins to play with.\n# because coinbase amounts are only spendable after 100 blocks, we generate\n# 101 blocks, to use the first block\'s coinbase amount.\nCORE_ADDR=$(bitcoin-cli getnewaddress)\nbitcoin-cli generatetoaddress 101 $CORE_ADDR\nbitcoin-cli getbalance\n50.00000000\n\n# And then send 10 btc to an address generated by `K1` descriptor\nBDK_ADDR=$(k1wallet get_new_address | jq -r ".address")\nbitcoin-cli -rpcwallet=mywallet sendtoaddress $BDK_ADDR 10\n\n# Confirm the transaction by creating one more block\nbitcoin-cli generatetoaddress 1 $CORE_ADDR\n')])])]),e("p",[t._v("Now sync the wallets and check balances in each")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("k1wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk1wallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nk2wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk2wallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nk3wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk3wallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Everyone has the same amount of balance.\nThis happened because it was a multisig wallet.\nNow, let's try to spend some balance.\nWe will give back some balance to the wallet maintained by "),e("code",[t._v("bitcoin-cli")]),t._v(".\nBut remember, this is a "),e("code",[t._v("2-of-3")]),t._v(" multisig wallet.\nThat's why we will need at least two keys to sign to make a transaction.")]),t._v(" "),e("p",[t._v("Here's where we will require to use a "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSBT"),e("OutboundLink")],1),t._v(" or a "),e("em",[t._v("partially signed bitcoin transaction")]),t._v(".\nBitcoin uses PSBTs as the standard protocol to create a transaction and add one or more signatures to it before broadcasting the same to\nthe network which finally can become a proper valid "),e("em",[t._v("transaction")]),t._v(".")]),t._v(" "),e("p",[t._v("We will aks "),e("code",[t._v("k2wallet")]),t._v(" to create and sign the transaction then "),e("code",[t._v("k1wallet")]),t._v(" and "),e("code",[t._v("k3wallet")]),t._v(" will co-sign it.\nNote that "),e("code",[t._v("k2wallet")]),t._v(" even if it creates the transaction, doesn't need to sign it, because its a "),e("code",[t._v("2-of-3")]),t._v(" multisig!")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# create the transaction, can be started by anyone")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("k2wallet create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--to")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v(':100000000"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sign the transaction by K1 and look at the output")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# it should say the psbt is not finalized since only one party has signed")]),t._v("\nk1wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PSBT")]),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('"is_finalized"')]),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('"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('"[...]"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Saving the PSBT signed by K1")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("k1wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sign by K3 - should be finalized this time")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Notice that this time, the input psbt was the signed PSBT of K1")]),t._v("\nk3wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_SIGNED_PSBT")]),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('"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('"[...]"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Saving the PSBT signed by K3")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("k3wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $K1_SIGNED_PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Broadcast the transaction, again doesn't really matter who broadcasts")]),t._v("\nk2wallet broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$SIGNED_PSBT")]),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('"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('"49e2706fc73c49605692bf1b9ce58baf1eb0307ea39b3118628994fd56c9b642"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Confirm the transaction by generating one block")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sync and check balance - it should have gone down by 100000000 + tx fees")]),t._v("\nk1wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),t._v("\nk1wallet get_balance\n"),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 number"}},[t._v("899999810")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Check similarly for `k2wallet` and `k3wallet` and they should all have same balance")]),t._v("\n")])])]),e("p",[t._v("So this proves we can definitely do transactions with multisig wallets with complicated descriptors.\nSince for Bitcoin, having keys equal having access to the accounts, we need to keep our keys safe.\nFor legacy single key wallets, we used to keep backups of the mnemonic codes in multiple places.\nIt was pretty insecure because in case any one of those backups leaks, our entire account would be compromised.\nComplicated multisig wallet descriptors are definitely a step forward - just in case a single key leak or are lost, no one would be able to take charge of the funds we hold.")]),t._v(" "),e("p",[t._v("Another problem with multisig was syncing between wallets to always create consistent addresses. How would\none wallet know whats the next address to create without talking to other wallets? The answer is "),e("code",[t._v("descriptors + PSBT")]),t._v(".\nIf all the wallet shares the correct descriptor string they will always create the exact sequence of addresses and\nby passing around PSBTs they would know how to sign them, without talking to each other. This solves a major problem of multisig interoperability. And BDK makes this process as seamless as possible.")]),t._v(" "),e("h2",{attrs:{id:"retention-bonus-smart-contract-with-bitcoin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#retention-bonus-smart-contract-with-bitcoin"}},[t._v("#")]),t._v(" Retention Bonus - Smart Contract with Bitcoin")]),t._v(" "),e("p",[t._v("Let us consider that a company wants to give its employees a retention bonus for two months.\nIf an employee stays with that company for over 2 months, the employee would get 1 BTC as a reward.\nThis would be a smart contract between the company and an employee.\nThe employee should be able to see that he would get his funds after two months.\nThe company would require confidence that the employee would not be able to withdraw the reward before two months have passed.")]),t._v(" "),e("p",[t._v("The Miniscript policy for this contract would be as follows:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("or(99@and(pk(E),older(8640)),pk(C))\n")])])]),e("p",[t._v("where "),e("code",[t._v("E")]),t._v(" is the employee and "),e("code",[t._v("C")]),t._v(" is the company.")]),t._v(" "),e("p",[t._v("I should emphasize over here that this policy will let the company still transfer funds after the designated 2 months.\nIt's not possible to block them after the lock time has passed, atleast not in a single policy.")]),t._v(" "),e("p",[t._v("Surely, after two months, the funds can be unlocked by the employee but before that, the company can revoke the funds.\nLet us compile this policy down to a descriptor. And this time we will ask help from the "),e("code",[t._v("miniscript")]),t._v(" program.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# The Descriptor will be on the log, the E and C are placeholders")]),t._v("\nminiscriptc "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"or(99@and(pk(E),older(8640)),pk(C))"')]),t._v(" sh-wsh\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2021")]),t._v("-08-05T12:25:40Z INFO miniscriptc"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" Compiling policy: or"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("99")]),t._v("@and"),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("E"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",older"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8640")]),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("C"),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 number"}},[t._v("2021")]),t._v("-08-05T12:25:40Z INFO miniscriptc"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(". Descriptor: sh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wsh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("andor"),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("E"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",older"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8640")]),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("C"),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 comment"}},[t._v("#55wzucxa")]),t._v("\nError: Descriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Miniscript"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Unexpected"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Key too short (<66 char), doesn\'t match any format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("So the compiled descriptor is")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("sh(wsh(andor(pk(E),older(8640),pk(C))))\n")])])]),e("p",[t._v("Let's make the keys, generate addresses using the above descriptor and fund it.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xprvs")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xpubs")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $E_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $C_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# descriptors using the compiled miniscript")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# please note in case company or the employee was using a complicated multisig descriptor,")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# it may as well have been added here like we did in the example before")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sh(wsh(andor(pk('),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$E_XPRV")]),t._v("/84'/1'/0'/0/*),older(8640),pk("),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$C_XPUB")]),t._v('))))"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sh(wsh(andor(pk('),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$E_XPUB")]),t._v("),older(8640),pk("),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$C_XPRV")]),t._v("/84'/1'/0'/0/*))))\"")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create wallet aliases for easy access and sync the wallet to create initial wallet files")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("Cwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w C -d $C_DESC'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("Ewallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w E -d $E_DESC'")]),t._v("\n\nCwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nEwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get some funds in Cwallet's address")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_ADDR")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Cwallet get_new_address "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".address"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\nbitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rpcwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("mywallet sendtoaddress "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$C_ADDR")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Confirm the transaction")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sync and check balance")]),t._v("\nCwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nCwallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Just as before, the employe can also see the fund in their wallet")]),t._v("\nEwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nEwallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("According to the spending policy, for "),e("code",[t._v("E")]),t._v(" has to wait for 8640 blocks before he can spend the coins.\nBut let's check what happens if "),e("code",[t._v("E")]),t._v(" tries to transact before the designated 2 months anyway.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# address to send the transaction to")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_ADDR")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet getnewaddress "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".address"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get external_policy id - this identifies which policy the wallet will try to sign against")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("POLICY_ID")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet policies "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".external | .id"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# create the tx (external_policy id from last step in my case is j7ncy3au")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--to")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$E_ADDR")]),t._v(':100000000"')]),t._v(" "),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('\\"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$POLICY_ID")]),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(':[0]}"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# sign and save the signed psbt")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# now let's try to broadcast - and see it failing")]),t._v("\nEwallet broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$SIGNED_PSBT")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2021")]),t._v("-08-05T17:48:45Z ERROR bdk_cli"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" Electrum"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Protocol"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object"),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 string"}},[t._v('"code"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" Number"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(", "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" String"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sendrawtransaction RPC error: {'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("code"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":-26,"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("message"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("non-BIP68-final"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),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("))")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("We get an error saying the transaction we sent is "),e("strong",[t._v("Not BIP68 Final")]),t._v(".\n"),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP68"),e("OutboundLink")],1),t._v(" is a relative lock-time specification that ensures consensus when a signed transaction is sent which is invalid at a given time because the lock time isn't passed.\nSo that's an expected error.")]),t._v(" "),e("p",[t._v("Now let's simulate two months passing and retry.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# simulate two months")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# this will take around 1 mins to complete")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8640")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# create, sign and broadcast tx")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--to")]),t._v(" $E_ADDR:100000000 "),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('\\"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$POLICY_ID")]),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(':[0]}"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\nEwallet broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$SIGNED_PSBT")]),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('"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('"2a0919bb3ce6e26018698ad1169965301a9ceab6d3da2a3dcb41343dc48e0dba"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Confirm the transaction")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sync and check balances")]),t._v("\nCwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nCwallet get_balance\n"),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 number"}},[t._v("999999810")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nEwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nEwallet get_balance\n"),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 number"}},[t._v("999999810")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("So this time it worked, because we have simulated 2 months passing by generating 8640 blocks. And both the Company\nand Employe wallet gets updated.\nHence, we saw that we can generate some smart contracts using Bitcoin.")]),t._v(" "),e("h2",{attrs:{id:"inspirations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inspirations"}},[t._v("#")]),t._v(" Inspirations")]),t._v(" "),e("ol",[e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Descriptors from Bitcoin Core"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript",target:"_blank",rel:"noopener noreferrer"}},[t._v("Miniscript"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors",target:"_blank",rel:"noopener noreferrer"}},[t._v("Output Script Descriptors"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoindevkit.org/descriptors",target:"_blank",rel:"noopener noreferrer"}},[t._v("Descriptors in Bitcoin Dev Kit"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoindevkit.org/blog/2020/11/descriptors-in-the-wild/#the-role-of-descriptors",target:"_blank",rel:"noopener noreferrer"}},[t._v("Role of Descriptors"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://gist.github.com/notmandatory/483c7edd098550c235da75d5babcf255",target:"_blank",rel:"noopener noreferrer"}},[t._v("Making a Taproot Descriptor Wallet using bitcoin-cli"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://www.youtube.com/watch?v=XM1lzN4Zfks",target:"_blank",rel:"noopener noreferrer"}},[t._v("Miniscripts SBC '19 - Video"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://www.youtube.com/watch?v=xC25NzIjzog",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rethinking Wallet Architecture: Native Descriptor Wallets - Video"),e("OutboundLink")],1)])]),t._v(" "),e("p",[t._v("Special thanks to my mentor "),e("a",{attrs:{href:"https://twitter.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("Steve Myers"),e("OutboundLink")],1),t._v(" for the constant motivation and support he gave me and for clearing so many doubts!\nImmense thanks to "),e("a",{attrs:{href:"https://github.com/rajarshimaitra",target:"_blank",rel:"noopener noreferrer"}},[t._v("Raj"),e("OutboundLink")],1),t._v(" for reviewing this blog and giving such detailed suggestions.\nMany of the lines added here are his.\nAlso, thanks to the folks at the "),e("code",[t._v("#miniscript")]),t._v(" IRC channel to help me out with the Retention Bonus policy.")]),t._v(" "),e("p",[t._v("This blog was written during "),e("a",{attrs:{href:"https://summerofbitcoin.org",target:"_blank",rel:"noopener noreferrer"}},[t._v("Summer of Bitcoin 2021"),e("OutboundLink")],1),t._v(" by "),e("a",{attrs:{href:"https://twitter.com/@sandipndev",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sandipan Dey"),e("OutboundLink")],1),t._v(".")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{419: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:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[t._v("To send people BTC - we simply scan a QR Code "),e("em",[t._v("(or paste an address)")]),t._v(", enter some amount and "),e("em",[t._v("whoosh")]),t._v(" - sent!\nUsers might think, just like traditional currency, we can only exchange money using Bitcoin.\nAs it so happens, the underlying technology Bitcoin supports specify outputs not as addresses, but as programming scripts.\nThis opens us to a world of possibilities using Bitcoin.")]),t._v(" "),e("h2",{attrs:{id:"script"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#script"}},[t._v("#")]),t._v(" Script")]),t._v(" "),e("p",[t._v("Bitcoin supports "),e("a",{attrs:{href:"https://en.bitcoin.it/wiki/Script",target:"_blank",rel:"noopener noreferrer"}},[t._v("Script"),e("OutboundLink")],1),t._v(", a "),e("strong",[t._v("stack-based")]),t._v(" lightweight programming language.\nAny script written in "),e("strong",[t._v("Script")]),t._v(" "),e("em",[t._v("(pun intended)")]),t._v(" contains "),e("code",[t._v("OP_*")]),t._v(" codes and raw byte arrays that Bitcoin Full Nodes understand and process.\nCurrently, there are "),e("code",[t._v("117")]),t._v(" op-codes in use.\nYou can read more about these op-codes straight "),e("a",{attrs:{href:"https://en.bitcoin.it/wiki/Script",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("Script is intentionally left "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Turing_completeness",target:"_blank",rel:"noopener noreferrer"}},[t._v("Turing incomplete"),e("OutboundLink")],1),t._v(" which is why there is no "),e("a",{attrs:{href:"https://en.wikipedia.org/wiki/Halting_problem",target:"_blank",rel:"noopener noreferrer"}},[t._v("halting problem"),e("OutboundLink")],1),t._v(" with scripts.\nThere are no loops and overall, it's a very constrained programming language.")]),t._v(" "),e("p",[t._v("A transaction is considered valid only when the Script returns "),e("code",[t._v("true")]),t._v(" at the end of execution.\nOutput Script (aka scriptpubkey) define the conditions under which coins associated with them can be spent. To spend a particular coin implies finding an input script (aka scriptsig) such that a script made out of concatenation of "),e("code",[t._v("scriptsig + scriptpubkey")]),t._v(" evaluates to "),e("code",[t._v("true")]),t._v(".")]),t._v(" "),e("p",[t._v("For example, a basic legacy "),e("code",[t._v("Pay-to-PubKey-Hash")]),t._v(" transaction would look like:")]),t._v(" "),e("div",{staticClass:"language-script extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("scriptPubKey: OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG\nscriptSig: \n")])])]),e("h4",{attrs:{id:"examples-of-things-achievable-using-bitcoin-script"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#examples-of-things-achievable-using-bitcoin-script"}},[t._v("#")]),t._v(" Examples of things achievable using Bitcoin Script:")]),t._v(" "),e("ol",[e("li",[e("code",[t._v("Pay Someone (p2pkh/p2wpkh)")]),t._v(" - A specific public key must sign to spend the coins.")]),t._v(" "),e("li",[e("code",[t._v("Escrow (2-of-3-multisig)")]),t._v(" - Two parties need to sign together to spend the coins.")]),t._v(" "),e("li",[e("code",[t._v("Vault (locked)")]),t._v(" - A specific key will not be able to spend the coins until a timeout but another master key will always be able to spend them.")]),t._v(" "),e("li",[e("code",[t._v("HTLC")]),t._v(" - The receiver needs disclose a secret before a timeout, else the coins are transferred back to the payee.")])]),t._v(" "),e("h4",{attrs:{id:"motivation-for-policies"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#motivation-for-policies"}},[t._v("#")]),t._v(" Motivation for Policies")]),t._v(" "),e("p",[t._v("Unfortunately, due to its low-level and unusual stack-based nature, Script is pretty hard to reason about and use.\nDespite being around since Bitcoin's creation, writing and understanding Script is not trivial.\nThis is why the scripts for the above few examples are pretty lengthy and might not make sense at the first glance.\nWhen writing a script, we would want to know that if the logic we wrote is "),e("strong",[t._v("correct")]),t._v(", "),e("strong",[t._v("optimal")]),t._v(" and "),e("strong",[t._v("efficient in size")]),t._v(" (use lower "),e("a",{attrs:{href:"https://en.bitcoin.it/wiki/Weight_units",target:"_blank",rel:"noopener noreferrer"}},[t._v("weight"),e("OutboundLink")],1),t._v(").")]),t._v(" "),e("p",[t._v("The community wanted an easy alternative way of writing Script that would create the most optimized Script code.\nThis gave rise to "),e("strong",[t._v("Miniscript")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"miniscript"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#miniscript"}},[t._v("#")]),t._v(" Miniscript")]),t._v(" "),e("p",[e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Miniscript"),e("OutboundLink")],1),t._v(" tackles the above problems head-on.\nIt is an expressive way to create policies on Bitcoin Scripts in a structured and simple fashion.\nUsing Miniscript, it's difficult to go wrong.")]),t._v(" "),e("p",[t._v("Another very important goal of Miniscript is to replace any key used in a policy with another policy.\nThis is important because people might have multiple keys and complicated timelocks in their existing setup.\nWhile signing a new policy, they would want to use their existing setup to also generate addresses for this new setup.\nThis is accomplished using something called "),e("strong",[t._v("Output Descriptors")]),t._v(" which we will get into in next section.")]),t._v(" "),e("p",[t._v("Miniscript compiler compiles a "),e("strong",[t._v("spending policy")]),t._v(" down to Miniscript.\nIt doesn't contain any signature, it's mainly a combinator language for designing spending conditions.\nYou can try out the compiler online by using "),e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/#:~:text=Policy%20to%20Miniscript%20compiler",target:"_blank",rel:"noopener noreferrer"}},[t._v("this link"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h4",{attrs:{id:"fragments"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#fragments"}},[t._v("#")]),t._v(" Fragments")]),t._v(" "),e("p",[t._v("Here are some fragments which can be combined to create powerful expressions.")]),t._v(" "),e("ol",[e("li",[e("code",[t._v("pk(key)")]),t._v(" - Specifies a given public key")]),t._v(" "),e("li",[e("code",[t._v("thresh(k, expr_1, expr_2, ..., expr_n)")]),t._v(" - Specifies k of n multisig using expressions.")]),t._v(" "),e("li",[e("code",[t._v("older(T)")]),t._v(" - Timelock for T blocks")]),t._v(" "),e("li",[e("code",[t._v("and(expr_1, expr_2)")]),t._v(" - Both expressions should evaluate to true.")]),t._v(" "),e("li",[e("code",[t._v("or(expr_1, expr_2)")]),t._v(" - Any one of the expressions should evaluate to true.")]),t._v(" "),e("li",[e("code",[t._v("aor(expr_1, expr_2)")]),t._v(" - Similar to "),e("code",[t._v("or")]),t._v(" but "),e("code",[t._v("expr_1")]),t._v(" has a more probability to evaluate to true.")])]),t._v(" "),e("p",[t._v("Bitcoin Script allows us to use another alternate stack. The combinator functions use this second stack to evaluate expressions of "),e("code",[t._v("thresh")]),t._v(", "),e("code",[t._v("and")]),t._v(", "),e("code",[t._v("aor")]),t._v(" and "),e("code",[t._v("or")]),t._v(".\nThe complete Miniscript Reference can be found "),e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/#:~:text=Miniscript%20reference",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h4",{attrs:{id:"example-policies"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-policies"}},[t._v("#")]),t._v(" Example Policies")]),t._v(" "),e("p",[t._v("Here are the Miniscript Policies for the examples we looked at earlier.\nNote "),e("code",[t._v("A")]),t._v(", "),e("code",[t._v("B")]),t._v(", "),e("code",[t._v("C")]),t._v(" are placeholders for keys "),e("em",[t._v("("),e("code",[t._v("xpub")]),t._v("/"),e("code",[t._v("xprv")]),t._v(")")]),t._v(" involved in the tx.\nDescriptors are high level description of scriptpubkey (p2pkh, p2sh etc).\nAnd miniscripts are semantics that describes the actual redeemscript.\nIn general you have Descriptor(Miniscript) format.")]),t._v(" "),e("ol",[e("li",[t._v("Pay A (pay-to-public-key)")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("pk(A)\n")])])]),e("ol",{attrs:{start:"2"}},[e("li",[t._v("Escrow Account between A, B and third-party C.")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("thresh(2,pk(A),pk(B),pk(C))\n")])])]),e("ol",{attrs:{start:"3"}},[e("li",[t._v("Vault for A time-locked for T blocks with B as the master key.")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("aor(and(pk(A),time(T)),pk(B))\n")])])]),e("ol",{attrs:{start:"4"}},[e("li",[t._v("HTLC payment to B, which, if unspent for T blocks, returns to A.")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("aor(and(pk(A),time(T)),and(pk(B),hash(H))))\n")])])]),e("p",[t._v("The Miniscript Policy Compiler is written in Rust and is present in "),e("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[t._v("this repository"),e("OutboundLink")],1),t._v(".\nIn this blog, we will later use the same using "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[t._v("bitcoindevkit/bdk"),e("OutboundLink")],1),t._v(", a lightweight descriptor-based wallet library\nwith a "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("cli"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"descriptors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#descriptors"}},[t._v("#")]),t._v(" Descriptors")]),t._v(" "),e("p",[t._v('The Bitcoin scriptpubkey supports various schemes like P2PKH, P2SH, P2WPKH, P2TR (Segwit v1) etc.\nA Descriptor is a simple "description" of what scriptpubkey to be used for a given policy.\nIt can inclue a single pubkey within itself, or an entire miniscript policy.\nOn the other hand, Miniscript policies are used to derive the redeemscript (the actual executable script), whereas the descriptor describes how the redeemscript will be encumbered within the scriptpubkey.')]),t._v(" "),e("p",[t._v('In other words, a descriptor "describes" the procedure to create an '),e("em",[t._v("address")]),t._v(", given a "),e("em",[t._v("spending condition")]),t._v(".")]),t._v(" "),e("p",[t._v("They make it easier to deal with Multisig or complicated key setups.\nDescriptors are super portable and can be easily used by any wallet to determine the list of all addresses that can be generated from the same.\nThis feature creates a common stage for all Bitcoin apps and software.")]),t._v(" "),e("p",[t._v("The concept of descriptor came into existence in 2018 and since then, a lot of wallets have added support for descriptors.\nYou can read the descriptor doc from "),e("code",[t._v("bitcoin-core")]),t._v(" "),e("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("here"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v('According to Bitcoin Core, Output Descriptors are "a simple language which can be used to describe collections of output scripts".\nThey bring in themselves, derivation paths, master xpub/xprv fingerprints and paths to generate addresses from.\nLet\'s understand this with an example of an Output Descriptor:')]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("\nDescriptor: pkh([d34db33f/44'/0'/0']xpub6ERaJH[...]LJRcEL/1/*)#ml40v0wf\n <1> <--------2---------\x3e<----------3---------\x3e<4> <---5---\x3e\n\nSections:\n1 - address type specifier (here, describing P2PK type addresses)\n2 - master key fingerprint and derivation path from master\n3 - xpub at m/44'/0'/0\n4 - path to deriving keys/addresses at\n5 - checksum for the descriptor\n")])])]),e("p",[t._v("A descriptor have three parts:")]),t._v(" "),e("ul",[e("li",[e("em",[t._v("address type specifier")]),t._v(" (item 1) : describes the type of address created by this descriptor.")]),t._v(" "),e("li",[e("em",[t._v("policy")]),t._v(" : the spending condition that locks funds into this address.")]),t._v(" "),e("li",[e("em",[t._v("checksum")]),t._v(" : for quick verification.")])]),t._v(" "),e("p",[t._v("The address type specifiers currently supported are "),e("code",[t._v("pk")]),t._v(", "),e("code",[t._v("pkh")]),t._v(", "),e("code",[t._v("sh")]),t._v(", "),e("code",[t._v("wpkh")]),t._v(", "),e("code",[t._v("wsh")]),t._v(" for corresponding address type and recently added "),e("code",[t._v("tr")]),t._v(" for taproot addresses.")]),t._v(" "),e("p",[t._v("There is a special address specifier called "),e("code",[t._v("combo")]),t._v(" that creates addresses of all types from spending policy policy.")]),t._v(" "),e("p",[t._v("After the address specifier, comes the "),e("em",[t._v("policy")]),t._v(' that describes how the funds in the address can be spent. The descriptor\nabove in the example has a simple spending policy of "spend by the correct private key". There can be more complicated policies,\nand we will touch them in later sections.')]),t._v(" "),e("p",[e("code",[t._v("multi")]),t._v(" is a special keyword that can be used as both "),e("em",[t._v("address type")]),t._v(" and "),e("em",[t._v("policy")]),t._v(".\nWhen used as an "),e("em",[t._v("address type")]),t._v(" like "),e("code",[t._v("multi(...)")]),t._v(", it will create an address from the raw multisig scriptpubkey.\nWhile when used as a "),e("em",[t._v("policy")]),t._v(" like "),e("code",[t._v("wsh(multi(...))")]),t._v(" it will create that specific address type from the multisig script.\nOf course we cannot use "),e("code",[t._v("pk(multi(...))")]),t._v(", "),e("code",[t._v("pkh(multi(...))")]),t._v(" or "),e("code",[t._v("wpkh(multi(...))")]),t._v(", because these address types cannot hold scripts (any scripts) inside them.")]),t._v(" "),e("p",[t._v("For example a descriptor like "),e("code",[t._v("wsh(multi(2, PKA, PKB, PKC))")]),t._v(" describes a P2WSH type address created by a "),e("code",[t._v("2-of-3")]),t._v(" multisig\nscript using "),e("code",[t._v("PKA")]),t._v(", "),e("code",[t._v("PKB")]),t._v(" and "),e("code",[t._v("PKC")]),t._v(" pubkeys.")]),t._v(" "),e("h2",{attrs:{id:"where-it-all-comes-together"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#where-it-all-comes-together"}},[t._v("#")]),t._v(" Where it all comes together...")]),t._v(" "),e("p",[t._v("In this section, we are going to make a descriptor-based wallet and derive addresses from "),e("code",[t._v("bitcoin-cli")]),t._v(" and then use "),e("code",[t._v("bdk-cli")]),t._v(" to confirm that the addresses generated for descriptor wallets are deterministic for a given descriptor.")]),t._v(" "),e("p",[t._v("We will also try to create a vault miniscript policy and push funds to the vault with a lock time of 2 months.\nDuring this time, we will try to break our vault and see our transactions failing.")]),t._v(" "),e("h4",{attrs:{id:"tools-and-armor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tools-and-armor"}},[t._v("#")]),t._v(" Tools and Armor")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://docs.docker.com/engine/install/",target:"_blank",rel:"noopener noreferrer"}},[t._v("docker"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/compiler/#installation",target:"_blank",rel:"noopener noreferrer"}},[t._v("miniscriptc"),e("OutboundLink")],1)])]),t._v(" "),e("h4",{attrs:{id:"setting-up"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#setting-up"}},[t._v("#")]),t._v(" Setting Up")]),t._v(" "),e("p",[t._v("We require "),e("code",[t._v("bitcoind")]),t._v(" to run in "),e("code",[t._v("regtest")]),t._v(" mode. Use the following config file, or any other config\nthat you are familiar with.")]),t._v(" "),e("div",{staticClass:"language-txt extra-class"},[e("pre",{pre:!0,attrs:{class:"language-txt"}},[e("code",[t._v("regtest=1\nfallbackfee=0.0001\nserver=1\n\nrpcuser=user\nrpcpassword=password\n")])])]),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Start Bitcoin Core")]),t._v("\nbitcoind\n")])])]),e("h3",{attrs:{id:"keys-and-generating-addresses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#keys-and-generating-addresses"}},[t._v("#")]),t._v(" Keys and Generating Addresses")]),t._v(" "),e("p",[t._v("Quick installation for "),e("code",[t._v("bdk-cli")]),t._v(" and "),e("code",[t._v("miniscriptc")]),t._v(":")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[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("rpc,compiler\n"),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 "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compiler"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--example")]),t._v(" miniscriptc\n")])])]),e("p",[t._v("Let us first generate an XPRV and create the wpkh wallet descriptor")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.xprv'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("EX_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh('),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$XPRV")]),t._v("/86'/1'/0'/0/*)\"")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("EX_DESC_CS")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("elcli getdescriptorinfo $EX_DESC "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.checksum'")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("EX_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("#$EX_DESC_CS")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Set this descriptor in a wallet in bitcoin-cli")]),t._v("\nbitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-named")]),t._v(" createwallet "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("wallet_name")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mywallet"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("descriptors")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("true\nbitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rpcwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mywallet"')]),t._v(" importdescriptors "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[{'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("desc"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(", "),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("timestamp"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("now"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(", "),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("active"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(": true, "),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("range"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(': [0,100]}]"')]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("echo")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),t._v("\n")])])]),e("p",[t._v("It should look something like this:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("wpkh(tprv8ZgxMBicQKsPeuazF16EdPZw84eHj55AU8ZKgZgdhu3sXcHnFgjzskfDvZdTaAFHYNCbKqrurFo9onSaT7zGT1i3u3j7LKhVZF5sJA39WPN/86'/1'/0'/0/*)#40hv8z77\n")])])]),e("p",[t._v("Now, we will generate 10 addresses using "),e("code",[t._v("bitcoin-cli")]),t._v(" and thereafter "),e("code",[t._v("bdk-cli")]),t._v(" using this above descriptor.\nNotice how both of them output the same set of addresses.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generation via bdk-cli")]),t._v("\nrepeat "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bdk-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-n")]),t._v(" regtest wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--descriptor")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$EX_DESC")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-w")]),t._v(" mywallet get_new_address "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".address"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nbcrt1qc9wzxf8pthyexl00m23ug92pqrthagnzzf33wp\nbcrt1qgnh7e72q92fqujwg3qxlg5kplxkm6rep0nerur\nbcrt1qea6r8yvd0peupk29p94wm0xasvydgdsnyzkhez\nbcrt1qm99230tpqflq0f8kpkn5d2tee02hgqcsw5sd99\nbcrt1qd0afjfnl5udrsfkrj72rl34pss34yluma752qv\nbcrt1qj2aymplrzxcp4m7vcxrzq93g58pmgm4fpluesy\nbcrt1q4p4k63xglftez0h8yc7d4kmhsn5j5kecguu34j\nbcrt1q29z2uanskweur7qrzr43gyv3l028s0pnd9ptvp\nbcrt1qkzpeqz8sd73sucfythjxftez0e3ee30yhp9w67\nbcrt1qptwd6ggy8ttryck2f6yjf4la68apruc3fs7elz\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generation via bitcoin-cli")]),t._v("\nrepeat "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rpcwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mywallet"')]),t._v(" getnewaddress "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nbcrt1qc9wzxf8pthyexl00m23ug92pqrthagnzzf33wp\nbcrt1qgnh7e72q92fqujwg3qxlg5kplxkm6rep0nerur\nbcrt1qea6r8yvd0peupk29p94wm0xasvydgdsnyzkhez\nbcrt1qm99230tpqflq0f8kpkn5d2tee02hgqcsw5sd99\nbcrt1qd0afjfnl5udrsfkrj72rl34pss34yluma752qv\nbcrt1qj2aymplrzxcp4m7vcxrzq93g58pmgm4fpluesy\nbcrt1q4p4k63xglftez0h8yc7d4kmhsn5j5kecguu34j\nbcrt1q29z2uanskweur7qrzr43gyv3l028s0pnd9ptvp\nbcrt1qkzpeqz8sd73sucfythjxftez0e3ee30yhp9w67\nbcrt1qptwd6ggy8ttryck2f6yjf4la68apruc3fs7elz\n")])])]),e("p",[t._v("Notes:")]),t._v(" "),e("ul",[e("li",[t._v("The "),e("code",[t._v("repeat n {}")]),t._v(" syntax will only work in "),e("code",[t._v("zsh")]),t._v(", you can use other loops for your shell, or just manually repeat the code 10 times.")]),t._v(" "),e("li",[t._v("In case you get different outputs in either of the cases, try deleting "),e("code",[t._v("~/.bdk-bitcoin")]),t._v(" and retrying (thanks "),e("a",{attrs:{href:"https://twitter.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("@Steve"),e("OutboundLink")],1),t._v(" for this tip!)")])]),t._v(" "),e("p",[t._v("Note that both "),e("code",[t._v("bdk-cli")]),t._v(" and "),e("code",[t._v("bitcoin-cli")]),t._v(" produced the exact same addresses. So now we have definitive proof that descriptors can make wallets portable. That single string will be able to make any wallet generate the same set of addresses and hence they can sync and broadcast transactions in the same manner!")]),t._v(" "),e("h3",{attrs:{id:"making-a-multisig-descriptor-for-funds"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#making-a-multisig-descriptor-for-funds"}},[t._v("#")]),t._v(" Making a MultiSig Descriptor for Funds")]),t._v(" "),e("p",[t._v("In the real-life, most of us hold two kinds of savings accounts - one to store huge funds saved throughout our lifetime "),e("em",[t._v("(probably without internet banking functionalities)")]),t._v("\nand another for regular expenses.")]),t._v(" "),e("p",[t._v("In the Bitcoin world, to store huge funds, most people prefer to use a Multisig descriptor with a "),e("code",[t._v("2-of-3")]),t._v(" or "),e("code",[t._v("3-of-4")]),t._v(" setup.\nThey can have one key stored in their PC, one key stored in a hardware wallet, one key stored in writing in a secure vault and another key learnt by heart.\nIn case of a mishap like a house burning on fire or permanent memory loss, they would still be able to recover their funds by using the other keys.")]),t._v(" "),e("p",[t._v("Here's how a secure "),e("code",[t._v("2-of-3")]),t._v(" descriptor generation would look like:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xprv generation")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K2_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K3_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xpub generation")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $K1_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K2_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $K2_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K3_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $K3_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Descriptors for each key - Since we used BIP-84 generation paths for xpubs,")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# we need to append the same to the xprvs so that our wallet can understand ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# which path to generate addresses and xpubs from")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wsh(multi(2,'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_XPRV")]),t._v("/84'/1'/0'/0/*,"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K2_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K3_XPUB")]),t._v('))"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K2_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wsh(multi(2,'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K2_XPRV")]),t._v("/84'/1'/0'/0/*,"),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K3_XPUB")]),t._v('))"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K3_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wsh(multi(2,'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K2_XPUB")]),t._v(","),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K3_XPRV")]),t._v("/84'/1'/0'/0/*))\"")]),t._v("\n")])])]),e("p",[t._v("Lets create three bdk wallets aliases with above descriptors for easy future use\nand do initial sync to create the wallet files")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("k1wallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w K1 -d $K1_DESC'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("k2wallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w K2 -d $K2_DESC'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("k3wallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w K3 -d $K3_DESC'")]),t._v("\n\nk1wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk2wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk3wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("p",[t._v("Now, let us send some funds to an address generated by "),e("code",[t._v("k1wallet")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('# ask regtest to generate 101 blocks, so we get 50 regtest coins to play with.\n# because coinbase amounts are only spendable after 100 blocks, we generate\n# 101 blocks, to use the first block\'s coinbase amount.\nCORE_ADDR=$(bitcoin-cli getnewaddress)\nbitcoin-cli generatetoaddress 101 $CORE_ADDR\nbitcoin-cli getbalance\n50.00000000\n\n# And then send 10 btc to an address generated by `K1` descriptor\nBDK_ADDR=$(k1wallet get_new_address | jq -r ".address")\nbitcoin-cli -rpcwallet=mywallet sendtoaddress $BDK_ADDR 10\n\n# Confirm the transaction by creating one more block\nbitcoin-cli generatetoaddress 1 $CORE_ADDR\n')])])]),e("p",[t._v("Now sync the wallets and check balances in each")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("k1wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk1wallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nk2wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk2wallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nk3wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nk3wallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Everyone has the same amount of balance.\nThis happened because it was a multisig wallet.\nNow, let's try to spend some balance.\nWe will give back some balance to the wallet maintained by "),e("code",[t._v("bitcoin-cli")]),t._v(".\nBut remember, this is a "),e("code",[t._v("2-of-3")]),t._v(" multisig wallet.\nThat's why we will need at least two keys to sign to make a transaction.")]),t._v(" "),e("p",[t._v("Here's where we will require to use a "),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("PSBT"),e("OutboundLink")],1),t._v(" or a "),e("em",[t._v("partially signed bitcoin transaction")]),t._v(".\nBitcoin uses PSBTs as the standard protocol to create a transaction and add one or more signatures to it before broadcasting the same to\nthe network which finally can become a proper valid "),e("em",[t._v("transaction")]),t._v(".")]),t._v(" "),e("p",[t._v("We will aks "),e("code",[t._v("k2wallet")]),t._v(" to create and sign the transaction then "),e("code",[t._v("k1wallet")]),t._v(" and "),e("code",[t._v("k3wallet")]),t._v(" will co-sign it.\nNote that "),e("code",[t._v("k2wallet")]),t._v(" even if it creates the transaction, doesn't need to sign it, because its a "),e("code",[t._v("2-of-3")]),t._v(" multisig!")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# create the transaction, can be started by anyone")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("k2wallet create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--to")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v(':100000000"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sign the transaction by K1 and look at the output")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# it should say the psbt is not finalized since only one party has signed")]),t._v("\nk1wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$PSBT")]),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('"is_finalized"')]),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('"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('"[...]"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Saving the PSBT signed by K1")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("K1_SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("k1wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sign by K3 - should be finalized this time")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Notice that this time, the input psbt was the signed PSBT of K1")]),t._v("\nk3wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$K1_SIGNED_PSBT")]),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('"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('"[...]"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Saving the PSBT signed by K3")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("k3wallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $K1_SIGNED_PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Broadcast the transaction, again doesn't really matter who broadcasts")]),t._v("\nk2wallet broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$SIGNED_PSBT")]),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('"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('"49e2706fc73c49605692bf1b9ce58baf1eb0307ea39b3118628994fd56c9b642"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Confirm the transaction by generating one block")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sync and check balance - it should have gone down by 100000000 + tx fees")]),t._v("\nk1wallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),t._v("\nk1wallet get_balance\n"),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 number"}},[t._v("899999810")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Check similarly for `k2wallet` and `k3wallet` and they should all have same balance")]),t._v("\n")])])]),e("p",[t._v("So this proves we can definitely do transactions with multisig wallets with complicated descriptors.\nSince for Bitcoin, having keys equal having access to the accounts, we need to keep our keys safe.\nFor legacy single key wallets, we used to keep backups of the mnemonic codes in multiple places.\nIt was pretty insecure because in case any one of those backups leaks, our entire account would be compromised.\nComplicated multisig wallet descriptors are definitely a step forward - just in case a single key leak or are lost, no one would be able to take charge of the funds we hold.")]),t._v(" "),e("p",[t._v("Another problem with multisig was syncing between wallets to always create consistent addresses. How would\none wallet know whats the next address to create without talking to other wallets? The answer is "),e("code",[t._v("descriptors + PSBT")]),t._v(".\nIf all the wallet shares the correct descriptor string they will always create the exact sequence of addresses and\nby passing around PSBTs they would know how to sign them, without talking to each other. This solves a major problem of multisig interoperability. And BDK makes this process as seamless as possible.")]),t._v(" "),e("h2",{attrs:{id:"retention-bonus-smart-contract-with-bitcoin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#retention-bonus-smart-contract-with-bitcoin"}},[t._v("#")]),t._v(" Retention Bonus - Smart Contract with Bitcoin")]),t._v(" "),e("p",[t._v("Let us consider that a company wants to give its employees a retention bonus for two months.\nIf an employee stays with that company for over 2 months, the employee would get 1 BTC as a reward.\nThis would be a smart contract between the company and an employee.\nThe employee should be able to see that he would get his funds after two months.\nThe company would require confidence that the employee would not be able to withdraw the reward before two months have passed.")]),t._v(" "),e("p",[t._v("The Miniscript policy for this contract would be as follows:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("or(99@and(pk(E),older(8640)),pk(C))\n")])])]),e("p",[t._v("where "),e("code",[t._v("E")]),t._v(" is the employee and "),e("code",[t._v("C")]),t._v(" is the company.")]),t._v(" "),e("p",[t._v("I should emphasize over here that this policy will let the company still transfer funds after the designated 2 months.\nIt's not possible to block them after the lock time has passed, atleast not in a single policy.")]),t._v(" "),e("p",[t._v("Surely, after two months, the funds can be unlocked by the employee but before that, the company can revoke the funds.\nLet us compile this policy down to a descriptor. And this time we will ask help from the "),e("code",[t._v("miniscript")]),t._v(" program.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# The Descriptor will be on the log, the E and C are placeholders")]),t._v("\nminiscriptc "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"or(99@and(pk(E),older(8640)),pk(C))"')]),t._v(" sh-wsh\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2021")]),t._v("-08-05T12:25:40Z INFO miniscriptc"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" Compiling policy: or"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("99")]),t._v("@and"),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("E"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",older"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8640")]),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("C"),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 number"}},[t._v("2021")]),t._v("-08-05T12:25:40Z INFO miniscriptc"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(". Descriptor: sh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wsh"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("andor"),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("E"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",older"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8640")]),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("C"),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 comment"}},[t._v("#55wzucxa")]),t._v("\nError: Descriptor"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Miniscript"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Unexpected"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Key too short (<66 char), doesn\'t match any format"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("So the compiled descriptor is")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("sh(wsh(andor(pk(E),older(8640),pk(C))))\n")])])]),e("p",[t._v("Let's make the keys, generate addresses using the above descriptor and fund it.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xprvs")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_XPRV")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key generate "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xprv"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# xpubs")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $E_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_XPUB")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("bdk-cli key derive "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--xprv")]),t._v(" $C_XPRV "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--path")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("\"m/84'/1'/0'/0\"")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".xpub"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# descriptors using the compiled miniscript")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# please note in case company or the employee was using a complicated multisig descriptor,")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# it may as well have been added here like we did in the example before")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sh(wsh(andor(pk('),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$E_XPRV")]),t._v("/84'/1'/0'/0/*),older(8640),pk("),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$C_XPUB")]),t._v('))))"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_DESC")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sh(wsh(andor(pk('),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$E_XPUB")]),t._v("),older(8640),pk("),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$C_XPRV")]),t._v("/84'/1'/0'/0/*))))\"")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Create wallet aliases for easy access and sync the wallet to create initial wallet files")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("Cwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w C -d $C_DESC'")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("alias")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("Ewallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'bdk-cli -n regtest wallet -w E -d $E_DESC'")]),t._v("\n\nCwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nEwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get some funds in Cwallet's address")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("C_ADDR")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Cwallet get_new_address "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".address"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\nbitcoin-cli "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rpcwallet")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("mywallet sendtoaddress "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$C_ADDR")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Confirm the transaction")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sync and check balance")]),t._v("\nCwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nCwallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Just as before, the employe can also see the fund in their wallet")]),t._v("\nEwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nEwallet get_balance\n"),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 number"}},[t._v("1000000000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("According to the spending policy, for "),e("code",[t._v("E")]),t._v(" has to wait for 8640 blocks before he can spend the coins.\nBut let's check what happens if "),e("code",[t._v("E")]),t._v(" tries to transact before the designated 2 months anyway.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# address to send the transaction to")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("E_ADDR")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet getnewaddress "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".address"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get external_policy id - this identifies which policy the wallet will try to sign against")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("POLICY_ID")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet policies "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".external | .id"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# create the tx (external_policy id from last step in my case is j7ncy3au")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--to")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$E_ADDR")]),t._v(':100000000"')]),t._v(" "),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('\\"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$POLICY_ID")]),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(':[0]}"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# sign and save the signed psbt")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# now let's try to broadcast - and see it failing")]),t._v("\nEwallet broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$SIGNED_PSBT")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2021")]),t._v("-08-05T17:48:45Z ERROR bdk_cli"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" Electrum"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Protocol"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object"),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 string"}},[t._v('"code"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" Number"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(", "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(":")]),t._v(" String"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sendrawtransaction RPC error: {'),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("code"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":-26,"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("message"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(":"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v("non-BIP68-final"),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),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("))")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("p",[t._v("We get an error saying the transaction we sent is "),e("strong",[t._v("Not BIP68 Final")]),t._v(".\n"),e("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[t._v("BIP68"),e("OutboundLink")],1),t._v(" is a relative lock-time specification that ensures consensus when a signed transaction is sent which is invalid at a given time because the lock time isn't passed.\nSo that's an expected error.")]),t._v(" "),e("p",[t._v("Now let's simulate two months passing and retry.")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# simulate two months")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# this will take around 1 mins to complete")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8640")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# create, sign and broadcast tx")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet create_tx "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--to")]),t._v(" $E_ADDR:100000000 "),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('\\"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$POLICY_ID")]),e("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[t._v('\\"')]),t._v(':[0]}"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("SIGNED_PSBT")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),e("span",{pre:!0,attrs:{class:"token variable"}},[e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),t._v("Ewallet sign "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" $PSBT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" jq "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-r")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('".psbt"')]),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\nEwallet broadcast "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--psbt")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$SIGNED_PSBT")]),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('"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('"2a0919bb3ce6e26018698ad1169965301a9ceab6d3da2a3dcb41343dc48e0dba"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Confirm the transaction")]),t._v("\nbitcoin-cli generatetoaddress "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CORE_ADDR")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Sync and check balances")]),t._v("\nCwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nCwallet get_balance\n"),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 number"}},[t._v("999999810")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nEwallet "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),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("\nEwallet get_balance\n"),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 number"}},[t._v("999999810")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("So this time it worked, because we have simulated 2 months passing by generating 8640 blocks. And both the Company\nand Employe wallet gets updated.\nHence, we saw that we can generate some smart contracts using Bitcoin.")]),t._v(" "),e("h2",{attrs:{id:"inspirations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inspirations"}},[t._v("#")]),t._v(" Inspirations")]),t._v(" "),e("ol",[e("li",[e("a",{attrs:{href:"https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Descriptors from Bitcoin Core"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript",target:"_blank",rel:"noopener noreferrer"}},[t._v("Miniscript"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoinops.org/en/topics/output-script-descriptors",target:"_blank",rel:"noopener noreferrer"}},[t._v("Output Script Descriptors"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoindevkit.org/descriptors",target:"_blank",rel:"noopener noreferrer"}},[t._v("Descriptors in Bitcoin Dev Kit"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://bitcoindevkit.org/blog/2020/11/descriptors-in-the-wild/#the-role-of-descriptors",target:"_blank",rel:"noopener noreferrer"}},[t._v("Role of Descriptors"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://gist.github.com/notmandatory/483c7edd098550c235da75d5babcf255",target:"_blank",rel:"noopener noreferrer"}},[t._v("Making a Taproot Descriptor Wallet using bitcoin-cli"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://www.youtube.com/watch?v=XM1lzN4Zfks",target:"_blank",rel:"noopener noreferrer"}},[t._v("Miniscripts SBC '19 - Video"),e("OutboundLink")],1)]),t._v(" "),e("li",[e("a",{attrs:{href:"https://www.youtube.com/watch?v=xC25NzIjzog",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rethinking Wallet Architecture: Native Descriptor Wallets - Video"),e("OutboundLink")],1)])]),t._v(" "),e("p",[t._v("Special thanks to my mentor "),e("a",{attrs:{href:"https://twitter.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("Steve Myers"),e("OutboundLink")],1),t._v(" for the constant motivation and support he gave me and for clearing so many doubts!\nImmense thanks to "),e("a",{attrs:{href:"https://github.com/rajarshimaitra",target:"_blank",rel:"noopener noreferrer"}},[t._v("Raj"),e("OutboundLink")],1),t._v(" for reviewing this blog and giving such detailed suggestions.\nMany of the lines added here are his.\nAlso, thanks to the folks at the "),e("code",[t._v("#miniscript")]),t._v(" IRC channel to help me out with the Retention Bonus policy.")]),t._v(" "),e("p",[t._v("This blog was written during "),e("a",{attrs:{href:"https://summerofbitcoin.org",target:"_blank",rel:"noopener noreferrer"}},[t._v("Summer of Bitcoin 2021"),e("OutboundLink")],1),t._v(" by "),e("a",{attrs:{href:"https://twitter.com/@sandipndev",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sandipan Dey"),e("OutboundLink")],1),t._v(".")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/66.dc7e2efd.js b/assets/js/66.62fed6f7.js similarity index 99% rename from assets/js/66.dc7e2efd.js rename to assets/js/66.62fed6f7.js index 0f48cc816a..b2b91af1b1 100644 --- a/assets/js/66.dc7e2efd.js +++ b/assets/js/66.62fed6f7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{424:function(t,a,e){"use strict";e.r(a);var s=e(7),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("p",[t._v("A new release of BDK is finally out! The "),a("code",[t._v("v0.2.0")]),t._v(" release contains many exciting new features, bug fixes and overall improvements. This release also marks the beginning of our new regular "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/DEVELOPMENT_CYCLE.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("release schedule"),a("OutboundLink")],1),t._v(", which will see us pushing\nout a new release every four weeks. We think this is a good compromise to ensure that developers using BDK have access to all the new features and fixes as soon as possible, at least while the library is still evolving very fast as it is\nright now. After "),a("code",[t._v("v1.0.0")]),t._v(" we will increase this time to a more relaxed 6 weeks.")]),t._v(" "),a("p",[t._v("You can find the full "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/CHANGELOG.md#v020---010-beta1",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.2.0 changelog"),a("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),a("h2",{attrs:{id:"whats-new-in-v020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v020"}},[t._v("#")]),t._v(" What's new in v0.2.0")]),t._v(" "),a("p",[t._v("Considering the sheer amount of new things being added we don't have room here to explain every new feature in detail, but below is a quick overview of some you could find useful in your projects.")]),t._v(" "),a("h3",{attrs:{id:"a-new-name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#a-new-name"}},[t._v("#")]),t._v(" A new name")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release was tagged right before the project was renamed "),a("code",[t._v("bdk")]),t._v(': at that time the library was still called "Magical Bitcoin Library", or '),a("code",[t._v("magical")]),t._v(" for short. With this release we have now renamed it to "),a("code",[t._v("bdk")]),t._v(". If you were using the library\nbefore, it should only be a matter of renaming the imports to match the new name. Alternatively you can also rename "),a("code",[t._v("bdk")]),t._v(" to "),a("code",[t._v("magical")]),t._v(" in your Cargo.toml, but you'll still have to do some changes here and there because the APIs have been changed in a few\nplaces.")]),t._v(" "),a("p",[t._v("This release being particularly large contains a few different API-breaking changes: going forward we expect to make the interface more and more stable, which in turn will make applying updates easier.")]),t._v(" "),a("h3",{attrs:{id:"branch-and-bound-coin-selection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#branch-and-bound-coin-selection"}},[t._v("#")]),t._v(" Branch and Bound coin selection")]),t._v(" "),a("p",[t._v('We now support the state-of-the-art coin selection algorithm called "branch and bound", with an implementation derived straight from Bitcoin Core. This algorithm is now enabled by default, but it can be replaced with a different one (either\nthe old default, '),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/struct.LargestFirstCoinSelection.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("LargestFirstCoinSelection")]),a("OutboundLink")],1),t._v(" or a custom "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("CoinSelectionAlgorithm")]),a("OutboundLink")],1),t._v(") by using the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.coin_selection",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("TxBuilder::coin_selection()")]),a("OutboundLink")],1),t._v(" option.")]),t._v(" "),a("p",[t._v("Branch and bound works by trying to find a set of inputs that perfectly matches the amount being sent by a transaction, to avoid making an extra change output which takes up more space in the transaction, requires more fees, and in general lowers the privacy\nof a user if the change is later spent together with other outputs.")]),t._v(" "),a("h3",{attrs:{id:"key-generation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-generation"}},[t._v("#")]),t._v(" Key generation")]),t._v(" "),a("p",[t._v("If you need to generate a new "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v(", or perhaps a new BIP39 mnemonic, you can use the unified "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableKey")]),a("OutboundLink")],1),t._v(" trait to do so: paired with "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableDefaultOptions.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableDefaultOptions")]),a("OutboundLink")],1),t._v(" they provide many different ways to generate keys,\nwith or without a custom source of entropy, and with or without customized options.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableDefaultOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" default_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" custom_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" compressed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"generic-key-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#generic-key-types"}},[t._v("#")]),t._v(" Generic key types")]),t._v(" "),a("p",[t._v("With this update there's now a generalized trait for keys that can be used in descriptors, which is called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(". This trait is already implemented for the native "),a("code",[t._v("rust-bitcoin")]),t._v(" key types, like "),a("code",[t._v("PrivateKey")]),t._v(", "),a("code",[t._v("PublicKey")]),t._v(", "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v("\nand "),a("code",[t._v("bip32::ExtendedPubKey")]),t._v(". It's also implemented for BIP39 mnemonic and seeds, when the the opt-in "),a("code",[t._v("keys-bip39")]),t._v(" feature is enabled. As always, being this a public trait, you can also implement it for custom types to better suit your needs.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bitcoin::PrivateKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If your custom key type is simply a different representation of an "),a("code",[t._v("xprv")]),t._v(" or "),a("code",[t._v("xpub")]),t._v(", you can also consider implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(" trait instead: for a type "),a("code",[t._v("K")]),t._v(" that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(", the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" trait is automatically\nimplemented for the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::KeySource, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" tuples.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Option")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bip32::ExtendedPrivKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"descriptor-templates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-templates"}},[t._v("#")]),t._v(" Descriptor templates")]),t._v(" "),a("p",[t._v("Instead of having to serialize keys to strings using "),a("code",[t._v("format!()")]),t._v(" just to place them somewhere inside a descriptor, you can now use descriptor templates to build a descriptor starting from a key and some other options\nin a couple of lines of code. You can use one of the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("provided templates"),a("OutboundLink")],1),t._v(" or make a custom one by implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/trait.DescriptorTemplate.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DescriptorTemplate")]),a("OutboundLink")],1),t._v(" trait on a "),a("code",[t._v("struct")]),t._v(" or "),a("code",[t._v("enum")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"..."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"easier-creation-of-blockchain-and-database"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#easier-creation-of-blockchain-and-database"}},[t._v("#")]),t._v(" Easier creation of "),a("code",[t._v("Blockchain")]),t._v(" and "),a("code",[t._v("Database")])]),t._v(" "),a("p",[t._v("We've added a new way to create a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" instance from a configuration, with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.ConfigurableBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableBlockchain")]),a("OutboundLink")],1),t._v(" trait. All the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types provided by the library implement this trait, which allows you to easily build an\ninstance of them starting from a configuration "),a("code",[t._v("struct")]),t._v(": moreover, the configuration structures implement "),a("code",[t._v("Serialize")]),t._v(" and "),a("code",[t._v("Deserialize")]),t._v(", so that they can be easily stored/loaded using "),a("code",[t._v("serde")]),t._v(".")]),t._v(" "),a("p",[t._v("We've also added a new "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" type called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/any/enum.AnyBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyBlockchain")]),a("OutboundLink")],1),t._v(", which is essentially an "),a("code",[t._v("enum")]),t._v(" that wraps all the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types exposed by the library. This allows you to build a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet")]),a("OutboundLink")],1),t._v(" that always has the same\nRust type, but that can internally use different "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" backends chosen at runtime.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('r#"{"Electrum":{"url":"ssl://electrum.blockstream.info:50002","socks5":null,"retry":3,"timeout":5}}"#')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("serde_json"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The same is true for "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Database")]),a("OutboundLink")],1),t._v(" types, thanks to the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.ConfigurableDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableDatabase")]),a("OutboundLink")],1),t._v(" trait and the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/any/enum.AnyDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyDatabase")]),a("OutboundLink")],1),t._v(" "),a("code",[t._v("enum")]),t._v(". While we think most people generally prefer to choose a single database type and then stick to it, it's still good\nto offer the choice to switch them at runtime, should somebody need that.")]),t._v(" "),a("h3",{attrs:{id:"descriptor-macro"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-macro"}},[t._v("#")]),t._v(" "),a("code",[t._v("descriptor!()")]),t._v(" macro")]),t._v(" "),a("p",[t._v("If you start writing complex descriptor templates, you'll soon find yourself with the need of building large descriptor syntax trees: you can very easily do that with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("descriptor!()")]),a("OutboundLink")],1),t._v(" macro, with the added bonus that some additional checks on the\nsyntax of your descriptor will be performed at compile-time, rather than at runtime by. You can use any type that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" (even strings!) as keys in "),a("code",[t._v("pk()")]),t._v(", "),a("code",[t._v("multi()")]),t._v(" and "),a("code",[t._v("sortedmulti()")]),t._v(" fragments, and you can even mix\nthem in the same descriptor.")]),t._v(" "),a("p",[t._v("The syntax supported by the macro is almost exactly the same as the standard descriptor syntax we all know, with the only difference that modifiers should be specified individually rather than\ngrouped in a series of characters (see the example below).")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("map_err")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token closure-params"}},[a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Message")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"support-for-sortedmulti"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#support-for-sortedmulti"}},[t._v("#")]),t._v(" Support for "),a("code",[t._v("sortedmulti()")])]),t._v(" "),a("p",[t._v("Thanks to the addition of "),a("code",[t._v("sortedmulti()")]),t._v(" in "),a("code",[t._v("rust-miniscript")]),t._v(", we can now also support them in BDK, which means we are getting more and more compatible with other descriptor-based wallets out there like Bitcoin Core.")]),t._v(" "),a("h2",{attrs:{id:"contributors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),a("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),a("p",[t._v("Since the "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release over three months ago, we've had "),a("code",[t._v("213")]),t._v(" new commits made by "),a("code",[t._v("10")]),t._v(" different contributors for a total of "),a("code",[t._v("9990")]),t._v(" additions and "),a("code",[t._v("2993")]),t._v(" deletions. Here's the "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/0.1.0-beta.1...v0.2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("A special thanks to the "),a("code",[t._v("7")]),t._v(" new contributors:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/eupn",target:"_blank",rel:"noopener noreferrer"}},[t._v("@eupn"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/justinmoon",target:"_blank",rel:"noopener noreferrer"}},[t._v("@justinmoon"),a("OutboundLink")],1),t._v(" - Justin Moon")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/Xekyo",target:"_blank",rel:"noopener noreferrer"}},[t._v("@Xekyo"),a("OutboundLink")],1),t._v(" - Mark Erhardt")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[t._v("@RCasatta"),a("OutboundLink")],1),t._v(" - Riccardo Casatta")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/ulrichard",target:"_blank",rel:"noopener noreferrer"}},[t._v("@ulrichard"),a("OutboundLink")],1),t._v(" - Richard Ulrich")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("@notmandatory"),a("OutboundLink")],1),t._v(" - Steve Myers")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/willcl-ark",target:"_blank",rel:"noopener noreferrer"}},[t._v("@willcl-ark"),a("OutboundLink")],1),t._v(" - Will Clark")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{425:function(t,a,e){"use strict";e.r(a);var s=e(7),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("p",[t._v("A new release of BDK is finally out! The "),a("code",[t._v("v0.2.0")]),t._v(" release contains many exciting new features, bug fixes and overall improvements. This release also marks the beginning of our new regular "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/DEVELOPMENT_CYCLE.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("release schedule"),a("OutboundLink")],1),t._v(", which will see us pushing\nout a new release every four weeks. We think this is a good compromise to ensure that developers using BDK have access to all the new features and fixes as soon as possible, at least while the library is still evolving very fast as it is\nright now. After "),a("code",[t._v("v1.0.0")]),t._v(" we will increase this time to a more relaxed 6 weeks.")]),t._v(" "),a("p",[t._v("You can find the full "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/7d6cd6d4f5a26194830f90e6460e0b82bddf9594/CHANGELOG.md#v020---010-beta1",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.2.0 changelog"),a("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),a("h2",{attrs:{id:"whats-new-in-v020"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v020"}},[t._v("#")]),t._v(" What's new in v0.2.0")]),t._v(" "),a("p",[t._v("Considering the sheer amount of new things being added we don't have room here to explain every new feature in detail, but below is a quick overview of some you could find useful in your projects.")]),t._v(" "),a("h3",{attrs:{id:"a-new-name"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#a-new-name"}},[t._v("#")]),t._v(" A new name")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release was tagged right before the project was renamed "),a("code",[t._v("bdk")]),t._v(': at that time the library was still called "Magical Bitcoin Library", or '),a("code",[t._v("magical")]),t._v(" for short. With this release we have now renamed it to "),a("code",[t._v("bdk")]),t._v(". If you were using the library\nbefore, it should only be a matter of renaming the imports to match the new name. Alternatively you can also rename "),a("code",[t._v("bdk")]),t._v(" to "),a("code",[t._v("magical")]),t._v(" in your Cargo.toml, but you'll still have to do some changes here and there because the APIs have been changed in a few\nplaces.")]),t._v(" "),a("p",[t._v("This release being particularly large contains a few different API-breaking changes: going forward we expect to make the interface more and more stable, which in turn will make applying updates easier.")]),t._v(" "),a("h3",{attrs:{id:"branch-and-bound-coin-selection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#branch-and-bound-coin-selection"}},[t._v("#")]),t._v(" Branch and Bound coin selection")]),t._v(" "),a("p",[t._v('We now support the state-of-the-art coin selection algorithm called "branch and bound", with an implementation derived straight from Bitcoin Core. This algorithm is now enabled by default, but it can be replaced with a different one (either\nthe old default, '),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/struct.LargestFirstCoinSelection.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("LargestFirstCoinSelection")]),a("OutboundLink")],1),t._v(" or a custom "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/coin_selection/trait.CoinSelectionAlgorithm.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("CoinSelectionAlgorithm")]),a("OutboundLink")],1),t._v(") by using the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.coin_selection",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("TxBuilder::coin_selection()")]),a("OutboundLink")],1),t._v(" option.")]),t._v(" "),a("p",[t._v("Branch and bound works by trying to find a set of inputs that perfectly matches the amount being sent by a transaction, to avoid making an extra change output which takes up more space in the transaction, requires more fees, and in general lowers the privacy\nof a user if the change is later spent together with other outputs.")]),t._v(" "),a("h3",{attrs:{id:"key-generation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#key-generation"}},[t._v("#")]),t._v(" Key generation")]),t._v(" "),a("p",[t._v("If you need to generate a new "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v(", or perhaps a new BIP39 mnemonic, you can use the unified "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableKey")]),a("OutboundLink")],1),t._v(" trait to do so: paired with "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.GeneratableDefaultOptions.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("GeneratableDefaultOptions")]),a("OutboundLink")],1),t._v(" they provide many different ways to generate keys,\nwith or without a custom source of entropy, and with or without customized options.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("keys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("GeneratableDefaultOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" default_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate_default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" custom_options_key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKeyGenerateOptions")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" compressed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"generic-key-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#generic-key-types"}},[t._v("#")]),t._v(" Generic key types")]),t._v(" "),a("p",[t._v("With this update there's now a generalized trait for keys that can be used in descriptors, which is called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(". This trait is already implemented for the native "),a("code",[t._v("rust-bitcoin")]),t._v(" key types, like "),a("code",[t._v("PrivateKey")]),t._v(", "),a("code",[t._v("PublicKey")]),t._v(", "),a("code",[t._v("bip32::ExtendedPrivKey")]),t._v("\nand "),a("code",[t._v("bip32::ExtendedPubKey")]),t._v(". It's also implemented for BIP39 mnemonic and seeds, when the the opt-in "),a("code",[t._v("keys-bip39")]),t._v(" feature is enabled. As always, being this a public trait, you can also implement it for custom types to better suit your needs.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bitcoin::PrivateKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bitcoin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PrivateKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n privkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_descriptor_key")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("If your custom key type is simply a different representation of an "),a("code",[t._v("xprv")]),t._v(" or "),a("code",[t._v("xpub")]),t._v(", you can also consider implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(" trait instead: for a type "),a("code",[t._v("K")]),t._v(" that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.DerivableKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DerivableKey")]),a("OutboundLink")],1),t._v(", the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" trait is automatically\nimplemented for the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html#impl-ToDescriptorKey%3CCtx%3E-for-(T%2C%20KeySource%2C%20DerivationPath)",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("(K, bip32::KeySource, bip32::DerivationPath)")]),a("OutboundLink")],1),t._v(" tuples.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ScriptContext")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivableKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyKeyType")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Option")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeySource")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DerivationPath")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ctx")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom conversion to `bip32::ExtendedPrivKey`")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n xprv"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_metadata")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("origin"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" derivation_path"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"descriptor-templates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-templates"}},[t._v("#")]),t._v(" Descriptor templates")]),t._v(" "),a("p",[t._v("Instead of having to serialize keys to strings using "),a("code",[t._v("format!()")]),t._v(" just to place them somewhere inside a descriptor, you can now use descriptor templates to build a descriptor starting from a key and some other options\nin a couple of lines of code. You can use one of the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("provided templates"),a("OutboundLink")],1),t._v(" or make a custom one by implementing the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/descriptor/template/trait.DescriptorTemplate.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("DescriptorTemplate")]),a("OutboundLink")],1),t._v(" trait on a "),a("code",[t._v("struct")]),t._v(" or "),a("code",[t._v("enum")]),t._v(".")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" key "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bip32"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ExtendedPrivKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"..."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("clone")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("External")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Some")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("BIP84")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeychainKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Internal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Network")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Testnet")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MemoryDatabase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"easier-creation-of-blockchain-and-database"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#easier-creation-of-blockchain-and-database"}},[t._v("#")]),t._v(" Easier creation of "),a("code",[t._v("Blockchain")]),t._v(" and "),a("code",[t._v("Database")])]),t._v(" "),a("p",[t._v("We've added a new way to create a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" instance from a configuration, with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.ConfigurableBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableBlockchain")]),a("OutboundLink")],1),t._v(" trait. All the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types provided by the library implement this trait, which allows you to easily build an\ninstance of them starting from a configuration "),a("code",[t._v("struct")]),t._v(": moreover, the configuration structures implement "),a("code",[t._v("Serialize")]),t._v(" and "),a("code",[t._v("Deserialize")]),t._v(", so that they can be easily stored/loaded using "),a("code",[t._v("serde")]),t._v(".")]),t._v(" "),a("p",[t._v("We've also added a new "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" type called "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/any/enum.AnyBlockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyBlockchain")]),a("OutboundLink")],1),t._v(", which is essentially an "),a("code",[t._v("enum")]),t._v(" that wraps all the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" types exposed by the library. This allows you to build a "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/wallet/struct.Wallet.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Wallet")]),a("OutboundLink")],1),t._v(" that always has the same\nRust type, but that can internally use different "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/blockchain/trait.Blockchain.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Blockchain")]),a("OutboundLink")],1),t._v(" backends chosen at runtime.")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("blockchain"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ConfigurableBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ElectrumBlockchainConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('r#"{"Electrum":{"url":"ssl://electrum.blockstream.info:50002","socks5":null,"retry":3,"timeout":5}}"#')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("serde_json"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" blockchain "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AnyBlockchain")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_config")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The same is true for "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.Database.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("Database")]),a("OutboundLink")],1),t._v(" types, thanks to the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/trait.ConfigurableDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ConfigurableDatabase")]),a("OutboundLink")],1),t._v(" trait and the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/database/any/enum.AnyDatabase.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("AnyDatabase")]),a("OutboundLink")],1),t._v(" "),a("code",[t._v("enum")]),t._v(". While we think most people generally prefer to choose a single database type and then stick to it, it's still good\nto offer the choice to switch them at runtime, should somebody need that.")]),t._v(" "),a("h3",{attrs:{id:"descriptor-macro"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#descriptor-macro"}},[t._v("#")]),t._v(" "),a("code",[t._v("descriptor!()")]),t._v(" macro")]),t._v(" "),a("p",[t._v("If you start writing complex descriptor templates, you'll soon find yourself with the need of building large descriptor syntax trees: you can very easily do that with the "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("descriptor!()")]),a("OutboundLink")],1),t._v(" macro, with the added bonus that some additional checks on the\nsyntax of your descriptor will be performed at compile-time, rather than at runtime by. You can use any type that implements "),a("a",{attrs:{href:"https://docs.rs/bdk/0.2.0/bdk/keys/trait.ToDescriptorKey.html",target:"_blank",rel:"noopener noreferrer"}},[a("code",[t._v("ToDescriptorKey")]),a("OutboundLink")],1),t._v(" (even strings!) as keys in "),a("code",[t._v("pk()")]),t._v(", "),a("code",[t._v("multi()")]),t._v(" and "),a("code",[t._v("sortedmulti()")]),t._v(" fragments, and you can even mix\nthem in the same descriptor.")]),t._v(" "),a("p",[t._v("The syntax supported by the macro is almost exactly the same as the standard descriptor syntax we all know, with the only difference that modifiers should be specified individually rather than\ngrouped in a series of characters (see the example below).")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TimeDecayingMultisig")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Ok")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("timelock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("map_err")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token closure-params"}},[a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token closure-punctuation punctuation"}},[t._v("|")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("KeyError")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Message")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_string")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"support-for-sortedmulti"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#support-for-sortedmulti"}},[t._v("#")]),t._v(" Support for "),a("code",[t._v("sortedmulti()")])]),t._v(" "),a("p",[t._v("Thanks to the addition of "),a("code",[t._v("sortedmulti()")]),t._v(" in "),a("code",[t._v("rust-miniscript")]),t._v(", we can now also support them in BDK, which means we are getting more and more compatible with other descriptor-based wallets out there like Bitcoin Core.")]),t._v(" "),a("h2",{attrs:{id:"contributors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),a("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),a("p",[t._v("Since the "),a("code",[t._v("0.1.0-beta.1")]),t._v(" release over three months ago, we've had "),a("code",[t._v("213")]),t._v(" new commits made by "),a("code",[t._v("10")]),t._v(" different contributors for a total of "),a("code",[t._v("9990")]),t._v(" additions and "),a("code",[t._v("2993")]),t._v(" deletions. Here's the "),a("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/0.1.0-beta.1...v0.2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("A special thanks to the "),a("code",[t._v("7")]),t._v(" new contributors:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/eupn",target:"_blank",rel:"noopener noreferrer"}},[t._v("@eupn"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/justinmoon",target:"_blank",rel:"noopener noreferrer"}},[t._v("@justinmoon"),a("OutboundLink")],1),t._v(" - Justin Moon")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/Xekyo",target:"_blank",rel:"noopener noreferrer"}},[t._v("@Xekyo"),a("OutboundLink")],1),t._v(" - Mark Erhardt")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/RCasatta",target:"_blank",rel:"noopener noreferrer"}},[t._v("@RCasatta"),a("OutboundLink")],1),t._v(" - Riccardo Casatta")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/ulrichard",target:"_blank",rel:"noopener noreferrer"}},[t._v("@ulrichard"),a("OutboundLink")],1),t._v(" - Richard Ulrich")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/notmandatory",target:"_blank",rel:"noopener noreferrer"}},[t._v("@notmandatory"),a("OutboundLink")],1),t._v(" - Steve Myers")]),t._v(" "),a("li",[a("a",{attrs:{href:"https://github.com/willcl-ark",target:"_blank",rel:"noopener noreferrer"}},[t._v("@willcl-ark"),a("OutboundLink")],1),t._v(" - Will Clark")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/67.2683e61c.js b/assets/js/67.c17340ef.js similarity index 99% rename from assets/js/67.2683e61c.js rename to assets/js/67.c17340ef.js index c3ce826b68..31823d5eae 100644 --- a/assets/js/67.2683e61c.js +++ b/assets/js/67.c17340ef.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{425:function(t,s,e){"use strict";e.r(s);var a=e(7),n=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("A new release of BDK is out: the "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.3.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.3.0")]),s("OutboundLink")],1),t._v(" is a relatively small update compared to "),s("code",[t._v("v0.2.0")]),t._v(", but it still brings some nice APIs improvements and general bugfixes.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/75669049268bbc294564f8c6e0528e07a546258f/CHANGELOG.md#v030---v020",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.3.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v030"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v030"}},[t._v("#")]),t._v(" What's new in v0.3.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new improved APIs coming with this release:")]),t._v(" "),s("h3",{attrs:{id:"less-verbosity-when-using-walletnew-offline"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#less-verbosity-when-using-walletnew-offline"}},[t._v("#")]),t._v(" Less verbosity when using "),s("code",[t._v("Wallet::new_offline()")])]),t._v(" "),s("p",[t._v("Now you don't have to explicitly provide the "),s("code",[t._v("OfflineWallet<_>")]),t._v(" type anymore, saving you one import and making it much less verbose to use.")]),t._v(" "),s("p",[t._v("Where before you were doing:")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Now you can just write:")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"no-more-error-conversions-in-descriptortemplate"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#no-more-error-conversions-in-descriptortemplate"}},[t._v("#")]),t._v(" No more error conversions in "),s("code",[t._v("DescriptorTemplate")])]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DescriptorTemplate")]),t._v(" trait has been updated to return a "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/descriptor/error/enum.Error.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor::error::Error")]),s("OutboundLink")],1),t._v(" instead of a "),s("code",[t._v("KeyError")]),t._v(". The "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor!()")]),s("OutboundLink")],1),t._v(" macro has been updated as well, which means that now you can use the macro inside a "),s("code",[t._v("DescriptorTemplate::build()")]),t._v(" implementation\nwithout having to "),s("RouterLink",{attrs:{to:"/blog/2020/12/release-v0.2.0/#descriptor-macro"}},[t._v("map the error")]),t._v(", like so:")],1),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("timelock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"a-new-repo-for-the-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-new-repo-for-the-cli"}},[t._v("#")]),t._v(" A new repo for the CLI")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("cli")]),t._v(" module (and it's related "),s("code",[t._v("cli-utils")]),t._v(" feature) have been removed from the main BDK repo and moved to their new home, the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),s("OutboundLink")],1),t._v(" repo. The APIs exposed were mainly used internally, for the "),s("code",[t._v("repl")]),t._v(" and the "),s("a",{attrs:{href:"/bdk-cli/playground"}},[t._v("playground")]),t._v("\nin our website, but in case you were using one of those keep that in mind.")]),t._v(" "),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.2.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("24")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("404")]),t._v(" additions and "),s("code",[t._v("1243")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.2.0...v0.3.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/tcharding",target:"_blank",rel:"noopener noreferrer"}},[t._v("@tcharding"),s("OutboundLink")],1),t._v(" - Tobin C. Harding")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{424:function(t,s,e){"use strict";e.r(s);var a=e(7),n=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("A new release of BDK is out: the "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.3.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.3.0")]),s("OutboundLink")],1),t._v(" is a relatively small update compared to "),s("code",[t._v("v0.2.0")]),t._v(", but it still brings some nice APIs improvements and general bugfixes.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/75669049268bbc294564f8c6e0528e07a546258f/CHANGELOG.md#v030---v020",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.3.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v030"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v030"}},[t._v("#")]),t._v(" What's new in v0.3.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new improved APIs coming with this release:")]),t._v(" "),s("h3",{attrs:{id:"less-verbosity-when-using-walletnew-offline"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#less-verbosity-when-using-walletnew-offline"}},[t._v("#")]),t._v(" Less verbosity when using "),s("code",[t._v("Wallet::new_offline()")])]),t._v(" "),s("p",[t._v("Now you don't have to explicitly provide the "),s("code",[t._v("OfflineWallet<_>")]),t._v(" type anymore, saving you one import and making it much less verbose to use.")]),t._v(" "),s("p",[t._v("Where before you were doing:")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("OfflineWallet")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Now you can just write:")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" wallet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Wallet")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("new_offline")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"no-more-error-conversions-in-descriptortemplate"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#no-more-error-conversions-in-descriptortemplate"}},[t._v("#")]),t._v(" No more error conversions in "),s("code",[t._v("DescriptorTemplate")])]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("DescriptorTemplate")]),t._v(" trait has been updated to return a "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/descriptor/error/enum.Error.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor::error::Error")]),s("OutboundLink")],1),t._v(" instead of a "),s("code",[t._v("KeyError")]),t._v(". The "),s("a",{attrs:{href:"https://docs.rs/bdk/0.3.0/bdk/macro.descriptor.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("descriptor!()")]),s("OutboundLink")],1),t._v(" macro has been updated as well, which means that now you can use the macro inside a "),s("code",[t._v("DescriptorTemplate::build()")]),t._v(" implementation\nwithout having to "),s("RouterLink",{attrs:{to:"/blog/2020/12/release-v0.2.0/#descriptor-macro"}},[t._v("map the error")]),t._v(", like so:")],1),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("pub")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[t._v("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timelock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("u32")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("impl")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ToDescriptorKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Segwitv0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplate")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TimeDecayingMultisig")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("K")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("build")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Result")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DescriptorTemplateOut")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("descriptor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("bdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("descriptor!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("wsh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("thresh")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pk")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pk_b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("v"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("older")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("self")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("timelock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"a-new-repo-for-the-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-new-repo-for-the-cli"}},[t._v("#")]),t._v(" A new repo for the CLI")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("cli")]),t._v(" module (and it's related "),s("code",[t._v("cli-utils")]),t._v(" feature) have been removed from the main BDK repo and moved to their new home, the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[t._v("bdk-cli"),s("OutboundLink")],1),t._v(" repo. The APIs exposed were mainly used internally, for the "),s("code",[t._v("repl")]),t._v(" and the "),s("a",{attrs:{href:"/bdk-cli/playground"}},[t._v("playground")]),t._v("\nin our website, but in case you were using one of those keep that in mind.")]),t._v(" "),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.2.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("24")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("404")]),t._v(" additions and "),s("code",[t._v("1243")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.2.0...v0.3.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://github.com/tcharding",target:"_blank",rel:"noopener noreferrer"}},[t._v("@tcharding"),s("OutboundLink")],1),t._v(" - Tobin C. Harding")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/69.21c85af3.js b/assets/js/69.5afcde3f.js similarity index 98% rename from assets/js/69.21c85af3.js rename to assets/js/69.5afcde3f.js index b064b18913..eee02eadbc 100644 --- a/assets/js/69.21c85af3.js +++ b/assets/js/69.5afcde3f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{427:function(t,e,n){"use strict";n.r(e);var a=n(7),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.5.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.5.0")]),e("OutboundLink")],1),t._v(" is our first release licensed under Apache 2.0 and MIT, brings new features, bugfixes and some internal refactoring.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/f786f0e6241a3df47b96bbb07f1aba374bc73b2f/CHANGELOG.md#v050---v040",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.5.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v050"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v050"}},[t._v("#")]),t._v(" What's new in v0.5.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h3",{attrs:{id:"dual-licensing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dual-licensing"}},[t._v("#")]),t._v(" Dual Licensing")]),t._v(" "),e("p",[t._v("From now on BDK will be released under both Apache 2.0 and MIT, at your discretion. This change aligns our project with many other Rust crates and reiterates our commitment to a permissive licensing model.")]),t._v(" "),e("h3",{attrs:{id:"spending-foreign-utxos"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spending-foreign-utxos"}},[t._v("#")]),t._v(" Spending "),e("em",[t._v("foreign")]),t._v(" UTXOs")]),t._v(" "),e("p",[t._v("This release adds a new "),e("code",[t._v("TxBuilder")]),t._v(" method called "),e("a",{attrs:{href:"https://docs.rs/bdk/0.5.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_foreign_utxo",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("add_foreign_utxo()")]),e("OutboundLink")],1),t._v(", which can be used to spend UTXOs that don't belong to the "),e("code",[t._v("Wallet")]),t._v(". We think this is going to be very useful to developers working on multiparty\nprotocols like CoinJoins, Pay Join, etc.")]),t._v(" "),e("p",[t._v("It's as easy as giving the library a PSBT input and the satisfaction cost for that input:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nbuilder\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("60_000")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_foreign_utxo")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("foreign_utxo"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_psbt_input"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_satisfaction_weight"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v("\n")])])]),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.4.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("54")]),t._v(" new commits made by "),e("code",[t._v("7")]),t._v(" different contributors for a total of "),e("code",[t._v("1430")]),t._v(" additions and "),e("code",[t._v("1212")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.4.0...v0.5.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/davemo88",target:"_blank",rel:"noopener noreferrer"}},[t._v("@davemo88"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{428:function(t,e,n){"use strict";n.r(e);var a=n(7),s=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.5.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.5.0")]),e("OutboundLink")],1),t._v(" is our first release licensed under Apache 2.0 and MIT, brings new features, bugfixes and some internal refactoring.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/f786f0e6241a3df47b96bbb07f1aba374bc73b2f/CHANGELOG.md#v050---v040",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.5.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v050"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v050"}},[t._v("#")]),t._v(" What's new in v0.5.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h3",{attrs:{id:"dual-licensing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dual-licensing"}},[t._v("#")]),t._v(" Dual Licensing")]),t._v(" "),e("p",[t._v("From now on BDK will be released under both Apache 2.0 and MIT, at your discretion. This change aligns our project with many other Rust crates and reiterates our commitment to a permissive licensing model.")]),t._v(" "),e("h3",{attrs:{id:"spending-foreign-utxos"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#spending-foreign-utxos"}},[t._v("#")]),t._v(" Spending "),e("em",[t._v("foreign")]),t._v(" UTXOs")]),t._v(" "),e("p",[t._v("This release adds a new "),e("code",[t._v("TxBuilder")]),t._v(" method called "),e("a",{attrs:{href:"https://docs.rs/bdk/0.5.0/bdk/wallet/tx_builder/struct.TxBuilder.html#method.add_foreign_utxo",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("add_foreign_utxo()")]),e("OutboundLink")],1),t._v(", which can be used to spend UTXOs that don't belong to the "),e("code",[t._v("Wallet")]),t._v(". We think this is going to be very useful to developers working on multiparty\nprotocols like CoinJoins, Pay Join, etc.")]),t._v(" "),e("p",[t._v("It's as easy as giving the library a PSBT input and the satisfaction cost for that input:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nbuilder\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("60_000")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_foreign_utxo")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("foreign_utxo"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outpoint"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_psbt_input"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" foreign_utxo_satisfaction_weight"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v("\n")])])]),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.4.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("54")]),t._v(" new commits made by "),e("code",[t._v("7")]),t._v(" different contributors for a total of "),e("code",[t._v("1430")]),t._v(" additions and "),e("code",[t._v("1212")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.4.0...v0.5.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/davemo88",target:"_blank",rel:"noopener noreferrer"}},[t._v("@davemo88"),e("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/71.2e4adfaf.js b/assets/js/71.9f464778.js similarity index 99% rename from assets/js/71.2e4adfaf.js rename to assets/js/71.9f464778.js index 595a844f85..68754e0ee8 100644 --- a/assets/js/71.2e4adfaf.js +++ b/assets/js/71.9f464778.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{430:function(t,e,s){"use strict";s.r(e);var a=s(7),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.7.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.7.0")]),e("OutboundLink")],1),t._v(" improved APIs, a more robust signing process and various bugfixes and improvements.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/aaa9943a5f614da522cdac44af80adf941879210/CHANGELOG.md#v070---v060",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.7.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v070"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v070"}},[t._v("#")]),t._v(" What's new in v0.7.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h3",{attrs:{id:"new-signing-api"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#new-signing-api"}},[t._v("#")]),t._v(" New Signing API")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Wallet::sign()")]),t._v(" method has been updated to take a "),e("em",[t._v("mutable reference")]),t._v(" to a PSBT rather than consuming it entirely. This makes it easier to sign the same PSBT multiple times with different signers:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt "),e("span",{pre:!0,attrs:{class:"token operator"}},[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\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" alice_finalized "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet_alice"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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 keyword"}},[t._v("mut")]),t._v(" psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),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(")")]),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 keyword"}},[t._v("let")]),t._v(" bob_finalized "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet_bob"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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 keyword"}},[t._v("mut")]),t._v(" psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),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(")")]),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("p",[t._v("Under the hood, even more has changed around the way we make signatures: starting from this release, our signer will require by default that SegWit PSBTs also provide the "),e("code",[t._v("non_witness_utxo")]),t._v(' to mitigate the fee bruning "'),e("a",{attrs:{href:"https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd",target:"_blank",rel:"noopener noreferrer"}},[t._v("SegWit bug"),e("OutboundLink")],1),t._v('".')]),t._v(" "),e("p",[t._v("For this reason, the second argument of "),e("code",[t._v("Wallet::sign()")]),t._v(', which was initially used to optionally provide a different "current height" that the wallet would consider when trying to finalize the transaction, has been replaced with a more generic "options"\nargument of type '),e("a",{attrs:{href:"https://docs.rs/bdk/0.7.0/bdk/wallet/signer/struct.SignOptions.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("SignOptions")]),e("OutboundLink")],1),t._v(". This allows setting a different assumed block height and also opting out of requiring "),e("code",[t._v("non_witness_utxo")]),t._v(" by enabling the "),e("code",[t._v("trust_witness_utxo")]),t._v(" flag.")]),t._v(" "),e("p",[t._v("As a result of these new more strict requirements, BDK will also, by default, fill-in the "),e("code",[t._v("non_witness_utxo")]),t._v(" field when creating new PSBTs. The "),e("code",[t._v("TxBuilder::force_non_witness_utxo()")]),t._v(" option has been removed and a new one called\n"),e("code",[t._v("TxBuilder::only_witness_utxo()")]),t._v(" has been added, to allow users to opt-out of this new default behavior.")]),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("// Make a transaction that only contains the `witness_utxo`")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" details"),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("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n builder\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("send_to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("50_000")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("only_witness_utxo")]),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 builder"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),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 operator"}},[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 comment"}},[t._v("// Sign it by explicitly trusting just the `witness_utxo`")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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 keyword"}},[t._v("mut")]),t._v(" psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" trust_witness_utxo"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),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(" "),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 operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"support-timelocks-in-the-policy-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#support-timelocks-in-the-policy-module"}},[t._v("#")]),t._v(" Support Timelocks in the "),e("code",[t._v("policy")]),t._v(" Module")]),t._v(" "),e("p",[t._v('A less-known part of BDK is its "policy" module: its goal is to take a descriptor and encode the spending policy represented by that descriptor in a more "user-friendly" format. On top of that, the module\ntries to provide a summary for what a user\'s descriptor can '),e("em",[t._v("contribute")]),t._v(" to a transaction. For instance, given a 2-of-2 multisig policy, a descriptor that contains only the two public keys can't "),e("em",[t._v("contribute")]),t._v(" anything,\nwhile a descriptor that has one or both private keys can, respectively, "),e("em",[t._v("contribute to")]),t._v(" and "),e("em",[t._v("satisfy")]),t._v(" the policy by making signatures.")]),t._v(" "),e("p",[t._v("In release "),e("code",[t._v("v0.5.0")]),t._v(" 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\nand what's missing to fully satisfy a descriptor.")]),t._v(" "),e("p",[t._v("In this release we are starting to take timelocks into consideration when computing the "),e("em",[t._v("satisfaction")]),t._v(" component of a policy: this means that we can consider timelocks that are already expired as fully satisfied and also\nexclude policy branches that require specific "),e("code",[t._v("nLockTime")]),t._v(" or "),e("code",[t._v("nSequence")]),t._v(" values, if those aren't correctly set in the transaction.")]),t._v(" "),e("p",[t._v("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.")]),t._v(" "),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.6.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("39")]),t._v(" new commits made by "),e("code",[t._v("6")]),t._v(" different contributors for a total of "),e("code",[t._v("698")]),t._v(" additions and "),e("code",[t._v("309")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.6.0...v0.7.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/rajarshimaitra",target:"_blank",rel:"noopener noreferrer"}},[t._v("@rajarshimaitra"),e("OutboundLink")],1),t._v(" - Raj")])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{427:function(t,e,s){"use strict";s.r(e);var a=s(7),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("p",[t._v("A new release of BDK is out: "),e("a",{attrs:{href:"https://crates.io/crates/bdk/0.7.0",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("v0.7.0")]),e("OutboundLink")],1),t._v(" improved APIs, a more robust signing process and various bugfixes and improvements.")]),t._v(" "),e("p",[t._v("You can find the full "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/aaa9943a5f614da522cdac44af80adf941879210/CHANGELOG.md#v070---v060",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.7.0 changelog"),e("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),e("h2",{attrs:{id:"whats-new-in-v070"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v070"}},[t._v("#")]),t._v(" What's new in v0.7.0")]),t._v(" "),e("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),e("h3",{attrs:{id:"new-signing-api"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#new-signing-api"}},[t._v("#")]),t._v(" New Signing API")]),t._v(" "),e("p",[t._v("The "),e("code",[t._v("Wallet::sign()")]),t._v(" method has been updated to take a "),e("em",[t._v("mutable reference")]),t._v(" to a PSBT rather than consuming it entirely. This makes it easier to sign the same PSBT multiple times with different signers:")]),t._v(" "),e("div",{staticClass:"language-rust extra-class"},[e("pre",{pre:!0,attrs:{class:"language-rust"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt "),e("span",{pre:!0,attrs:{class:"token operator"}},[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\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" alice_finalized "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet_alice"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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 keyword"}},[t._v("mut")]),t._v(" psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),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(")")]),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 keyword"}},[t._v("let")]),t._v(" bob_finalized "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet_bob"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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 keyword"}},[t._v("mut")]),t._v(" psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),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(")")]),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("p",[t._v("Under the hood, even more has changed around the way we make signatures: starting from this release, our signer will require by default that SegWit PSBTs also provide the "),e("code",[t._v("non_witness_utxo")]),t._v(' to mitigate the fee bruning "'),e("a",{attrs:{href:"https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd",target:"_blank",rel:"noopener noreferrer"}},[t._v("SegWit bug"),e("OutboundLink")],1),t._v('".')]),t._v(" "),e("p",[t._v("For this reason, the second argument of "),e("code",[t._v("Wallet::sign()")]),t._v(', which was initially used to optionally provide a different "current height" that the wallet would consider when trying to finalize the transaction, has been replaced with a more generic "options"\nargument of type '),e("a",{attrs:{href:"https://docs.rs/bdk/0.7.0/bdk/wallet/signer/struct.SignOptions.html",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("SignOptions")]),e("OutboundLink")],1),t._v(". This allows setting a different assumed block height and also opting out of requiring "),e("code",[t._v("non_witness_utxo")]),t._v(" by enabling the "),e("code",[t._v("trust_witness_utxo")]),t._v(" flag.")]),t._v(" "),e("p",[t._v("As a result of these new more strict requirements, BDK will also, by default, fill-in the "),e("code",[t._v("non_witness_utxo")]),t._v(" field when creating new PSBTs. The "),e("code",[t._v("TxBuilder::force_non_witness_utxo()")]),t._v(" option has been removed and a new one called\n"),e("code",[t._v("TxBuilder::only_witness_utxo()")]),t._v(" has been added, to allow users to opt-out of this new default behavior.")]),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("// Make a transaction that only contains the `witness_utxo`")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" details"),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("let")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("build_tx")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n builder\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("add_recipient")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("send_to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("50_000")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("only_witness_utxo")]),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 builder"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("finish")]),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 operator"}},[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 comment"}},[t._v("// Sign it by explicitly trusting just the `witness_utxo`")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),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 keyword"}},[t._v("mut")]),t._v(" psbt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" trust_witness_utxo"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),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(" "),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 operator"}},[t._v("?")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),e("h3",{attrs:{id:"support-timelocks-in-the-policy-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#support-timelocks-in-the-policy-module"}},[t._v("#")]),t._v(" Support Timelocks in the "),e("code",[t._v("policy")]),t._v(" Module")]),t._v(" "),e("p",[t._v('A less-known part of BDK is its "policy" module: its goal is to take a descriptor and encode the spending policy represented by that descriptor in a more "user-friendly" format. On top of that, the module\ntries to provide a summary for what a user\'s descriptor can '),e("em",[t._v("contribute")]),t._v(" to a transaction. For instance, given a 2-of-2 multisig policy, a descriptor that contains only the two public keys can't "),e("em",[t._v("contribute")]),t._v(" anything,\nwhile a descriptor that has one or both private keys can, respectively, "),e("em",[t._v("contribute to")]),t._v(" and "),e("em",[t._v("satisfy")]),t._v(" the policy by making signatures.")]),t._v(" "),e("p",[t._v("In release "),e("code",[t._v("v0.5.0")]),t._v(" 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\nand what's missing to fully satisfy a descriptor.")]),t._v(" "),e("p",[t._v("In this release we are starting to take timelocks into consideration when computing the "),e("em",[t._v("satisfaction")]),t._v(" component of a policy: this means that we can consider timelocks that are already expired as fully satisfied and also\nexclude policy branches that require specific "),e("code",[t._v("nLockTime")]),t._v(" or "),e("code",[t._v("nSequence")]),t._v(" values, if those aren't correctly set in the transaction.")]),t._v(" "),e("p",[t._v("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.")]),t._v(" "),e("h2",{attrs:{id:"contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),e("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),e("p",[t._v("Since the "),e("code",[t._v("v0.6.0")]),t._v(" release around a month ago, we've had "),e("code",[t._v("39")]),t._v(" new commits made by "),e("code",[t._v("6")]),t._v(" different contributors for a total of "),e("code",[t._v("698")]),t._v(" additions and "),e("code",[t._v("309")]),t._v(" deletions. Here's the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.6.0...v0.7.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),e("OutboundLink")],1),t._v(".")]),t._v(" "),e("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"https://github.com/rajarshimaitra",target:"_blank",rel:"noopener noreferrer"}},[t._v("@rajarshimaitra"),e("OutboundLink")],1),t._v(" - Raj")])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/72.3dd57922.js b/assets/js/72.1c2cf134.js similarity index 99% rename from assets/js/72.3dd57922.js rename to assets/js/72.1c2cf134.js index 18a9767ad5..f01bdfdea0 100644 --- a/assets/js/72.3dd57922.js +++ b/assets/js/72.1c2cf134.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{428:function(t,s,a){"use strict";a.r(s);var e=a(7),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("A new release of BDK is out: "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.8.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.8.0")]),s("OutboundLink")],1),t._v(" brings new APIs and other minor bugfixes and internal improvements.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/67714adc80669129eff2cad8991609d3b1c41cb9/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.8.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v080"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v080"}},[t._v("#")]),t._v(" What's new in v0.8.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),s("h3",{attrs:{id:"getting-the-derivation-index"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-the-derivation-index"}},[t._v("#")]),t._v(" Getting the Derivation Index")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("Wallet::get_address()")]),t._v(" method now returns an "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/struct.AddressInfo.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("AddressInfo")]),s("OutboundLink")],1),t._v(" structure, rather than a simple "),s("code",[t._v("Address")]),t._v(". This new structure contains the address but also the derivation index, which can be useful in some contexts.")]),t._v(" "),s("p",[t._v("Since the structure implements "),s("code",[t._v("Deref")]),t._v(" it can be used directly as a "),s("code",[t._v("&Address")]),t._v(", which simplifies migrating to this change a little bit.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address_info "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Print the address and derivation index")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Address #{}: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use the `AddressInfo` structure directly like an `Address`")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" script_pubkey "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"explicitly-enable-non-all-sighashes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explicitly-enable-non-all-sighashes"}},[t._v("#")]),t._v(" Explicitly Enable non-ALL Sighashes")]),t._v(" "),s("p",[t._v("To mitigate potential attacks in multiparty protocols, this release includes a new "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/signer/struct.SignOptions.html#structfield.allow_all_sighashes",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("SignOptions::allow_all_sighashes")]),s("OutboundLink")],1),t._v(" option that must be explicitly enabled to let the signers produce signatures\nwith any non-ALL sighash.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fails if the psbt uses non-ALL sighashes")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Produces a signature successfully")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" allow_all_sighashes"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.7.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("39")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("1540")]),t._v(" additions and "),s("code",[t._v("1380")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.7.0...v0.8.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[t._v("[@futurepaul][@futurepaul] - Paul Miller")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{430:function(t,s,a){"use strict";a.r(s);var e=a(7),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("p",[t._v("A new release of BDK is out: "),s("a",{attrs:{href:"https://crates.io/crates/bdk/0.8.0",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("v0.8.0")]),s("OutboundLink")],1),t._v(" brings new APIs and other minor bugfixes and internal improvements.")]),t._v(" "),s("p",[t._v("You can find the full "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/blob/67714adc80669129eff2cad8991609d3b1c41cb9/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("v0.8.0 changelog"),s("OutboundLink")],1),t._v(" on GitHub.")]),t._v(" "),s("h2",{attrs:{id:"whats-new-in-v080"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#whats-new-in-v080"}},[t._v("#")]),t._v(" What's new in v0.8.0")]),t._v(" "),s("p",[t._v("Below are some highlights of the new release:")]),t._v(" "),s("h3",{attrs:{id:"getting-the-derivation-index"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getting-the-derivation-index"}},[t._v("#")]),t._v(" Getting the Derivation Index")]),t._v(" "),s("p",[t._v("The "),s("code",[t._v("Wallet::get_address()")]),t._v(" method now returns an "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/struct.AddressInfo.html",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("AddressInfo")]),s("OutboundLink")],1),t._v(" structure, rather than a simple "),s("code",[t._v("Address")]),t._v(". This new structure contains the address but also the derivation index, which can be useful in some contexts.")]),t._v(" "),s("p",[t._v("Since the structure implements "),s("code",[t._v("Deref")]),t._v(" it can be used directly as a "),s("code",[t._v("&Address")]),t._v(", which simplifies migrating to this change a little bit.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" address_info "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("get_address")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AddressInfo")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("New")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Print the address and derivation index")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("println!")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Address #{}: {}"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Use the `AddressInfo` structure directly like an `Address`")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" script_pubkey "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address_info"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("script_pubkey")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"explicitly-enable-non-all-sighashes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#explicitly-enable-non-all-sighashes"}},[t._v("#")]),t._v(" Explicitly Enable non-ALL Sighashes")]),t._v(" "),s("p",[t._v("To mitigate potential attacks in multiparty protocols, this release includes a new "),s("a",{attrs:{href:"https://docs.rs/bdk/0.8.0/bdk/wallet/signer/struct.SignOptions.html#structfield.allow_all_sighashes",target:"_blank",rel:"noopener noreferrer"}},[s("code",[t._v("SignOptions::allow_all_sighashes")]),s("OutboundLink")],1),t._v(" option that must be explicitly enabled to let the signers produce signatures\nwith any non-ALL sighash.")]),t._v(" "),s("div",{staticClass:"language-rust extra-class"},[s("pre",{pre:!0,attrs:{class:"language-rust"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("...")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Fails if the psbt uses non-ALL sighashes")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Produces a signature successfully")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" finalized "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" wallet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sign")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" psbt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SignOptions")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" allow_all_sighashes"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"contributors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributors"}},[t._v("#")]),t._v(" Contributors")]),t._v(" "),s("p",[t._v("A huge thanks to everybody who contributed to this new release with suggestions, pull requests and bug reports.")]),t._v(" "),s("p",[t._v("Since the "),s("code",[t._v("v0.7.0")]),t._v(" release around a month ago, we've had "),s("code",[t._v("39")]),t._v(" new commits made by "),s("code",[t._v("6")]),t._v(" different contributors for a total of "),s("code",[t._v("1540")]),t._v(" additions and "),s("code",[t._v("1380")]),t._v(" deletions. Here's the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/compare/v0.7.0...v0.8.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("full diff"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("p",[t._v("A special thanks to the new contributor for this release:")]),t._v(" "),s("ul",[s("li",[t._v("[@futurepaul][@futurepaul] - Paul Miller")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/74.8a409e4e.js b/assets/js/74.ae6867a4.js similarity index 99% rename from assets/js/74.8a409e4e.js rename to assets/js/74.ae6867a4.js index da2048ca48..6583740f1b 100644 --- a/assets/js/74.8a409e4e.js +++ b/assets/js/74.ae6867a4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{433:function(e,t,o){"use strict";o.r(t);var a=o(7),i=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("Over the past few months the work on "),t("a",{attrs:{href:"https://github.com/LLFourn/bdk_core_staging",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk_core"),t("OutboundLink")],1),e._v(" quietly continued behind the scenes, and as the time went on it started expanding beyond the scope of just improving the "),t("em",[e._v("syncing")]),e._v(" mechanism of BDK. Being a new fresh\nproject it allowed for iterating much faster, and we soon realized we could make large improvements to the general architecture of BDK to fix many of the issues and shortcomings found over time.")]),e._v(" "),t("p",[e._v("For this reason, we decided to move forward with the project and start planning the integration into BDK itself. This blog post will briefly describe the new concept for how BDK will be structured and lay down a plan\nfor the development in the next few months.")]),e._v(" "),t("h2",{attrs:{id:"goals"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#goals"}},[e._v("#")]),e._v(" Goals")]),e._v(" "),t("p",[e._v("First of all, we should outline at least the main goals of BDK 1.0, ergo what we want to improve over the current state of the project.")]),e._v(" "),t("h3",{attrs:{id:"stable-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#stable-api"}},[e._v("#")]),e._v(" Stable API")]),e._v(" "),t("p",[e._v("Ever since the "),t("code",[e._v("0.1.0")]),e._v(" release of BDK we've always broken the API with each release. Most of the time in minor and very contained ways, but in "),t("em",[e._v("some")]),e._v(" way nonetheless. One of the main sources of breakage have been\nthe "),t("code",[e._v("Blockchain")]),e._v(" and "),t("code",[e._v("Database")]),e._v(" traits. Those two together are used in essentially any operation a user may do on a "),t("code",[e._v("Wallet")]),e._v(", and are thus impacted by any relatively large change or new feature added to the code.")]),e._v(" "),t("p",[e._v("Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/515",target:"_blank",rel:"noopener noreferrer"}},[e._v("keep track of whether a UTXO is spent"),t("OutboundLink")],1),e._v("? You need to change the "),t("code",[e._v("Database")]),e._v(" that stores this information. Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/669",target:"_blank",rel:"noopener noreferrer"}},[e._v("know the timestamp of the latest block"),t("OutboundLink")],1),e._v("?\nYou need to change the "),t("code",[e._v("Blockchain")]),e._v(" trait to fetch that extra bit of information. And the list goes on and on.")]),e._v(" "),t("p",[e._v("Since making changes to these traits is always so painful for us and our downstream users, this ended up delaying or considerably slowing down the development of new features in BDK.")]),e._v(" "),t("p",[e._v("bdk_core tries to minimize the (ab)use of traits, and this will help immensely when trying to provide a stable API for our users.")]),e._v(" "),t("h3",{attrs:{id:"upstreaming-our-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upstreaming-our-code"}},[e._v("#")]),e._v(" Upstreaming our code")]),e._v(" "),t("p",[e._v("BDK internally implements many features that could be useful to other projects as well. While working on this integration we will also try to upstream some of our code to the relevant crates, mainly "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("rust-miniscript")]),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("This has essentially three benefits:")]),e._v(" "),t("ol",[t("li",[e._v("A new set of eyes will take a look at the code, potentially spotting issues or suggesting improvements")]),e._v(" "),t("li",[e._v("This will lower the amount of code that we have to maintain ourselves")]),e._v(" "),t("li",[e._v("Other people can benefit from our code, which was previously tightly integrated into BDK and hard to re-use")])]),e._v(" "),t("h3",{attrs:{id:"partially-syncing-a-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#partially-syncing-a-wallet"}},[e._v("#")]),e._v(" Partially Syncing a Wallet")]),e._v(" "),t("p",[e._v("This single point was the main reason the bdk_core project was kickstarted, and it means giving our users the ability to incrementally sync a wallet over time instead of working in single big batches.")]),e._v(" "),t("p",[e._v("This is explained very well in the "),t("RouterLink",{attrs:{to:"/blog/bdk-core-pt1/"}},[e._v("first bdk_core post")]),e._v(", so I won't go into details here. Think of this as a much more flexible way to sync a wallet, which in turn will allow us to simplify our current implementation\nof blockchain backends like compact block filters, and also offer a better API for our users.")],1),e._v(" "),t("h3",{attrs:{id:"no-std"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#no-std"}},[e._v("#")]),e._v(" "),t("code",[e._v("no_std")])]),e._v(" "),t("p",[e._v("bdk_core is built with "),t("code",[e._v("no_std")]),e._v(" in mind since the beginning, something we've been wanting to support in BDK "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/205",target:"_blank",rel:"noopener noreferrer"}},[e._v("for a long time"),t("OutboundLink")],1),e._v('. Being more modular means the "core" module doesn\'t really need that many dependencies,\nand this really simplifies the '),t("code",[e._v("no_std")]),e._v(" work.")]),e._v(" "),t("p",[e._v("This will allow the main components of BDK to work on embedded hardware as well, making it possible to use the library as a foundation for any Bitcoin hardware device like hardware wallets.")]),e._v(" "),t("h3",{attrs:{id:"lower-msrv"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#lower-msrv"}},[e._v("#")]),e._v(" Lower MSRV")]),e._v(" "),t("p",[e._v("Removing many of our current dependencies from the core components of BDK will also allow us to lower our MSRV considerably, which in turn will allow BDK to compile on older distros or entirely different toolchains like\n"),t("a",{attrs:{href:"https://github.com/thepowersgang/mrustc",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("mrustc")]),t("OutboundLink")],1),e._v(", which usually don't keep up with "),t("code",[e._v("rustc")]),e._v(" in terms of language features.")]),e._v(" "),t("h2",{attrs:{id:"architecture"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[e._v("#")]),e._v(" Architecture")]),e._v(" "),t("p",[e._v("Roughly speaking, after integrating bdk_core into BDK the architecture will look like this:")]),e._v(" "),t("ul",[t("li",[e._v("bdk_core: this crate will contain all the low level components of a Bitcoin wallet. For example, using this low level API it will be possible to keep track of arbitrary scripts (without the limitations"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v("\nof descriptors) or apply individual blocks to the state of the wallet")]),e._v(" "),t("li",[e._v("bdk_compat: this crate will use the components provided by bdk_core to implement a descriptor-based wallet that supports up to two "),t("em",[e._v("keychains")]),e._v(", like our current "),t("code",[e._v("Wallet")]),e._v(" implementation does. It will allow our\nusers to upgrade to BDK 1.0 with minimal changes to their code, but being a compatibility layer it will probably lack many of the advanced features that bdk_core brings to the table")]),e._v(" "),t("li",[e._v("bdk_"),t("em",[e._v("")]),e._v(": the blockchain backends like Esplora, Electrum, RPC, will be moved into individual separate crates that users can decide to include individually")])]),e._v(" "),t("h2",{attrs:{id:"timeline"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#timeline"}},[e._v("#")]),e._v(" Timeline")]),e._v(" "),t("p",[e._v("We can't provide a precise timeline because it's a big development effort and it also depends on some relatively large PRs making into upstream project. That said, here's our rough plan:")]),e._v(" "),t("ol",[t("li",[e._v("October: during this month we will work on opening a PR to integrate bdk_core into BDK")]),e._v(" "),t("li",[e._v("November: review of the PR, work on upstreaming our code to "),t("code",[e._v("rust-miniscript")])]),e._v(" "),t("li",[e._v("December: finishing touches, examples, documentation")])]),e._v(" "),t("h2",{attrs:{id:"feature-freezing-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#feature-freezing-bdk"}},[e._v("#")]),e._v(" Feature Freezing BDK")]),e._v(" "),t("p",[e._v("With our focus shifting to bdk_core we are officially "),t("em",[e._v("feature freezing")]),e._v(" BDK starting from release "),t("code",[e._v("0.23")]),e._v(" (which will be published on October 6th). This means that we won't be adding any new features to BDK until the\nintegration is completed, because it takes a lot of effort to implement and/or review them, and there's the risk that most of the code will have to be re-done or thrown away anyway when moving to bdk_core.")]),e._v(" "),t("p",[e._v("A notable exception to this rule will be the upcoming "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/770",target:"_blank",rel:"noopener noreferrer"}},[e._v("upgrade to "),t("code",[e._v("rust-bitcoin")]),e._v(" "),t("code",[e._v("0.29")]),t("OutboundLink")],1),e._v(", which is now planned for the release "),t("code",[e._v("0.24")]),e._v(" since "),t("code",[e._v("rust-miniscript")]),e._v(" "),t("code",[e._v("8.0.0")]),e._v(" hasn't been released in time for "),t("code",[e._v("0.23")]),e._v(".")]),e._v(" "),t("p",[e._v("During this feature freeze period we will keep maintaining the library, updating our dependencies, fixing bugs and making releases accordingly.")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("This is an exciting new development for BDK, a well needed refresh to an architecture that hasn't changed much over time, but that it's starting to show its age. This integration will open up so many new possibilities\nfor our downstream users, and it's a major step towards our goal of providing simple, yet powerful tools for Bitcoin developers 🚀.")]),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("Not every script can be expressed as descriptor "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{432:function(e,t,o){"use strict";o.r(t);var a=o(7),i=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("p",[e._v("Over the past few months the work on "),t("a",{attrs:{href:"https://github.com/LLFourn/bdk_core_staging",target:"_blank",rel:"noopener noreferrer"}},[e._v("bdk_core"),t("OutboundLink")],1),e._v(" quietly continued behind the scenes, and as the time went on it started expanding beyond the scope of just improving the "),t("em",[e._v("syncing")]),e._v(" mechanism of BDK. Being a new fresh\nproject it allowed for iterating much faster, and we soon realized we could make large improvements to the general architecture of BDK to fix many of the issues and shortcomings found over time.")]),e._v(" "),t("p",[e._v("For this reason, we decided to move forward with the project and start planning the integration into BDK itself. This blog post will briefly describe the new concept for how BDK will be structured and lay down a plan\nfor the development in the next few months.")]),e._v(" "),t("h2",{attrs:{id:"goals"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#goals"}},[e._v("#")]),e._v(" Goals")]),e._v(" "),t("p",[e._v("First of all, we should outline at least the main goals of BDK 1.0, ergo what we want to improve over the current state of the project.")]),e._v(" "),t("h3",{attrs:{id:"stable-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#stable-api"}},[e._v("#")]),e._v(" Stable API")]),e._v(" "),t("p",[e._v("Ever since the "),t("code",[e._v("0.1.0")]),e._v(" release of BDK we've always broken the API with each release. Most of the time in minor and very contained ways, but in "),t("em",[e._v("some")]),e._v(" way nonetheless. One of the main sources of breakage have been\nthe "),t("code",[e._v("Blockchain")]),e._v(" and "),t("code",[e._v("Database")]),e._v(" traits. Those two together are used in essentially any operation a user may do on a "),t("code",[e._v("Wallet")]),e._v(", and are thus impacted by any relatively large change or new feature added to the code.")]),e._v(" "),t("p",[e._v("Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/515",target:"_blank",rel:"noopener noreferrer"}},[e._v("keep track of whether a UTXO is spent"),t("OutboundLink")],1),e._v("? You need to change the "),t("code",[e._v("Database")]),e._v(" that stores this information. Want to "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/669",target:"_blank",rel:"noopener noreferrer"}},[e._v("know the timestamp of the latest block"),t("OutboundLink")],1),e._v("?\nYou need to change the "),t("code",[e._v("Blockchain")]),e._v(" trait to fetch that extra bit of information. And the list goes on and on.")]),e._v(" "),t("p",[e._v("Since making changes to these traits is always so painful for us and our downstream users, this ended up delaying or considerably slowing down the development of new features in BDK.")]),e._v(" "),t("p",[e._v("bdk_core tries to minimize the (ab)use of traits, and this will help immensely when trying to provide a stable API for our users.")]),e._v(" "),t("h3",{attrs:{id:"upstreaming-our-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upstreaming-our-code"}},[e._v("#")]),e._v(" Upstreaming our code")]),e._v(" "),t("p",[e._v("BDK internally implements many features that could be useful to other projects as well. While working on this integration we will also try to upstream some of our code to the relevant crates, mainly "),t("a",{attrs:{href:"https://github.com/rust-bitcoin/rust-miniscript",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("rust-miniscript")]),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("This has essentially three benefits:")]),e._v(" "),t("ol",[t("li",[e._v("A new set of eyes will take a look at the code, potentially spotting issues or suggesting improvements")]),e._v(" "),t("li",[e._v("This will lower the amount of code that we have to maintain ourselves")]),e._v(" "),t("li",[e._v("Other people can benefit from our code, which was previously tightly integrated into BDK and hard to re-use")])]),e._v(" "),t("h3",{attrs:{id:"partially-syncing-a-wallet"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#partially-syncing-a-wallet"}},[e._v("#")]),e._v(" Partially Syncing a Wallet")]),e._v(" "),t("p",[e._v("This single point was the main reason the bdk_core project was kickstarted, and it means giving our users the ability to incrementally sync a wallet over time instead of working in single big batches.")]),e._v(" "),t("p",[e._v("This is explained very well in the "),t("RouterLink",{attrs:{to:"/blog/bdk-core-pt1/"}},[e._v("first bdk_core post")]),e._v(", so I won't go into details here. Think of this as a much more flexible way to sync a wallet, which in turn will allow us to simplify our current implementation\nof blockchain backends like compact block filters, and also offer a better API for our users.")],1),e._v(" "),t("h3",{attrs:{id:"no-std"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#no-std"}},[e._v("#")]),e._v(" "),t("code",[e._v("no_std")])]),e._v(" "),t("p",[e._v("bdk_core is built with "),t("code",[e._v("no_std")]),e._v(" in mind since the beginning, something we've been wanting to support in BDK "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/issues/205",target:"_blank",rel:"noopener noreferrer"}},[e._v("for a long time"),t("OutboundLink")],1),e._v('. Being more modular means the "core" module doesn\'t really need that many dependencies,\nand this really simplifies the '),t("code",[e._v("no_std")]),e._v(" work.")]),e._v(" "),t("p",[e._v("This will allow the main components of BDK to work on embedded hardware as well, making it possible to use the library as a foundation for any Bitcoin hardware device like hardware wallets.")]),e._v(" "),t("h3",{attrs:{id:"lower-msrv"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#lower-msrv"}},[e._v("#")]),e._v(" Lower MSRV")]),e._v(" "),t("p",[e._v("Removing many of our current dependencies from the core components of BDK will also allow us to lower our MSRV considerably, which in turn will allow BDK to compile on older distros or entirely different toolchains like\n"),t("a",{attrs:{href:"https://github.com/thepowersgang/mrustc",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("mrustc")]),t("OutboundLink")],1),e._v(", which usually don't keep up with "),t("code",[e._v("rustc")]),e._v(" in terms of language features.")]),e._v(" "),t("h2",{attrs:{id:"architecture"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[e._v("#")]),e._v(" Architecture")]),e._v(" "),t("p",[e._v("Roughly speaking, after integrating bdk_core into BDK the architecture will look like this:")]),e._v(" "),t("ul",[t("li",[e._v("bdk_core: this crate will contain all the low level components of a Bitcoin wallet. For example, using this low level API it will be possible to keep track of arbitrary scripts (without the limitations"),t("sup",{staticClass:"footnote-ref"},[t("a",{attrs:{href:"#fn1",id:"fnref1"}},[e._v("[1]")])]),e._v("\nof descriptors) or apply individual blocks to the state of the wallet")]),e._v(" "),t("li",[e._v("bdk_compat: this crate will use the components provided by bdk_core to implement a descriptor-based wallet that supports up to two "),t("em",[e._v("keychains")]),e._v(", like our current "),t("code",[e._v("Wallet")]),e._v(" implementation does. It will allow our\nusers to upgrade to BDK 1.0 with minimal changes to their code, but being a compatibility layer it will probably lack many of the advanced features that bdk_core brings to the table")]),e._v(" "),t("li",[e._v("bdk_"),t("em",[e._v("")]),e._v(": the blockchain backends like Esplora, Electrum, RPC, will be moved into individual separate crates that users can decide to include individually")])]),e._v(" "),t("h2",{attrs:{id:"timeline"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#timeline"}},[e._v("#")]),e._v(" Timeline")]),e._v(" "),t("p",[e._v("We can't provide a precise timeline because it's a big development effort and it also depends on some relatively large PRs making into upstream project. That said, here's our rough plan:")]),e._v(" "),t("ol",[t("li",[e._v("October: during this month we will work on opening a PR to integrate bdk_core into BDK")]),e._v(" "),t("li",[e._v("November: review of the PR, work on upstreaming our code to "),t("code",[e._v("rust-miniscript")])]),e._v(" "),t("li",[e._v("December: finishing touches, examples, documentation")])]),e._v(" "),t("h2",{attrs:{id:"feature-freezing-bdk"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#feature-freezing-bdk"}},[e._v("#")]),e._v(" Feature Freezing BDK")]),e._v(" "),t("p",[e._v("With our focus shifting to bdk_core we are officially "),t("em",[e._v("feature freezing")]),e._v(" BDK starting from release "),t("code",[e._v("0.23")]),e._v(" (which will be published on October 6th). This means that we won't be adding any new features to BDK until the\nintegration is completed, because it takes a lot of effort to implement and/or review them, and there's the risk that most of the code will have to be re-done or thrown away anyway when moving to bdk_core.")]),e._v(" "),t("p",[e._v("A notable exception to this rule will be the upcoming "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk/pull/770",target:"_blank",rel:"noopener noreferrer"}},[e._v("upgrade to "),t("code",[e._v("rust-bitcoin")]),e._v(" "),t("code",[e._v("0.29")]),t("OutboundLink")],1),e._v(", which is now planned for the release "),t("code",[e._v("0.24")]),e._v(" since "),t("code",[e._v("rust-miniscript")]),e._v(" "),t("code",[e._v("8.0.0")]),e._v(" hasn't been released in time for "),t("code",[e._v("0.23")]),e._v(".")]),e._v(" "),t("p",[e._v("During this feature freeze period we will keep maintaining the library, updating our dependencies, fixing bugs and making releases accordingly.")]),e._v(" "),t("h2",{attrs:{id:"conclusion"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#conclusion"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),t("p",[e._v("This is an exciting new development for BDK, a well needed refresh to an architecture that hasn't changed much over time, but that it's starting to show its age. This integration will open up so many new possibilities\nfor our downstream users, and it's a major step towards our goal of providing simple, yet powerful tools for Bitcoin developers 🚀.")]),e._v(" "),t("hr",{staticClass:"footnotes-sep"}),e._v(" "),t("section",{staticClass:"footnotes"},[t("ol",{staticClass:"footnotes-list"},[t("li",{staticClass:"footnote-item",attrs:{id:"fn1"}},[t("p",[e._v("Not every script can be expressed as descriptor "),t("a",{staticClass:"footnote-backref",attrs:{href:"#fnref1"}},[e._v("↩︎")])])])])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/75.e1920f80.js b/assets/js/75.fc268886.js similarity index 99% rename from assets/js/75.e1920f80.js rename to assets/js/75.fc268886.js index e41199398d..546ed83973 100644 --- a/assets/js/75.e1920f80.js +++ b/assets/js/75.fc268886.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{432:function(a,s,t){"use strict";t.r(s);var e=t(7),n=Object(e.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),s("p",[a._v("In this post we will use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk-cli"),s("OutboundLink")],1),a._v(" tool to demonstrate how to use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk"),s("OutboundLink")],1),a._v(" library to:")]),a._v(" "),s("ol",[s("li",[a._v("generate "),s("em",[a._v("testnet")]),a._v(" public and private keys")]),a._v(" "),s("li",[a._v("create "),s("a",{attrs:{href:"https://bitcoinops.org/en/topics/psbt/",target:"_blank",rel:"noopener noreferrer"}},[a._v("PSBT"),s("OutboundLink")],1),a._v("s that can be spent based on different "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript spending policies"),s("OutboundLink")],1)]),a._v(" "),s("li",[a._v("cooperatively sign and finalize the resulting PSBTs")]),a._v(" "),s("li",[a._v("broadcast and confirm spending transactions")])]),a._v(" "),s("p",[a._v("The scenario we will simulate is a wallet with two spending policies:")]),a._v(" "),s("p",[a._v("A. "),s("strong",[a._v("three")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign spending transaction input "),s("a",{attrs:{href:"https://developer.bitcoin.org/glossary.html",target:"_blank",rel:"noopener noreferrer"}},[a._v("UTXO"),s("OutboundLink")],1),a._v("s, "),s("strong",[a._v("OR")])]),a._v(" "),s("p",[a._v("B. "),s("strong",[a._v("two")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign "),s("strong",[a._v("AND")]),a._v(" the input UTXOs must be a relative number of blocks older than the spending transaction's block")]),a._v(" "),s("p",[a._v("In a real-world wallet a longer relative time-lock would probably be used, but we chose a two block time-lock to make testing easier.")]),a._v(" "),s("p",[s("em",[a._v("Note: If you repeat these instructions on your own your extended keys, addresses, and other values will be different than shown in this post, but the end results should be the same.")])]),a._v(" "),s("h2",{attrs:{id:"initial-setup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#initial-setup"}},[a._v("#")]),a._v(" Initial Setup")]),a._v(" "),s("h3",{attrs:{id:"step-0-install-a-recent-version-bdk-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-0-install-a-recent-version-bdk-cli"}},[a._v("#")]),a._v(" Step 0: Install a recent version "),s("code",[a._v("bdk-cli")])]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cargo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" bdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--features")]),a._v(" electrum\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# confirm bdk-cli is installed")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v("\nBDK CLI "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0.4")]),a._v(".0\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# bdk-cli usage can be explored with the `help` sub-command")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-1-generate-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-private-extended-keys"}},[a._v("#")]),a._v(" Step 1: Generate private extended keys")]),a._v(" "),s("p",[a._v("Generate new extended private keys for each of our wallet participants:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" alice-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"witness poverty pulse crush era item game rose bargain quantum spawn sure way behave also basket journey worry stem entry toddler floor way bone"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPeAuGznXJZwfWHgWo86dFuufRBZN7ZT44UzoNG2cYmZLNLrnsm7eXhGSeccRU2nTtxunT11UkpqrRhJQefBnFJeHBddF68bg"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" bob-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"shiver atom february jealous spy gallery upset height captain snake tooth master ugly orbit amazing nice parrot elevator own olympic great relief ozone violin"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPei56wJPNt9u2132Ynncp2qXdfSHszobnyjaGjQwxQBGASUidc1unmEmpyMQ9XzLgvbN36MDW7LNziVFdXVGMrx6ckMHuRmd"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" carol-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"upon bridge side tool style lounge need faculty middle nation armed corn valve that undo ribbon rent digital adapt capable embody zero shiver carpet"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPf2edJLnXsF2AKwkCshCy2Z7fQD6FxiNVGsbkvpLRfxM8FSKrLqqpLFzLzVUBwgE9F5MQASrbedKCrGk1NG8oJgqYtmTLQEU"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2-extract-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2-extract-private-extended-keys"}},[a._v("#")]),a._v(" Step 2: Extract private extended keys")]),a._v(" "),s("p",[a._v("Here we use the "),s("code",[a._v("jq")]),a._v(" Unix command to parse the json output of the "),s("code",[a._v("bdk-cli")]),a._v(" commands.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" alice-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" bob-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" carol-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-3-derive-public-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3-derive-public-extended-keys"}},[a._v("#")]),a._v(" Step 3: Derive public extended keys")]),a._v(" "),s("p",[a._v("For this example we are using the "),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-84"),s("OutboundLink")],1),a._v(" key path: "),s("code",[a._v("m/84h/1h/0h/0/*")]),a._v(" to derive extended public keys to share with other wallet participants.")]),a._v(" "),s("p",[a._v("Note that the "),s("code",[a._v("key derive")]),a._v(" sub-command will generate a tpub for the last hardened node in the given derivation path. You'll also notice that "),s("code",[a._v("bdk-cli")]),a._v(" will returns our tpub with the key origin (fingerprint/path) added to it (the metadata part that looks like "),s("code",[a._v("[5adb4683/84'/1'/0']")]),a._v(" right before the tpub). This key origin information is not necessary in order to use a tpub and generate addresses, but it's good practice to include it because some signers require it.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $ALICE_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5adb4683/84'/1'/0']tpubDCyRBuncqwyAjSNiw1GWLmwQsWyhgPMEBpx3ZNpnCwZwf3HXerspTpaneN81KRxkwj8vjqH9pNWEPgNhen7dfE212SHfxBBbsCywxQGxvvu/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BOB_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5fdec309/84'/1'/0']tpubDDQcUeBH9JFtgZEsHZBhmRu8AuZ8ceJY1umnipPVEg1had2coGMCWdFBXNnZWKoCPic3EMgDZTdmkAVNoakwNZu2ESSW36rQvts6VXGx4bU/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $CAROL_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[de41e56d/84'/1'/0']tpubDCdxmvzJ5QBjTN8oCjjyT2V58AyZvA1fkmCeZRC75QMoaHcVP2m45Bv3hmnR7ttAwkb2UNYyoXdHVt4gwBqRrJqLUU2JrM43HippxiWpHra/0/*\"")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4-create-wallet-descriptors-for-each-participant"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-wallet-descriptors-for-each-participant"}},[a._v("#")]),a._v(" Step 4: Create wallet descriptors for each participant")]),a._v(" "),s("p",[a._v("We used the "),s("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/playground/",target:"_blank",rel:"noopener noreferrer"}},[a._v("BDK Playground Policy Compiler"),s("OutboundLink")],1),a._v(" to compile the "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript"),s("OutboundLink")],1),a._v(" policy:")]),a._v(" "),s("p",[s("code",[a._v("thresh(3,pk(Alice),pk(Bob),pk(Carol),older(2))")])]),a._v(" "),s("p",[a._v("To the "),s("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[a._v("output descriptor"),s("OutboundLink")],1),a._v(":")]),a._v(" "),s("p",[s("code",[a._v("wsh(thresh(3,pk(Alice),s:pk(Bob),s:pk(Carol),sdv:older(2)))")])]),a._v(" "),s("p",[a._v("This descriptor requires spending transaction inputs must be signed by all three signers, or by two signers and the spent UTXOs must be older than two blocks.")]),a._v(" "),s("p",[a._v("Each participant's descriptor only uses their own XPRV key plus the XPUB keys of the other participants.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPRV")]),a._v("/84'/1'/0'/0/*),snl:older(2)))\"")]),a._v("\n")])])]),s("h2",{attrs:{id:"policy-a-three-signatures"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-a-three-signatures"}},[a._v("#")]),a._v(" Policy A. Three signatures")]),a._v(" "),s("h3",{attrs:{id:"step-1a-create-a-testnet-segwit0-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1a-create-a-testnet-segwit0-receive-address"}},[a._v("#")]),a._v(" Step 1a: Create a testnet "),s("a",{attrs:{href:"https://en.bitcoin.it/wiki/Segregated_Witness",target:"_blank",rel:"noopener noreferrer"}},[a._v("segwit0"),s("OutboundLink")],1),a._v(" receive address")]),a._v(" "),s("p",[a._v("This step can be done independently by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[a._v("#")]),a._v(" Step 2a: Send testnet bitcoin from a faucet to receive address")]),a._v(" "),s("p",[a._v("After a faucet payment is sent, use a testnet block explorer to confirm the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3a-sync-participant-wallets-and-confirm-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3a-sync-participant-wallets-and-confirm-balance"}},[a._v("#")]),a._v(" Step 3a: Sync participant wallets and confirm balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice, Bob, and Carol so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4a-view-wallet-spending-policies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("#")]),a._v(" Step 4a: View wallet spending policies")]),a._v(" "),s("p",[a._v("This can also be done by any wallet participant, as long as they have the same descriptor and extended public keys from the other particpants..")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" policies\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"external"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"m"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"n"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("4")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"PARTIAL"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ydtnup84"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"uyxvyzqt"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dzkmxcgu"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekfu5uaw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"8kel7sdw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"RELATIVETIMELOCK"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"value"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"THRESH"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"internal"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5a-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5a-create-spending-transaction"}},[a._v("#")]),a._v(" Step 5a: Create spending transaction")]),a._v(" "),s("p",[a._v("The transaction can also be created by Alice, Bob, or Carol, or even an untrusted coordinator that only has all three tpubs.")]),a._v(" "),s("p",[a._v("Note that the argument provided to the --external_policy flag contains the id retrieved from the "),s("code",[a._v("policies")]),a._v(" subcommand in the above step, in this case "),s("code",[a._v("ydtnup84")]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614058791")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0BBXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThyIGAi82No/6bA0LQO2BoHoQ0H8M8+VtQNHr41nhLDTvSPM4DO66tnIAAAAAAAAAACIGA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxGFrbRoNUAACAAQAAgAAAAIAAAAAAAAAAACIGA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mDEMxpeYAAAAAAAAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6a-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6a-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 6a: Sign and finalize PSBTs")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_BOB_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $CAROL_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_BOB_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("## PSBT is finalized")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_BOB_SIGNED_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"is_finalized"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" true,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0iAgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOEcwRAIgRPXSwFLfzD1YQzw5FGYA0TgiQ+D88hSOVDbvyUZDiPUCIAbguaSGgCbBAXo5sIxpZ4c1dcGkYyrrqnDjc1jcdJ1CASICA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYASICA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBAQV3IQN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsax8IQO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpqyTfCECLzY2j/psDQtA7YGgehDQfwzz5W1A0evjWeEsNO9I8zisk3x2Y1KyaWiTU4ciBgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOBjeQeVtVAAAgAEAAIAAAACAAAAAAAAAAAAiBgN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsQwpbm6KAAAAAAAAAAAiBgO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpgxDMaXmAAAAAAAAAAABBwABCP1TAQUARzBEAiBE9dLAUt/MPVhDPDkUZgDROCJD4PzyFI5UNu/JRkOI9QIgBuC5pIaAJsEBejmwjGlnhzV1waRjKuuqcONzWNx0nUIBRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYAXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThwAA"')]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7a-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7a-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 7a: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-8a-confirm-transaction-included-in-a-testnet-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-8a-confirm-transaction-included-in-a-testnet-block"}},[a._v("#")]),a._v(" Step 8a: Confirm transaction included in a testnet block")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And new wallet balance is now zero.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-"}},[a._v("#")]),a._v(" DONE!")]),a._v(" "),s("h2",{attrs:{id:"policy-b-two-signatures-after-a-relative-time-lock"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-b-two-signatures-after-a-relative-time-lock"}},[a._v("#")]),a._v(" Policy B. Two signatures after a relative time lock")]),a._v(" "),s("p",[a._v("Now we will use the same extended private and public keys, and the same descriptors to receive and spend testnet bitcoin using only two of our participants signatures after the transaction input's relative time-lock has expired.")]),a._v(" "),s("h3",{attrs:{id:"step-1b-create-a-new-testnet-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1b-create-a-new-testnet-receive-address"}},[a._v("#")]),a._v(" Step 1b: Create a new testnet receive address")]),a._v(" "),s("p",[a._v("The receive address can still be generated by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2b-fund-new-address-from-testnet-faucet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2b-fund-new-address-from-testnet-faucet"}},[a._v("#")]),a._v(" Step 2b: Fund new address from testnet faucet")]),a._v(" "),s("p",[a._v("After the faucet payment is sent, confirm using a testnet block explorer to verify the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3b-sync-wallet-and-confirm-wallet-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3b-sync-wallet-and-confirm-wallet-balance"}},[a._v("#")]),a._v(" Step 3b: Sync wallet and confirm wallet balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice and Bob so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# NO CAROL SHE LOST HER KEY!")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4b-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4b-create-spending-transaction"}},[a._v("#")]),a._v(" Step 4b: Create spending transaction")]),a._v(" "),s("p",[a._v("This spending transaction uses Alice and Bob's keys plus a two block relative time-lock, see above "),s("a",{attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("Step 4a")]),a._v(" for the policy id. The transaction can be created by Alice or Bob.")]),a._v(" "),s("p",[a._v("A time based relative time-lock can be used instead of one based on blocks but is slightly more complicated to calculate. See\n"),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki#specification",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-68"),s("OutboundLink")],1),a._v(" for the details.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614059434")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFICAAAAAYmc6mhj4Cf4pcJyBvxSbCd9IB1yDGs+plzb95t7++v0AAAAAAACAAAAAWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgOfTlC2vtnGDNEC2n4j++Wxusqryh4QyqDCqEOQZ5mm4BBXchAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCpprHwhAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFrJN8IQOrU70B/wo/oUUCKFQ2cIsBxx6SysE7uVwxyu0ozM4zYqyTfHZjUrJpaJNThyIGAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCppGFrbRoNUAACAAQAAgAAAAIAAAAAAAQAAACIGAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFDEMxpeYAAAAAAQAAACIGA6tTvQH/Cj+hRQIoVDZwiwHHHpLKwTu5XDHK7SjMzjNiDO66tnIAAAAAAQAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5b-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5b-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 5b: Sign and finalize PSBTs")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL DOES *NOT* SIGN")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6b-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6b-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 6b: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\nthread "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'main'")]),a._v(" panicked at "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('\'called `Result::unwrap()` on an `Err` value: Electrum(Protocol(String("sendrawtransaction RPC error: {\\"code\\":-26,\\"message\\":\\"non-BIP68-final\\"}")))\'')]),a._v(", src/bdk_cli.rs:168:50\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Oops we didn't wait long enough for the relative time lock to expire")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Try again in ~20 mins and it is successfully broadcast")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7b-view-confirmed-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7b-view-confirmed-transaction"}},[a._v("#")]),a._v(" Step 7b: View confirmed transaction")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And wallet balance is again zero")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-again-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-again-"}},[a._v("#")]),a._v(" Done again!")]),a._v(" "),s("p",[a._v("In this demo we showed how to receive and spend bitcoin using two different descriptor wallet policies using the "),s("code",[a._v("bdk")]),a._v(" library and "),s("code",[a._v("bdk-cli")]),a._v(" wallet tool.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{433:function(a,s,t){"use strict";t.r(s);var e=t(7),n=Object(e.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[a._v("#")]),a._v(" Introduction")]),a._v(" "),s("p",[a._v("In this post we will use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk-cli"),s("OutboundLink")],1),a._v(" tool to demonstrate how to use the "),s("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[a._v("bdk"),s("OutboundLink")],1),a._v(" library to:")]),a._v(" "),s("ol",[s("li",[a._v("generate "),s("em",[a._v("testnet")]),a._v(" public and private keys")]),a._v(" "),s("li",[a._v("create "),s("a",{attrs:{href:"https://bitcoinops.org/en/topics/psbt/",target:"_blank",rel:"noopener noreferrer"}},[a._v("PSBT"),s("OutboundLink")],1),a._v("s that can be spent based on different "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript spending policies"),s("OutboundLink")],1)]),a._v(" "),s("li",[a._v("cooperatively sign and finalize the resulting PSBTs")]),a._v(" "),s("li",[a._v("broadcast and confirm spending transactions")])]),a._v(" "),s("p",[a._v("The scenario we will simulate is a wallet with two spending policies:")]),a._v(" "),s("p",[a._v("A. "),s("strong",[a._v("three")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign spending transaction input "),s("a",{attrs:{href:"https://developer.bitcoin.org/glossary.html",target:"_blank",rel:"noopener noreferrer"}},[a._v("UTXO"),s("OutboundLink")],1),a._v("s, "),s("strong",[a._v("OR")])]),a._v(" "),s("p",[a._v("B. "),s("strong",[a._v("two")]),a._v(" out of "),s("strong",[a._v("three")]),a._v(" signers must sign "),s("strong",[a._v("AND")]),a._v(" the input UTXOs must be a relative number of blocks older than the spending transaction's block")]),a._v(" "),s("p",[a._v("In a real-world wallet a longer relative time-lock would probably be used, but we chose a two block time-lock to make testing easier.")]),a._v(" "),s("p",[s("em",[a._v("Note: If you repeat these instructions on your own your extended keys, addresses, and other values will be different than shown in this post, but the end results should be the same.")])]),a._v(" "),s("h2",{attrs:{id:"initial-setup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#initial-setup"}},[a._v("#")]),a._v(" Initial Setup")]),a._v(" "),s("h3",{attrs:{id:"step-0-install-a-recent-version-bdk-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-0-install-a-recent-version-bdk-cli"}},[a._v("#")]),a._v(" Step 0: Install a recent version "),s("code",[a._v("bdk-cli")])]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cargo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" bdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--features")]),a._v(" electrum\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# confirm bdk-cli is installed")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--version")]),a._v("\nBDK CLI "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0.4")]),a._v(".0\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# bdk-cli usage can be explored with the `help` sub-command")]),a._v("\nbdk-cli "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("help")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-1-generate-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1-generate-private-extended-keys"}},[a._v("#")]),a._v(" Step 1: Generate private extended keys")]),a._v(" "),s("p",[a._v("Generate new extended private keys for each of our wallet participants:")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" alice-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"witness poverty pulse crush era item game rose bargain quantum spawn sure way behave also basket journey worry stem entry toddler floor way bone"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPeAuGznXJZwfWHgWo86dFuufRBZN7ZT44UzoNG2cYmZLNLrnsm7eXhGSeccRU2nTtxunT11UkpqrRhJQefBnFJeHBddF68bg"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" bob-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"shiver atom february jealous spy gallery upset height captain snake tooth master ugly orbit amazing nice parrot elevator own olympic great relief ozone violin"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPei56wJPNt9u2132Ynncp2qXdfSHszobnyjaGjQwxQBGASUidc1unmEmpyMQ9XzLgvbN36MDW7LNziVFdXVGMrx6ckMHuRmd"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli key generate "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tee")]),a._v(" carol-key.json\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"mnemonic"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"upon bridge side tool style lounge need faculty middle nation armed corn valve that undo ribbon rent digital adapt capable embody zero shiver carpet"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"xprv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tprv8ZgxMBicQKsPf2edJLnXsF2AKwkCshCy2Z7fQD6FxiNVGsbkvpLRfxM8FSKrLqqpLFzLzVUBwgE9F5MQASrbedKCrGk1NG8oJgqYtmTLQEU"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2-extract-private-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2-extract-private-extended-keys"}},[a._v("#")]),a._v(" Step 2: Extract private extended keys")]),a._v(" "),s("p",[a._v("Here we use the "),s("code",[a._v("jq")]),a._v(" Unix command to parse the json output of the "),s("code",[a._v("bdk-cli")]),a._v(" commands.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" alice-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" bob-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPRV")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cat")]),a._v(" carol-key.json "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'.xprv'")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-3-derive-public-extended-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3-derive-public-extended-keys"}},[a._v("#")]),a._v(" Step 3: Derive public extended keys")]),a._v(" "),s("p",[a._v("For this example we are using the "),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-84"),s("OutboundLink")],1),a._v(" key path: "),s("code",[a._v("m/84h/1h/0h/0/*")]),a._v(" to derive extended public keys to share with other wallet participants.")]),a._v(" "),s("p",[a._v("Note that the "),s("code",[a._v("key derive")]),a._v(" sub-command will generate a tpub for the last hardened node in the given derivation path. You'll also notice that "),s("code",[a._v("bdk-cli")]),a._v(" will returns our tpub with the key origin (fingerprint/path) added to it (the metadata part that looks like "),s("code",[a._v("[5adb4683/84'/1'/0']")]),a._v(" right before the tpub). This key origin information is not necessary in order to use a tpub and generate addresses, but it's good practice to include it because some signers require it.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $ALICE_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5adb4683/84'/1'/0']tpubDCyRBuncqwyAjSNiw1GWLmwQsWyhgPMEBpx3ZNpnCwZwf3HXerspTpaneN81KRxkwj8vjqH9pNWEPgNhen7dfE212SHfxBBbsCywxQGxvvu/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $BOB_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[5fdec309/84'/1'/0']tpubDDQcUeBH9JFtgZEsHZBhmRu8AuZ8ceJY1umnipPVEg1had2coGMCWdFBXNnZWKoCPic3EMgDZTdmkAVNoakwNZu2ESSW36rQvts6VXGx4bU/0/*\"")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli key derive "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--xprv")]),a._v(" $CAROL_XPRV "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--path")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"m/84'/1'/0'/0\"")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".xpub"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("echo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("\\")]),a._v('"\n'),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("\"[de41e56d/84'/1'/0']tpubDCdxmvzJ5QBjTN8oCjjyT2V58AyZvA1fkmCeZRC75QMoaHcVP2m45Bv3hmnR7ttAwkb2UNYyoXdHVt4gwBqRrJqLUU2JrM43HippxiWpHra/0/*\"")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4-create-wallet-descriptors-for-each-participant"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4-create-wallet-descriptors-for-each-participant"}},[a._v("#")]),a._v(" Step 4: Create wallet descriptors for each participant")]),a._v(" "),s("p",[a._v("We used the "),s("a",{attrs:{href:"https://bitcoindevkit.org/bdk-cli/playground/",target:"_blank",rel:"noopener noreferrer"}},[a._v("BDK Playground Policy Compiler"),s("OutboundLink")],1),a._v(" to compile the "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[a._v("miniscript"),s("OutboundLink")],1),a._v(" policy:")]),a._v(" "),s("p",[s("code",[a._v("thresh(3,pk(Alice),pk(Bob),pk(Carol),older(2))")])]),a._v(" "),s("p",[a._v("To the "),s("a",{attrs:{href:"https://bitcoindevkit.org/descriptors/",target:"_blank",rel:"noopener noreferrer"}},[a._v("output descriptor"),s("OutboundLink")],1),a._v(":")]),a._v(" "),s("p",[s("code",[a._v("wsh(thresh(3,pk(Alice),s:pk(Bob),s:pk(Carol),sdv:older(2)))")])]),a._v(" "),s("p",[a._v("This descriptor requires spending transaction inputs must be signed by all three signers, or by two signers and the spent UTXOs must be older than two blocks.")]),a._v(" "),s("p",[a._v("Each participant's descriptor only uses their own XPRV key plus the XPUB keys of the other participants.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("BOB_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPRV")]),a._v("/84'/1'/0'/0/*),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPUB")]),a._v('),snl:older(2)))"')]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("CAROL_DESCRIPTOR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"wsh(thresh(3,pk('),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_XPUB")]),a._v("),s:pk("),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_XPRV")]),a._v("/84'/1'/0'/0/*),snl:older(2)))\"")]),a._v("\n")])])]),s("h2",{attrs:{id:"policy-a-three-signatures"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-a-three-signatures"}},[a._v("#")]),a._v(" Policy A. Three signatures")]),a._v(" "),s("h3",{attrs:{id:"step-1a-create-a-testnet-segwit0-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1a-create-a-testnet-segwit0-receive-address"}},[a._v("#")]),a._v(" Step 1a: Create a testnet "),s("a",{attrs:{href:"https://en.bitcoin.it/wiki/Segregated_Witness",target:"_blank",rel:"noopener noreferrer"}},[a._v("segwit0"),s("OutboundLink")],1),a._v(" receive address")]),a._v(" "),s("p",[a._v("This step can be done independently by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"}},[a._v("#")]),a._v(" Step 2a: Send testnet bitcoin from a faucet to receive address")]),a._v(" "),s("p",[a._v("After a faucet payment is sent, use a testnet block explorer to confirm the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1qpqglt6yntay0se5vj3a7g36rql5pyzzp0w6jknfch2c0unwphsxs22g96e"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3a-sync-participant-wallets-and-confirm-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3a-sync-participant-wallets-and-confirm-balance"}},[a._v("#")]),a._v(" Step 3a: Sync participant wallets and confirm balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice, Bob, and Carol so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4a-view-wallet-spending-policies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("#")]),a._v(" Step 4a: View wallet spending policies")]),a._v(" "),s("p",[a._v("This can also be done by any wallet participant, as long as they have the same descriptor and extended public keys from the other particpants..")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" policies\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"external"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"0"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"m"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"n"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("4")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"PARTIAL"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ydtnup84"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"items"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("[")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5adb4683"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"uyxvyzqt"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"5fdec309"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"dzkmxcgu"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fingerprint"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"de41e56d"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"ekfu5uaw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"SIGNATURE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"COMPLETE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"id"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"8kel7sdw"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"RELATIVETIMELOCK"')]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"value"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("2")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("]")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"NONE"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("3")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"type"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"THRESH"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"internal"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5a-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5a-create-spending-transaction"}},[a._v("#")]),a._v(" Step 5a: Create spending transaction")]),a._v(" "),s("p",[a._v("The transaction can also be created by Alice, Bob, or Carol, or even an untrusted coordinator that only has all three tpubs.")]),a._v(" "),s("p",[a._v("Note that the argument provided to the --external_policy flag contains the id retrieved from the "),s("code",[a._v("policies")]),a._v(" subcommand in the above step, in this case "),s("code",[a._v("ydtnup84")]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614058791")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0BBXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThyIGAi82No/6bA0LQO2BoHoQ0H8M8+VtQNHr41nhLDTvSPM4DO66tnIAAAAAAAAAACIGA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxGFrbRoNUAACAAQAAgAAAAIAAAAAAAAAAACIGA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mDEMxpeYAAAAAAAAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,2]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6a-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6a-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 6a: Sign and finalize PSBTs")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_BOB_SIGNED_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $CAROL_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_BOB_SIGNED_PSBT "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("## PSBT is finalized")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_BOB_SIGNED_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"is_finalized"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" true,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFIBAAAAAYx7T0cL7EoUYBEU0mSL6+DS4VQafUzJgAf0Ftlbkya5AQAAAAD/////AWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgCBH16JNfSPhmjJR75EdDB+gSCEF7tStNOLqw/k3BvA0iAgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOEcwRAIgRPXSwFLfzD1YQzw5FGYA0TgiQ+D88hSOVDbvyUZDiPUCIAbguaSGgCbBAXo5sIxpZ4c1dcGkYyrrqnDjc1jcdJ1CASICA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYASICA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBAQV3IQN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsax8IQO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpqyTfCECLzY2j/psDQtA7YGgehDQfwzz5W1A0evjWeEsNO9I8zisk3x2Y1KyaWiTU4ciBgIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOBjeQeVtVAAAgAEAAIAAAACAAAAAAAAAAAAiBgN3NQJNpHBjszoenkVxSn6Z6cz9Zc33FyGIcRRmRudZsQwpbm6KAAAAAAAAAAAiBgO+WA10Swy7fnl+VLBNN5iBlErED9jKyfZZte3Blw8NpgxDMaXmAAAAAAAAAAABBwABCP1TAQUARzBEAiBE9dLAUt/MPVhDPDkUZgDROCJD4PzyFI5UNu/JRkOI9QIgBuC5pIaAJsEBejmwjGlnhzV1waRjKuuqcONzWNx0nUIBRzBEAiBPJlQEnuVDHgfgOdTZNlIcRZz2iqHoMWfDmLMFqJSOQAIgCuOcTKp/VaaqwIjnYfMKO3eQ1k9pOygSWt6teT1o13QBSDBFAiEA0kdkvlA+k5kUBWVUM8SkR4Ua9pnXF66ECVwIM1l0doACIF0aMiORVC35+M3GHF2Vl8Q7t455mebrr1HuLaAyxBOYAXchA3c1Ak2kcGOzOh6eRXFKfpnpzP1lzfcXIYhxFGZG51mxrHwhA75YDXRLDLt+eX5UsE03mIGUSsQP2MrJ9lm17cGXDw2mrJN8IQIvNjaP+mwNC0DtgaB6ENB/DPPlbUDR6+NZ4Sw070jzOKyTfHZjUrJpaJNThwAA"')]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7a-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7a-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 7a: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" carol "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$CAROL_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-8a-confirm-transaction-included-in-a-testnet-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-8a-confirm-transaction-included-in-a-testnet-block"}},[a._v("#")]),a._v(" Step 8a: Confirm transaction included in a testnet block")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/3b9a7ac610afc91f1d1a0dd844e609376278fe7210c69b7ef663c5a8e8308f3e"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And new wallet balance is now zero.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-"}},[a._v("#")]),a._v(" DONE!")]),a._v(" "),s("h2",{attrs:{id:"policy-b-two-signatures-after-a-relative-time-lock"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#policy-b-two-signatures-after-a-relative-time-lock"}},[a._v("#")]),a._v(" Policy B. Two signatures after a relative time lock")]),a._v(" "),s("p",[a._v("Now we will use the same extended private and public keys, and the same descriptors to receive and spend testnet bitcoin using only two of our participants signatures after the transaction input's relative time-lock has expired.")]),a._v(" "),s("h3",{attrs:{id:"step-1b-create-a-new-testnet-receive-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-1b-create-a-new-testnet-receive-address"}},[a._v("#")]),a._v(" Step 1b: Create a new testnet receive address")]),a._v(" "),s("p",[a._v("The receive address can still be generated by Alice, Bob, or Carol.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_new_address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"address"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-2b-fund-new-address-from-testnet-faucet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-2b-fund-new-address-from-testnet-faucet"}},[a._v("#")]),a._v(" Step 2b: Fund new address from testnet faucet")]),a._v(" "),s("p",[a._v("After the faucet payment is sent, confirm using a testnet block explorer to verify the transaction was included in a block.")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/address/tb1q886w2zmtakwxpngs9kn7y0a7tvd6e24u58sse2sv92zrjpnenfhqtfnmw9"),s("OutboundLink")],1)]),a._v(" "),s("h3",{attrs:{id:"step-3b-sync-wallet-and-confirm-wallet-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-3b-sync-wallet-and-confirm-wallet-balance"}},[a._v("#")]),a._v(" Step 3b: Sync wallet and confirm wallet balance")]),a._v(" "),s("p",[a._v("This step must be done by Alice and Bob so their individual descriptor wallets know about the faucet transaction they will later be spending the output of.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# NO CAROL SHE LOST HER KEY!")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-4b-create-spending-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-4b-create-spending-transaction"}},[a._v("#")]),a._v(" Step 4b: Create spending transaction")]),a._v(" "),s("p",[a._v("This spending transaction uses Alice and Bob's keys plus a two block relative time-lock, see above "),s("a",{attrs:{href:"#step-4a-view-wallet-spending-policies"}},[a._v("Step 4a")]),a._v(" for the policy id. The transaction can be created by Alice or Bob.")]),a._v(" "),s("p",[a._v("A time based relative time-lock can be used instead of one based on blocks but is slightly more complicated to calculate. See\n"),s("a",{attrs:{href:"https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki#specification",target:"_blank",rel:"noopener noreferrer"}},[a._v("BIP-68"),s("OutboundLink")],1),a._v(" for the details.")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"details"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"fees"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("169")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"height"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"received"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"sent"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("10000")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"timestamp"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1614059434")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"transaction"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" null,\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v(",\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"psbt"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"cHNidP8BAFICAAAAAYmc6mhj4Cf4pcJyBvxSbCd9IB1yDGs+plzb95t7++v0AAAAAAACAAAAAWcmAAAAAAAAFgAU3RacollkleIxk+lz8my/mLCXiH0AAAAAAAEBKxAnAAAAAAAAIgAgOfTlC2vtnGDNEC2n4j++Wxusqryh4QyqDCqEOQZ5mm4BBXchAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCpprHwhAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFrJN8IQOrU70B/wo/oUUCKFQ2cIsBxx6SysE7uVwxyu0ozM4zYqyTfHZjUrJpaJNThyIGAlUVWMkNwGkCxDe4ZAcyz7HI+Vpmo4A5//OvkV33PCppGFrbRoNUAACAAQAAgAAAAIAAAAAAAQAAACIGAq9NOHBbPEdKr8IzYEomNTk1eokAkLQ9+ZMuS/OlX+nFDEMxpeYAAAAAAQAAACIGA6tTvQH/Cj+hRQIoVDZwiwHHHpLKwTu5XDHK7SjMzjNiDO66tnIAAAAAAQAAAAAA"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("UNSIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR create_tx "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-a")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--to")]),a._v(" tb1qm5tfegjevj27yvvna9elym9lnzcf0zraxgl8z2:0 "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--external_policy")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"{'),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v("ydtnup84"),s("span",{pre:!0,attrs:{class:"token entity",title:'\\"'}},[a._v('\\"')]),a._v(': [0,1,3]}"')]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n")])])]),s("h3",{attrs:{id:"step-5b-sign-and-finalize-psbts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-5b-sign-and-finalize-psbts"}},[a._v("#")]),a._v(" Step 5b: Sign and finalize PSBTs")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# ALICE SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ALICE_SIGNED_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $ALICE_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $UNSIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# BOB SIGNS")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("FINAL_PSBT2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$(")]),a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" $BOB_DESCRIPTOR sign "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" $ALICE_SIGNED_PSBT2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("|")]),a._v(" jq "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('".psbt"')]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v(")")])]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# CAROL DOES *NOT* SIGN")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-6b-broadcast-finalized-psbt"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-6b-broadcast-finalized-psbt"}},[a._v("#")]),a._v(" Step 6b: Broadcast finalized PSBT")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\nthread "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v("'main'")]),a._v(" panicked at "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('\'called `Result::unwrap()` on an `Err` value: Electrum(Protocol(String("sendrawtransaction RPC error: {\\"code\\":-26,\\"message\\":\\"non-BIP68-final\\"}")))\'')]),a._v(", src/bdk_cli.rs:168:50\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Oops we didn't wait long enough for the relative time lock to expire")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# Try again in ~20 mins and it is successfully broadcast")]),a._v("\n\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" bob "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$BOB_DESCRIPTOR")]),a._v(" broadcast "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--psbt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$FINAL_PSBT2")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"txid"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"')]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h3",{attrs:{id:"step-7b-view-confirmed-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#step-7b-view-confirmed-transaction"}},[a._v("#")]),a._v(" Step 7b: View confirmed transaction")]),a._v(" "),s("p",[s("a",{attrs:{href:"https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28",target:"_blank",rel:"noopener noreferrer"}},[a._v("https://mempool.space/testnet/tx/6a04c60dff8eeb14dc0848c663d669c34ddc30125d9564364c9414e3ff4a7d28"),s("OutboundLink")],1)]),a._v(" "),s("p",[a._v("And wallet balance is again zero")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("bdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sync")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\nbdk-cli wallet "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" alice "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-d")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ALICE_DESCRIPTOR")]),a._v(" get_balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("{")]),a._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[a._v('"satoshi"')]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(":")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("0")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("}")]),a._v("\n")])])]),s("h4",{attrs:{id:"done-again-"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#done-again-"}},[a._v("#")]),a._v(" Done again!")]),a._v(" "),s("p",[a._v("In this demo we showed how to receive and spend bitcoin using two different descriptor wallet policies using the "),s("code",[a._v("bdk")]),a._v(" library and "),s("code",[a._v("bdk-cli")]),a._v(" wallet tool.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/78.74419356.js b/assets/js/78.1816ce47.js similarity index 99% rename from assets/js/78.74419356.js rename to assets/js/78.1816ce47.js index a125936cd3..1286399e06 100644 --- a/assets/js/78.74419356.js +++ b/assets/js/78.1816ce47.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{443:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"compiler"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compiler"}},[t._v("#")]),t._v(" Compiler")]),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("If you want to play around with more complicated spending policies, you'll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The "),s("code",[t._v("bdk")]),t._v(" library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[t._v("in this page"),s("OutboundLink")],1),t._v(',\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for '),s("code",[t._v("rust-miniscript")]),t._v(" that have some minor differences from\nthe ones made by the C++ implementation used in that website.")]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("p",[t._v("To install the miniscript compiler run the following command:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/bdk "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compiler"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--example")]),t._v(" miniscriptc\n")])])]),s("p",[t._v("Once the command is done, you should have a "),s("code",[t._v("miniscriptc")]),t._v(" command available. You can check if that's the case by running "),s("code",[t._v("miniscriptc --help")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[t._v('In this case the interface is very simple: it accepts two arguments called "POLICY" and "TYPE", in this order. The first one, as the name implies, sets the spending policy to compile. The latter defines the type\nof address that should be used to encapsulate the produced script, like a P2SH, P2WSH, etc.')]),t._v(" "),s("p",[t._v("Optionally, the "),s("code",[t._v("--parsed_policy")]),t._v(' flag can be enabled and it will make the compiler print the JSON "human-readable" version of the spending policy, as described in the '),s("RouterLink",{attrs:{to:"/bdk-cli/interface/#policies"}},[s("code",[t._v("policies subcommand")])]),t._v(" of the CLI.")],1),t._v(" "),s("p",[t._v("The "),s("code",[t._v("--network")]),t._v(" flag can be used to change the network encoding of the address shown.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Tip")]),t._v(" "),s("p",[t._v("Keep in mind that since the compiler loads and interprets the descriptor, all the public keys specified in the policy must be valid public keys. This differs from the web tool linked above that also accepts\nplaceholders too. As described in the previous sections of this guide, the keys can be either "),s("code",[t._v("xpub")]),t._v("/"),s("code",[t._v("xprv")]),t._v(" with or without metadata and a derivation path, WIF keys or raw hex public keys.")])]),t._v(" "),s("h2",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),s("p",[t._v("Let's take this policy for example:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("miniscriptc "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--parsed_policy")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"and(pk(cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR),or(50@pk(02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c),older(1000)))"')]),t._v(" sh-wsh\n")])])]),s("p",[t._v("The compiler should print something like:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2020")]),t._v("-04-29T10:42:05Z INFO miniscriptc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" Compiling policy: and"),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("cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",or"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),t._v("@pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",older"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2020")]),t._v("-04-29T10:42:05Z INFO miniscriptc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(". Descriptor: sh"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wsh"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("and_v"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("or_c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c:pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",v:older"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v(",c:pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR"),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 number"}},[t._v("2020")]),t._v("-04-29T10:42:05Z INFO miniscriptc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(". First address: 2MsqrJuZewY3o3ADAy1Uhi5vsBqTANjH3Cf\n")])])]),s("p",[t._v("JSON policy:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"THRESH"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"THRESH"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SIGNATURE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkey"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 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 property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"RELATIVETIMELOCK"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"COMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),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("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 property"}},[t._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIALCOMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"n"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"m"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),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 property"}},[t._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"[1]"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),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("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 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 property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SIGNATURE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkey"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"COMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token 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("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 property"}},[t._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIALCOMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"n"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"m"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),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 property"}},[t._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"[0, 1]"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),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("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:"troubleshooting"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#troubleshooting"}},[t._v("#")]),t._v(" Troubleshooting")]),t._v(" "),s("h4",{attrs:{id:"nothing-is-printed"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nothing-is-printed"}},[t._v("#")]),t._v(" Nothing is printed")]),t._v(" "),s("p",[t._v("This might mean that you have a "),s("code",[t._v("RUST_LOG")]),t._v(" variable set to a value that suppresses the compiler's log. You can try adding "),s("code",[t._v("miniscriptc=info")]),t._v(" to your "),s("code",[t._v("RUST_LOG")]),t._v(" value and see if that works, or open a new clean\nshell.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{444:function(t,s,a){"use strict";a.r(s);var n=a(7),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"compiler"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compiler"}},[t._v("#")]),t._v(" Compiler")]),t._v(" "),s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),s("p",[t._v("If you want to play around with more complicated spending policies, you'll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The "),s("code",[t._v("bdk")]),t._v(" library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described "),s("a",{attrs:{href:"http://bitcoin.sipa.be/miniscript/",target:"_blank",rel:"noopener noreferrer"}},[t._v("in this page"),s("OutboundLink")],1),t._v(',\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for '),s("code",[t._v("rust-miniscript")]),t._v(" that have some minor differences from\nthe ones made by the C++ implementation used in that website.")]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("p",[t._v("To install the miniscript compiler run the following command:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cargo")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/bdk "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"compiler"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--example")]),t._v(" miniscriptc\n")])])]),s("p",[t._v("Once the command is done, you should have a "),s("code",[t._v("miniscriptc")]),t._v(" command available. You can check if that's the case by running "),s("code",[t._v("miniscriptc --help")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[t._v('In this case the interface is very simple: it accepts two arguments called "POLICY" and "TYPE", in this order. The first one, as the name implies, sets the spending policy to compile. The latter defines the type\nof address that should be used to encapsulate the produced script, like a P2SH, P2WSH, etc.')]),t._v(" "),s("p",[t._v("Optionally, the "),s("code",[t._v("--parsed_policy")]),t._v(' flag can be enabled and it will make the compiler print the JSON "human-readable" version of the spending policy, as described in the '),s("RouterLink",{attrs:{to:"/bdk-cli/interface/#policies"}},[s("code",[t._v("policies subcommand")])]),t._v(" of the CLI.")],1),t._v(" "),s("p",[t._v("The "),s("code",[t._v("--network")]),t._v(" flag can be used to change the network encoding of the address shown.")]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("Tip")]),t._v(" "),s("p",[t._v("Keep in mind that since the compiler loads and interprets the descriptor, all the public keys specified in the policy must be valid public keys. This differs from the web tool linked above that also accepts\nplaceholders too. As described in the previous sections of this guide, the keys can be either "),s("code",[t._v("xpub")]),t._v("/"),s("code",[t._v("xprv")]),t._v(" with or without metadata and a derivation path, WIF keys or raw hex public keys.")])]),t._v(" "),s("h2",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),s("p",[t._v("Let's take this policy for example:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("miniscriptc "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--parsed_policy")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"and(pk(cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR),or(50@pk(02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c),older(1000)))"')]),t._v(" sh-wsh\n")])])]),s("p",[t._v("The compiler should print something like:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2020")]),t._v("-04-29T10:42:05Z INFO miniscriptc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" Compiling policy: and"),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("cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",or"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),t._v("@pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",older"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2020")]),t._v("-04-29T10:42:05Z INFO miniscriptc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(". Descriptor: sh"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wsh"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("and_v"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("or_c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c:pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(",v:older"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("))")]),t._v(",c:pk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR"),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 number"}},[t._v("2020")]),t._v("-04-29T10:42:05Z INFO miniscriptc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(". First address: 2MsqrJuZewY3o3ADAy1Uhi5vsBqTANjH3Cf\n")])])]),s("p",[t._v("JSON policy:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"THRESH"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"THRESH"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SIGNATURE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkey"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 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 property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"RELATIVETIMELOCK"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"COMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),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("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 property"}},[t._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIALCOMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"n"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"m"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),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 property"}},[t._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"[1]"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),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("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 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 property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SIGNATURE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkey"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"02e96fe52ef0e22d2f131dd425ce1893073a3c6ad20e8cac36726393dfb4856a4c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"COMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"condition"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token 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("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 property"}},[t._v('"threshold"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"satisfaction"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NONE"')]),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 property"}},[t._v('"contribution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PARTIALCOMPLETE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"n"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"m"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"items"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),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 property"}},[t._v('"conditions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"[0, 1]"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"csv"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),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("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:"troubleshooting"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#troubleshooting"}},[t._v("#")]),t._v(" Troubleshooting")]),t._v(" "),s("h4",{attrs:{id:"nothing-is-printed"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nothing-is-printed"}},[t._v("#")]),t._v(" Nothing is printed")]),t._v(" "),s("p",[t._v("This might mean that you have a "),s("code",[t._v("RUST_LOG")]),t._v(" variable set to a value that suppresses the compiler's log. You can try adding "),s("code",[t._v("miniscriptc=info")]),t._v(" to your "),s("code",[t._v("RUST_LOG")]),t._v(" value and see if that works, or open a new clean\nshell.")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/80.b1938c71.js b/assets/js/80.b9017867.js similarity index 99% rename from assets/js/80.b1938c71.js rename to assets/js/80.b9017867.js index af1843fa08..4ad64c1c5b 100644 --- a/assets/js/80.b1938c71.js +++ b/assets/js/80.b9017867.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{447:function(t,e,a){"use strict";a.r(e);var n=a(7),s=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),e("h2",{attrs:{id:"requirements"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[t._v("#")]),t._v(" Requirements")]),t._v(" "),e("p",[t._v("The only requirement to run the "),e("code",[t._v("bdk-cli")]),t._v(" tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is "),e("a",{attrs:{href:"https://rustup.rs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("rustup.rs"),e("OutboundLink")],1),t._v(". You can head there and\nfollow their instructions, after which you can test if everything went fine by running\n"),e("code",[t._v("cargo version")]),t._v(", which should print something like:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("cargo 1.56.0 (4ed5d137b 2021-10-04)\n")])])]),e("p",[t._v("As an alternative to installing the Rust toolchain, you can try using a\n"),e("a",{attrs:{href:"https://hub.docker.com/_/rust",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker image"),e("OutboundLink")],1),t._v(" and working inside of it, but that's meant for more\nadvanced users and won't be covered in this guide.")]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("Note")]),t._v(" "),e("p",[t._v("At the time of writing, the project requires cargo >= 1.56.0, which is our minimum supported rust version (MSRV) as of May 2022. If you have an older version installed with rustup.rs, you can upgrade it with "),e("code",[t._v("rustup update")]),t._v(".")])]),t._v(" "),e("h2",{attrs:{id:"installing-the-bdk-cli-tool"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installing-the-bdk-cli-tool"}},[t._v("#")]),t._v(" Installing the "),e("code",[t._v("bdk-cli")]),t._v(" tool")]),t._v(" "),e("p",[t._v("Once Cargo is installed, you can proceed to install the interactive "),e("code",[t._v("bdk-cli")]),t._v(" tool directly from\nthe GitHub repository, by running:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# all features with the blocking esplora client ")]),t._v("\n"),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(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/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("esplora-ureq,compiler\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# all features with the async esplora client ")]),t._v("\n"),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(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/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("esplora-reqwest,compiler\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# minimal install (only repl feature is on by default)")]),t._v("\n"),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(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/bdk-cli\n")])])]),e("p",[t._v("For Windows users, the default SQLite database requires extensive configuration and "),e("code",[t._v("bdk-cli")]),t._v(" will not build properly if SQLite is unconfigured. To proceed with the installation using "),e("code",[t._v("sled")]),t._v(" instead, run:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# disable sqlite and use sled")]),t._v("\n"),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 --no-default-features "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("key-value-db,esplora-ureq,compiler\n")])])]),e("p",[t._v("This command may take a while to finish, since it will fetch and compile all the dependencies and the "),e("code",[t._v("bdk")]),t._v(" library itself.")]),t._v(" "),e("p",[t._v("Once it's done, you can check if everything went fine by running "),e("code",[t._v("bdk-cli --help")]),t._v(" which should print something like this:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("bdk-cli 0.5.0\nAlekos Filini :Riccardo Casatta :Steve Myers \nThe BDK Command Line Wallet App\n\nbdk-cli is a light weight command 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 in 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!\n\n\nUSAGE:\n bdk-cli [OPTIONS] \n\nFLAGS:\n -h, --help \n Prints help information\n\n -V, --version \n Prints version information\n\n\nOPTIONS:\n -n, --network \n Sets the network [default: testnet]\n\n\nSUBCOMMANDS:\n compile Compile a miniscript policy to an output descriptor\n help Prints this message or the help of the given subcommand(s)\n key Key Management Operations\n repl REPL command loop mode\n wallet Wallet Operations\n\n")])])]),e("p",[t._v("An example command to sync a testnet wallet to a default electrum server looks like this:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("bdk-cli wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-w")]),t._v(" example "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--descriptor")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh(tprv8ZgxMBicQKsPexGYyaFwnAsCXCjmz2FaTm6LtesyyihjbQE3gRMfXqQBXKM43DvC1UgRVv1qom1qFxNMSqVAs88qx9PhgFnfGVUdiiDf6j4/0/*)"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{446:function(t,e,a){"use strict";a.r(e);var n=a(7),s=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),e("h2",{attrs:{id:"requirements"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[t._v("#")]),t._v(" Requirements")]),t._v(" "),e("p",[t._v("The only requirement to run the "),e("code",[t._v("bdk-cli")]),t._v(" tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is "),e("a",{attrs:{href:"https://rustup.rs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("rustup.rs"),e("OutboundLink")],1),t._v(". You can head there and\nfollow their instructions, after which you can test if everything went fine by running\n"),e("code",[t._v("cargo version")]),t._v(", which should print something like:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("cargo 1.56.0 (4ed5d137b 2021-10-04)\n")])])]),e("p",[t._v("As an alternative to installing the Rust toolchain, you can try using a\n"),e("a",{attrs:{href:"https://hub.docker.com/_/rust",target:"_blank",rel:"noopener noreferrer"}},[t._v("Docker image"),e("OutboundLink")],1),t._v(" and working inside of it, but that's meant for more\nadvanced users and won't be covered in this guide.")]),t._v(" "),e("div",{staticClass:"custom-block tip"},[e("p",{staticClass:"custom-block-title"},[t._v("Note")]),t._v(" "),e("p",[t._v("At the time of writing, the project requires cargo >= 1.56.0, which is our minimum supported rust version (MSRV) as of May 2022. If you have an older version installed with rustup.rs, you can upgrade it with "),e("code",[t._v("rustup update")]),t._v(".")])]),t._v(" "),e("h2",{attrs:{id:"installing-the-bdk-cli-tool"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installing-the-bdk-cli-tool"}},[t._v("#")]),t._v(" Installing the "),e("code",[t._v("bdk-cli")]),t._v(" tool")]),t._v(" "),e("p",[t._v("Once Cargo is installed, you can proceed to install the interactive "),e("code",[t._v("bdk-cli")]),t._v(" tool directly from\nthe GitHub repository, by running:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# all features with the blocking esplora client ")]),t._v("\n"),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(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/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("esplora-ureq,compiler\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# all features with the async esplora client ")]),t._v("\n"),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(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/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("esplora-reqwest,compiler\n\n"),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# minimal install (only repl feature is on by default)")]),t._v("\n"),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(" "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--git")]),t._v(" https://github.com/bitcoindevkit/bdk-cli\n")])])]),e("p",[t._v("For Windows users, the default SQLite database requires extensive configuration and "),e("code",[t._v("bdk-cli")]),t._v(" will not build properly if SQLite is unconfigured. To proceed with the installation using "),e("code",[t._v("sled")]),t._v(" instead, run:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# disable sqlite and use sled")]),t._v("\n"),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 --no-default-features "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--features")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("key-value-db,esplora-ureq,compiler\n")])])]),e("p",[t._v("This command may take a while to finish, since it will fetch and compile all the dependencies and the "),e("code",[t._v("bdk")]),t._v(" library itself.")]),t._v(" "),e("p",[t._v("Once it's done, you can check if everything went fine by running "),e("code",[t._v("bdk-cli --help")]),t._v(" which should print something like this:")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("bdk-cli 0.5.0\nAlekos Filini :Riccardo Casatta :Steve Myers \nThe BDK Command Line Wallet App\n\nbdk-cli is a light weight command 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 in 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!\n\n\nUSAGE:\n bdk-cli [OPTIONS] \n\nFLAGS:\n -h, --help \n Prints help information\n\n -V, --version \n Prints version information\n\n\nOPTIONS:\n -n, --network \n Sets the network [default: testnet]\n\n\nSUBCOMMANDS:\n compile Compile a miniscript policy to an output descriptor\n help Prints this message or the help of the given subcommand(s)\n key Key Management Operations\n repl REPL command loop mode\n wallet Wallet Operations\n\n")])])]),e("p",[t._v("An example command to sync a testnet wallet to a default electrum server looks like this:")]),t._v(" "),e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[t._v("bdk-cli wallet "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-w")]),t._v(" example "),e("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--descriptor")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wpkh(tprv8ZgxMBicQKsPexGYyaFwnAsCXCjmz2FaTm6LtesyyihjbQE3gRMfXqQBXKM43DvC1UgRVv1qom1qFxNMSqVAs88qx9PhgFnfGVUdiiDf6j4/0/*)"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("sync")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/82.d0dc05bc.js b/assets/js/82.a858da93.js similarity index 96% rename from assets/js/82.d0dc05bc.js rename to assets/js/82.a858da93.js index 7dea540538..3360a5c0e9 100644 --- a/assets/js/82.d0dc05bc.js +++ b/assets/js/82.a858da93.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{446:function(t,e,o){"use strict";o.r(e);var n=o(7),r=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk-cli")]),e("OutboundLink")],1),t._v(" is a lightweight "),e("a",{attrs:{href:"https://codewith.mu/en/tutorials/1.0/repl",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("repl")]),e("OutboundLink")],1),t._v(" wrapper over "),e("code",[t._v("bdk")]),t._v(" that comes as a command line application. It is useful for quick testing and prototyping of bdk functionalities.")]),t._v(" "),e("p",[t._v("This can also be used as an example application to create your own command line bitcoin wallet tool using bdk.")]),t._v(" "),e("p",[e("code",[t._v("bdk-cli")]),t._v(" can interface with all the blockchain backends currently supported by "),e("code",[t._v("bdk")]),t._v(", like "),e("code",[t._v("rpc")]),t._v(", "),e("code",[t._v("electrum")]),t._v(", "),e("code",[t._v("esplora")]),t._v(" and "),e("code",[t._v("compact_filters")]),t._v(".")]),t._v(" "),e("p",[t._v("Check out "),e("a",{attrs:{href:"https://docs.rs/bdk-cli/0.5.0/bdk_cli/",target:"_blank",rel:"noopener noreferrer"}},[t._v("project documentation"),e("OutboundLink")],1),t._v(" for more details.")]),t._v(" "),e("p",[t._v("The following sections goes into more details on the installation and usage of "),e("code",[t._v("bdk-cli")]),t._v(".")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{447:function(t,e,o){"use strict";o.r(e);var n=o(7),r=Object(n.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),e("p",[e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-cli",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("bdk-cli")]),e("OutboundLink")],1),t._v(" is a lightweight "),e("a",{attrs:{href:"https://codewith.mu/en/tutorials/1.0/repl",target:"_blank",rel:"noopener noreferrer"}},[e("code",[t._v("repl")]),e("OutboundLink")],1),t._v(" wrapper over "),e("code",[t._v("bdk")]),t._v(" that comes as a command line application. It is useful for quick testing and prototyping of bdk functionalities.")]),t._v(" "),e("p",[t._v("This can also be used as an example application to create your own command line bitcoin wallet tool using bdk.")]),t._v(" "),e("p",[e("code",[t._v("bdk-cli")]),t._v(" can interface with all the blockchain backends currently supported by "),e("code",[t._v("bdk")]),t._v(", like "),e("code",[t._v("rpc")]),t._v(", "),e("code",[t._v("electrum")]),t._v(", "),e("code",[t._v("esplora")]),t._v(" and "),e("code",[t._v("compact_filters")]),t._v(".")]),t._v(" "),e("p",[t._v("Check out "),e("a",{attrs:{href:"https://docs.rs/bdk-cli/0.5.0/bdk_cli/",target:"_blank",rel:"noopener noreferrer"}},[t._v("project documentation"),e("OutboundLink")],1),t._v(" for more details.")]),t._v(" "),e("p",[t._v("The following sections goes into more details on the installation and usage of "),e("code",[t._v("bdk-cli")]),t._v(".")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/88.4bca1259.js b/assets/js/88.c63c0587.js similarity index 97% rename from assets/js/88.4bca1259.js rename to assets/js/88.c63c0587.js index a9e009e04c..ee06896fcf 100644 --- a/assets/js/88.4bca1259.js +++ b/assets/js/88.c63c0587.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{454:function(e,t,o){"use strict";o.r(t);var r=o(7),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"bitcoin-dev-kit-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-foundation"}},[e._v("#")]),e._v(" Bitcoin Dev Kit Foundation")]),e._v(" "),t("p",[e._v("The Bitcoin Dev Kit Foundation (EIN 93-2023051) is established as a US non-profit corporation to promote the development of, public access to and adoption of the free and open source Bitcoin Dev Kit (BDK) library software.")]),e._v(" "),t("p",[e._v("The Foundation aims to achieve this mission by funding the developers who contribute to and maintain the Bitcoin Dev Kit software libraries, documentation, and related infrastructure. We independently raise funds on behalf of the development team, and recruit for, fund, and operate the grant program.")]),e._v(" "),t("h2",{attrs:{id:"board"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#board"}},[e._v("#")]),e._v(" Board")]),e._v(" "),t("p",[e._v("The current BDK Foundation board is made up of five directors. The board members are all unpaid volunteer positions. All board members are long-time contributors and supporters of the BDK project:")]),e._v(" "),t("ul",[t("li",[e._v("Riccardo Casatta")]),e._v(" "),t("li",[e._v("Alekos Filini")]),e._v(" "),t("li",[e._v("Lloyd Fournier")]),e._v(" "),t("li",[e._v("Steve Lee")]),e._v(" "),t("li",[e._v("Steve Myers")])]),e._v(" "),t("h2",{attrs:{id:"operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#operations"}},[e._v("#")]),e._v(" Operations")]),e._v(" "),t("p",[e._v("Our operations team handles the day-to-day operations of the Foundation and reports to the board of directors. Our officers are all also active contributors to the development of the software. The five current officers are:")]),e._v(" "),t("ul",[t("li",[e._v("Steve Myers, President")]),e._v(" "),t("li",[e._v("Daniela Brozzoni, Vice-President")]),e._v(" "),t("li",[e._v("Joe Wood, Treasurer")]),e._v(" "),t("li",[e._v("thunderbiscuit, Secretary")]),e._v(" "),t("li",[e._v("Evan Lin, Grants Program Lead")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{453:function(e,t,o){"use strict";o.r(t);var r=o(7),a=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"bitcoin-dev-kit-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-foundation"}},[e._v("#")]),e._v(" Bitcoin Dev Kit Foundation")]),e._v(" "),t("p",[e._v("The Bitcoin Dev Kit Foundation (EIN 93-2023051) is established as a US non-profit corporation to promote the development of, public access to and adoption of the free and open source Bitcoin Dev Kit (BDK) library software.")]),e._v(" "),t("p",[e._v("The Foundation aims to achieve this mission by funding the developers who contribute to and maintain the Bitcoin Dev Kit software libraries, documentation, and related infrastructure. We independently raise funds on behalf of the development team, and recruit for, fund, and operate the grant program.")]),e._v(" "),t("h2",{attrs:{id:"board"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#board"}},[e._v("#")]),e._v(" Board")]),e._v(" "),t("p",[e._v("The current BDK Foundation board is made up of five directors. The board members are all unpaid volunteer positions. All board members are long-time contributors and supporters of the BDK project:")]),e._v(" "),t("ul",[t("li",[e._v("Riccardo Casatta")]),e._v(" "),t("li",[e._v("Alekos Filini")]),e._v(" "),t("li",[e._v("Lloyd Fournier")]),e._v(" "),t("li",[e._v("Steve Lee")]),e._v(" "),t("li",[e._v("Steve Myers")])]),e._v(" "),t("h2",{attrs:{id:"operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#operations"}},[e._v("#")]),e._v(" Operations")]),e._v(" "),t("p",[e._v("Our operations team handles the day-to-day operations of the Foundation and reports to the board of directors. Our officers are all also active contributors to the development of the software. The five current officers are:")]),e._v(" "),t("ul",[t("li",[e._v("Steve Myers, President")]),e._v(" "),t("li",[e._v("Daniela Brozzoni, Vice-President")]),e._v(" "),t("li",[e._v("Joe Wood, Treasurer")]),e._v(" "),t("li",[e._v("thunderbiscuit, Secretary")]),e._v(" "),t("li",[e._v("Evan Lin, Grants Program Lead")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/89.351dd0b1.js b/assets/js/89.01f3740b.js similarity index 99% rename from assets/js/89.351dd0b1.js rename to assets/js/89.01f3740b.js index 87fbbb3958..d9667a9aca 100644 --- a/assets/js/89.351dd0b1.js +++ b/assets/js/89.01f3740b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{453:function(t,e,a){"use strict";a.r(e);var i=a(7),n=Object(i.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"current-grantees-full-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-full-time"}},[t._v("#")]),t._v(" Current Grantees (Full-Time)")]),t._v(" "),e("h2",{attrs:{id:"evan-lin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#evan-lin"}},[t._v("#")]),t._v(" Evan Lin")]),t._v(" "),e("p",[t._v("Evan Lin (林志宇) is a Rust/Golang developer who has been contributing to BDK since 2022. Before working on bitcoin-related projects, his professional career started in 2017 where he led various umbrella projects for an altcoin. After discovering the importance of bitcoin, he started contributing to various projects (including BDK, Fedimint and Utreexo) and was eventually taken under the wing of and mentored by Lloyd Fournier.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1kysd8m44dhv7ywa75u5z7w2w0gs4t6qzhgvjp555gfknasy3krlqfxde60",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"thunderbiscuit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#thunderbiscuit"}},[t._v("#")]),t._v(" thunderbiscuit")]),t._v(" "),e("p",[t._v("Thunderbiscuit is an Android engineer who's has been working on the project for over 3 years, leading the work on the language bindings for BDK. He's using BDK in production with "),e("a",{attrs:{href:"https://padawanwallet.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Padawan Wallet"),e("OutboundLink")],1),t._v(". He's also in charge of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-kotlin-example-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Kotlin Example Wallet"),e("OutboundLink")],1),t._v(", the sample native Android wallet for BDK, and the "),e("a",{attrs:{href:"https://bitcoindevkit.github.io/book-of-bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Book of BDK"),e("OutboundLink")],1),t._v(" project, working on building walkthrough documentation for the BDK ecosystem.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/thunderB__",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1thunderat5g552cuy7umk624ct5xe4tpgwr2jcjjq2gc0567wgrqnya79l",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://thunderbiscuit.com",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/www.png"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"matthew-ramsden"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#matthew-ramsden"}},[t._v("#")]),t._v(" Matthew Ramsden")]),t._v(" "),e("p",[t._v("Matthew is an experienced iOS engineer who has picked up Rust along the way to expand his contributions to the bitcoin ecosystem. His primary focus is maintaining the bdk-ffi Rust bindings, contributing features, and ensuring the library's robustness, along with leading the development of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/BDKSwiftExampleWallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Swift Example Wallet"),e("OutboundLink")],1),t._v(" which is an example iOS wallet built on BDK.")]),t._v(" "),e("p",[t._v("He also created the Lightning iOS app "),e("a",{attrs:{href:"https://github.com/reez/Monday",target:"_blank",rel:"noopener noreferrer"}},[t._v("Monday"),e("OutboundLink")],1),t._v(", the native iOS implementation of Bitcoin UI Kit "),e("a",{attrs:{href:"https://github.com/reez/BitcoinUI",target:"_blank",rel:"noopener noreferrer"}},[t._v("BitcoinUI"),e("OutboundLink")],1),t._v(", the iOS app "),e("a",{attrs:{href:"https://apps.apple.com/us/app/block-screen/id1533333210",target:"_blank",rel:"noopener noreferrer"}},[t._v("Block Screen"),e("OutboundLink")],1),t._v(", and co-organizes NashBitDevs.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/matthewramsden",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/reez",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1reezn2ctrrg736uqj7mva9lsuwv0kr5asj4vvkwxnrwlhvxf98tsq99ty4",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"valuedmammal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#valuedmammal"}},[t._v("#")]),t._v(" ValuedMammal")]),t._v(" "),e("p",[t._v("ValuedMammal is a Rust developer and node operator whose work includes research in the areas of mempool and p2p. He's interested in bitcoin payment solutions, problems around fee estimation, and innovations in bitcoin Script. In 2021 he managed Tangerine node on the lightning network and was active in the PLEBNET community. He started contributing to BDK out of a belief that modern wallets should be built with modern tools and sought out a team that makes no compromises when it comes to quality and correctness and who share a mission to master the fundamentals while providing convenient abstractions to developers. His unorthodox path into software development came as a byproduct of his own bitcoin journey and continues to grow more fulfilling each day. As a result, his natural environment is in a terminal managing a server or database, and of course writing code. ValuedMammal studied Biological Science at university, and outside of bitcoin he's a writer and educator who likes music, travel, and foreign languages.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/valuedmammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/ValuedMammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h1",{attrs:{id:"current-grantees-project-grants"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-project-grants"}},[t._v("#")]),t._v(" Current Grantees (Project Grants)")]),t._v(" "),e("h2",{attrs:{id:"wei-chen"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wei-chen"}},[t._v("#")]),t._v(" Wei Chen")]),t._v(" "),e("p",[t._v("Wei Chen has been contributing to BDK since late 2023 and was formerly a full stack Java developer based in Washington D.C. with ten years of experience. He was introduced to BDK as a result of Evan Lin, whom he met when taking Mandarin lessons in Taipei. The focus of his contributions will be towards assisting with the restructuring of the electrum crate, reengineering of the TxGraph data components to simplify the tracking of lineal conflicts, as well as focusing on performance optimization and the continued debugging of BDK, which includes the maintenance of the TestEnv crate. Outside of code contributions to the project, Wei Chen will be also assisting Evan Lin with various bitcoin events or workshops to improve understanding towards BDK.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://github.com/LagginTimes",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"manuel-gatti"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manuel-gatti"}},[t._v("#")]),t._v(" Manuel Gatti")]),t._v(" "),e("p",[t._v("Manuel Gatti is a Product/Project Manager who has worked for about 3 and a half years as a functional analyst/project manager in the IT consultancy sector and for the last year as a Product Owner in a non-bitcoin-related software company. He is involved in some educational projects related to bitcoin in Italy and hosts an italian podcast about libertarian philosophy with episodes dedicated to bitcoin as a tool for freedom.")]),t._v(" "),e("p",[t._v("He has been contributing to BDK since April 2023 mostly on the project management side (holding calls, helping with triage and prioritization, updating stakeholders). Since April 2024, he has started conducting user interviews in order to get feedback on BDK usage and possible pain points with the aim to help the team with the definition and prioritization of the development activities. In May 2024 he started collaborating as a product/project manager with Wizard Sardine (users of BDK) and in particular to the development and go-to-market strategy of Liana Wallet.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub10znwkv69vus58rrqydwfzy3tuljhqn5plec84y0v2pa5n85xfwnqaft2sl",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br")])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{457:function(t,e,a){"use strict";a.r(e);var i=a(7),n=Object(i.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"current-grantees-full-time"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-full-time"}},[t._v("#")]),t._v(" Current Grantees (Full-Time)")]),t._v(" "),e("h2",{attrs:{id:"evan-lin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#evan-lin"}},[t._v("#")]),t._v(" Evan Lin")]),t._v(" "),e("p",[t._v("Evan Lin (林志宇) is a Rust/Golang developer who has been contributing to BDK since 2022. Before working on bitcoin-related projects, his professional career started in 2017 where he led various umbrella projects for an altcoin. After discovering the importance of bitcoin, he started contributing to various projects (including BDK, Fedimint and Utreexo) and was eventually taken under the wing of and mentored by Lloyd Fournier.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/evanlinjin",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1kysd8m44dhv7ywa75u5z7w2w0gs4t6qzhgvjp555gfknasy3krlqfxde60",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"thunderbiscuit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#thunderbiscuit"}},[t._v("#")]),t._v(" thunderbiscuit")]),t._v(" "),e("p",[t._v("Thunderbiscuit is an Android engineer who's has been working on the project for over 3 years, leading the work on the language bindings for BDK. He's using BDK in production with "),e("a",{attrs:{href:"https://padawanwallet.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Padawan Wallet"),e("OutboundLink")],1),t._v(". He's also in charge of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-kotlin-example-wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Kotlin Example Wallet"),e("OutboundLink")],1),t._v(", the sample native Android wallet for BDK, and the "),e("a",{attrs:{href:"https://bitcoindevkit.github.io/book-of-bdk/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Book of BDK"),e("OutboundLink")],1),t._v(" project, working on building walkthrough documentation for the BDK ecosystem.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/thunderB__",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/thunderbiscuit",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1thunderat5g552cuy7umk624ct5xe4tpgwr2jcjjq2gc0567wgrqnya79l",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://thunderbiscuit.com",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/www.png"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"matthew-ramsden"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#matthew-ramsden"}},[t._v("#")]),t._v(" Matthew Ramsden")]),t._v(" "),e("p",[t._v("Matthew is an experienced iOS engineer who has picked up Rust along the way to expand his contributions to the bitcoin ecosystem. His primary focus is maintaining the bdk-ffi Rust bindings, contributing features, and ensuring the library's robustness, along with leading the development of the "),e("a",{attrs:{href:"https://github.com/bitcoindevkit/BDKSwiftExampleWallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("BDK Swift Example Wallet"),e("OutboundLink")],1),t._v(" which is an example iOS wallet built on BDK.")]),t._v(" "),e("p",[t._v("He also created the Lightning iOS app "),e("a",{attrs:{href:"https://github.com/reez/Monday",target:"_blank",rel:"noopener noreferrer"}},[t._v("Monday"),e("OutboundLink")],1),t._v(", the native iOS implementation of Bitcoin UI Kit "),e("a",{attrs:{href:"https://github.com/reez/BitcoinUI",target:"_blank",rel:"noopener noreferrer"}},[t._v("BitcoinUI"),e("OutboundLink")],1),t._v(", the iOS app "),e("a",{attrs:{href:"https://apps.apple.com/us/app/block-screen/id1533333210",target:"_blank",rel:"noopener noreferrer"}},[t._v("Block Screen"),e("OutboundLink")],1),t._v(", and co-organizes NashBitDevs.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/matthewramsden",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/reez",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub1reezn2ctrrg736uqj7mva9lsuwv0kr5asj4vvkwxnrwlhvxf98tsq99ty4",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"valuedmammal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#valuedmammal"}},[t._v("#")]),t._v(" ValuedMammal")]),t._v(" "),e("p",[t._v("ValuedMammal is a Rust developer and node operator whose work includes research in the areas of mempool and p2p. He's interested in bitcoin payment solutions, problems around fee estimation, and innovations in bitcoin Script. In 2021 he managed Tangerine node on the lightning network and was active in the PLEBNET community. He started contributing to BDK out of a belief that modern wallets should be built with modern tools and sought out a team that makes no compromises when it comes to quality and correctness and who share a mission to master the fundamentals while providing convenient abstractions to developers. His unorthodox path into software development came as a byproduct of his own bitcoin journey and continues to grow more fulfilling each day. As a result, his natural environment is in a terminal managing a server or database, and of course writing code. ValuedMammal studied Biological Science at university, and outside of bitcoin he's a writer and educator who likes music, travel, and foreign languages.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/valuedmammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/ValuedMammal",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h1",{attrs:{id:"current-grantees-project-grants"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#current-grantees-project-grants"}},[t._v("#")]),t._v(" Current Grantees (Project Grants)")]),t._v(" "),e("h2",{attrs:{id:"wei-chen"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wei-chen"}},[t._v("#")]),t._v(" Wei Chen")]),t._v(" "),e("p",[t._v("Wei Chen has been contributing to BDK since late 2023 and was formerly a full stack Java developer based in Washington D.C. with ten years of experience. He was introduced to BDK as a result of Evan Lin, whom he met when taking Mandarin lessons in Taipei. The focus of his contributions will be towards assisting with the restructuring of the electrum crate, reengineering of the TxGraph data components to simplify the tracking of lineal conflicts, as well as focusing on performance optimization and the continued debugging of BDK, which includes the maintenance of the TestEnv crate. Outside of code contributions to the project, Wei Chen will be also assisting Evan Lin with various bitcoin events or workshops to improve understanding towards BDK.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://github.com/LagginTimes",target:"_blank"}},[e("img",{staticStyle:{width:"24px"},attrs:{src:"/img/github-icon.svg"}})])]),t._v(" "),e("br"),t._v(" "),e("h2",{attrs:{id:"manuel-gatti"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manuel-gatti"}},[t._v("#")]),t._v(" Manuel Gatti")]),t._v(" "),e("p",[t._v("Manuel Gatti is a Product/Project Manager who has worked for about 3 and a half years as a functional analyst/project manager in the IT consultancy sector and for the last year as a Product Owner in a non-bitcoin-related software company. He is involved in some educational projects related to bitcoin in Italy and hosts an italian podcast about libertarian philosophy with episodes dedicated to bitcoin as a tool for freedom.")]),t._v(" "),e("p",[t._v("He has been contributing to BDK since April 2023 mostly on the project management side (holding calls, helping with triage and prioritization, updating stakeholders). Since April 2024, he has started conducting user interviews in order to get feedback on BDK usage and possible pain points with the aim to help the team with the definition and prioritization of the development activities. In May 2024 he started collaborating as a product/project manager with Wizard Sardine (users of BDK) and in particular to the development and go-to-market strategy of Liana Wallet.")]),t._v(" "),e("div",[e("a",{attrs:{href:"https://twitter.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/twitter-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://github.com/nondiremanuel",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/github-icon.svg"}})]),t._v(" "),e("a",{attrs:{href:"https://njump.me/npub10znwkv69vus58rrqydwfzy3tuljhqn5plec84y0v2pa5n85xfwnqaft2sl",target:"_blank"}},[e("img",{staticStyle:{width:"24px",margin:"0 12px 0 0"},attrs:{src:"/img/nostr-icon.svg"}})])]),t._v(" "),e("br")])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/90.ebb1edf1.js b/assets/js/90.d19e45ae.js similarity index 98% rename from assets/js/90.ebb1edf1.js rename to assets/js/90.d19e45ae.js index e2e52ddb5a..7f2ad1ec66 100644 --- a/assets/js/90.ebb1edf1.js +++ b/assets/js/90.d19e45ae.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{456:function(e,t,r){"use strict";r.r(t);var o=r(7),a=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"grants-program"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#grants-program"}},[e._v("#")]),e._v(" Grants Program")]),e._v(" "),t("p",[e._v("One of the primary purposes of the BDK Foundation is to support the ongoing development and maintenance of the BDK suite of open source software. To this end the BDK Foundation funds open source developers working on BDK and related projects via full-time and project based grants.")]),e._v(" "),t("h2",{attrs:{id:"grant-requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#grant-requirements"}},[e._v("#")]),e._v(" Grant Requirements")]),e._v(" "),t("p",[e._v("Below is a list of general requirements the BDK Foundation looks for in grant applicants. These requirements may be demonstrated via any open source project you have contributed to. In particular through your public work on PR reviews, PRs, issues, team discussions, and current or prior side projects. We also consider work you've done as part of bitcoin development training programs (eg. Chaincode Labs, Base58, etc.) and related professional work experience.")]),e._v(" "),t("ul",[t("li",[e._v("Mature team player who communicates well and supports fellow team members.")]),e._v(" "),t("li",[e._v("Supports the overall bitcoin mission, in particular to improve individuals financial privacy and autonomy.")]),e._v(" "),t("li",[e._v("Understands bitcoin on-chain protocols and technology.")]),e._v(" "),t("li",[e._v("Helps train/mentor/onboard others to BDK, bitcoin, or related software development.")]),e._v(" "),t("li",[e._v("Helps supports a project outside of coding; for example user support, maintaining docs, CI, and managing releases.")])]),e._v(" "),t("p",[e._v("Bonus/optional:")]),e._v(" "),t("ul",[t("li",[e._v("Likely in the future to start or work for a project or company using BDK.")]),e._v(" "),t("li",[e._v("Understands/has experience with related protocols, eg. Lightning, e-cash.")]),e._v(" "),t("li",[e._v("Active in your local bitcoin community (eg. bitdevs, meetups, workshops).")]),e._v(" "),t("li",[e._v("From a geographical region not currently represented on the team.")])]),e._v(" "),t("h2",{attrs:{id:"full-time-grants"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#full-time-grants"}},[e._v("#")]),e._v(" Full-time grants")]),e._v(" "),t("p",[e._v("Full-time grants are for developers who are dedicating most of their work time to improving and maintaining bitcoin open source software, and in particular BDK and supporting projects.")]),e._v(" "),t("p",[e._v("The core "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("bdk")]),t("OutboundLink")],1),e._v(" repo projects are written in Rust with mobile and language bindings (Swift, Kotlin, Python) provided by the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("bdk-ffi")]),t("OutboundLink")],1),e._v(" repo projects. Grantees should have strong Rust and/or mobile and language bindings skills.")]),e._v(" "),t("h3",{attrs:{id:"rust"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rust"}},[e._v("#")]),e._v(" Rust")]),e._v(" "),t("p",[e._v("Additional traits that are a plus for full-time Rust developer grants:")]),e._v(" "),t("ul",[t("li",[e._v("Solid Rust development and API use and design experience.")]),e._v(" "),t("li",[e._v("A vision for how to maintain and improve the overall BDK Rust codebase.")]),e._v(" "),t("li",[e._v("A proposal for new or existing BDK Rust features or modules you want to improve and maintain.")]),e._v(" "),t("li",[e._v("Engaged with upstream projects, eg. rust-bitcoin, rust-miniscript, uniffi-rs, etc.")]),e._v(" "),t("li",[e._v("Engaged with downstream projects.")])]),e._v(" "),t("h3",{attrs:{id:"mobile-language-bindings"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mobile-language-bindings"}},[e._v("#")]),e._v(" Mobile / language bindings")]),e._v(" "),t("p",[e._v("Additional traits that are a plus for full-time mobile/language bindings grants:")]),e._v(" "),t("ul",[t("li",[e._v("Solid mobile development and app design experience (Android, iOS).")]),e._v(" "),t("li",[e._v("Kotlin, Swift, and/or Python development and API use and design experience.")]),e._v(" "),t("li",[e._v("Rust development experience and/or willingness to learn.")]),e._v(" "),t("li",[e._v("Vision for how to best support all BDK based app developers.")]),e._v(" "),t("li",[e._v("Engaged with the bitcoin app design community.")])]),e._v(" "),t("h2",{attrs:{id:"project-grants"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#project-grants"}},[e._v("#")]),e._v(" Project grants")]),e._v(" "),t("p",[e._v("Project grants are for contributors who are able to focus part-time for at least three months on a project to improve BDK or a supporting project.")]),e._v(" "),t("p",[e._v("Additional traits that are a plus for project grants:")]),e._v(" "),t("ul",[t("li",[e._v("A project proposal that clearly supports the BDK mission.")]),e._v(" "),t("li",[e._v("The project doesn't have to be coding, it could be research, testing, docs, etc.")]),e._v(" "),t("li",[e._v("The project can be completed in 3 months (one quarter).")])]),e._v(" "),t("h2",{attrs:{id:"applying"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#applying"}},[e._v("#")]),e._v(" Applying")]),e._v(" "),t("p",[e._v("To apply for a full-time or project grant please send your proposal to: "),t("a",{attrs:{href:"mailto:grants@bitcoindevkit.org"}},[e._v("grants@bitcoindevkit.org")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{455:function(e,t,r){"use strict";r.r(t);var o=r(7),a=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"grants-program"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#grants-program"}},[e._v("#")]),e._v(" Grants Program")]),e._v(" "),t("p",[e._v("One of the primary purposes of the BDK Foundation is to support the ongoing development and maintenance of the BDK suite of open source software. To this end the BDK Foundation funds open source developers working on BDK and related projects via full-time and project based grants.")]),e._v(" "),t("h2",{attrs:{id:"grant-requirements"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#grant-requirements"}},[e._v("#")]),e._v(" Grant Requirements")]),e._v(" "),t("p",[e._v("Below is a list of general requirements the BDK Foundation looks for in grant applicants. These requirements may be demonstrated via any open source project you have contributed to. In particular through your public work on PR reviews, PRs, issues, team discussions, and current or prior side projects. We also consider work you've done as part of bitcoin development training programs (eg. Chaincode Labs, Base58, etc.) and related professional work experience.")]),e._v(" "),t("ul",[t("li",[e._v("Mature team player who communicates well and supports fellow team members.")]),e._v(" "),t("li",[e._v("Supports the overall bitcoin mission, in particular to improve individuals financial privacy and autonomy.")]),e._v(" "),t("li",[e._v("Understands bitcoin on-chain protocols and technology.")]),e._v(" "),t("li",[e._v("Helps train/mentor/onboard others to BDK, bitcoin, or related software development.")]),e._v(" "),t("li",[e._v("Helps supports a project outside of coding; for example user support, maintaining docs, CI, and managing releases.")])]),e._v(" "),t("p",[e._v("Bonus/optional:")]),e._v(" "),t("ul",[t("li",[e._v("Likely in the future to start or work for a project or company using BDK.")]),e._v(" "),t("li",[e._v("Understands/has experience with related protocols, eg. Lightning, e-cash.")]),e._v(" "),t("li",[e._v("Active in your local bitcoin community (eg. bitdevs, meetups, workshops).")]),e._v(" "),t("li",[e._v("From a geographical region not currently represented on the team.")])]),e._v(" "),t("h2",{attrs:{id:"full-time-grants"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#full-time-grants"}},[e._v("#")]),e._v(" Full-time grants")]),e._v(" "),t("p",[e._v("Full-time grants are for developers who are dedicating most of their work time to improving and maintaining bitcoin open source software, and in particular BDK and supporting projects.")]),e._v(" "),t("p",[e._v("The core "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("bdk")]),t("OutboundLink")],1),e._v(" repo projects are written in Rust with mobile and language bindings (Swift, Kotlin, Python) provided by the "),t("a",{attrs:{href:"https://github.com/bitcoindevkit/bdk-ffi",target:"_blank",rel:"noopener noreferrer"}},[t("code",[e._v("bdk-ffi")]),t("OutboundLink")],1),e._v(" repo projects. Grantees should have strong Rust and/or mobile and language bindings skills.")]),e._v(" "),t("h3",{attrs:{id:"rust"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rust"}},[e._v("#")]),e._v(" Rust")]),e._v(" "),t("p",[e._v("Additional traits that are a plus for full-time Rust developer grants:")]),e._v(" "),t("ul",[t("li",[e._v("Solid Rust development and API use and design experience.")]),e._v(" "),t("li",[e._v("A vision for how to maintain and improve the overall BDK Rust codebase.")]),e._v(" "),t("li",[e._v("A proposal for new or existing BDK Rust features or modules you want to improve and maintain.")]),e._v(" "),t("li",[e._v("Engaged with upstream projects, eg. rust-bitcoin, rust-miniscript, uniffi-rs, etc.")]),e._v(" "),t("li",[e._v("Engaged with downstream projects.")])]),e._v(" "),t("h3",{attrs:{id:"mobile-language-bindings"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mobile-language-bindings"}},[e._v("#")]),e._v(" Mobile / language bindings")]),e._v(" "),t("p",[e._v("Additional traits that are a plus for full-time mobile/language bindings grants:")]),e._v(" "),t("ul",[t("li",[e._v("Solid mobile development and app design experience (Android, iOS).")]),e._v(" "),t("li",[e._v("Kotlin, Swift, and/or Python development and API use and design experience.")]),e._v(" "),t("li",[e._v("Rust development experience and/or willingness to learn.")]),e._v(" "),t("li",[e._v("Vision for how to best support all BDK based app developers.")]),e._v(" "),t("li",[e._v("Engaged with the bitcoin app design community.")])]),e._v(" "),t("h2",{attrs:{id:"project-grants"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#project-grants"}},[e._v("#")]),e._v(" Project grants")]),e._v(" "),t("p",[e._v("Project grants are for contributors who are able to focus part-time for at least three months on a project to improve BDK or a supporting project.")]),e._v(" "),t("p",[e._v("Additional traits that are a plus for project grants:")]),e._v(" "),t("ul",[t("li",[e._v("A project proposal that clearly supports the BDK mission.")]),e._v(" "),t("li",[e._v("The project doesn't have to be coding, it could be research, testing, docs, etc.")]),e._v(" "),t("li",[e._v("The project can be completed in 3 months (one quarter).")])]),e._v(" "),t("h2",{attrs:{id:"applying"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#applying"}},[e._v("#")]),e._v(" Applying")]),e._v(" "),t("p",[e._v("To apply for a full-time or project grant please send your proposal to: "),t("a",{attrs:{href:"mailto:grants@bitcoindevkit.org"}},[e._v("grants@bitcoindevkit.org")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/91.bd284082.js b/assets/js/91.cc301224.js similarity index 90% rename from assets/js/91.bd284082.js rename to assets/js/91.cc301224.js index 9f0136032c..9bd5d1e88e 100644 --- a/assets/js/91.bd284082.js +++ b/assets/js/91.cc301224.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{457:function(t,o,i){"use strict";i.r(o);var n=i(7),e=Object(n.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"bitcoin-dev-kit-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-foundation"}},[this._v("#")]),this._v(" Bitcoin Dev Kit Foundation")]),this._v(" "),t("p",[this._v("The Bitcoin Dev Kit Foundation is established as a US non-profit corporation to promote the development of, public access to and adoption of the free and open source Bitcoin Dev Kit (BDK) library software.")])])}),[],!1,null,null,null);o.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{454:function(t,o,i){"use strict";i.r(o);var n=i(7),e=Object(n.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"bitcoin-dev-kit-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#bitcoin-dev-kit-foundation"}},[this._v("#")]),this._v(" Bitcoin Dev Kit Foundation")]),this._v(" "),t("p",[this._v("The Bitcoin Dev Kit Foundation is established as a US non-profit corporation to promote the development of, public access to and adoption of the free and open source Bitcoin Dev Kit (BDK) library software.")])])}),[],!1,null,null,null);o.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/92.20a48c5f.js b/assets/js/92.c93a606e.js similarity index 98% rename from assets/js/92.20a48c5f.js rename to assets/js/92.c93a606e.js index 9daf24ebcf..7bd55bba29 100644 --- a/assets/js/92.20a48c5f.js +++ b/assets/js/92.c93a606e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{455:function(t,r,a){"use strict";a.r(r);var s=a(7),n=Object(s.a)({},(function(){var t=this,r=t._self._c;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"supporters"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supporters"}},[t._v("#")]),t._v(" Supporters")]),t._v(" "),r("p",[t._v("The Bitcoin Dev Kit project is proudly supported by a number of organizations. If you'd like to becoming a supporter\nplease reach out at: "),r("a",{attrs:{href:"mailto:hello@bitcoindevkit.org"}},[t._v("hello@bitcoindevkit.org")])]),t._v(" "),r("h1",{attrs:{id:"2024"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2024"}},[t._v("#")]),t._v(" 2024")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://opensats.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/opensats.png",alt:"OpenSats"}}),t._v("\n OpenSats\n ")]),t._v(" "),r("a",{attrs:{href:"https://vinteum.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/vinteum.jpg",alt:"Vinteum"}}),t._v("\n Vinteum\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2023"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2023"}},[t._v("#")]),t._v(" 2023")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://opensats.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/opensats.png",alt:"OpenSats"}}),t._v("\n OpenSats\n ")]),t._v(" "),r("a",{attrs:{href:"https://twitter.com/btrust_builders",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/btrust.jpg",alt:"Btrust"}}),t._v("\n ₿trust\n ")]),t._v(" "),r("a",{attrs:{href:"https://vinteum.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/vinteum.jpg",alt:"Vinteum"}}),t._v("\n Vinteum\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2022"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2022"}},[t._v("#")]),t._v(" 2022")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://brink.dev/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/brink.png",alt:"Sponsor Brink"}}),t._v("\n Brink\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2021"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2021"}},[t._v("#")]),t._v(" 2021")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://brink.dev/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/brink.png",alt:"Sponsor Brink"}}),t._v("\n Brink\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2020"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2020"}},[t._v("#")]),t._v(" 2020")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://www.bitfinex.com/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/bitfinex.svg",alt:"Sponsor Bitfinex"}}),t._v("\n Bitfinex\n ")]),t._v(" "),r("a",{attrs:{href:"https://tether.to/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/tether.png",alt:"Sponsor Tether"}}),t._v("\n Tether\n ")]),t._v(" "),r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://brink.dev/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/brink.png",alt:"Sponsor Brink"}}),t._v("\n Brink\n ")])])])])}),[],!1,null,null,null);r.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{456:function(t,r,a){"use strict";a.r(r);var s=a(7),n=Object(s.a)({},(function(){var t=this,r=t._self._c;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"supporters"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#supporters"}},[t._v("#")]),t._v(" Supporters")]),t._v(" "),r("p",[t._v("The Bitcoin Dev Kit project is proudly supported by a number of organizations. If you'd like to becoming a supporter\nplease reach out at: "),r("a",{attrs:{href:"mailto:hello@bitcoindevkit.org"}},[t._v("hello@bitcoindevkit.org")])]),t._v(" "),r("h1",{attrs:{id:"2024"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2024"}},[t._v("#")]),t._v(" 2024")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://opensats.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/opensats.png",alt:"OpenSats"}}),t._v("\n OpenSats\n ")]),t._v(" "),r("a",{attrs:{href:"https://vinteum.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/vinteum.jpg",alt:"Vinteum"}}),t._v("\n Vinteum\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2023"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2023"}},[t._v("#")]),t._v(" 2023")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://opensats.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/opensats.png",alt:"OpenSats"}}),t._v("\n OpenSats\n ")]),t._v(" "),r("a",{attrs:{href:"https://twitter.com/btrust_builders",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/btrust.jpg",alt:"Btrust"}}),t._v("\n ₿trust\n ")]),t._v(" "),r("a",{attrs:{href:"https://vinteum.org/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/vinteum.jpg",alt:"Vinteum"}}),t._v("\n Vinteum\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2022"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2022"}},[t._v("#")]),t._v(" 2022")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://brink.dev/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/brink.png",alt:"Sponsor Brink"}}),t._v("\n Brink\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2021"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2021"}},[t._v("#")]),t._v(" 2021")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://brink.dev/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/brink.png",alt:"Sponsor Brink"}}),t._v("\n Brink\n ")])])]),t._v(" "),r("br"),t._v(" "),r("h1",{attrs:{id:"2020"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#2020"}},[t._v("#")]),t._v(" 2020")]),t._v(" "),r("div",{staticClass:"supporters"},[r("div",{staticClass:"row"},[r("a",{attrs:{href:"https://www.bitfinex.com/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/bitfinex.svg",alt:"Sponsor Bitfinex"}}),t._v("\n Bitfinex\n ")]),t._v(" "),r("a",{attrs:{href:"https://tether.to/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/tether.png",alt:"Sponsor Tether"}}),t._v("\n Tether\n ")]),t._v(" "),r("a",{attrs:{href:"https://spiral.xyz/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/spiral.svg",alt:"Sponsor Spiral"}}),t._v("\n Spiral\n ")]),t._v(" "),r("a",{attrs:{href:"https://brink.dev/",target:"_blank",rel:"nofollow noopener"}},[r("img",{attrs:{src:"/img/brink.png",alt:"Sponsor Brink"}}),t._v("\n Brink\n ")])])])])}),[],!1,null,null,null);r.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/app.fa26e167.js b/assets/js/app.f121eb03.js similarity index 70% rename from assets/js/app.fa26e167.js rename to assets/js/app.f121eb03.js index 04d1ff131e..7782460de2 100644 --- a/assets/js/app.fa26e167.js +++ b/assets/js/app.f121eb03.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var o,a,c=e[0],l=e[1],s=e[2],d=0,u=[];d
'};function i(t,e,n){return tn?n:t}function r(t){return 100*(-1+t)}n.configure=function(t){var e,n;for(e in t)void 0!==(n=t[e])&&t.hasOwnProperty(e)&&(o[e]=n);return this},n.status=null,n.set=function(t){var e=n.isStarted();t=i(t,o.minimum,1),n.status=1===t?null:t;var l=n.render(!e),s=l.querySelector(o.barSelector),p=o.speed,d=o.easing;return l.offsetWidth,a((function(e){""===o.positionUsing&&(o.positionUsing=n.getPositioningCSS()),c(s,function(t,e,n){var i;return(i="translate3d"===o.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===o.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"}).transition="all "+e+"ms "+n,i}(t,p,d)),1===t?(c(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){c(l,{transition:"all "+p+"ms linear",opacity:0}),setTimeout((function(){n.remove(),e()}),p)}),p)):setTimeout(e,p)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var t=function(){setTimeout((function(){n.status&&(n.trickle(),t())}),o.trickleSpeed)};return o.trickle&&t(),this},n.done=function(t){return t||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(t){var e=n.status;return e?("number"!=typeof t&&(t=(1-e)*i(Math.random()*e,.1,.95)),e=i(e+t,0,.994),n.set(e)):n.start()},n.trickle=function(){return n.inc(Math.random()*o.trickleRate)},t=0,e=0,n.promise=function(o){return o&&"resolved"!==o.state()?(0===e&&n.start(),t++,e++,o.always((function(){0==--e?(t=0,n.done()):n.set((t-e)/t)})),this):this},n.render=function(t){if(n.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var e=document.createElement("div");e.id="nprogress",e.innerHTML=o.template;var i,a=e.querySelector(o.barSelector),l=t?"-100":r(n.status||0),p=document.querySelector(o.parent);return c(a,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),o.showSpinner||(i=e.querySelector(o.spinnerSelector))&&u(i),p!=document.body&&s(p,"nprogress-custom-parent"),p.appendChild(e),e},n.remove=function(){p(document.documentElement,"nprogress-busy"),p(document.querySelector(o.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&u(t)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var a=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),c=function(){var t=["Webkit","O","Moz","ms"],e={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()})),e[n]||(e[n]=function(e){var n=document.body.style;if(e in n)return e;for(var o,i=t.length,r=e.charAt(0).toUpperCase()+e.slice(1);i--;)if((o=t[i]+r)in n)return o;return e}(n))}function o(t,e,o){e=n(e),t.style[e]=o}return function(t,e){var n,i,r=arguments;if(2==r.length)for(n in e)void 0!==(i=e[n])&&e.hasOwnProperty(n)&&o(t,n,i);else o(t,r[1],r[2])}}();function l(t,e){return("string"==typeof t?t:d(t)).indexOf(" "+e+" ")>=0}function s(t,e){var n=d(t),o=n+e;l(n,e)||(t.className=o.substring(1))}function p(t,e){var n,o=d(t);l(t,e)&&(n=o.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function d(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function u(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return n})?o.call(e,n,e,t):o)||(t.exports=i)},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";var o=n(0),i=n(54).f,r=n(13),a=n(96),c=n(34),l=n(69),s=n(135);t.exports=function(t,e){var n,p,d,u,g,h=t.target,m=t.global,f=t.stat;if(n=m?o:f?o[h]||c(h,{}):o[h]&&o[h].prototype)for(p in e){if(u=e[p],d=t.dontCallGetSet?(g=i(n,p))&&g.value:n[p],!s(m?p:h+(f?".":"#")+p,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(t.sham||d&&d.sham)&&r(u,"sham",!0),a(n,p,u,t)}}},function(t,e,n){"use strict";var o=n(27),i=Function.prototype.call;t.exports=o?i.bind(i):function(){return i.apply(i,arguments)}},function(t,e,n){"use strict";var o=n(3);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},function(t,e,n){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var o=n(55),i=n(56);t.exports=function(t){return o(i(t))}},function(t,e,n){"use strict";var o=n(0),i=n(1),r=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?r(o[t]):o[t]&&o[t][e]}},function(t,e,n){"use strict";var o=n(1),i=n(117),r=TypeError;t.exports=function(t){if(o(t))return t;throw new r(i(t)+" is not a function")}},function(t,e,n){"use strict";var o=n(0),i=n(64),r=n(9),a=n(66),c=n(62),l=n(61),s=o.Symbol,p=i("wks"),d=l?s.for||s:s&&s.withoutSetter||a;t.exports=function(t){return r(p,t)||(p[t]=c&&r(s,t)?s[t]:d("Symbol."+t)),p[t]}},function(t,e,n){"use strict";var o=n(65),i=n(0),r=n(34),a=t.exports=i["__core-js_shared__"]||r("__core-js_shared__",{});(a.versions||(a.versions=[])).push({version:"3.36.0",mode:o?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e,n){"use strict";var o=n(0),i=Object.defineProperty;t.exports=function(t,e){try{i(o,t,{value:e,configurable:!0,writable:!0})}catch(n){o[t]=e}return e}},function(t,e,n){"use strict";var o=n(56),i=Object;t.exports=function(t){return i(o(t))}},function(t,e,n){"use strict";var o=n(8),i=String,r=TypeError;t.exports=function(t){if(o(t))return t;throw new r(i(t)+" is not an object")}},function(t,e,n){"use strict";var o=n(132);t.exports=function(t){return o(t.length)}},function(t,e,n){var o=n(158),i=n(11),r=Object.prototype,a=r.hasOwnProperty,c=r.propertyIsEnumerable,l=o(function(){return arguments}())?o:function(t){return i(t)&&a.call(t,"callee")&&!c.call(t,"callee")};t.exports=l},function(t,e,n){var o=n(10)(n(6),"Map");t.exports=o},function(t,e,n){var o=n(177),i=n(184),r=n(186),a=n(187),c=n(188);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var o=n(4),i=n(44),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(o(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(a.test(t)||!r.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var o=n(12),i=n(11);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==o(t)}},function(t,e,n){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",o="second",i="minute",r="hour",a="day",c="week",l="month",s="quarter",p="year",d="date",u="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},f=function(t,e,n){var o=String(t);return!o||o.length>=e?t:""+Array(e+1-o.length).join(n)+t},v={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),o=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+f(o,2,"0")+":"+f(i,2,"0")},m:function t(e,n){if(e.date()1)return t(a[0])}else{var c=e.name;y[c]=e,i=c}return!o&&i&&(b=i),i||!o&&b},B=function(t,e){if(k(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},D=v;D.l=_,D.i=k,D.w=function(t,e){return B(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function m(t){this.$L=_(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var f=m.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(g);if(o){var i=o[2]-1||0,r=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,r)}}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return D},f.isValid=function(){return!(this.$d.toString()===u)},f.isSame=function(t,e){var n=B(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return B(t)-1&&t%1==0&&t79&&a<83||!r("reduce")},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var o=n(5),i=n(26),r=n(113),a=n(28),c=n(29),l=n(58),s=n(9),p=n(67),d=Object.getOwnPropertyDescriptor;e.f=o?d:function(t,e){if(t=c(t),e=l(e),p)try{return d(t,e)}catch(t){}if(s(t,e))return a(!i(r.f,t,e),t[e])}},function(t,e,n){"use strict";var o=n(2),i=n(3),r=n(17),a=Object,c=o("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?c(t,""):a(t)}:a},function(t,e,n){"use strict";var o=n(57),i=TypeError;t.exports=function(t){if(o(t))throw new i("Can't call method on "+t);return t}},function(t,e,n){"use strict";t.exports=function(t){return null==t}},function(t,e,n){"use strict";var o=n(114),i=n(59);t.exports=function(t){var e=o(t,"string");return i(e)?e:e+""}},function(t,e,n){"use strict";var o=n(30),i=n(1),r=n(60),a=n(61),c=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&r(e.prototype,c(t))}},function(t,e,n){"use strict";var o=n(2);t.exports=o({}.isPrototypeOf)},function(t,e,n){"use strict";var o=n(62);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){"use strict";var o=n(63),i=n(3),r=n(0).String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},function(t,e,n){"use strict";var o,i,r=n(0),a=n(115),c=r.process,l=r.Deno,s=c&&c.versions||l&&l.version,p=s&&s.v8;p&&(i=(o=p.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!i&&a&&(!(o=a.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=a.match(/Chrome\/(\d+)/))&&(i=+o[1]),t.exports=i},function(t,e,n){"use strict";var o=n(33);t.exports=function(t,e){return o[t]||(o[t]=e||{})}},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";var o=n(2),i=0,r=Math.random(),a=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+r,36)}},function(t,e,n){"use strict";var o=n(5),i=n(3),r=n(119);t.exports=!o&&!i((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var o=n(9),i=n(126),r=n(54),a=n(15);t.exports=function(t,e,n){for(var c=i(e),l=a.f,s=r.f,p=0;pp))return!1;var u=l.get(t),g=l.get(e);if(u&&g)return u==e&&g==t;var h=-1,m=!0,f=2&n?new o:void 0;for(l.set(t,e),l.set(e,t);++h=0&&Math.floor(e)===e&&isFinite(t)}function m(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===d?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function b(t,e){for(var n=Object.create(null),o=t.split(","),i=0;i-1)return t.splice(o,1)}}var k=Object.prototype.hasOwnProperty;function _(t,e){return k.call(t,e)}function B(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var D=/-(\w)/g,x=B((function(t){return t.replace(D,(function(t,e){return e?e.toUpperCase():""}))})),P=B((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),K=/\B([A-Z])/g,S=B((function(t){return t.replace(K,"-$1").toLowerCase()}));var T=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var o=arguments.length;return o?o>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;for(var n=t.length-e,o=new Array(n);n--;)o[n]=t[n+e];return o}function C(t,e){for(var n in e)t[n]=e[n];return t}function A(t){for(var e={},n=0;n0,J=Z&&Z.indexOf("edge/")>0;Z&&Z.indexOf("android");var Q=Z&&/iphone|ipad|ipod|ios/.test(Z);Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z);var tt,et=Z&&Z.match(/firefox\/(\d+)/),nt={}.watch,ot=!1;if(G)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var rt=function(){return void 0===tt&&(tt=!G&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=G&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,st="undefined"!=typeof Symbol&&ct(Symbol)&&"undefined"!=typeof Reflect&&ct(Reflect.ownKeys);lt="undefined"!=typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pt=null;function dt(t){void 0===t&&(t=null),t||pt&&pt._scope.off(),pt=t,t&&t._scope.on()}var ut=function(){function t(t,e,n,o,i,r,a,c){this.tag=t,this.data=e,this.children=n,this.text=o,this.elm=i,this.ns=void 0,this.context=r,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=c,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),gt=function(t){void 0===t&&(t="");var e=new ut;return e.text=t,e.isComment=!0,e};function ht(t){return new ut(void 0,void 0,void 0,String(t))}function mt(t){var e=new ut(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ft=0,vt=[],bt=function(){function t(){this._pending=!1,this.id=ft++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,vt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,o=e.length;n0&&(Zt((s=t(s,"".concat(n||"","_").concat(o)))[0])&&Zt(d)&&(u[p]=ht(d.text+s[0].text),s.shift()),u.push.apply(u,s)):l(s)?Zt(d)?u[p]=ht(d.text+s):""!==s&&u.push(ht(s)):Zt(s)&&Zt(d)?u[p]=ht(d.text+s.text):(c(e._isVList)&&a(s.tag)&&r(s.key)&&a(n)&&(s.key="__vlist".concat(n,"_").concat(o,"__")),u.push(s)));return u}(t):void 0}function Zt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Xt(t,e){var n,o,r,c,l=null;if(i(t)||"string"==typeof t)for(l=new Array(t.length),n=0,o=t.length;n0,c=e?!!e.$stable:!a,l=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(c&&i&&i!==o&&l===i.$key&&!a&&!i.$hasNormal)return i;for(var s in r={},e)e[s]&&"$"!==s[0]&&(r[s]=me(t,n,s,e[s]))}else r={};for(var p in n)p in r||(r[p]=fe(n,p));return e&&Object.isExtensible(e)&&(e._normalized=r),H(r,"$stable",c),H(r,"$key",l),H(r,"$hasNormal",a),r}function me(t,e,n,o){var r=function(){var e=pt;dt(t);var n=arguments.length?o.apply(null,arguments):o({}),r=(n=n&&"object"==typeof n&&!i(n)?[n]:Gt(n))&&n[0];return dt(e),n&&(!r||1===n.length&&r.isComment&&!ge(r))?void 0:n};return o.proxy&&Object.defineProperty(e,n,{get:r,enumerable:!0,configurable:!0}),r}function fe(t,e){return function(){return t[e]}}function ve(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};H(e,"_v_attr_proxy",!0),be(e,t.$attrs,o,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||be(t._listenersProxy={},t.$listeners,o,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||we(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:T(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return It(t,e,n)}))}}}function be(t,e,n,o,i){var r=!1;for(var a in e)a in t?e[a]!==n[a]&&(r=!0):(r=!0,ye(t,a,o,i));for(var a in t)a in e||(r=!0,delete t[a]);return r}function ye(t,e,n,o){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[o][e]}})}function we(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var ke=null;function _e(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),p(t)?e.extend(t):t}function Be(t){if(i(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(ln=function(){return sn.now()})}var pn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function dn(){var t,e;for(cn=ln(),rn=!0,tn.sort(pn),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);on||(on=!0,Re(dn))}}function gn(t,e){if(t){for(var n=Object.create(null),o=st?Reflect.ownKeys(t):Object.keys(t),i=0;i-1)if(r&&!_(i,"default"))a=!1;else if(""===a||a===S(t)){var l=$n(String,i.type);(l<0||c-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!g(t)&&t.test(e)}function Xn(t,e){var n=t.cache,o=t.keys,i=t._vnode;for(var r in n){var a=n[r];if(a){var c=a.name;c&&!e(c)&&Yn(n,r,o,i)}}}function Yn(t,e,n,o){var i=t[e];!i||o&&i.tag===o.tag||i.componentInstance.$destroy(),t[e]=null,w(n,e)}Vn.prototype._init=function(t){var e=this;e._uid=Wn++,e._isVue=!0,e.__v_skip=!0,e._scope=new Nt(!0),e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),o=e._parentVnode;n.parent=e.parent,n._parentVnode=o;var i=o.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Tn(Hn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ge(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=de(e._renderChildren,i),t.$scopedSlots=n?he(t.$parent,n.data.scopedSlots,t.$slots):o,t._c=function(e,n,o,i){return De(t,e,n,o,i,!1)},t.$createElement=function(e,n,o,i){return De(t,e,n,o,i,!0)};var r=n&&n.data;Ct(t,"$attrs",r&&r.attrs||o,null,!0),Ct(t,"$listeners",e._parentListeners||o,null,!0)}(e),Qe(e,"beforeCreate",void 0,!1),function(t){var e=gn(t.$options.inject,t);e&&(Kt(!1),Object.keys(e).forEach((function(n){Ct(t,n,e[n])})),Kt(!0))}(e),Rn(e),function(t){var e=t.$options.provide;if(e){var n=s(e)?e.call(t):e;if(!p(n))return;for(var o=Ut(t),i=st?Reflect.ownKeys(n):Object.keys(n),r=0;r1?O(n):n;for(var o=O(arguments,1),i='event handler for "'.concat(t,'"'),r=0,a=n.length;rparseInt(this.max)&&Yn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Yn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Xn(t,(function(t){return Zn(e,t)}))})),this.$watch("exclude",(function(e){Xn(t,(function(t){return!Zn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Be(t),n=e&&e.componentOptions;if(n){var o=Gn(n),i=this.include,r=this.exclude;if(i&&(!o||!Zn(i,o))||r&&o&&Zn(r,o))return e;var a=this.cache,c=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[l]?(e.componentInstance=a[l].componentInstance,w(c,l),c.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:_n,extend:C,mergeOptions:Tn,defineReactive:Ct},t.set=At,t.delete=Et,t.nextTick=Re,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,C(t.options.components,Qn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=O(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Tn(this.options,t),this}}(t),qn(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Vn),Object.defineProperty(Vn.prototype,"$isServer",{get:rt}),Object.defineProperty(Vn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Vn,"FunctionalRenderContext",{value:hn}),Vn.version="2.7.14";var to=b("style,class"),eo=b("input,textarea,option,select,progress"),no=b("contenteditable,draggable,spellcheck"),oo=b("events,caret,typing,plaintext-only"),io=b("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ro="http://www.w3.org/1999/xlink",ao=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},co=function(t){return ao(t)?t.slice(6,t.length):""},lo=function(t){return null==t||!1===t};function so(t){for(var e=t.data,n=t,o=t;a(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=po(o.data,e));for(;a(n=n.parent);)n&&n.data&&(e=po(e,n.data));return function(t,e){if(a(t)||a(e))return uo(t,go(e));return""}(e.staticClass,e.class)}function po(t,e){return{staticClass:uo(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function uo(t,e){return t?e?t+" "+e:t:e||""}function go(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Mo(t,e,n):io(e)?lo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):no(e)?t.setAttribute(e,function(t,e){return lo(e)||"false"===e?"false":"contenteditable"===t&&oo(e)?e:"true"}(e,n)):ao(e)?lo(n)?t.removeAttributeNS(ro,co(e)):t.setAttributeNS(ro,e,n):Mo(t,e,n)}function Mo(t,e,n){if(lo(n))t.removeAttribute(e);else{if(X&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var o=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",o)};t.addEventListener("input",o),t.__ieph=!0}t.setAttribute(e,n)}}var Ro={create:$o,update:$o};function Io(t,e){var n=e.elm,o=e.data,i=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(i)||r(i.staticClass)&&r(i.class)))){var c=so(e),l=n._transitionClasses;a(l)&&(c=uo(c,go(l))),c!==n._prevClass&&(n.setAttribute("class",c),n._prevClass=c)}}var Lo,No={create:Io,update:Io};function Uo(t,e,n){var o=Lo;return function i(){var r=e.apply(null,arguments);null!==r&&Ho(t,i,n,o)}}var zo=Oe&&!(et&&Number(et[1])<=53);function Wo(t,e,n,o){if(zo){var i=cn,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Lo.addEventListener(t,e,ot?{capture:n,passive:o}:n)}function Ho(t,e,n,o){(o||Lo).removeEventListener(t,e._wrapper||e,n)}function Vo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},o=t.data.on||{};Lo=e.elm||t.elm,function(t){if(a(t.__r)){var e=X?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Ht(n,o,Wo,Ho,Uo,e.context),Lo=void 0}}var qo,Go={create:Vo,update:Vo,destroy:function(t){return Vo(t,Do)}};function Zo(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,i=e.elm,l=t.data.domProps||{},s=e.data.domProps||{};for(n in(a(s.__ob__)||c(s._v_attr_proxy))&&(s=e.data.domProps=C({},s)),l)n in s||(i[n]="");for(n in s){if(o=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===l[n])continue;1===i.childNodes.length&&i.removeChild(i.childNodes[0])}if("value"===n&&"PROGRESS"!==i.tagName){i._value=o;var p=r(o)?"":String(o);Xo(i,p)&&(i.value=p)}else if("innerHTML"===n&&fo(i.tagName)&&r(i.innerHTML)){(qo=qo||document.createElement("div")).innerHTML="".concat(o,"");for(var d=qo.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;d.firstChild;)i.appendChild(d.firstChild)}else if(o!==l[n])try{i[n]=o}catch(t){}}}}function Xo(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(a(o)){if(o.number)return v(n)!==v(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Yo={create:Zo,update:Zo},Jo=B((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var o=t.split(n);o.length>1&&(e[o[0].trim()]=o[1].trim())}})),e}));function Qo(t){var e=ti(t.style);return t.staticStyle?C(t.staticStyle,e):e}function ti(t){return Array.isArray(t)?A(t):"string"==typeof t?Jo(t):t}var ei,ni=/^--/,oi=/\s*!important$/,ii=function(t,e,n){if(ni.test(e))t.style.setProperty(e,n);else if(oi.test(n))t.style.setProperty(S(e),n.replace(oi,""),"important");else{var o=ai(e);if(Array.isArray(n))for(var i=0,r=n.length;i-1?e.split(si).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function di(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(si).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),o=" "+e+" ";n.indexOf(o)>=0;)n=n.replace(o," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function ui(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&C(e,gi(t.name||"v")),C(e,t),e}return"string"==typeof t?gi(t):void 0}}var gi=B((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),hi=G&&!Y,mi="transition",fi="transitionend",vi="animation",bi="animationend";hi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(mi="WebkitTransition",fi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(vi="WebkitAnimation",bi="webkitAnimationEnd"));var yi=G?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function wi(t){yi((function(){yi(t)}))}function ki(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),pi(t,e))}function _i(t,e){t._transitionClasses&&w(t._transitionClasses,e),di(t,e)}function Bi(t,e,n){var o=xi(t,e),i=o.type,r=o.timeout,a=o.propCount;if(!i)return n();var c="transition"===i?fi:bi,l=0,s=function(){t.removeEventListener(c,p),n()},p=function(e){e.target===t&&++l>=a&&s()};setTimeout((function(){l0&&(n="transition",p=a,d=r.length):"animation"===e?s>0&&(n="animation",p=s,d=l.length):d=(n=(p=Math.max(a,s))>0?a>s?"transition":"animation":null)?"transition"===n?r.length:l.length:0,{type:n,timeout:p,propCount:d,hasTransform:"transition"===n&&Di.test(o[mi+"Property"])}}function Pi(t,e){for(;t.length1}function Ai(t,e){!0!==e.data.show&&Si(e)}var Ei=function(t){var e,n,o={},s=t.modules,p=t.nodeOps;for(e=0;eh?w(t,r(n[v+1])?null:n[v+1].elm,n,g,v,o):g>v&&_(e,d,h)}(d,m,v,n,s):a(v)?(a(t.text)&&p.setTextContent(d,""),w(d,null,v,0,v.length-1,n)):a(m)?_(m,0,m.length-1):a(t.text)&&p.setTextContent(d,""):t.text!==e.text&&p.setTextContent(d,e.text),a(h)&&a(g=h.hook)&&a(g=g.postpatch)&&g(t,e)}}}function P(t,e,n){if(c(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var o=0;o-1,a.selected!==r&&(a.selected=r);else if(j(Ri(a),o))return void(t.selectedIndex!==c&&(t.selectedIndex=c));i||(t.selectedIndex=-1)}}function Mi(t,e){return e.every((function(e){return!j(e,t)}))}function Ri(t){return"_value"in t?t._value:t.value}function Ii(t){t.target.composing=!0}function Li(t){t.target.composing&&(t.target.composing=!1,Ni(t.target,"input"))}function Ni(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ui(t){return!t.componentInstance||t.data&&t.data.transition?t:Ui(t.componentInstance._vnode)}var zi={model:Fi,show:{bind:function(t,e,n){var o=e.value,i=(n=Ui(n)).data&&n.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;o&&i?(n.data.show=!0,Si(n,(function(){t.style.display=r}))):t.style.display=o?r:"none"},update:function(t,e,n){var o=e.value;!o!=!e.oldValue&&((n=Ui(n)).data&&n.data.transition?(n.data.show=!0,o?Si(n,(function(){t.style.display=t.__vOriginalDisplay})):Ti(n,(function(){t.style.display="none"}))):t.style.display=o?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,o,i){i||(t.style.display=t.__vOriginalDisplay)}}},Wi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Hi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Hi(Be(e.children)):t}function Vi(t){var e={},n=t.$options;for(var o in n.propsData)e[o]=t[o];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function qi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Gi=function(t){return t.tag||ge(t)},Zi=function(t){return"show"===t.name},Xi={name:"transition",props:Wi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Gi)).length){0;var o=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var r=Hi(i);if(!r)return i;if(this._leaving)return qi(t,i);var a="__transition-".concat(this._uid,"-");r.key=null==r.key?r.isComment?a+"comment":a+r.tag:l(r.key)?0===String(r.key).indexOf(a)?r.key:a+r.key:r.key;var c=(r.data||(r.data={})).transition=Vi(this),s=this._vnode,p=Hi(s);if(r.data.directives&&r.data.directives.some(Zi)&&(r.data.show=!0),p&&p.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(r,p)&&!ge(p)&&(!p.componentInstance||!p.componentInstance._vnode.isComment)){var d=p.data.transition=C({},c);if("out-in"===o)return this._leaving=!0,Vt(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),qi(t,i);if("in-out"===o){if(ge(r))return s;var u,g=function(){u()};Vt(c,"afterEnter",g),Vt(c,"enterCancelled",g),Vt(d,"delayLeave",(function(t){u=t}))}}return i}}},Yi=C({tag:String,moveClass:String},Wi);function Ji(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Qi(t){t.data.newPos=t.elm.getBoundingClientRect()}function tr(t){var e=t.data.pos,n=t.data.newPos,o=e.left-n.left,i=e.top-n.top;if(o||i){t.data.moved=!0;var r=t.elm.style;r.transform=r.WebkitTransform="translate(".concat(o,"px,").concat(i,"px)"),r.transitionDuration="0s"}}delete Yi.mode;var er={Transition:Xi,TransitionGroup:{props:Yi,beforeMount:function(){var t=this,e=this._update;this._update=function(n,o){var i=Xe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,o)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),o=this.prevChildren=this.children,i=this.$slots.default||[],r=this.children=[],a=Vi(this),c=0;c-1?bo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:bo[t]=/HTMLUnknownElement/.test(e.toString())},C(Vn.options.directives,zi),C(Vn.options.components,er),Vn.prototype.__patch__=G?Ei:E,Vn.prototype.$mount=function(t,e){return function(t,e,n){var o;t.$el=e,t.$options.render||(t.$options.render=gt),Qe(t,"beforeMount"),o=function(){t._update(t._render(),n)},new We(t,o,E,{before:function(){t._isMounted&&!t._isDestroyed&&Qe(t,"beforeUpdate")}},!0),n=!1;var i=t._preWatchers;if(i)for(var r=0;r=0&&(e=t.slice(o),t=t.slice(0,o));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(i.path||""),s=e&&e.path||"/",p=l.path?_r(l.path,s,n||i.append):s,d=function(t,e,n){void 0===e&&(e={});var o,i=n||sr;try{o=i(t||"")}catch(t){o={}}for(var r in e){var a=e[r];o[r]=Array.isArray(a)?a.map(lr):lr(a)}return o}(l.query,i.query,o&&o.options.parseQuery),u=i.hash||l.hash;return u&&"#"!==u.charAt(0)&&(u="#"+u),{_normalized:!0,path:p,query:d,hash:u}}var zr,Wr=function(){},Hr={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),r=i.location,a=i.route,c=i.href,l={},s=n.options.linkActiveClass,p=n.options.linkExactActiveClass,d=null==s?"router-link-active":s,u=null==p?"router-link-exact-active":p,g=null==this.activeClass?d:this.activeClass,h=null==this.exactActiveClass?u:this.exactActiveClass,m=a.redirectedFrom?ur(null,Ur(a.redirectedFrom),null,n):a;l[h]=vr(o,m,this.exactPath),l[g]=this.exact||this.exactPath?l[h]:function(t,e){return 0===t.path.replace(dr,"/").indexOf(e.path.replace(dr,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(o,m);var f=l[h]?this.ariaCurrentValue:null,v=function(t){Vr(t)&&(e.replace?n.replace(r,Wr):n.push(r,Wr))},b={click:Vr};Array.isArray(this.event)?this.event.forEach((function(t){b[t]=v})):b[this.event]=v;var y={class:l},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:c,route:a,navigate:v,isActive:l[g],isExactActive:l[h]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)y.on=b,y.attrs={href:c,"aria-current":f};else{var k=function t(e){var n;if(e)for(var o=0;o-1&&(c.params[u]=n.params[u]);return c.path=Nr(p.path,c.params),l(p,c,a)}if(c.path){c.params={};for(var g=0;g-1}function Ba(t,e){return _a(t)&&t._isRouter&&(null==e||t.type===e)}function Da(t,e,n){var o=function(i){i>=t.length?n():t[i]?e(t[i],(function(){o(i+1)})):o(i+1)};o(0)}function xa(t){return function(e,n,o){var i=!1,r=0,a=null;Pa(t,(function(t,e,n,c){if("function"==typeof t&&void 0===t.cid){i=!0,r++;var l,s=Ta((function(e){var i;((i=e).__esModule||Sa&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:zr.extend(e),n.components[c]=e,--r<=0&&o()})),p=Ta((function(t){var e="Failed to resolve async component "+c+": "+t;a||(a=_a(t)?t:new Error(e),o(a))}));try{l=t(s,p)}catch(t){p(t)}if(l)if("function"==typeof l.then)l.then(s,p);else{var d=l.component;d&&"function"==typeof d.then&&d.then(s,p)}}})),i||o()}}function Pa(t,e){return Ka(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ka(t){return Array.prototype.concat.apply([],t)}var Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ta(t){var e=!1;return function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(!e)return e=!0,t.apply(this,n)}}var Oa=function(t,e){this.router=t,this.base=function(t){if(!t)if(qr){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=hr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ca(t,e,n,o){var i=Pa(t,(function(t,o,i,r){var a=function(t,e){"function"!=typeof t&&(t=zr.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,o,i,r)})):n(a,o,i,r)}));return Ka(o?i.reverse():i)}function Aa(t,e){if(e)return function(){return t.apply(e,arguments)}}Oa.prototype.listen=function(t){this.cb=t},Oa.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Oa.prototype.onError=function(t){this.errorCbs.push(t)},Oa.prototype.transitionTo=function(t,e,n){var o,i=this;try{o=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var r=this.current;this.confirmTransition(o,(function(){i.updateRoute(o),e&&e(o),i.ensureURL(),i.router.afterHooks.forEach((function(t){t&&t(o,r)})),i.ready||(i.ready=!0,i.readyCbs.forEach((function(t){t(o)})))}),(function(t){n&&n(t),t&&!i.ready&&(Ba(t,va.redirected)&&r===hr||(i.ready=!0,i.readyErrorCbs.forEach((function(e){e(t)}))))}))},Oa.prototype.confirmTransition=function(t,e,n){var o=this,i=this.current;this.pending=t;var r,a,c=function(t){!Ba(t)&&_a(t)&&(o.errorCbs.length?o.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},l=t.matched.length-1,s=i.matched.length-1;if(vr(t,i)&&l===s&&t.matched[l]===i.matched[s])return this.ensureURL(),t.hash&&ra(this.router,i,t,!1),c(((a=wa(r=i,t,va.duplicated,'Avoided redundant navigation to current location: "'+r.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var n,o=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,o=ha&&n;o&&this.listeners.push(ia());var i=function(){var n=t.current,i=Fa(t.base);t.current===hr&&i===t._startLocation||t.transitionTo(i,(function(t){o&&ra(e,t,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){ma(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){fa(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Fa(this.base)!==this.current.fullPath){var e=Br(this.base+this.current.fullPath);t?ma(e):fa(e)}},e.prototype.getCurrentLocation=function(){return Fa(this.base)},e}(Oa);function Fa(t){var e=window.location.pathname,n=e.toLowerCase(),o=t.toLowerCase();return!t||n!==o&&0!==n.indexOf(Br(o+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var $a=function(t){function e(e,n,o){t.call(this,e,n),o&&function(t){var e=Fa(t);if(!/^\/#/.test(e))return window.location.replace(Br(t+"/#"+e)),!0}(this.base)||ja()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=ha&&e;n&&this.listeners.push(ia());var o=function(){var e=t.current;ja()&&t.transitionTo(Ma(),(function(o){n&&ra(t.router,o,e,!0),ha||La(o.fullPath)}))},i=ha?"popstate":"hashchange";window.addEventListener(i,o),this.listeners.push((function(){window.removeEventListener(i,o)}))}},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){Ia(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){La(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ma()!==e&&(t?Ia(e):La(e))},e.prototype.getCurrentLocation=function(){return Ma()},e}(Oa);function ja(){var t=Ma();return"/"===t.charAt(0)||(La("/"+t),!1)}function Ma(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ra(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ia(t){ha?ma(Ra(t)):window.location.hash=t}function La(t){ha?fa(Ra(t)):window.location.replace(Ra(t))}var Na=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index+1).concat(t),o.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var o=this.stack[n];this.confirmTransition(o,(function(){var t=e.current;e.index=n,e.updateRoute(o),e.router.afterHooks.forEach((function(e){e&&e(o,t)}))}),(function(t){Ba(t,va.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Oa),Ua=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Xr(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ha&&!1!==t.fallback,this.fallback&&(e="hash"),qr||(e="abstract"),this.mode=e,e){case"history":this.history=new Ea(this,t.base);break;case"hash":this.history=new $a(this,t.base,this.fallback);break;case"abstract":this.history=new Na(this,t.base);break;default:0}},za={currentRoute:{configurable:!0}};Ua.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},za.currentRoute.get=function(){return this.history&&this.history.current},Ua.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Ea||n instanceof $a){var o=function(t){n.setupListeners(),function(t){var o=n.current,i=e.options.scrollBehavior;ha&&i&&"fullPath"in t&&ra(e,t,o,!1)}(t)};n.transitionTo(n.getCurrentLocation(),o,o)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ua.prototype.beforeEach=function(t){return Ha(this.beforeHooks,t)},Ua.prototype.beforeResolve=function(t){return Ha(this.resolveHooks,t)},Ua.prototype.afterEach=function(t){return Ha(this.afterHooks,t)},Ua.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ua.prototype.onError=function(t){this.history.onError(t)},Ua.prototype.push=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.push(t,e,n)}));this.history.push(t,e,n)},Ua.prototype.replace=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ua.prototype.go=function(t){this.history.go(t)},Ua.prototype.back=function(){this.go(-1)},Ua.prototype.forward=function(){this.go(1)},Ua.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ua.prototype.resolve=function(t,e,n){var o=Ur(t,e=e||this.history.current,n,this),i=this.match(o,e),r=i.redirectedFrom||i.fullPath;return{location:o,route:i,href:function(t,e,n){var o="hash"===n?"#"+e:e;return t?Br(t+"/"+o):o}(this.history.base,r,this.mode),normalizedTo:o,resolved:i}},Ua.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ua.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Ua.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ua.prototype,za);var Wa=Ua;function Ha(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ua.install=function t(e){if(!t.installed||zr!==e){t.installed=!0,zr=e;var n=function(t){return void 0!==t},o=function(t,e){var o=t.$options._parentVnode;n(o)&&n(o=o.data)&&n(o=o.registerRouteInstance)&&o(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed:function(){o(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",wr),e.component("RouterLink",Hr);var i=e.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},Ua.version="3.6.5",Ua.isNavigationFailure=Ba,Ua.NavigationFailureType=va,Ua.START_LOCATION=hr,qr&&window.Vue&&window.Vue.use(Ua);n(53);n(100),n(46);var Va={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(23)]).then(n.bind(null,326)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(22)]).then(n.bind(null,287)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(32)]).then(n.bind(null,262)),"components/Home":()=>Promise.all([n.e(0),n.e(27)]).then(n.bind(null,327)),"components/NavLink":()=>n.e(43).then(n.bind(null,254)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,276)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,286)),"components/Page":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,298)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(28)]).then(n.bind(null,288)),"components/PageNav":()=>Promise.all([n.e(0),n.e(24)]).then(n.bind(null,289)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,269)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(33)]).then(n.bind(null,329)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,265)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(30)]).then(n.bind(null,263)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,256)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398)),"global-components/CodeBlock":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388)),"global-components/CodeGroup":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)),"layouts/404":()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),NotFound:()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),"components/Cases":()=>Promise.all([n.e(0),n.e(25)]).then(n.bind(null,328)),"components/Footer":()=>Promise.all([n.e(0),n.e(26)]).then(n.bind(null,270)),"components/LayoutWrap":()=>Promise.all([n.e(0),n.e(1),n.e(17)]).then(n.bind(null,277)),"components/PostMeta":()=>Promise.all([n.e(0),n.e(29)]).then(n.bind(null,299)),"layouts/DirectoryPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),"layouts/FrontmatterKey":()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),"layouts/FrontmatterPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),"layouts/IndexPost":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),"layouts/Post":()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395)),DirectoryPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),FrontmatterKey:()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),FrontmatterPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),IndexPost:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),Post:()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395))},qa={"v-330a32a2":()=>n.e(45).then(n.bind(null,399)),"v-2c450c3f":()=>n.e(46).then(n.bind(null,400)),"v-5e744cf7":()=>n.e(47).then(n.bind(null,401)),"v-7c0c45f9":()=>n.e(48).then(n.bind(null,402)),"v-2cebe183":()=>n.e(34).then(n.bind(null,403)),"v-0f4d5d15":()=>n.e(50).then(n.bind(null,404)),"v-8bd632d6":()=>n.e(49).then(n.bind(null,405)),"v-3eaa044d":()=>n.e(31).then(n.bind(null,406)),"v-353b78e1":()=>n.e(51).then(n.bind(null,407)),"v-3875825f":()=>n.e(52).then(n.bind(null,408)),"v-07ff1843":()=>n.e(53).then(n.bind(null,409)),"v-9504490e":()=>n.e(54).then(n.bind(null,410)),"v-c6756cce":()=>n.e(55).then(n.bind(null,411)),"v-f58ec8f2":()=>n.e(21).then(n.bind(null,412)),"v-015729b9":()=>n.e(56).then(n.bind(null,413)),"v-56536559":()=>n.e(19).then(n.bind(null,414)),"v-2c605799":()=>n.e(57).then(n.bind(null,415)),"v-57698579":()=>n.e(58).then(n.bind(null,416)),"v-9145467a":()=>n.e(59).then(n.bind(null,417)),"v-2cf72b39":()=>n.e(60).then(n.bind(null,418)),"v-5d749fce":()=>n.e(62).then(n.bind(null,419)),"v-11d64359":()=>n.e(61).then(n.bind(null,420)),"v-d0375c8e":()=>n.e(64).then(n.bind(null,421)),"v-ab5ba3ce":()=>n.e(63).then(n.bind(null,422)),"v-10852eea":()=>n.e(65).then(n.bind(null,423)),"v-edd5570e":()=>n.e(66).then(n.bind(null,424)),"v-05df4999":()=>n.e(67).then(n.bind(null,425)),"v-faad828e":()=>n.e(68).then(n.bind(null,426)),"v-0119984e":()=>n.e(69).then(n.bind(null,427)),"v-75d11339":()=>n.e(72).then(n.bind(null,428)),"v-7c3d28f9":()=>n.e(70).then(n.bind(null,429)),"v-0df1c3ce":()=>n.e(71).then(n.bind(null,430)),"v-1ac9ef4e":()=>n.e(73).then(n.bind(null,431)),"v-8534b9c2":()=>n.e(75).then(n.bind(null,432)),"v-55969f39":()=>n.e(74).then(n.bind(null,433)),"v-aeb70fce":()=>n.e(76).then(n.bind(null,434)),"v-4dc135e3":()=>n.e(77).then(n.bind(null,435)),"v-4d760891":()=>Promise.all([n.e(0),n.e(35)]).then(n.bind(null,436)),"v-30c0037b":()=>Promise.all([n.e(0),n.e(36)]).then(n.bind(null,437)),"v-4bb7844a":()=>Promise.all([n.e(0),n.e(37)]).then(n.bind(null,438)),"v-b936290e":()=>Promise.all([n.e(0),n.e(38)]).then(n.bind(null,439)),"v-7afdbb4e":()=>Promise.all([n.e(0),n.e(39)]).then(n.bind(null,440)),"v-a7c24c4e":()=>Promise.all([n.e(0),n.e(41)]).then(n.bind(null,441)),"v-17019aeb":()=>Promise.all([n.e(0),n.e(42)]).then(n.bind(null,442)),"v-7a315e41":()=>n.e(78).then(n.bind(null,443)),"v-4e0b610e":()=>Promise.all([n.e(0),n.e(40)]).then(n.bind(null,444)),"v-f611a14e":()=>n.e(79).then(n.bind(null,445)),"v-496cb7f9":()=>n.e(81).then(n.bind(null,396)),"v-0b3b65ea":()=>n.e(82).then(n.bind(null,446)),"v-3acb6e6a":()=>n.e(80).then(n.bind(null,447)),"v-a76bccee":()=>n.e(83).then(n.bind(null,448)),"v-05d01c19":()=>n.e(84).then(n.bind(null,449)),"v-11bf335e":()=>n.e(85).then(n.bind(null,450)),"v-29f9f21c":()=>n.e(87).then(n.bind(null,451)),"v-a9236c10":()=>n.e(86).then(n.bind(null,452)),"v-105750ce":()=>n.e(89).then(n.bind(null,453)),"v-3750297a":()=>n.e(88).then(n.bind(null,454)),"v-50aa6d4e":()=>n.e(92).then(n.bind(null,455)),"v-08589c4e":()=>n.e(90).then(n.bind(null,456)),"v-c152529c":()=>n.e(91).then(n.bind(null,457)),"v-4bcdac39":()=>n.e(93).then(n.bind(null,458))};function Ga(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Za=/-(\w)/g,Xa=Ga(t=>t.replace(Za,(t,e)=>e?e.toUpperCase():"")),Ya=/\B([A-Z])/g,Ja=Ga(t=>t.replace(Ya,"-$1").toLowerCase()),Qa=Ga(t=>t.charAt(0).toUpperCase()+t.slice(1));function tc(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(Qa(Xa(e))):t(Qa(e))||t(Ja(e))}const ec=Object.assign({},Va,qa),nc=t=>ec[t],oc=t=>qa[t],ic=t=>Va[t],rc=t=>Vn.component(t);function ac(t){return tc(oc,t)}function cc(t){return tc(ic,t)}function lc(t){return tc(nc,t)}function sc(t){return tc(rc,t)}function pc(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!sc(t)&&lc(t)){const e=await lc(t)();Vn.component(t,e.default)}}))}function dc(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var uc=n(91),gc=n.n(uc),hc=n(92),mc=n.n(hc),fc={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${mc()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=bc(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=yc(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return gc()([{name:"description",content:this.$description}],t,this.siteMeta,wc)},updateCanonicalLink(){vc(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",bc(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){yc(null,this.currentMetaTags),vc()}};function vc(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function bc(t=""){return t?``:""}function yc(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function wc(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var kc=n(93),_c={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(kc)()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),i=window.innerHeight+n;for(let t=0;t=r.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Bc=n(22),Dc=n.n(Bc),xc={mounted(){Dc.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Vn.component(t.name)||Dc.a.start(),n()}),this.$router.afterEach(()=>{Dc.a.done(),this.isSidebarOpen=!1})}},Pc={props:{parent:Object,code:String,options:{align:String,color:String,backgroundTransition:Boolean,backgroundColor:String,successText:String,staticIcon:Boolean}},data:()=>({success:!1,originalBackground:null,originalTransition:null}),computed:{alignStyle(){let t={};return t[this.options.align]="7.5px",t},iconClass(){return this.options.staticIcon?"":"hover"}},mounted(){this.originalTransition=this.parent.style.transition,this.originalBackground=this.parent.style.background},beforeDestroy(){this.parent.style.transition=this.originalTransition,this.parent.style.background=this.originalBackground},methods:{hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},copyToClipboard(t){if(navigator.clipboard)navigator.clipboard.writeText(this.code).then(()=>{this.setSuccessTransitions()},()=>{});else{let t=document.createElement("textarea");document.body.appendChild(t),t.value=this.code,t.select(),document.execCommand("Copy"),t.remove(),this.setSuccessTransitions()}},setSuccessTransitions(){if(clearTimeout(this.successTimeout),this.options.backgroundTransition){this.parent.style.transition="background 350ms";let t=this.hexToRgb(this.options.backgroundColor);this.parent.style.background=`rgba(${t.r}, ${t.g}, ${t.b}, 0.1)`}this.success=!0,this.successTimeout=setTimeout(()=>{this.options.backgroundTransition&&(this.parent.style.background=this.originalBackground,this.parent.style.transition=this.originalTransition),this.success=!1},500)}}},Kc=(n(240),n(7)),Sc=Object(Kc.a)(Pc,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"code-copy"},[e("svg",{class:t.iconClass,style:t.alignStyle,attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},on:{click:t.copyToClipboard}},[e("path",{attrs:{fill:"none",d:"M0 0h24v24H0z"}}),t._v(" "),e("path",{attrs:{fill:t.options.color,d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}})]),t._v(" "),e("span",{class:t.success?"success":"",style:t.alignStyle},[t._v("\n "+t._s(t.options.successText)+"\n ")])])}),[],!1,null,"49140617",null).exports,Tc=(n(241),{updated(){this.update()},methods:{update(){setTimeout(()=>{document.querySelectorAll('div[class*="language-"] pre').forEach(t=>{if(t.classList.contains("code-copy-added"))return;let e=new(Vn.extend(Sc));e.options={align:"bottom",color:"#8F979E",backgroundTransition:!1,backgroundColor:"#0075b8",successText:"Copied!",staticIcon:!0},e.code=t.innerText,e.parent=t,e.$mount(),t.classList.add("code-copy-added"),t.appendChild(e.$el)})},100)}}}),Oc=(n(242),Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=window.Promise||function(t){function e(){}t(e,e)},i=function(t){var e=t.target;e!==x?-1!==y.indexOf(e)&&m({target:e}):h()},r=function(){if(!k&&D.original){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(_-t)>B.scrollOffset&&setTimeout(h,150)}},a=function(t){var e=t.key||t.keyCode;"Escape"!==e&&"Esc"!==e&&27!==e||h()},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t;if(t.background&&(x.style.background=t.background),t.container&&t.container instanceof Object&&(e.container=Oc({},B.container,t.container)),t.template){var n=Ac(t.template)?t.template:document.querySelector(t.template);e.template=n}return B=Oc({},B,e),y.forEach((function(t){t.dispatchEvent(Mc("medium-zoom:update",{detail:{zoom:P}}))})),P},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(Oc({},B,e))},s=function(){for(var t=arguments.length,e=Array(t),n=0;n0?e.reduce((function(t,e){return[].concat(t,Fc(e))}),[]):y;return o.forEach((function(t){t.classList.remove("medium-zoom-image"),t.dispatchEvent(Mc("medium-zoom:detach",{detail:{zoom:P}}))})),y=y.filter((function(t){return-1===o.indexOf(t)})),P},d=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.addEventListener("medium-zoom:"+t,e,n)})),w.push({type:"medium-zoom:"+t,listener:e,options:n}),P},u=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.removeEventListener("medium-zoom:"+t,e,n)})),w=w.filter((function(n){return!(n.type==="medium-zoom:"+t&&n.listener.toString()===e.toString())})),P},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},e=void 0,n=void 0;if(B.container)if(B.container instanceof Object)e=(t=Oc({},t,B.container)).width-t.left-t.right-2*B.margin,n=t.height-t.top-t.bottom-2*B.margin;else{var o=(Ac(B.container)?B.container:document.querySelector(B.container)).getBoundingClientRect(),i=o.width,r=o.height,a=o.left,c=o.top;t=Oc({},t,{width:i,height:r,left:a,top:c})}e=e||t.width-2*B.margin,n=n||t.height-2*B.margin;var l=D.zoomedHd||D.original,s=Ec(l)?e:l.naturalWidth||e,p=Ec(l)?n:l.naturalHeight||n,d=l.getBoundingClientRect(),u=d.top,g=d.left,h=d.width,m=d.height,f=Math.min(Math.max(h,s),e)/h,v=Math.min(Math.max(m,p),n)/m,b=Math.min(f,v),y="scale("+b+") translate3d("+((e-h)/2-g+B.margin+t.left)/b+"px, "+((n-m)/2-u+B.margin+t.top)/b+"px, 0)";D.zoomed.style.transform=y,D.zoomedHd&&(D.zoomedHd.style.transform=y)};return new o((function(t){if(e&&-1===y.indexOf(e))t(P);else{if(D.zoomed)t(P);else{if(e)D.original=e;else{if(!(y.length>0))return void t(P);var o=y;D.original=o[0]}if(D.original.dispatchEvent(Mc("medium-zoom:open",{detail:{zoom:P}})),_=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,k=!0,D.zoomed=jc(D.original),document.body.appendChild(x),B.template){var i=Ac(B.template)?B.template:document.querySelector(B.template);D.template=document.createElement("div"),D.template.appendChild(i.content.cloneNode(!0)),document.body.appendChild(D.template)}if(D.original.parentElement&&"PICTURE"===D.original.parentElement.tagName&&D.original.currentSrc&&(D.zoomed.src=D.original.currentSrc),document.body.appendChild(D.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),D.original.classList.add("medium-zoom-image--hidden"),D.zoomed.classList.add("medium-zoom-image--opened"),D.zoomed.addEventListener("click",h),D.zoomed.addEventListener("transitionend",(function e(){k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:opened",{detail:{zoom:P}})),t(P)})),D.original.getAttribute("data-zoom-src")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("srcset"),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading"),D.zoomedHd.src=D.zoomed.getAttribute("data-zoom-src"),D.zoomedHd.onerror=function(){clearInterval(r),console.warn("Unable to reach the zoom image target "+D.zoomedHd.src),D.zoomedHd=null,n()};var r=setInterval((function(){D.zoomedHd.complete&&(clearInterval(r),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n())}),10)}else if(D.original.hasAttribute("srcset")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading");var a=D.zoomedHd.addEventListener("load",(function(){D.zoomedHd.removeEventListener("load",a),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n()}))}else n()}}}))},h=function(){return new o((function(t){if(!k&&D.original){k=!0,document.body.classList.remove("medium-zoom--opened"),D.zoomed.style.transform="",D.zoomedHd&&(D.zoomedHd.style.transform=""),D.template&&(D.template.style.transition="opacity 150ms",D.template.style.opacity=0),D.original.dispatchEvent(Mc("medium-zoom:close",{detail:{zoom:P}})),D.zoomed.addEventListener("transitionend",(function e(){D.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(D.zoomed),D.zoomedHd&&document.body.removeChild(D.zoomedHd),document.body.removeChild(x),D.zoomed.classList.remove("medium-zoom-image--opened"),D.template&&document.body.removeChild(D.template),k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:closed",{detail:{zoom:P}})),D.original=null,D.zoomed=null,D.zoomedHd=null,D.template=null,t(P)}))}else t(P)}))},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target;return D.original?h():g({target:e})},f=function(){return B},v=function(){return y},b=function(){return D.original},y=[],w=[],k=!1,_=0,B=n,D={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(e)?B=e:(e||"string"==typeof e)&&s(e),B=Oc({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},B);var x=$c(B.background);document.addEventListener("click",i),document.addEventListener("keyup",a),document.addEventListener("scroll",r),window.addEventListener("resize",h);var P={open:g,close:h,toggle:m,update:c,clone:l,attach:s,detach:p,on:d,off:u,getOptions:f,getImages:v,getZoomedImage:b};return P},Ic=[fc,_c,xc,Tc,{data:()=>({zoom:null}),mounted(){this.updateZoom()},updated(){this.updateZoom()},methods:{updateZoom(){setTimeout(()=>{this.zoom&&this.zoom.detach(),this.zoom=Rc(".theme-default-content :not(a) > img",void 0)},1e3)}}}],Lc={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return dc("layout",t),Vn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Nc=Object(Kc.a)(Lc,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(Nc,"mixins",Ic);const Uc=[{name:"v-330a32a2",path:"/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-330a32a2").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-2c450c3f",path:"/blog/_2023-q4-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c450c3f").then(n)}},{path:"/blog/_2023-q4-update/index.html",redirect:"/blog/_2023-q4-update/"},{path:"/_blog/2023_q4_update.html",redirect:"/blog/_2023-q4-update/"},{name:"v-5e744cf7",path:"/blog/_2024-q1-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5e744cf7").then(n)}},{path:"/blog/_2024-q1-update/index.html",redirect:"/blog/_2024-q1-update/"},{path:"/_blog/2024_q1_update.html",redirect:"/blog/_2024-q1-update/"},{name:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c0c45f9").then(n)}},{path:"/blog/bitcoin-core-rpc-demo/index.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{path:"/_blog/Bitcoin_Core_RPC_Demo.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{name:"v-2cebe183",path:"/blog/bdk-core-pt1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cebe183").then(n)}},{path:"/blog/bdk-core-pt1/index.html",redirect:"/blog/bdk-core-pt1/"},{path:"/_blog/bdk_core_pt1.html",redirect:"/blog/bdk-core-pt1/"},{name:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0f4d5d15").then(n)}},{path:"/blog/bdk-cli-basics/index.html",redirect:"/blog/bdk-cli-basics/"},{path:"/_blog/bdk_cli_basics.html",redirect:"/blog/bdk-cli-basics/"},{name:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8bd632d6").then(n)}},{path:"/blog/bdk-cli-basics-multisig-2of3/index.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{path:"/_blog/bdk-cli_basics_multisig_2of3.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{name:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3eaa044d").then(n)}},{path:"/blog/bdk-rn-making-of/index.html",redirect:"/blog/bdk-rn-making-of/"},{path:"/_blog/bdk_rn_making_of.html",redirect:"/blog/bdk-rn-making-of/"},{name:"v-353b78e1",path:"/blog/bdk-with-tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-353b78e1").then(n)}},{path:"/blog/bdk-with-tor/index.html",redirect:"/blog/bdk-with-tor/"},{path:"/_blog/bdk_with_tor.html",redirect:"/blog/bdk-with-tor/"},{name:"v-3875825f",path:"/blog/bindings-scope/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3875825f").then(n)}},{path:"/blog/bindings-scope/index.html",redirect:"/blog/bindings-scope/"},{path:"/_blog/bindings-scope.html",redirect:"/blog/bindings-scope/"},{name:"v-07ff1843",path:"/blog/compact-filters-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-07ff1843").then(n)}},{path:"/blog/compact-filters-demo/index.html",redirect:"/blog/compact-filters-demo/"},{path:"/_blog/compact_filters_demo.html",redirect:"/blog/compact-filters-demo/"},{name:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9504490e").then(n)}},{path:"/blog/descriptor-based-paper-wallet/index.html",redirect:"/blog/descriptor-based-paper-wallet/"},{path:"/_blog/descriptor_based_paper_wallet.html",redirect:"/blog/descriptor-based-paper-wallet/"},{name:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-c6756cce").then(n)}},{path:"/blog/descriptors-in-the-wild/index.html",redirect:"/blog/descriptors-in-the-wild/"},{path:"/_blog/descriptors_in_the_wild.html",redirect:"/blog/descriptors-in-the-wild/"},{name:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-f58ec8f2").then(n)}},{path:"/blog/exploring-bdk-rn/index.html",redirect:"/blog/exploring-bdk-rn/"},{path:"/_blog/exploring_bdk_rn.html",redirect:"/blog/exploring-bdk-rn/"},{name:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-015729b9").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{path:"/_blog/fee_estimation_for_light_clients_part_1.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"v-56536559",path:"/blog/exploring-bdk-flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-56536559").then(n)}},{path:"/blog/exploring-bdk-flutter/index.html",redirect:"/blog/exploring-bdk-flutter/"},{path:"/_blog/exploring_bdk_flutter.html",redirect:"/blog/exploring-bdk-flutter/"},{name:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c605799").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{path:"/_blog/fee_estimation_for_light_clients_part_2.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-57698579").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{path:"/_blog/fee_estimation_for_light_clients_part_3.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9145467a").then(n)}},{path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/index.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{path:"/_blog/first_bdk_taproot_tx.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cf72b39").then(n)}},{path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/index.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{path:"/_blog/first_bdk_taproot_tx_part_2.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"v-5d749fce",path:"/blog/2020/12/hello-world/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5d749fce").then(n)}},{path:"/blog/2020/12/hello-world/index.html",redirect:"/blog/2020/12/hello-world/"},{path:"/_blog/hello-world.html",redirect:"/blog/2020/12/hello-world/"},{name:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-11d64359").then(n)}},{path:"/blog/getting-started-with-rust-hwi/index.html",redirect:"/blog/getting-started-with-rust-hwi/"},{path:"/_blog/getting_started_with_rust_hwi.html",redirect:"/blog/getting-started-with-rust-hwi/"},{name:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-d0375c8e").then(n)}},{path:"/blog/improving-coin-selection-in-bdk/index.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{path:"/_blog/improving_coin_selection_in_BDK.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{name:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-ab5ba3ce").then(n)}},{path:"/blog/hidden-power-of-bitcoin/index.html",redirect:"/blog/hidden-power-of-bitcoin/"},{path:"/_blog/hidden-power-of-bitcoin.html",redirect:"/blog/hidden-power-of-bitcoin/"},{name:"v-10852eea",path:"/blog/miniscript-vulnerability/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-10852eea").then(n)}},{path:"/blog/miniscript-vulnerability/index.html",redirect:"/blog/miniscript-vulnerability/"},{path:"/_blog/miniscript_vulnerability.html",redirect:"/blog/miniscript-vulnerability/"},{name:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-edd5570e").then(n)}},{path:"/blog/2020/12/release-v0.2.0/index.html",redirect:"/blog/2020/12/release-v0.2.0/"},{path:"/_blog/release-0.2.0.html",redirect:"/blog/2020/12/release-v0.2.0/"},{name:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-05df4999").then(n)}},{path:"/blog/2021/01/release-v0.3.0/index.html",redirect:"/blog/2021/01/release-v0.3.0/"},{path:"/_blog/release-0.3.0.html",redirect:"/blog/2021/01/release-v0.3.0/"},{name:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-faad828e").then(n)}},{path:"/blog/2021/02/release-v0.4.0/index.html",redirect:"/blog/2021/02/release-v0.4.0/"},{path:"/_blog/release-0.4.0.html",redirect:"/blog/2021/02/release-v0.4.0/"},{name:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0119984e").then(n)}},{path:"/blog/2021/03/release-v0.5.0/index.html",redirect:"/blog/2021/03/release-v0.5.0/"},{path:"/_blog/release-0.5.0.html",redirect:"/blog/2021/03/release-v0.5.0/"},{name:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-75d11339").then(n)}},{path:"/blog/2021/06/release-v0.8.0/index.html",redirect:"/blog/2021/06/release-v0.8.0/"},{path:"/_blog/release-0.8.0.html",redirect:"/blog/2021/06/release-v0.8.0/"},{name:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c3d28f9").then(n)}},{path:"/blog/2021/04/release-v0.6.0/index.html",redirect:"/blog/2021/04/release-v0.6.0/"},{path:"/_blog/release-0.6.0.html",redirect:"/blog/2021/04/release-v0.6.0/"},{name:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0df1c3ce").then(n)}},{path:"/blog/2021/05/release-v0.7.0/index.html",redirect:"/blog/2021/05/release-v0.7.0/"},{path:"/_blog/release-0.7.0.html",redirect:"/blog/2021/05/release-v0.7.0/"},{name:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-1ac9ef4e").then(n)}},{path:"/blog/2021/07/release-v0.9.0/index.html",redirect:"/blog/2021/07/release-v0.9.0/"},{path:"/_blog/release-0.9.0.html",redirect:"/blog/2021/07/release-v0.9.0/"},{name:"v-8534b9c2",path:"/blog/spending-policy-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8534b9c2").then(n)}},{path:"/blog/spending-policy-demo/index.html",redirect:"/blog/spending-policy-demo/"},{path:"/_blog/spending_policy_demo.html",redirect:"/blog/spending-policy-demo/"},{name:"v-55969f39",path:"/blog/road-to-bdk-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-55969f39").then(n)}},{path:"/blog/road-to-bdk-1/index.html",redirect:"/blog/road-to-bdk-1/"},{path:"/_blog/road_to_bdk_1.html",redirect:"/blog/road-to-bdk-1/"},{name:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-aeb70fce").then(n)}},{path:"/blog/using-bdk-with-hardware-wallets/index.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{path:"/_blog/using_bdk_with_hardware_wallets.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{name:"v-4dc135e3",path:"/blog/why-bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-4dc135e3").then(n)}},{path:"/blog/why-bindings/index.html",redirect:"/blog/why-bindings/"},{path:"/_blog/why-bindings.html",redirect:"/blog/why-bindings/"},{name:"v-4d760891",path:"/adoption/all/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4d760891").then(n)}},{path:"/adoption/all/index.html",redirect:"/adoption/all/"},{path:"/adoption/all.html",redirect:"/adoption/all/"},{name:"v-30c0037b",path:"/adoption/custodial/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-30c0037b").then(n)}},{path:"/adoption/custodial/index.html",redirect:"/adoption/custodial/"},{path:"/adoption/custodial.html",redirect:"/adoption/custodial/"},{name:"v-4bb7844a",path:"/adoption/desktop/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bb7844a").then(n)}},{path:"/adoption/desktop/index.html",redirect:"/adoption/desktop/"},{path:"/adoption/desktop.html",redirect:"/adoption/desktop/"},{name:"v-b936290e",path:"/adoption/exchange/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-b936290e").then(n)}},{path:"/adoption/exchange/index.html",redirect:"/adoption/exchange/"},{path:"/adoption/exchange.html",redirect:"/adoption/exchange/"},{name:"v-7afdbb4e",path:"/adoption/hardware/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7afdbb4e").then(n)}},{path:"/adoption/hardware/index.html",redirect:"/adoption/hardware/"},{path:"/adoption/hardware.html",redirect:"/adoption/hardware/"},{name:"v-a7c24c4e",path:"/adoption/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a7c24c4e").then(n)}},{path:"/adoption/mobile/index.html",redirect:"/adoption/mobile/"},{path:"/adoption/mobile.html",redirect:"/adoption/mobile/"},{name:"v-17019aeb",path:"/adoption/web/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-17019aeb").then(n)}},{path:"/adoption/web/index.html",redirect:"/adoption/web/"},{path:"/adoption/web.html",redirect:"/adoption/web/"},{name:"v-7a315e41",path:"/bdk-cli/compiler/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7a315e41").then(n)}},{path:"/bdk-cli/compiler/index.html",redirect:"/bdk-cli/compiler/"},{path:"/bdk-cli/compiler.html",redirect:"/bdk-cli/compiler/"},{name:"v-4e0b610e",path:"/adoption/infrastructure/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4e0b610e").then(n)}},{path:"/adoption/infrastructure/index.html",redirect:"/adoption/infrastructure/"},{path:"/adoption/infrastructure.html",redirect:"/adoption/infrastructure/"},{name:"v-f611a14e",path:"/bdk-cli/concept/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-f611a14e").then(n)}},{path:"/bdk-cli/concept/index.html",redirect:"/bdk-cli/concept/"},{path:"/bdk-cli/concept.html",redirect:"/bdk-cli/concept/"},{name:"v-496cb7f9",path:"/bdk-cli/interface/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-496cb7f9").then(n)}},{path:"/bdk-cli/interface/index.html",redirect:"/bdk-cli/interface/"},{path:"/bdk-cli/interface.html",redirect:"/bdk-cli/interface/"},{name:"v-0b3b65ea",path:"/bdk-cli/introduction/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-0b3b65ea").then(n)}},{path:"/bdk-cli/introduction/index.html",redirect:"/bdk-cli/introduction/"},{path:"/bdk-cli/introduction.html",redirect:"/bdk-cli/introduction/"},{name:"v-3acb6e6a",path:"/bdk-cli/installation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3acb6e6a").then(n)}},{path:"/bdk-cli/installation/index.html",redirect:"/bdk-cli/installation/"},{path:"/bdk-cli/installation.html",redirect:"/bdk-cli/installation/"},{name:"v-a76bccee",path:"/bdk-cli/playground/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a76bccee").then(n)}},{path:"/bdk-cli/playground/index.html",redirect:"/bdk-cli/playground/"},{path:"/bdk-cli/playground.html",redirect:"/bdk-cli/playground/"},{name:"v-05d01c19",path:"/bdk-cli/regtest/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-05d01c19").then(n)}},{path:"/bdk-cli/regtest/index.html",redirect:"/bdk-cli/regtest/"},{path:"/bdk-cli/regtest.html",redirect:"/bdk-cli/regtest/"},{name:"v-11bf335e",path:"/case-studies/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-11bf335e").then(n)}},{path:"/case-studies/index.html",redirect:"/case-studies/"},{path:"/case-studies.html",redirect:"/case-studies/"},{name:"v-29f9f21c",path:"/examples/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-29f9f21c").then(n)}},{path:"/examples/index.html",redirect:"/examples/"},{name:"v-a9236c10",path:"/descriptors/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a9236c10").then(n)}},{path:"/descriptors/index.html",redirect:"/descriptors/"},{name:"v-105750ce",path:"/foundation/grantees/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-105750ce").then(n)}},{path:"/foundation/grantees/index.html",redirect:"/foundation/grantees/"},{path:"/foundation/grantees.html",redirect:"/foundation/grantees/"},{name:"v-3750297a",path:"/foundation/about/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3750297a").then(n)}},{path:"/foundation/about/index.html",redirect:"/foundation/about/"},{path:"/foundation/about.html",redirect:"/foundation/about/"},{name:"v-50aa6d4e",path:"/foundation/supporters/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-50aa6d4e").then(n)}},{path:"/foundation/supporters/index.html",redirect:"/foundation/supporters/"},{path:"/foundation/supporters.html",redirect:"/foundation/supporters/"},{name:"v-08589c4e",path:"/foundation/grants/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-08589c4e").then(n)}},{path:"/foundation/grants/index.html",redirect:"/foundation/grants/"},{path:"/foundation/grants.html",redirect:"/foundation/grants/"},{name:"v-c152529c",path:"/foundation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-c152529c").then(n)}},{path:"/foundation/index.html",redirect:"/foundation/"},{name:"v-4bcdac39",path:"/getting-started/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bcdac39").then(n)}},{path:"/getting-started/index.html",redirect:"/getting-started/"},{path:"/getting-started.html",redirect:"/getting-started/"},{name:"v-424df898",path:"/blog/",component:Nc,beforeEnter:(t,e,n)=>{pc("IndexPost","v-424df898").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/index.html",redirect:"/blog/"},{name:"v-619df59e",path:"/blog/tags/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-619df59e").then(n)},meta:{pid:"tags",id:"tags"}},{path:"/blog/tags/index.html",redirect:"/blog/tags/"},{name:"v-b0968728",path:"/blog/author/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-b0968728").then(n)},meta:{pid:"author",id:"author"}},{path:"/blog/author/index.html",redirect:"/blog/author/"},{name:"v-5f2600b8",path:"/blog/tags/BDK/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f2600b8").then(n)},meta:{pid:"tags",id:"BDK"}},{path:"/blog/tags/BDK/index.html",redirect:"/blog/tags/BDK/"},{name:"v-398e8fd4",path:"/blog/tags/project/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-398e8fd4").then(n)},meta:{pid:"tags",id:"project"}},{path:"/blog/tags/project/index.html",redirect:"/blog/tags/project/"},{name:"v-da8c869a",path:"/blog/tags/tutorial/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-da8c869a").then(n)},meta:{pid:"tags",id:"tutorial"}},{path:"/blog/tags/tutorial/index.html",redirect:"/blog/tags/tutorial/"},{name:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-62bbf2ad").then(n)},meta:{pid:"tags",id:"Bitcoin Core"}},{path:"/blog/tags/Bitcoin Core/index.html",redirect:"/blog/tags/Bitcoin Core/"},{name:"v-5f171cb0",path:"/blog/tags/RPC/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f171cb0").then(n)},meta:{pid:"tags",id:"RPC"}},{path:"/blog/tags/RPC/index.html",redirect:"/blog/tags/RPC/"},{name:"v-4696dfd8",path:"/blog/tags/Wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4696dfd8").then(n)},meta:{pid:"tags",id:"Wallet"}},{path:"/blog/tags/Wallet/index.html",redirect:"/blog/tags/Wallet/"},{name:"v-c4494744",path:"/blog/tags/architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c4494744").then(n)},meta:{pid:"tags",id:"architecture"}},{path:"/blog/tags/architecture/index.html",redirect:"/blog/tags/architecture/"},{name:"v-c711ccde",path:"/blog/tags/bdk-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c711ccde").then(n)},meta:{pid:"tags",id:"bdk-cli"}},{path:"/blog/tags/bdk-cli/index.html",redirect:"/blog/tags/bdk-cli/"},{name:"v-e646a928",path:"/blog/tags/basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e646a928").then(n)},meta:{pid:"tags",id:"basics"}},{path:"/blog/tags/basics/index.html",redirect:"/blog/tags/basics/"},{name:"v-1fb58ffb",path:"/blog/tags/novice/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1fb58ffb").then(n)},meta:{pid:"tags",id:"novice"}},{path:"/blog/tags/novice/index.html",redirect:"/blog/tags/novice/"},{name:"v-655ee4a0",path:"/blog/tags/multi-sig/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-655ee4a0").then(n)},meta:{pid:"tags",id:"multi-sig"}},{path:"/blog/tags/multi-sig/index.html",redirect:"/blog/tags/multi-sig/"},{name:"v-876cfade",path:"/blog/tags/BDK-RN/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-876cfade").then(n)},meta:{pid:"tags",id:"BDK-RN"}},{path:"/blog/tags/BDK-RN/index.html",redirect:"/blog/tags/BDK-RN/"},{name:"v-3acc51dc",path:"/blog/tags/Development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3acc51dc").then(n)},meta:{pid:"tags",id:"Development"}},{path:"/blog/tags/Development/index.html",redirect:"/blog/tags/Development/"},{name:"v-650ae784",path:"/blog/tags/Architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-650ae784").then(n)},meta:{pid:"tags",id:"Architecture"}},{path:"/blog/tags/Architecture/index.html",redirect:"/blog/tags/Architecture/"},{name:"v-5ef73f54",path:"/blog/tags/tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5ef73f54").then(n)},meta:{pid:"tags",id:"tor"}},{path:"/blog/tags/tor/index.html",redirect:"/blog/tags/tor/"},{name:"v-39437010",path:"/blog/tags/wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-39437010").then(n)},meta:{pid:"tags",id:"wallet"}},{path:"/blog/tags/wallet/index.html",redirect:"/blog/tags/wallet/"},{name:"v-7c8563fd",path:"/blog/tags/blockchain/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-7c8563fd").then(n)},meta:{pid:"tags",id:"blockchain"}},{path:"/blog/tags/blockchain/index.html",redirect:"/blog/tags/blockchain/"},{name:"v-1296a8fa",path:"/blog/tags/bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1296a8fa").then(n)},meta:{pid:"tags",id:"bindings"}},{path:"/blog/tags/bindings/index.html",redirect:"/blog/tags/bindings/"},{name:"v-baacba64",path:"/blog/tags/compact_filters/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-baacba64").then(n)},meta:{pid:"tags",id:"compact_filters"}},{path:"/blog/tags/compact_filters/index.html",redirect:"/blog/tags/compact_filters/"},{name:"v-75ccd5f2",path:"/blog/tags/BIP157/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-75ccd5f2").then(n)},meta:{pid:"tags",id:"BIP157"}},{path:"/blog/tags/BIP157/index.html",redirect:"/blog/tags/BIP157/"},{name:"v-4fed1c23",path:"/blog/tags/Neutrino/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4fed1c23").then(n)},meta:{pid:"tags",id:"Neutrino"}},{path:"/blog/tags/Neutrino/index.html",redirect:"/blog/tags/Neutrino/"},{name:"v-a9e0285e",path:"/blog/tags/guide/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a9e0285e").then(n)},meta:{pid:"tags",id:"guide"}},{path:"/blog/tags/guide/index.html",redirect:"/blog/tags/guide/"},{name:"v-733ed37c",path:"/blog/tags/descriptor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-733ed37c").then(n)},meta:{pid:"tags",id:"descriptor"}},{path:"/blog/tags/descriptor/index.html",redirect:"/blog/tags/descriptor/"},{name:"v-1144be8a",path:"/blog/tags/paper wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1144be8a").then(n)},meta:{pid:"tags",id:"paper wallets"}},{path:"/blog/tags/paper wallets/index.html",redirect:"/blog/tags/paper wallets/"},{name:"v-915f8322",path:"/blog/tags/bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-915f8322").then(n)},meta:{pid:"tags",id:"bitcoin"}},{path:"/blog/tags/bitcoin/index.html",redirect:"/blog/tags/bitcoin/"},{name:"v-bf53d4d4",path:"/blog/tags/React Native/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-bf53d4d4").then(n)},meta:{pid:"tags",id:"React Native"}},{path:"/blog/tags/React Native/index.html",redirect:"/blog/tags/React Native/"},{name:"v-5f023740",path:"/blog/tags/iOS/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f023740").then(n)},meta:{pid:"tags",id:"iOS"}},{path:"/blog/tags/iOS/index.html",redirect:"/blog/tags/iOS/"},{name:"v-414e735e",path:"/blog/tags/Android/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-414e735e").then(n)},meta:{pid:"tags",id:"Android"}},{path:"/blog/tags/Android/index.html",redirect:"/blog/tags/Android/"},{name:"v-2c94bf22",path:"/blog/tags/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-2c94bf22").then(n)},meta:{pid:"tags",id:"mobile"}},{path:"/blog/tags/mobile/index.html",redirect:"/blog/tags/mobile/"},{name:"v-dd212a9e",path:"/blog/tags/bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-dd212a9e").then(n)},meta:{pid:"tags",id:"bdk-rn"}},{path:"/blog/tags/bdk-rn/index.html",redirect:"/blog/tags/bdk-rn/"},{name:"v-5f07f0f8",path:"/blog/tags/bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f07f0f8").then(n)},meta:{pid:"tags",id:"bdk"}},{path:"/blog/tags/bdk/index.html",redirect:"/blog/tags/bdk/"},{name:"v-5f0447f2",path:"/blog/tags/fee/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f0447f2").then(n)},meta:{pid:"tags",id:"fee"}},{path:"/blog/tags/fee/index.html",redirect:"/blog/tags/fee/"},{name:"v-e2317b12",path:"/blog/tags/machine learning/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e2317b12").then(n)},meta:{pid:"tags",id:"machine learning"}},{path:"/blog/tags/machine learning/index.html",redirect:"/blog/tags/machine learning/"},{name:"v-07eeb15e",path:"/blog/tags/Flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-07eeb15e").then(n)},meta:{pid:"tags",id:"Flutter"}},{path:"/blog/tags/Flutter/index.html",redirect:"/blog/tags/Flutter/"},{name:"v-57f3a168",path:"/blog/tags/taproot/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-57f3a168").then(n)},meta:{pid:"tags",id:"taproot"}},{path:"/blog/tags/taproot/index.html",redirect:"/blog/tags/taproot/"},{name:"v-ef7c3fa2",path:"/blog/tags/miniscript/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ef7c3fa2").then(n)},meta:{pid:"tags",id:"miniscript"}},{path:"/blog/tags/miniscript/index.html",redirect:"/blog/tags/miniscript/"},{name:"v-79c3de4b",path:"/blog/tags/getting started/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-79c3de4b").then(n)},meta:{pid:"tags",id:"getting started"}},{path:"/blog/tags/getting started/index.html",redirect:"/blog/tags/getting started/"},{name:"v-3fee41ed",path:"/blog/tags/rust/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3fee41ed").then(n)},meta:{pid:"tags",id:"rust"}},{path:"/blog/tags/rust/index.html",redirect:"/blog/tags/rust/"},{name:"v-640144b2",path:"/blog/tags/Hardware Wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-640144b2").then(n)},meta:{pid:"tags",id:"Hardware Wallets"}},{path:"/blog/tags/Hardware Wallets/index.html",redirect:"/blog/tags/Hardware Wallets/"},{name:"v-74edfe92",path:"/blog/tags/coin selection/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-74edfe92").then(n)},meta:{pid:"tags",id:"coin selection"}},{path:"/blog/tags/coin selection/index.html",redirect:"/blog/tags/coin selection/"},{name:"v-4e62fa1c",path:"/blog/tags/development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4e62fa1c").then(n)},meta:{pid:"tags",id:"development"}},{path:"/blog/tags/development/index.html",redirect:"/blog/tags/development/"},{name:"v-0159a747",path:"/blog/tags/summer of bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0159a747").then(n)},meta:{pid:"tags",id:"summer of bitcoin"}},{path:"/blog/tags/summer of bitcoin/index.html",redirect:"/blog/tags/summer of bitcoin/"},{name:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-01a03a08").then(n)},meta:{pid:"tags",id:"bitcoin-cli"}},{path:"/blog/tags/bitcoin-cli/index.html",redirect:"/blog/tags/bitcoin-cli/"},{name:"v-0755ed11",path:"/blog/tags/security/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0755ed11").then(n)},meta:{pid:"tags",id:"security"}},{path:"/blog/tags/security/index.html",redirect:"/blog/tags/security/"},{name:"v-543950a6",path:"/blog/tags/release/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-543950a6").then(n)},meta:{pid:"tags",id:"release"}},{path:"/blog/tags/release/index.html",redirect:"/blog/tags/release/"},{name:"v-a354115e",path:"/blog/author/Steve Myers/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a354115e").then(n)},meta:{pid:"author",id:"Steve Myers"}},{path:"/blog/author/Steve Myers/index.html",redirect:"/blog/author/Steve Myers/"},{name:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-22d0e252").then(n)},meta:{pid:"author",id:"Daniela Brozzoni"}},{path:"/blog/author/Daniela Brozzoni/index.html",redirect:"/blog/author/Daniela Brozzoni/"},{name:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-82e16b5c").then(n)},meta:{pid:"author",id:"Rajarshi Maitra"}},{path:"/blog/author/Rajarshi Maitra/index.html",redirect:"/blog/author/Rajarshi Maitra/"},{name:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-600b5b28").then(n)},meta:{pid:"author",id:"Lloyd Fournier"}},{path:"/blog/author/Lloyd Fournier/index.html",redirect:"/blog/author/Lloyd Fournier/"},{name:"v-3e6950f4",path:"/blog/author/waterst0ne/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3e6950f4").then(n)},meta:{pid:"author",id:"waterst0ne"}},{path:"/blog/author/waterst0ne/index.html",redirect:"/blog/author/waterst0ne/"},{name:"v-37829241",path:"/blog/author/Bitcoin Zavior/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-37829241").then(n)},meta:{pid:"author",id:"Bitcoin Zavior"}},{path:"/blog/author/Bitcoin Zavior/index.html",redirect:"/blog/author/Bitcoin Zavior/"},{name:"v-d2b26530",path:"/blog/author/rorp/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-d2b26530").then(n)},meta:{pid:"author",id:"rorp"}},{path:"/blog/author/rorp/index.html",redirect:"/blog/author/rorp/"},{name:"v-5d54001e",path:"/blog/author/thunderbiscuit/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5d54001e").then(n)},meta:{pid:"author",id:"thunderbiscuit"}},{path:"/blog/author/thunderbiscuit/index.html",redirect:"/blog/author/thunderbiscuit/"},{name:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-624fd61e").then(n)},meta:{pid:"author",id:"Riccardo Casatta"}},{path:"/blog/author/Riccardo Casatta/index.html",redirect:"/blog/author/Riccardo Casatta/"},{name:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-6b564fb4").then(n)},meta:{pid:"author",id:"Gabriele Domenichini"}},{path:"/blog/author/Gabriele Domenichini/index.html",redirect:"/blog/author/Gabriele Domenichini/"},{name:"v-ad00c09c",path:"/blog/author/Alekos Filini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ad00c09c").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/index.html",redirect:"/blog/author/Alekos Filini/"},{name:"v-4eeab648",path:"/blog/author/Wszdexdrf/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4eeab648").then(n)},meta:{pid:"author",id:"Wszdexdrf"}},{path:"/blog/author/Wszdexdrf/index.html",redirect:"/blog/author/Wszdexdrf/"},{name:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a0d840b0").then(n)},meta:{pid:"author",id:"César Alvarez Vallero"}},{path:"/blog/author/César Alvarez Vallero/index.html",redirect:"/blog/author/César Alvarez Vallero/"},{name:"v-91c10894",path:"/blog/author/Sandipan Dey/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-91c10894").then(n)},meta:{pid:"author",id:"Sandipan Dey"}},{path:"/blog/author/Sandipan Dey/index.html",redirect:"/blog/author/Sandipan Dey/"},{name:"v-c3507bb6",path:"/blog/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507bb6").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/2/index.html",redirect:"/blog/page/2/"},{name:"v-c3507b78",path:"/blog/page/3/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b78").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/3/index.html",redirect:"/blog/page/3/"},{name:"v-c3507b3a",path:"/blog/page/4/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b3a").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/4/index.html",redirect:"/blog/page/4/"},{name:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-5f2ac9cb").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/page/2/index.html",redirect:"/blog/author/Alekos Filini/page/2/"},{path:"*",component:Nc}],zc={title:"Bitcoin Dev Kit Documentation",description:"The Bitcoin Dev Kit (BDK) project (originally called Magical Bitcoin 🧙) aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallet called Magical Bitcoin.",base:"/",headTags:[["meta",{name:"viewport",content:"width=device-width,initial-scale=1.0"}],["link",{rel:"preload",href:"/fonts/ibm-plex-mono-400.woff2",as:"font",crossorigin:!0}],["link",{rel:"apple-touch-icon",sizes:"180x180",href:"/img/favicon/apple-touch-icon.png"}],["link",{rel:"manifest",href:"/site.webmanifest"}],["link",{rel:"stylesheet",href:"/css/variables.css"}],["link",{name:"msapplication-config",content:"/browserconfig.xml"}],["link",{name:"msapplication-TileColor",content:"#ffffff"}],["link",{name:"theme-color",content:"#ffffff"}]],pages:[{title:"Home",frontmatter:{home:!0,heroText:"Bitcoin Dev Kit",tagline:"With BDK, you can seamlessly build cross platform mobile wallets",actionText:"Get started",actionLink:"/getting-started/",features:[{title:"Customizable",details:"Designed from the ground up to be easily customized to your application needs: blockchain backends, databases, signers, coin selection, key management and more.",image:"customizable"},{title:"Focus on what matters",details:"All of the low-level Bitcoin logic is handled by us, so you can focus on crafting custom-tailored user experiences.",image:"focus"},{title:"High performance & compact",details:"As lightweight as you need it to be and optimized to run on all modern-day embedded devices such as mobile phones, IoT devices, PoS terminals and more.",image:"mobile"}],meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{property:"og:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{name:"twitter:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{name:"twitter:url",content:"https://bitcoindevkit.org/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/",relativePath:"README.md",key:"v-330a32a2",path:"/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"2023 Q4 Project Update",frontmatter:{title:"2023 Q4 Project Update",description:"2023 Q4 update on the BDK project's progress.",authors:["Steve Myers","Daniela Brozzoni"],date:"2024-02-20",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-02-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2023 Q4 Project Update"},{property:"og:description",content:"2023 Q4 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2023 Q4 Project Update"},{name:"twitter:description",content:"2023 Q4 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2023_q4_update.html",relativePath:"_blog/2023_q4_update.md",key:"v-2c450c3f",path:"/blog/_2023-q4-update/",headers:[{level:3,title:"This Post",slug:"this-post"},{level:3,title:"End of Year Review",slug:"end-of-year-review"},{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"2024 Q1 Project Update",frontmatter:{title:"2024 Q1 Project Update",description:"2024 Q1 update on the BDK project's progress.",authors:["Steve Myers"],date:"2024-03-21",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-03-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2024 Q1 Project Update"},{property:"og:description",content:"2024 Q1 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2024 Q1 Project Update"},{name:"twitter:description",content:"2024 Q1 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2024_q1_update.html",relativePath:"_blog/2024_q1_update.md",key:"v-5e744cf7",path:"/blog/_2024-q1-update/",headers:[{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"Plans for Next Quarter",slug:"plans-for-next-quarter"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"BDK wallet with Bitcoin core RPC",frontmatter:{title:"BDK wallet with Bitcoin core RPC ",description:"Tutorial showing usage of Bitcoin core backend with BDK wallet",authors:["Rajarshi Maitra"],date:"2021-08-21",tags:["tutorial","BDK","Bitcoin Core","RPC","Wallet"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2021-08-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet with Bitcoin core RPC"},{property:"og:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet with Bitcoin core RPC"},{name:"twitter:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, Bitcoin Core, RPC, Wallet"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Bitcoin Core"},{property:"article:tag",content:"RPC"},{property:"article:tag",content:"Wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/Bitcoin_Core_RPC_Demo.html",relativePath:"_blog/Bitcoin_Core_RPC_Demo.md",key:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"Setting dependencies",slug:"setting-dependencies"},{level:2,title:"Getting Descriptors",slug:"getting-descriptors"},{level:2,title:"Talking to Bitcoin Core Programmatically",slug:"talking-to-bitcoin-core-programmatically"},{level:2,title:"Get some balance in core wallet.",slug:"get-some-balance-in-core-wallet"},{level:2,title:"Setup the BDK wallet",slug:"setup-the-bdk-wallet"},{level:2,title:"Sending Sats Around",slug:"sending-sats-around"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"bdk_core: a new architecture for the Bitcoin Dev Kit",frontmatter:{title:"`bdk_core`: a new architecture for the Bitcoin Dev Kit",description:"A new architecture for the Bitcoin Dev Kit",authors:["Lloyd Fournier"],date:"2022-05-09",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-05-09T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{property:"og:description",content:"A new architecture for the Bitcoin Dev Kit"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{name:"twitter:description",content:"A new architecture for the Bitcoin Dev Kit"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_core_pt1.html",relativePath:"_blog/bdk_core_pt1.md",key:"v-2cebe183",path:"/blog/bdk-core-pt1/",headers:[{level:2,title:"The separation of policy and mechanism",slug:"the-separation-of-policy-and-mechanism"},{level:2,title:"A syncing mechansim without the policy",slug:"a-syncing-mechansim-without-the-policy"},{level:3,title:"A general syncing mechanism",slug:"a-general-syncing-mechanism"},{level:3,title:"How to store and index transactions",slug:"how-to-store-and-index-transactions"},{level:3,title:"Rolling back, rolling forward and syncing to disk",slug:"rolling-back-rolling-forward-and-syncing-to-disk"},{level:2,title:"Examples",slug:"examples"},{level:3,title:"Doing an initial sync of a descriptor that may already contain coins",slug:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"},{level:3,title:"Doing a sync of a wallet after you already have sync'd",slug:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"},{level:3,title:"Updating state when you get the data in real time",slug:"updating-state-when-you-get-the-data-in-real-time"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",frontmatter:{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",description:"Intro to bdk-cli and wallet dev",authors:["waterst0ne"],date:"2022-09-22",tags:["bdk-cli","basics","novice"],meta:[{property:"article:published_time",content:"2022-09-22T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{property:"og:description",content:"Intro to bdk-cli and wallet dev"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{name:"twitter:description",content:"Intro to bdk-cli and wallet dev"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bdk-cli, basics, novice"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"basics"},{property:"article:tag",content:"novice"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_cli_basics.html",relativePath:"_blog/bdk_cli_basics.md",key:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",headers:[{level:2,title:"Tutorial Goals",slug:"tutorial-goals"},{level:2,title:"A few things before you begin:",slug:"a-few-things-before-you-begin"},{level:3,title:"Outline of Tutorial and Installation notes:",slug:"outline-of-tutorial-and-installation-notes"},{level:3,title:"Brief Outline of Tutorial",slug:"brief-outline-of-tutorial"},{level:3,title:"Rust and Cargo installation:",slug:"rust-and-cargo-installation"},{level:3,title:"bdk-cli installation:",slug:"bdk-cli-installation"},{level:3,title:"Emoji Legend:",slug:"emoji-legend"},{level:2,title:"Step 0: Check Version of bdk-cli",slug:"step-0-check-version-of-bdk-cli"},{level:3,title:"Preview of bdk-cli help menu",slug:"preview-of-bdk-cli-help-menu"},{level:2,title:"Step 1: Seed Generate",slug:"step-1-seed-generate"},{level:3,title:"1a: Mnemonic word-list + XPRV (Extended Private Key) :key:",slug:"1a-mnemonic-word-list-xprv-extended-private-key-"},{level:3,title:"1b: Save XPRV (Extended Private Key) into environment variable",slug:"1b-save-xprv-extended-private-key-into-environment-variable"},{level:3,title:"1c: Verify environment variable XPRV_00 is active",slug:"1c-verify-environment-variable-xprv-00-is-active"},{level:3,title:"1d: Create Descriptor and Save into environment variable",slug:"1d-create-descriptor-and-save-into-environment-variable"},{level:3,title:"1e: Verify environment variable my_descriptor is active",slug:"1e-verify-environment-variable-my-descriptor-is-active"},{level:2,title:"Step 2: Generate Receive-Address",slug:"step-2-generate-receive-address"},{level:2,title:"Step 3: Send testnet bitcoin to the newly created receive-address",slug:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 4: Sync the wallet",slug:"step-4-sync-the-wallet"},{level:2,title:"Step 5: Check the balance",slug:"step-5-check-the-balance"},{level:2,title:"Step 6: Create Transaction (PSBT)",slug:"step-6-create-transaction-psbt"},{level:3,title:"6a: export PSBT to environment-variable",slug:"6a-export-psbt-to-environment-variable"},{level:2,title:"Step 7: Sign Transaction (PSBT)",slug:"step-7-sign-transaction-psbt"},{level:3,title:"7a: export signed psbt to environment variable",slug:"7a-export-signed-psbt-to-environment-variable"},{level:2,title:"Step 8: Broadcast Transaction",slug:"step-8-broadcast-transaction"},{level:2,title:"Resources",slug:"resources"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"bdk-cli basics multi-sig 2 of 3 tutorial",frontmatter:{title:"bdk-cli basics multi-sig 2 of 3 tutorial",description:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend",authors:["waterst0ne"],date:"2022-10-17",tags:["tutorial","bdk-cli","multi-sig"],hidden:!1,draft:!1,meta:[{property:"article:published_time",content:"2022-10-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{property:"og:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{name:"twitter:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk-cli, multi-sig"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"multi-sig"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk-cli_basics_multisig_2of3.html",relativePath:"_blog/bdk-cli_basics_multisig_2of3.md",key:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",headers:[{level:2,title:"2-of-3 Multi-Signature Descriptor Wallet using bdk-cli",slug:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"},{level:2,title:"Overview of the tutorial",slug:"overview-of-the-tutorial"},{level:2,title:"Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables",slug:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"},{level:3,title:"1a: Verify XPRV environment variables are Active",slug:"1a-verify-xprv-environment-variables-are-active"},{level:2,title:"Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables",slug:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"},{level:3,title:"2a: Verify XPUB environment variables",slug:"2a-verify-xpub-environment-variables"},{level:2,title:"Step 3: Create Single-Wallet Descriptors",slug:"step-3-create-single-wallet-descriptors"},{level:2,title:"Step 4: Create Multi-Sig-Descriptor Wallets",slug:"step-4-create-multi-sig-descriptor-wallets"},{level:3,title:"4a: Verify Multi-Sig-Descriptor environment variables are active",slug:"4a-verify-multi-sig-descriptor-environment-variables-are-active"},{level:2,title:"Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets",slug:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"},{level:2,title:"Step 6: Send Testnet Bitcoin to the newly created receive-address",slug:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 7: Sync one of the Multi-Sig Wallets",slug:"step-7-sync-one-of-the-multi-sig-wallets"},{level:2,title:"Step 8: Check Balance Multi-Sig Wallets",slug:"step-8-check-balance-multi-sig-wallets"},{level:2,title:"Step 9: Check Multi-Sig Policies on Descriptor Wallet",slug:"step-9-check-multi-sig-policies-on-descriptor-wallet"},{level:3,title:"SpendingPolicyRequired for complex descriptors",slug:"spendingpolicyrequired-for-complex-descriptors"},{level:2,title:"Step 10: Create a Transaction (PSBT)",slug:"step-10-create-a-transaction-psbt"},{level:3,title:"Export UNSIGNED_PSBT to environment variable",slug:"export-unsigned-psbt-to-environment-variable"},{level:3,title:"Verify UNSIGNED_PSBT environment variable",slug:"verify-unsigned-psbt-environment-variable"},{level:2,title:"Step 11: SIGN the Transaction",slug:"step-11-sign-the-transaction"},{level:3,title:"1st Wallet Signs the transaction",slug:"1st-wallet-signs-the-transaction"},{level:3,title:"2nd Wallet Signs the transaction",slug:"2nd-wallet-signs-the-transaction"},{level:2,title:"Step 12: Broadcast Transaction",slug:"step-12-broadcast-transaction"},{level:3,title:"Verify Transaction",slug:"verify-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"bdk-rn: Behind the scenes",frontmatter:{title:"`bdk-rn`: Behind the scenes",description:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed",authors:["Bitcoin Zavior"],date:"2022-07-10",tags:["BDK-RN","Development","Architecture"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-07-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-rn: Behind the scenes"},{property:"og:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-rn: Behind the scenes"},{name:"twitter:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK-RN, Development, Architecture"},{property:"article:tag",content:"BDK-RN"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_rn_making_of.html",relativePath:"_blog/bdk_rn_making_of.md",key:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",headers:[{level:2,title:"React Native Architecture",slug:"react-native-architecture"},{level:2,title:"Native Integration",slug:"native-integration"},{level:2,title:"Android Module",slug:"android-module"},{level:2,title:"References",slug:"references"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Using BDK with Tor",frontmatter:{title:"Using BDK with Tor",description:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service",authors:["rorp"],date:"2023-01-03",tags:["tutorial","tor","wallet","blockchain"],meta:[{property:"article:published_time",content:"2023-01-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with Tor"},{property:"og:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with Tor"},{name:"twitter:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, tor, wallet, blockchain"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"tor"},{property:"article:tag",content:"wallet"},{property:"article:tag",content:"blockchain"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_with_tor.html",relativePath:"_blog/bdk_with_tor.md",key:"v-353b78e1",path:"/blog/bdk-with-tor/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"ElectrumBlockchain",slug:"electrumblockchain"},{level:2,title:"Blocking EsploraBlockchain",slug:"blocking-esplorablockchain"},{level:2,title:"Asynchronous EsploraBlockchain",slug:"asynchronous-esplorablockchain"},{level:2,title:"CompactFiltersBlockchain",slug:"compactfiltersblockchain"},{level:2,title:"Integrated Tor daemon",slug:"integrated-tor-daemon"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"BDK's Scope and Approach to Rust Bindings",frontmatter:{title:"BDK's Scope and Approach to Rust Bindings",description:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own.",authors:["thunderbiscuit"],date:"2023-06-02",tags:["BDK","bindings"],meta:[{property:"article:published_time",content:"2023-06-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK's Scope and Approach to Rust Bindings"},{property:"og:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK's Scope and Approach to Rust Bindings"},{name:"twitter:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, bindings"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bindings-scope.html",relativePath:"_blog/bindings-scope.md",key:"v-3875825f",path:"/blog/bindings-scope/",headers:[{level:2,title:"Current architecture",slug:"current-architecture"},{level:2,title:"Moving forward: building a family of libraries",slug:"moving-forward-building-a-family-of-libraries"},{level:2,title:"Why can't we just build one big BDK library with everything in it?",slug:"why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"},{level:2,title:"Are you looking to build Rust bindings yourself?",slug:"are-you-looking-to-build-rust-bindings-yourself"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"BDK wallet as a BIP157 SPV light client",frontmatter:{title:"BDK wallet as a BIP157 SPV light client",description:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools",authors:["Rajarshi Maitra"],date:"2021-06-20",tags:["tutorial","BDK","bdk-cli","compact_filters","BIP157","Neutrino"],meta:[{property:"article:published_time",content:"2021-06-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet as a BIP157 SPV light client"},{property:"og:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet as a BIP157 SPV light client"},{name:"twitter:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, bdk-cli, compact_filters, BIP157, Neutrino"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"compact_filters"},{property:"article:tag",content:"BIP157"},{property:"article:tag",content:"Neutrino"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/compact_filters_demo.html",relativePath:"_blog/compact_filters_demo.md",key:"v-07ff1843",path:"/blog/compact-filters-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Compact Filters:",slug:"compact-filters"},{level:3,title:"BDK and Compact filters",slug:"bdk-and-compact-filters"},{level:3,title:"bdk-cli",slug:"bdk-cli"},{level:2,title:"Tutorial Scope",slug:"tutorial-scope"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Install and run bitcoind",slug:"install-and-run-bitcoind"},{level:3,title:"Install and run bdk-cli",slug:"install-and-run-bdk-cli"},{level:2,title:"Tutorial",slug:"tutorial"},{level:3,title:"Bitcoin Core Wallet Generation",slug:"bitcoin-core-wallet-generation"},{level:3,title:"BDK Wallet Generation",slug:"bdk-wallet-generation"},{level:3,title:"Recieve Coins",slug:"recieve-coins"},{level:3,title:"Creating a transaction.",slug:"creating-a-transaction"},{level:3,title:"Sign and Broadcast the transaction",slug:"sign-and-broadcast-the-transaction"},{level:3,title:"Confirming the Transaction",slug:"confirming-the-transaction"},{level:3,title:"Shutdown Docker",slug:"shutdown-docker"},{level:2,title:"End Words",slug:"end-words"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Making Descriptor-based paper wallets",frontmatter:{title:"Making Descriptor-based paper wallets",description:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk",authors:["Riccardo Casatta","Steve Myers"],date:"2021-03-30",tags:["guide","descriptor","paper wallets"],meta:[{property:"article:published_time",content:"2021-03-30T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Making Descriptor-based paper wallets"},{property:"og:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Making Descriptor-based paper wallets"},{name:"twitter:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor, paper wallets"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"paper wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptor_based_paper_wallet.html",relativePath:"_blog/descriptor_based_paper_wallet.md",key:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"About paper wallets",slug:"about-paper-wallets"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Example use case",slug:"example-use-case"},{level:2,title:"Creating the paper wallet",slug:"creating-the-paper-wallet"},{level:2,title:"BDK",slug:"bdk"},{level:2,title:"Funding tx",slug:"funding-tx"},{level:2,title:"Sweep tx",slug:"sweep-tx"},{level:3,title:"Step 1: Alice creates and signs a PSBT",slug:"step-1-alice-creates-and-signs-a-psbt"},{level:3,title:"Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx",slug:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"A Multisig between BDK and Core",frontmatter:{title:"A Multisig between BDK and Core",description:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK",authors:["Gabriele Domenichini"],date:"2020-11-18",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2020-11-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"A Multisig between BDK and Core"},{property:"og:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"A Multisig between BDK and Core"},{name:"twitter:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptors_in_the_wild.html",relativePath:"_blog/descriptors_in_the_wild.md",key:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"The use case",slug:"the-use-case"},{level:2,title:"The role of Descriptors",slug:"the-role-of-descriptors"},{level:2,title:"Our playground",slug:"our-playground"},{level:3,title:"1. Creating the seeds and the derived Extended Public keys",slug:"1-creating-the-seeds-and-the-derived-extended-public-keys"},{level:3,title:"2. Creation of the multi signature descriptor for each wallet",slug:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"},{level:3,title:"3. Use each other's software to receive testnet coins from a faucet",slug:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"},{level:3,title:"4. we return part of the satoshis received back to the faucet",slug:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"BDK-RN: Building React Native Apps with BDK",frontmatter:{title:"BDK-RN: Building React Native Apps with BDK",description:"A tutorial and guide to using bdk-rn for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-08-05",tags:["bitcoin","React Native","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-08-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-RN: Building React Native Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-RN: Building React Native Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_rn.html",relativePath:"_blog/exploring_bdk_rn.md",key:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-rn",slug:"bitcoin-dev-kit-and-bdk-rn"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up styles and RN app structure",slug:"setting-up-styles-and-rn-app-structure"},{level:2,title:"Installing bdk-rn",slug:"installing-bdk-rn"},{level:2,title:"Importing bdk-rn",slug:"importing-bdk-rn"},{level:2,title:"Calling bdk-rn methods",slug:"calling-bdk-rn-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring wallet",slug:"restoring-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Fee estimation for light-clients (Part 1)",frontmatter:{title:"Fee estimation for light-clients (Part 1)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 1)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 1)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_1.html",relativePath:"_blog/fee_estimation_for_light_clients_part_1.md",key:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",headers:[{level:2,title:"Introduction: what is fee estimation?",slug:"introduction-what-is-fee-estimation"},{level:2,title:"The problem",slug:"the-problem"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"BDK-FLUTTER: Building Flutter Apps with BDK",frontmatter:{title:"BDK-FLUTTER: Building Flutter Apps with BDK",description:"A tutorial and guide to using bdk-flutter for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-10-05",tags:["bitcoin","React Native","Flutter","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-10-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, Flutter, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"Flutter"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_flutter.html",relativePath:"_blog/exploring_bdk_flutter.md",key:"v-56536559",path:"/blog/exploring-bdk-flutter/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-flutter",slug:"bitcoin-dev-kit-and-bdk-flutter"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up Flutter app structure",slug:"setting-up-flutter-app-structure"},{level:2,title:"Installing bdk-flutter",slug:"installing-bdk-flutter"},{level:2,title:"Configuring",slug:"configuring"},{level:2,title:"Importing bdk-flutter",slug:"importing-bdk-flutter"},{level:2,title:"Calling bdk-flutter methods",slug:"calling-bdk-flutter-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring a wallet",slug:"restoring-a-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Fee estimation for light-clients (Part 2)",frontmatter:{title:"Fee estimation for light-clients (Part 2)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 2)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 2)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_2.html",relativePath:"_blog/fee_estimation_for_light_clients_part_2.md",key:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",headers:[{level:2,title:"The dataset",slug:"the-dataset"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Fee estimation for light-clients (Part 3)",frontmatter:{title:"Fee estimation for light-clients (Part 3)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 3)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 3)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_3.html",relativePath:"_blog/fee_estimation_for_light_clients_part_3.md",key:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",headers:[{level:2,title:"The model",slug:"the-model"},{level:2,title:"The prediction phase",slug:"the-prediction-phase"},{level:2,title:"Conclusion and future development",slug:"conclusion-and-future-development"},{level:2,title:"Acknowledgements",slug:"acknowledgements"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"The first BDK Taproot TX: a look at the code (Part 1)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 1)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-11-15",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1",meta:[{property:"article:published_time",content:"2021-11-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx.html",relativePath:"_blog/first_bdk_taproot_tx.md",key:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",headers:[{level:2,title:"Backstory",slug:"backstory"},{level:2,title:"rust-bitcoin",slug:"rust-bitcoin"},{level:2,title:"rust-miniscript",slug:"rust-miniscript"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"The first BDK Taproot TX: a look at the code (Part 2)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 2)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-12-10",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2",meta:[{property:"article:published_time",content:"2021-12-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx_part_2.html",relativePath:"_blog/first_bdk_taproot_tx_part_2.md",key:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",headers:[{level:2,title:"Shortcuts",slug:"shortcuts"},{level:2,title:"Utilities",slug:"utilities"},{level:2,title:"Wrap Fallible Methods",slug:"wrap-fallible-methods"},{level:2,title:"Descriptor Metadata",slug:"descriptor-metadata"},{level:2,title:"Policy",slug:"policy"},{level:2,title:"Signer",slug:"signer"},{level:2,title:"PSBT Metadata",slug:"psbt-metadata"},{level:2,title:"descriptor!() Macro",slug:"descriptor-macro"},{level:3,title:"tr() Descriptors",slug:"tr-descriptors"},{level:3,title:"multi_a() Operator",slug:"multi-a-operator"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Hello World!",frontmatter:{title:"Hello World!",description:"Getting started using the BDK library in a very simple Rust project",authors:["Alekos Filini"],date:"2020-12-18",tags:["getting started","rust"],permalink:"/blog/2020/12/hello-world/",meta:[{property:"article:published_time",content:"2020-12-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hello World!"},{property:"og:description",content:"Getting started using the BDK library in a very simple Rust project"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hello World!"},{name:"twitter:description",content:"Getting started using the BDK library in a very simple Rust project"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"getting started, rust"},{property:"article:tag",content:"getting started"},{property:"article:tag",content:"rust"}],layout:"Post"},regularPath:"/_blog/hello-world.html",relativePath:"_blog/hello-world.md",key:"v-5d749fce",path:"/blog/2020/12/hello-world/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Design Goals",slug:"design-goals"},{level:2,title:"The Wallet Structure",slug:"the-wallet-structure"},{level:2,title:"Custom Database and Blockchain types",slug:"custom-database-and-blockchain-types"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Getting Started with rust-hwi",frontmatter:{title:"Getting Started with rust-hwi",description:"This post will help one understand and develop for hardware wallets using BDK",authors:["Wszdexdrf"],date:"2022-08-16",tags:["BDK","Development","Hardware Wallets"],draft:!1,meta:[{property:"article:published_time",content:"2022-08-16T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Getting Started with rust-hwi"},{property:"og:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Getting Started with rust-hwi"},{name:"twitter:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/getting_started_with_rust_hwi.html",relativePath:"_blog/getting_started_with_rust_hwi.md",key:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",headers:[{level:2,title:"Fundamentals",slug:"fundamentals"},{level:2,title:"Integration with BDK",slug:"integration-with-bdk"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Improving coin selection in BDK",frontmatter:{title:"Improving coin selection in BDK",description:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022",date:"2022-08-17",tags:["coin selection","BDK","development","summer of bitcoin"],authors:["César Alvarez Vallero"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-08-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Improving coin selection in BDK"},{property:"og:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Improving coin selection in BDK"},{name:"twitter:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"coin selection, BDK, development, summer of bitcoin"},{property:"article:tag",content:"coin selection"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"development"},{property:"article:tag",content:"summer of bitcoin"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/improving_coin_selection_in_BDK.html",relativePath:"_blog/improving_coin_selection_in_BDK.md",key:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",headers:[{level:2,title:"Waste",slug:"waste"},{level:3,title:"How it works?",slug:"how-it-works"},{level:3,title:"What has been done",slug:"what-has-been-done"},{level:3,title:"Work in progress",slug:"work-in-progress"},{level:2,title:"Further Improvements",slug:"further-improvements"},{level:3,title:"Privacy",slug:"privacy"},{level:3,title:"Flexibility",slug:"flexibility"},{level:2,title:"Conclusion",slug:"conclusion"},{level:2,title:"Acknowledgements",slug:"acknowledgements"},{level:2,title:"References",slug:"references"},{level:3,title:"About coin selection considerations",slug:"about-coin-selection-considerations"},{level:3,title:"About Waste metric",slug:"about-waste-metric"},{level:3,title:"About improving privacy in coin selection",slug:"about-improving-privacy-in-coin-selection"},{level:3,title:"About bdk_core",slug:"about-bdk-core"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Hidden Powers of Miniscript Policy & Descriptors",frontmatter:{title:"Hidden Powers of Miniscript Policy & Descriptors",description:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies",authors:["Sandipan Dey","Rajarshi Maitra"],date:"2022-01-02",tags:["tutorial","bdk","bdk-cli","miniscript","descriptor","bitcoin-cli"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-01-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{property:"og:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{name:"twitter:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk, bdk-cli, miniscript, descriptor, bitcoin-cli"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"bitcoin-cli"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/hidden-power-of-bitcoin.html",relativePath:"_blog/hidden-power-of-bitcoin.md",key:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Script",slug:"script"},{level:2,title:"Miniscript",slug:"miniscript"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Where it all comes together...",slug:"where-it-all-comes-together"},{level:3,title:"Keys and Generating Addresses",slug:"keys-and-generating-addresses"},{level:3,title:"Making a MultiSig Descriptor for Funds",slug:"making-a-multisig-descriptor-for-funds"},{level:2,title:"Retention Bonus - Smart Contract with Bitcoin",slug:"retention-bonus-smart-contract-with-bitcoin"},{level:2,title:"Inspirations",slug:"inspirations"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Security Advisory: Miniscript MINIMALIF Bug",frontmatter:{title:"Security Advisory: Miniscript MINIMALIF Bug",description:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next.",authors:["Alekos Filini"],date:"2022-04-19",tags:["miniscript","security"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-04-19T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{property:"og:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{name:"twitter:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"miniscript, security"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"security"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/miniscript_vulnerability.html",relativePath:"_blog/miniscript_vulnerability.md",key:"v-10852eea",path:"/blog/miniscript-vulnerability/",headers:[{level:2,title:"How to check if you are vulnerable",slug:"how-to-check-if-you-are-vulnerable"},{level:2,title:"Next steps",slug:"next-steps"},{level:3,title:"If you are affected",slug:"if-you-are-affected"},{level:3,title:"Everybody",slug:"everybody"},{level:2,title:"Consequences of the update",slug:"consequences-of-the-update"},{level:2,title:"Footnote: How we analyzed the blockchain",slug:"footnote-how-we-analyzed-the-blockchain"},{level:2,title:"Correction (2022-04-25)",slug:"correction-2022-04-25"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.2.0",frontmatter:{title:"Release v0.2.0",description:"Announcing the v0.2.0 release of BDK",authors:["Alekos Filini"],date:"2020-12-21",tags:["rust","release"],permalink:"/blog/2020/12/release-v0.2.0/",meta:[{property:"article:published_time",content:"2020-12-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.2.0"},{property:"og:description",content:"Announcing the v0.2.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.2.0"},{name:"twitter:description",content:"Announcing the v0.2.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.2.0.html",relativePath:"_blog/release-0.2.0.md",key:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",headers:[{level:2,title:"What's new in v0.2.0",slug:"whats-new-in-v020"},{level:3,title:"A new name",slug:"a-new-name"},{level:3,title:"Branch and Bound coin selection",slug:"branch-and-bound-coin-selection"},{level:3,title:"Key generation",slug:"key-generation"},{level:3,title:"Generic key types",slug:"generic-key-types"},{level:3,title:"Descriptor templates",slug:"descriptor-templates"},{level:3,title:"Easier creation of Blockchain and Database",slug:"easier-creation-of-blockchain-and-database"},{level:3,title:"descriptor!() macro",slug:"descriptor-macro"},{level:3,title:"Support for sortedmulti()",slug:"support-for-sortedmulti"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.3.0",frontmatter:{title:"Release v0.3.0",description:"Announcing the v0.3.0 release of BDK",authors:["Alekos Filini"],date:"2021-01-20",tags:["rust","release"],permalink:"/blog/2021/01/release-v0.3.0/",meta:[{property:"article:published_time",content:"2021-01-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.3.0"},{property:"og:description",content:"Announcing the v0.3.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.3.0"},{name:"twitter:description",content:"Announcing the v0.3.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.3.0.html",relativePath:"_blog/release-0.3.0.md",key:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",headers:[{level:2,title:"What's new in v0.3.0",slug:"whats-new-in-v030"},{level:3,title:"Less verbosity when using Wallet::new_offline()",slug:"less-verbosity-when-using-walletnew-offline"},{level:3,title:"No more error conversions in DescriptorTemplate",slug:"no-more-error-conversions-in-descriptortemplate"},{level:3,title:"A new repo for the CLI",slug:"a-new-repo-for-the-cli"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.4.0",frontmatter:{title:"Release v0.4.0",description:"Announcing the v0.4.0 release of BDK",authors:["Alekos Filini"],date:"2021-02-17",tags:["rust","release"],permalink:"/blog/2021/02/release-v0.4.0/",meta:[{property:"article:published_time",content:"2021-02-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.4.0"},{property:"og:description",content:"Announcing the v0.4.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.4.0"},{name:"twitter:description",content:"Announcing the v0.4.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.4.0.html",relativePath:"_blog/release-0.4.0.md",key:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",headers:[{level:2,title:"What's new in v0.4.0",slug:"whats-new-in-v040"},{level:3,title:"A new API to build transaction",slug:"a-new-api-to-build-transaction"},{level:3,title:"Upgraded dependencies",slug:"upgraded-dependencies"},{level:3,title:"Compact Filters example",slug:"compact-filters-example"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.5.0",frontmatter:{title:"Release v0.5.0",description:"Announcing the v0.5.0 release of BDK",authors:["Alekos Filini"],date:"2021-03-18",tags:["rust","release"],permalink:"/blog/2021/03/release-v0.5.0/",meta:[{property:"article:published_time",content:"2021-03-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.5.0"},{property:"og:description",content:"Announcing the v0.5.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.5.0"},{name:"twitter:description",content:"Announcing the v0.5.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.5.0.html",relativePath:"_blog/release-0.5.0.md",key:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",headers:[{level:2,title:"What's new in v0.5.0",slug:"whats-new-in-v050"},{level:3,title:"Dual Licensing",slug:"dual-licensing"},{level:3,title:"Spending foreign UTXOs",slug:"spending-foreign-utxos"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.8.0",frontmatter:{title:"Release v0.8.0",description:"Announcing the v0.8.0 release of BDK",authors:["Alekos Filini"],date:"2021-06-14",tags:["rust","release"],permalink:"/blog/2021/06/release-v0.8.0/",meta:[{property:"article:published_time",content:"2021-06-14T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.8.0"},{property:"og:description",content:"Announcing the v0.8.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.8.0"},{name:"twitter:description",content:"Announcing the v0.8.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.8.0.html",relativePath:"_blog/release-0.8.0.md",key:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",headers:[{level:2,title:"What's new in v0.8.0",slug:"whats-new-in-v080"},{level:3,title:"Getting the Derivation Index",slug:"getting-the-derivation-index"},{level:3,title:"Explicitly Enable non-ALL Sighashes",slug:"explicitly-enable-non-all-sighashes"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.6.0",frontmatter:{title:"Release v0.6.0",description:"Announcing the v0.6.0 release of BDK",authors:["Alekos Filini"],date:"2021-04-15",tags:["rust","release"],permalink:"/blog/2021/04/release-v0.6.0/",meta:[{property:"article:published_time",content:"2021-04-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.6.0"},{property:"og:description",content:"Announcing the v0.6.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.6.0"},{name:"twitter:description",content:"Announcing the v0.6.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.6.0.html",relativePath:"_blog/release-0.6.0.md",key:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",headers:[{level:2,title:"What's new in v0.6.0",slug:"whats-new-in-v060"},{level:3,title:"A new way to generate addresses",slug:"a-new-way-to-generate-addresses"},{level:3,title:"Easier multiparty transaction creation",slug:"easier-multiparty-transaction-creation"},{level:3,title:"Renamed types",slug:"renamed-types"},{level:3,title:"New MSRV",slug:"new-msrv"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.7.0",frontmatter:{title:"Release v0.7.0",description:"Announcing the v0.7.0 release of BDK",authors:["Alekos Filini"],date:"2021-05-17",tags:["rust","release"],permalink:"/blog/2021/05/release-v0.7.0/",meta:[{property:"article:published_time",content:"2021-05-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.7.0"},{property:"og:description",content:"Announcing the v0.7.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.7.0"},{name:"twitter:description",content:"Announcing the v0.7.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.7.0.html",relativePath:"_blog/release-0.7.0.md",key:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",headers:[{level:2,title:"What's new in v0.7.0",slug:"whats-new-in-v070"},{level:3,title:"New Signing API",slug:"new-signing-api"},{level:3,title:"Support Timelocks in the policy Module",slug:"support-timelocks-in-the-policy-module"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Release v0.9.0",frontmatter:{title:"Release v0.9.0",description:"Announcing the v0.9.0 release of BDK",authors:["Alekos Filini"],date:"2021-07-11",tags:["rust","release"],permalink:"/blog/2021/07/release-v0.9.0/",meta:[{property:"article:published_time",content:"2021-07-11T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.9.0"},{property:"og:description",content:"Announcing the v0.9.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.9.0"},{name:"twitter:description",content:"Announcing the v0.9.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.9.0.html",relativePath:"_blog/release-0.9.0.md",key:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",headers:[{level:2,title:"What's new in v0.9.0",slug:"whats-new-in-v090"},{level:2,title:"Bitcoin Core Blockchain Backend",slug:"bitcoin-core-blockchain-backend"},{level:2,title:"Updated TransactionDetails Struct",slug:"updated-transactiondetails-struct"},{level:2,title:"Verify Downloaded TXs",slug:"verify-downloaded-txs"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Spending Policy Decoded",frontmatter:{title:"Spending Policy Decoded",description:"Demonstrate how to use a descriptor wallet with different spending policies",authors:["Steve Myers","thunderbiscuit"],date:"2021-02-23",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2021-02-23T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Spending Policy Decoded"},{property:"og:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Spending Policy Decoded"},{name:"twitter:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/spending_policy_demo.html",relativePath:"_blog/spending_policy_demo.md",key:"v-8534b9c2",path:"/blog/spending-policy-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Initial Setup",slug:"initial-setup"},{level:3,title:"Step 0: Install a recent version bdk-cli",slug:"step-0-install-a-recent-version-bdk-cli"},{level:3,title:"Step 1: Generate private extended keys",slug:"step-1-generate-private-extended-keys"},{level:3,title:"Step 2: Extract private extended keys",slug:"step-2-extract-private-extended-keys"},{level:3,title:"Step 3: Derive public extended keys",slug:"step-3-derive-public-extended-keys"},{level:3,title:"Step 4: Create wallet descriptors for each participant",slug:"step-4-create-wallet-descriptors-for-each-participant"},{level:2,title:"Policy A. Three signatures",slug:"policy-a-three-signatures"},{level:3,title:"Step 1a: Create a testnet segwit0 receive address",slug:"step-1a-create-a-testnet-segwit0-receive-address"},{level:3,title:"Step 2a: Send testnet bitcoin from a faucet to receive address",slug:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"},{level:3,title:"Step 3a: Sync participant wallets and confirm balance",slug:"step-3a-sync-participant-wallets-and-confirm-balance"},{level:3,title:"Step 4a: View wallet spending policies",slug:"step-4a-view-wallet-spending-policies"},{level:3,title:"Step 5a: Create spending transaction",slug:"step-5a-create-spending-transaction"},{level:3,title:"Step 6a: Sign and finalize PSBTs",slug:"step-6a-sign-and-finalize-psbts"},{level:3,title:"Step 7a: Broadcast finalized PSBT",slug:"step-7a-broadcast-finalized-psbt"},{level:3,title:"Step 8a: Confirm transaction included in a testnet block",slug:"step-8a-confirm-transaction-included-in-a-testnet-block"},{level:2,title:"Policy B. Two signatures after a relative time lock",slug:"policy-b-two-signatures-after-a-relative-time-lock"},{level:3,title:"Step 1b: Create a new testnet receive address",slug:"step-1b-create-a-new-testnet-receive-address"},{level:3,title:"Step 2b: Fund new address from testnet faucet",slug:"step-2b-fund-new-address-from-testnet-faucet"},{level:3,title:"Step 3b: Sync wallet and confirm wallet balance",slug:"step-3b-sync-wallet-and-confirm-wallet-balance"},{level:3,title:"Step 4b: Create spending transaction",slug:"step-4b-create-spending-transaction"},{level:3,title:"Step 5b: Sign and finalize PSBTs",slug:"step-5b-sign-and-finalize-psbts"},{level:3,title:"Step 6b: Broadcast finalized PSBT",slug:"step-6b-broadcast-finalized-psbt"},{level:3,title:"Step 7b: View confirmed transaction",slug:"step-7b-view-confirmed-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"The Road to BDK 1.0",frontmatter:{title:"The Road to BDK 1.0",description:"Outlining the plan for the 1.0 release of BDK",authors:["Alekos Filini"],date:"2022-10-03",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-10-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The Road to BDK 1.0"},{property:"og:description",content:"Outlining the plan for the 1.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The Road to BDK 1.0"},{name:"twitter:description",content:"Outlining the plan for the 1.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/road_to_bdk_1.html",relativePath:"_blog/road_to_bdk_1.md",key:"v-55969f39",path:"/blog/road-to-bdk-1/",headers:[{level:2,title:"Goals",slug:"goals"},{level:3,title:"Stable API",slug:"stable-api"},{level:3,title:"Upstreaming our code",slug:"upstreaming-our-code"},{level:3,title:"Partially Syncing a Wallet",slug:"partially-syncing-a-wallet"},{level:3,title:"no_std",slug:"no-std"},{level:3,title:"Lower MSRV",slug:"lower-msrv"},{level:2,title:"Architecture",slug:"architecture"},{level:2,title:"Timeline",slug:"timeline"},{level:2,title:"Feature Freezing BDK",slug:"feature-freezing-bdk"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Using BDK with hardware wallets",frontmatter:{title:"Using BDK with hardware wallets",description:"Tutorial showing how to send funds to a HW and then spend from it using BDK",authors:["Daniela Brozzoni"],date:"2022-10-27",tags:["BDK","Development","Hardware Wallets"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-10-27T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with hardware wallets"},{property:"og:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with hardware wallets"},{name:"twitter:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/using_bdk_with_hardware_wallets.html",relativePath:"_blog/using_bdk_with_hardware_wallets.md",key:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Initial setup",slug:"initial-setup"},{level:2,title:"Finding the hardware wallet",slug:"finding-the-hardware-wallet"},{level:2,title:"Receiving funds",slug:"receiving-funds"},{level:2,title:"Spending funds",slug:"spending-funds"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Why Do We Build Bindings?",frontmatter:{title:"Why Do We Build Bindings?",description:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries",authors:["thunderbiscuit"],date:"2024-05-07",tags:["bindings"],meta:[{property:"article:published_time",content:"2024-05-07T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Why Do We Build Bindings?"},{property:"og:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Why Do We Build Bindings?"},{name:"twitter:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bindings"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/why-bindings.html",relativePath:"_blog/why-bindings.md",key:"v-4dc135e3",path:"/blog/why-bindings/",headers:[{level:2,title:"Awesome! Producing Bindings Must Be Easy Right?",slug:"awesome-producing-bindings-must-be-easy-right"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"All",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/all/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/all/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/all.html",relativePath:"adoption/all.md",key:"v-4d760891",path:"/adoption/all/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Custodial",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/custodial.html",relativePath:"adoption/custodial.md",key:"v-30c0037b",path:"/adoption/custodial/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Desktop",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/desktop.html",relativePath:"adoption/desktop.md",key:"v-4bb7844a",path:"/adoption/desktop/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Exchange",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/exchange.html",relativePath:"adoption/exchange.md",key:"v-b936290e",path:"/adoption/exchange/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Hardware",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/hardware.html",relativePath:"adoption/hardware.md",key:"v-7afdbb4e",path:"/adoption/hardware/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Mobile",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/mobile.html",relativePath:"adoption/mobile.md",key:"v-a7c24c4e",path:"/adoption/mobile/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Web",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/web/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/web/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/web.html",relativePath:"adoption/web.md",key:"v-17019aeb",path:"/adoption/web/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Compiler",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Compiler"},{property:"og:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Compiler"},{name:"twitter:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/compiler.html",relativePath:"bdk-cli/compiler.md",key:"v-7a315e41",path:"/bdk-cli/compiler/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Installation",slug:"installation"},{level:2,title:"Usage",slug:"usage"},{level:2,title:"Example",slug:"example"},{level:2,title:"Troubleshooting",slug:"troubleshooting"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Infrastructure",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/infrastructure.html",relativePath:"adoption/infrastructure.md",key:"v-4e0b610e",path:"/adoption/infrastructure/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Concept",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Concept"},{property:"og:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Concept"},{name:"twitter:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/concept.html",relativePath:"bdk-cli/concept.md",key:"v-f611a14e",path:"/bdk-cli/concept/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Interface",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Interface"},{property:"og:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Interface"},{name:"twitter:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/interface.html",relativePath:"bdk-cli/interface.md",key:"v-496cb7f9",path:"/bdk-cli/interface/",headers:[{level:2,title:"Flags",slug:"flags"},{level:3,title:"Verbosity",slug:"verbosity"},{level:2,title:"Options",slug:"options"},{level:2,title:"Subcommands",slug:"subcommands"},{level:2,title:"key",slug:"key"},{level:3,title:"generate",slug:"generate"},{level:3,title:"restore",slug:"restore"},{level:3,title:"derive",slug:"derive"},{level:2,title:"wallet",slug:"wallet"},{level:3,title:"Options",slug:"options-2"},{level:2,title:"Subcommands",slug:"subcommands-2"},{level:3,title:"broadcast",slug:"broadcast"},{level:3,title:"bump_fee",slug:"bump-fee"},{level:3,title:"combine_psbt",slug:"combine-psbt"},{level:3,title:"create_tx",slug:"create-tx"},{level:3,title:"extract_psbt",slug:"extract-psbt"},{level:3,title:"finalize_psbt",slug:"finalize-psbt"},{level:3,title:"get_balance",slug:"get-balance"},{level:3,title:"get_new_address",slug:"get-new-address"},{level:3,title:"list_transactions",slug:"list-transactions"},{level:3,title:"list_unspent",slug:"list-unspent"},{level:3,title:"policies",slug:"policies"},{level:3,title:"public_descriptor",slug:"public-descriptor"},{level:3,title:"help",slug:"help"},{level:3,title:"sign",slug:"sign"},{level:3,title:"sync",slug:"sync"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Introduction",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Introduction"},{property:"og:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Introduction"},{name:"twitter:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/introduction.html",relativePath:"bdk-cli/introduction.md",key:"v-0b3b65ea",path:"/bdk-cli/introduction/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Installation",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Installation"},{property:"og:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Installation"},{name:"twitter:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/installation.html",relativePath:"bdk-cli/installation.md",key:"v-3acb6e6a",path:"/bdk-cli/installation/",headers:[{level:2,title:"Requirements",slug:"requirements"},{level:2,title:"Installing the bdk-cli tool",slug:"installing-the-bdk-cli-tool"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Playground",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Playground"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Playground"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/playground.html",relativePath:"bdk-cli/playground.md",key:"v-a76bccee",path:"/bdk-cli/playground/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Regtest",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Regtest"},{property:"og:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Regtest"},{name:"twitter:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/regtest.html",relativePath:"bdk-cli/regtest.md",key:"v-05d01c19",path:"/bdk-cli/regtest/",headers:[{level:2,title:"Troubleshooting",slug:"troubleshooting"},{level:2,title:"Bonus: Docker",slug:"bonus-docker"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{frontmatter:{cases:!0,sidebar:!1,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",actionText:"Add your project",actionLink:"https://github.com/orgs/bitcoindevkit/discussions/64",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/case-studies/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/case-studies/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/case-studies.html",relativePath:"case-studies.md",key:"v-11bf335e",path:"/case-studies/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Examples",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Examples"},{property:"og:description",content:"Click the links below and learn from community-built example projects."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/examples/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Examples"},{name:"twitter:description",content:"Click the links below and learn from community-built example projects."},{name:"twitter:url",content:"https://bitcoindevkit.org/examples/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/examples/",relativePath:"examples/README.md",key:"v-29f9f21c",path:"/examples/",headers:[{level:2,title:"BDK-CLI",slug:"bdk-cli"},{level:2,title:"DevkitWallet",slug:"devkitwallet"},{level:2,title:"Padawan Wallet",slug:"padawan-wallet"},{level:2,title:"BDKSwiftExampleWallet",slug:"bdkswiftexamplewallet"},{level:2,title:"Tatooine",slug:"tatooine"},{level:2,title:"SEBA Bank Proof of reserves",slug:"seba-bank-proof-of-reserves"},{level:2,title:"Stackmate",slug:"stackmate"},{level:2,title:"Spotbit",slug:"spotbit"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Descriptors",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Descriptors"},{property:"og:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/descriptors/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Descriptors"},{name:"twitter:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{name:"twitter:url",content:"https://bitcoindevkit.org/descriptors/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/descriptors/",relativePath:"descriptors/README.md",key:"v-a9236c10",path:"/descriptors/",headers:[{level:3,title:"Compatibility Matrix",slug:"compatibility-matrix"},{level:3,title:"Examples",slug:"examples"},{level:3,title:"Implementation Details",slug:"implementation-details"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Current Grantees (Full-Time)",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/grantees.html",relativePath:"foundation/grantees.md",key:"v-105750ce",path:"/foundation/grantees/",headers:[{level:2,title:"Evan Lin",slug:"evan-lin"},{level:2,title:"thunderbiscuit",slug:"thunderbiscuit"},{level:2,title:"Matthew Ramsden",slug:"matthew-ramsden"},{level:2,title:"ValuedMammal",slug:"valuedmammal"},{level:2,title:"Wei Chen",slug:"wei-chen"},{level:2,title:"Manuel Gatti",slug:"manuel-gatti"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/about/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/about/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/about.html",relativePath:"foundation/about.md",key:"v-3750297a",path:"/foundation/about/",headers:[{level:2,title:"Board",slug:"board"},{level:2,title:"Operations",slug:"operations"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Supporters",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/supporters.html",relativePath:"foundation/supporters.md",key:"v-50aa6d4e",path:"/foundation/supporters/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Grants Program",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/grants/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/grants/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/grants.html",relativePath:"foundation/grants.md",key:"v-08589c4e",path:"/foundation/grants/",headers:[{level:2,title:"Grant Requirements",slug:"grant-requirements"},{level:2,title:"Full-time grants",slug:"full-time-grants"},{level:3,title:"Rust",slug:"rust"},{level:3,title:"Mobile / language bindings",slug:"mobile-language-bindings"},{level:2,title:"Project grants",slug:"project-grants"},{level:2,title:"Applying",slug:"applying"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/",relativePath:"foundation/index.md",key:"v-c152529c",path:"/foundation/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{title:"Bitcoin Dev Kit",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin Dev Kit"},{property:"og:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/getting-started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin Dev Kit"},{name:"twitter:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{name:"twitter:url",content:"https://bitcoindevkit.org/getting-started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/getting-started.html",relativePath:"getting-started.md",key:"v-4bcdac39",path:"/getting-started/",headers:[{level:2,title:"Initial Configuration",slug:"initial-configuration"},{level:2,title:"Internal Features",slug:"internal-features"},{level:2,title:"Playground",slug:"playground"},{level:2,title:"Descriptors",slug:"descriptors"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 4:15:03 AM",lastUpdatedTimestamp:1718252103e3},{frontmatter:{layout:"IndexPost",title:"Blog",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/",key:"v-424df898",path:"/blog/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Tags",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/",key:"v-619df59e",path:"/blog/tags/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Authors",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/",key:"v-b0968728",path:"/blog/author/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK/",key:"v-5f2600b8",path:"/blog/tags/BDK/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"project ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/project/",key:"v-398e8fd4",path:"/blog/tags/project/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tutorial ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tutorial/",key:"v-da8c869a",path:"/blog/tags/tutorial/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Core ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Bitcoin%20Core/",key:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"RPC ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/RPC/",key:"v-5f171cb0",path:"/blog/tags/RPC/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Wallet/",key:"v-4696dfd8",path:"/blog/tags/Wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/architecture/",key:"v-c4494744",path:"/blog/tags/architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-cli/",key:"v-c711ccde",path:"/blog/tags/bdk-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"basics ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/basics/",key:"v-e646a928",path:"/blog/tags/basics/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"novice ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/novice/",key:"v-1fb58ffb",path:"/blog/tags/novice/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"multi-sig ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/multi-sig/",key:"v-655ee4a0",path:"/blog/tags/multi-sig/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK-RN ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK-RN/",key:"v-876cfade",path:"/blog/tags/BDK-RN/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Development/",key:"v-3acc51dc",path:"/blog/tags/Development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Architecture/",key:"v-650ae784",path:"/blog/tags/Architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tor/",key:"v-5ef73f54",path:"/blog/tags/tor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/wallet/",key:"v-39437010",path:"/blog/tags/wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"blockchain ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/blockchain/",key:"v-7c8563fd",path:"/blog/tags/blockchain/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bindings ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bindings/",key:"v-1296a8fa",path:"/blog/tags/bindings/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"compact_filters ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/compact_filters/",key:"v-baacba64",path:"/blog/tags/compact_filters/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BIP157 ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BIP157/",key:"v-75ccd5f2",path:"/blog/tags/BIP157/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Neutrino ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Neutrino/",key:"v-4fed1c23",path:"/blog/tags/Neutrino/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"guide ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/guide/",key:"v-a9e0285e",path:"/blog/tags/guide/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"descriptor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/descriptor/",key:"v-733ed37c",path:"/blog/tags/descriptor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"paper wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/paper%20wallets/",key:"v-1144be8a",path:"/blog/tags/paper wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin/",key:"v-915f8322",path:"/blog/tags/bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"React Native ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/React%20Native/",key:"v-bf53d4d4",path:"/blog/tags/React Native/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"iOS ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/iOS/",key:"v-5f023740",path:"/blog/tags/iOS/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Android ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Android/",key:"v-414e735e",path:"/blog/tags/Android/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"mobile ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/mobile/",key:"v-2c94bf22",path:"/blog/tags/mobile/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-rn ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-rn/",key:"v-dd212a9e",path:"/blog/tags/bdk-rn/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk/",key:"v-5f07f0f8",path:"/blog/tags/bdk/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"fee ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/fee/",key:"v-5f0447f2",path:"/blog/tags/fee/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"machine learning ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/machine%20learning/",key:"v-e2317b12",path:"/blog/tags/machine learning/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Flutter ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Flutter/",key:"v-07eeb15e",path:"/blog/tags/Flutter/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"taproot ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/taproot/",key:"v-57f3a168",path:"/blog/tags/taproot/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"miniscript ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/miniscript/",key:"v-ef7c3fa2",path:"/blog/tags/miniscript/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"getting started ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/getting%20started/",key:"v-79c3de4b",path:"/blog/tags/getting started/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rust ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/rust/",key:"v-3fee41ed",path:"/blog/tags/rust/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Hardware Wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Hardware%20Wallets/",key:"v-640144b2",path:"/blog/tags/Hardware Wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"coin selection ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/coin%20selection/",key:"v-74edfe92",path:"/blog/tags/coin selection/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/development/",key:"v-4e62fa1c",path:"/blog/tags/development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"summer of bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/summer%20of%20bitcoin/",key:"v-0159a747",path:"/blog/tags/summer of bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin-cli/",key:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"security ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/security/",key:"v-0755ed11",path:"/blog/tags/security/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"release ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/release/",key:"v-543950a6",path:"/blog/tags/release/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Steve Myers ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Steve%20Myers/",key:"v-a354115e",path:"/blog/author/Steve Myers/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Daniela Brozzoni ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Daniela%20Brozzoni/",key:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Rajarshi Maitra ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Rajarshi%20Maitra/",key:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Lloyd Fournier ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Lloyd%20Fournier/",key:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"waterst0ne ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/waterst0ne/",key:"v-3e6950f4",path:"/blog/author/waterst0ne/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Zavior ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Bitcoin%20Zavior/",key:"v-37829241",path:"/blog/author/Bitcoin Zavior/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rorp ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/rorp/",key:"v-d2b26530",path:"/blog/author/rorp/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"thunderbiscuit ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/thunderbiscuit/",key:"v-5d54001e",path:"/blog/author/thunderbiscuit/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Riccardo Casatta ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Riccardo%20Casatta/",key:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Gabriele Domenichini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Gabriele%20Domenichini/",key:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Alekos Filini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/",key:"v-ad00c09c",path:"/blog/author/Alekos Filini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wszdexdrf ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Wszdexdrf/",key:"v-4eeab648",path:"/blog/author/Wszdexdrf/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"César Alvarez Vallero ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/C%C3%A9sar%20Alvarez%20Vallero/",key:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Sandipan Dey ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Sandipan%20Dey/",key:"v-91c10894",path:"/blog/author/Sandipan Dey/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/2/",key:"v-c3507bb6",path:"/blog/page/2/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 3",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/3/",key:"v-c3507b78",path:"/blog/page/3/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 4",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/4/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/4/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/4/",key:"v-c3507b3a",path:"/blog/page/4/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Alekos Filini - Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/page/2/",key:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",codeSwitcherOptions:{}}],themeConfig:{domain:"https://bitcoindevkit.org",logo:"/img/logo.svg",displayAllHeaders:!1,repo:"bitcoindevkit/bitcoindevkit.org",docsDir:"docs",editLinks:!0,sidebarDepth:0,nav:[{text:"Docs",link:"/getting-started/"},{text:"Adoption",link:"/adoption/all.md"},{text:"Foundation",link:"/foundation/"},{text:"Blog",link:"/blog/"}],sidebar:{"/adoption/":[{title:"Built With BDK",collapsable:!1,children:[["/adoption/all.md","All"],["/adoption/mobile.md","Mobile"],["/adoption/desktop.md","Desktop"],["/adoption/hardware.md","Hardware"],["/adoption/web.md","Web"],["/adoption/custodial.md","Custodial"],["/adoption/exchange.md","Exchange"],["/adoption/infrastructure.md","Infrastructure"]]}],"/_blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/foundation/":[{title:"Foundation",collapsable:!1,children:[["/foundation/about.md","About Us"],["/foundation/supporters.md","Supporters"],["/foundation/grantees.md","Grantees"],["/foundation/grants.md","Grants"]]}],"/":[{title:"Documentation",collapsable:!1,children:[["/getting-started","Getting Started"],{title:"BDK-CLI",collapsable:!0,children:["/bdk-cli/introduction","/bdk-cli/installation","/bdk-cli/concept","/bdk-cli/interface","/bdk-cli/regtest","/bdk-cli/compiler","/bdk-cli/playground"]},"/descriptors/","/examples/"]},{title:"API Reference",collapsable:!1,children:[["https://docs.rs/bdk_wallet/","Rust Stable Docs"],["https://bitcoindevkit.org/docs-rs/bdk/nightly/latest/bdk_wallet/","Rust Nightly Docs"],["https://bitcoindevkit.org/android/","Android Docs"],["https://bitcoindevkit.org/jvm/","Kotlin/JVM Docs"],["https://bitcoindevkit.org/java/","Java Docs"]]}]},footer:{links:[{title:"Docs",children:[{text:"Getting Started",link:"/getting-started/"},{text:"BDK-CLI",link:"/bdk-cli/installation/"},{text:"Descriptors",link:"/descriptors/"}]},{title:"Community",children:[{text:"GitHub",link:"https://github.com/bitcoindevkit",rel:"noopener noreferrer"},{text:"Nostr",link:"nostr:npub13dk3dke4zm9vdkucm7f6vv7vhqgkevgg3gju9kr2wzumz7nrykdq0dgnvc",rel:"noopener noreferrer"},{text:"Twitter",link:"https://twitter.com/intent/follow?screen_name=bitcoindevkit",rel:"noopener noreferrer"},{text:"Chat on Discord",link:"https://discord.gg/dstn4dQ",rel:"noopener noreferrer"}]},{title:"More",children:[{text:"Blog",link:"/blog/"},{text:"Supporters",link:"/foundation/supporters/"},{text:"BDK Foundation",link:"/foundation/"}]}],copyright:"Copyright © 2024 BDK Developers"}}},{COLOR_MODES:Wc,STORE_ATTR:Hc,setColorMode:Vc}=n(111),qc=t=>"Enter"===t.code||13===(t.keyCode||t.which),Gc=t=>{const e=t.target.matches("#algolia-search-input")&&qc(t);(t.target.matches(".ds-dropdown-menu *")||e)&&document.getElementById("algolia-search-input").blur(),t.target.matches(".ytEmbed")&&(t.preventDefault(),(t=>{const e=t.querySelector("iframe[data-src]");if(e){const t=e.getAttribute("data-src");e.setAttribute("src",t)}})(t.target))};if("undefined"==typeof process||"server"!==process.env.VUE_ENV){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?Wc[1]:Wc[0],e=window.localStorage.getItem(Hc);Vc(Wc.includes(e)?e:t)}n(243);Vn.component("Badge",()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398))),Vn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388))),Vn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)));n(244);var Zc={props:{color:{required:!1,default:"rgb(66, 185, 131)"}}},Xc=(n(245),Object(Kc.a)(Zc,(function(){return(0,this._self._c)("div",{staticClass:"spinner",style:{background:this.color}})}),[],!1,null,"1bbcb91a",null).exports);const Yc={name:"Mermaid",props:{id:{type:String,required:!0},graph:{type:String,required:!0}},data:()=>({svg:void 0}),render(t){return void 0===this.svg?t("Loading"):t("div",{domProps:{innerHTML:this.svg,style:"width: 100%"}})},mounted(){n.e(94).then(n.t.bind(null,384,7)).then(t=>{t.initialize({startOnLoad:!0});let e=document.createElement("div");document.body.appendChild(e),t.render(this.id,this.graph,t=>{this.svg=t,document.body.removeChild(e)},e)})},components:{Loading:Xc}};var Jc=n(94),Qc=n.n(Jc);n(246);Vn.component("CodeSwitcher",()=>n.e(44).then(n.bind(null,397)));var tl={tags:{BDK:{key:"BDK",scope:"tags",path:"/blog/tags/BDK/",pageKeys:["v-2c450c3f","v-5e744cf7","v-7c0c45f9","v-3875825f","v-07ff1843","v-9145467a","v-2cf72b39","v-11d64359","v-d0375c8e","v-aeb70fce"]},project:{key:"project",scope:"tags",path:"/blog/tags/project/",pageKeys:["v-2c450c3f","v-5e744cf7"]},tutorial:{key:"tutorial",scope:"tags",path:"/blog/tags/tutorial/",pageKeys:["v-7c0c45f9","v-8bd632d6","v-353b78e1","v-07ff1843","v-f58ec8f2","v-56536559","v-ab5ba3ce"]},"Bitcoin Core":{key:"Bitcoin Core",scope:"tags",path:"/blog/tags/Bitcoin Core/",pageKeys:["v-7c0c45f9"]},RPC:{key:"RPC",scope:"tags",path:"/blog/tags/RPC/",pageKeys:["v-7c0c45f9"]},Wallet:{key:"Wallet",scope:"tags",path:"/blog/tags/Wallet/",pageKeys:["v-7c0c45f9"]},architecture:{key:"architecture",scope:"tags",path:"/blog/tags/architecture/",pageKeys:["v-2cebe183","v-55969f39"]},"bdk-cli":{key:"bdk-cli",scope:"tags",path:"/blog/tags/bdk-cli/",pageKeys:["v-0f4d5d15","v-8bd632d6","v-07ff1843","v-ab5ba3ce"]},basics:{key:"basics",scope:"tags",path:"/blog/tags/basics/",pageKeys:["v-0f4d5d15"]},novice:{key:"novice",scope:"tags",path:"/blog/tags/novice/",pageKeys:["v-0f4d5d15"]},"multi-sig":{key:"multi-sig",scope:"tags",path:"/blog/tags/multi-sig/",pageKeys:["v-8bd632d6"]},"BDK-RN":{key:"BDK-RN",scope:"tags",path:"/blog/tags/BDK-RN/",pageKeys:["v-3eaa044d"]},Development:{key:"Development",scope:"tags",path:"/blog/tags/Development/",pageKeys:["v-3eaa044d","v-11d64359","v-aeb70fce"]},Architecture:{key:"Architecture",scope:"tags",path:"/blog/tags/Architecture/",pageKeys:["v-3eaa044d"]},tor:{key:"tor",scope:"tags",path:"/blog/tags/tor/",pageKeys:["v-353b78e1"]},wallet:{key:"wallet",scope:"tags",path:"/blog/tags/wallet/",pageKeys:["v-353b78e1","v-f58ec8f2","v-56536559"]},blockchain:{key:"blockchain",scope:"tags",path:"/blog/tags/blockchain/",pageKeys:["v-353b78e1"]},bindings:{key:"bindings",scope:"tags",path:"/blog/tags/bindings/",pageKeys:["v-3875825f","v-4dc135e3"]},compact_filters:{key:"compact_filters",scope:"tags",path:"/blog/tags/compact_filters/",pageKeys:["v-07ff1843"]},BIP157:{key:"BIP157",scope:"tags",path:"/blog/tags/BIP157/",pageKeys:["v-07ff1843"]},Neutrino:{key:"Neutrino",scope:"tags",path:"/blog/tags/Neutrino/",pageKeys:["v-07ff1843"]},guide:{key:"guide",scope:"tags",path:"/blog/tags/guide/",pageKeys:["v-9504490e","v-c6756cce","v-f58ec8f2","v-56536559","v-8534b9c2"]},descriptor:{key:"descriptor",scope:"tags",path:"/blog/tags/descriptor/",pageKeys:["v-9504490e","v-c6756cce","v-ab5ba3ce","v-8534b9c2"]},"paper wallets":{key:"paper wallets",scope:"tags",path:"/blog/tags/paper wallets/",pageKeys:["v-9504490e"]},bitcoin:{key:"bitcoin",scope:"tags",path:"/blog/tags/bitcoin/",pageKeys:["v-f58ec8f2","v-56536559"]},"React Native":{key:"React Native",scope:"tags",path:"/blog/tags/React Native/",pageKeys:["v-f58ec8f2","v-56536559"]},iOS:{key:"iOS",scope:"tags",path:"/blog/tags/iOS/",pageKeys:["v-f58ec8f2","v-56536559"]},Android:{key:"Android",scope:"tags",path:"/blog/tags/Android/",pageKeys:["v-f58ec8f2","v-56536559"]},mobile:{key:"mobile",scope:"tags",path:"/blog/tags/mobile/",pageKeys:["v-f58ec8f2","v-56536559"]},"bdk-rn":{key:"bdk-rn",scope:"tags",path:"/blog/tags/bdk-rn/",pageKeys:["v-f58ec8f2","v-56536559"]},bdk:{key:"bdk",scope:"tags",path:"/blog/tags/bdk/",pageKeys:["v-f58ec8f2","v-56536559","v-ab5ba3ce"]},fee:{key:"fee",scope:"tags",path:"/blog/tags/fee/",pageKeys:["v-015729b9","v-2c605799","v-57698579"]},"machine learning":{key:"machine learning",scope:"tags",path:"/blog/tags/machine learning/",pageKeys:["v-015729b9","v-2c605799","v-57698579"]},Flutter:{key:"Flutter",scope:"tags",path:"/blog/tags/Flutter/",pageKeys:["v-56536559"]},taproot:{key:"taproot",scope:"tags",path:"/blog/tags/taproot/",pageKeys:["v-9145467a","v-2cf72b39"]},miniscript:{key:"miniscript",scope:"tags",path:"/blog/tags/miniscript/",pageKeys:["v-9145467a","v-2cf72b39","v-ab5ba3ce","v-10852eea"]},"getting started":{key:"getting started",scope:"tags",path:"/blog/tags/getting started/",pageKeys:["v-5d749fce"]},rust:{key:"rust",scope:"tags",path:"/blog/tags/rust/",pageKeys:["v-5d749fce","v-edd5570e","v-05df4999","v-faad828e","v-0119984e","v-75d11339","v-7c3d28f9","v-0df1c3ce","v-1ac9ef4e"]},"Hardware Wallets":{key:"Hardware Wallets",scope:"tags",path:"/blog/tags/Hardware Wallets/",pageKeys:["v-11d64359","v-aeb70fce"]},"coin selection":{key:"coin selection",scope:"tags",path:"/blog/tags/coin selection/",pageKeys:["v-d0375c8e"]},development:{key:"development",scope:"tags",path:"/blog/tags/development/",pageKeys:["v-d0375c8e"]},"summer of bitcoin":{key:"summer of bitcoin",scope:"tags",path:"/blog/tags/summer of bitcoin/",pageKeys:["v-d0375c8e"]},"bitcoin-cli":{key:"bitcoin-cli",scope:"tags",path:"/blog/tags/bitcoin-cli/",pageKeys:["v-ab5ba3ce"]},security:{key:"security",scope:"tags",path:"/blog/tags/security/",pageKeys:["v-10852eea"]},release:{key:"release",scope:"tags",path:"/blog/tags/release/",pageKeys:["v-edd5570e","v-05df4999","v-faad828e","v-0119984e","v-75d11339","v-7c3d28f9","v-0df1c3ce","v-1ac9ef4e"]}},author:{"Steve Myers":{key:"Steve Myers",scope:"author",path:"/blog/author/Steve Myers/",pageKeys:["v-2c450c3f","v-5e744cf7","v-9504490e","v-8534b9c2"]},"Daniela Brozzoni":{key:"Daniela Brozzoni",scope:"author",path:"/blog/author/Daniela Brozzoni/",pageKeys:["v-2c450c3f","v-aeb70fce"]},"Rajarshi Maitra":{key:"Rajarshi Maitra",scope:"author",path:"/blog/author/Rajarshi Maitra/",pageKeys:["v-7c0c45f9","v-07ff1843","v-ab5ba3ce"]},"Lloyd Fournier":{key:"Lloyd Fournier",scope:"author",path:"/blog/author/Lloyd Fournier/",pageKeys:["v-2cebe183"]},waterst0ne:{key:"waterst0ne",scope:"author",path:"/blog/author/waterst0ne/",pageKeys:["v-0f4d5d15","v-8bd632d6"]},"Bitcoin Zavior":{key:"Bitcoin Zavior",scope:"author",path:"/blog/author/Bitcoin Zavior/",pageKeys:["v-3eaa044d","v-f58ec8f2","v-56536559"]},rorp:{key:"rorp",scope:"author",path:"/blog/author/rorp/",pageKeys:["v-353b78e1"]},thunderbiscuit:{key:"thunderbiscuit",scope:"author",path:"/blog/author/thunderbiscuit/",pageKeys:["v-3875825f","v-8534b9c2","v-4dc135e3"]},"Riccardo Casatta":{key:"Riccardo Casatta",scope:"author",path:"/blog/author/Riccardo Casatta/",pageKeys:["v-9504490e","v-015729b9","v-2c605799","v-57698579"]},"Gabriele Domenichini":{key:"Gabriele Domenichini",scope:"author",path:"/blog/author/Gabriele Domenichini/",pageKeys:["v-c6756cce"]},"Alekos Filini":{key:"Alekos Filini",scope:"author",path:"/blog/author/Alekos Filini/",pageKeys:["v-9145467a","v-2cf72b39","v-5d749fce","v-10852eea","v-edd5570e","v-05df4999","v-faad828e","v-0119984e","v-75d11339","v-7c3d28f9","v-0df1c3ce","v-1ac9ef4e","v-55969f39"]},Wszdexdrf:{key:"Wszdexdrf",scope:"author",path:"/blog/author/Wszdexdrf/",pageKeys:["v-11d64359"]},"César Alvarez Vallero":{key:"César Alvarez Vallero",scope:"author",path:"/blog/author/César Alvarez Vallero/",pageKeys:["v-d0375c8e"]},"Sandipan Dey":{key:"Sandipan Dey",scope:"author",path:"/blog/author/Sandipan Dey/",pageKeys:["v-ab5ba3ce"]}}};class el{constructor(t,e){this._metaMap=Object.assign({},t),Object.keys(this._metaMap).forEach(t=>{const{pageKeys:n}=this._metaMap[t];this._metaMap[t].pages=n.map(t=>function(t,e){for(let n=0;n{const{pages:n,path:o}=this._metaMap[e];t.push({name:e,pages:n,path:o})}),t}getItemByName(t){return this._metaMap[t]}}var nl={blog:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},tags:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},author:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1}},ol={blog:function(t,e,n){return t.pid===n&&t.id===e},tags:function(t,e,n){const o=e;return["tags"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})},author:function(t,e,n){const o=e;return["author","authors"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})}},il=[{pid:"blog",id:"blog",filter:ol.blog,sorter:nl.blog,pages:[{path:"/blog/",interval:[0,9]},{path:"/blog/page/2/",interval:[10,19]},{path:"/blog/page/3/",interval:[20,29]},{path:"/blog/page/4/",interval:[30,36]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"project",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/project/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tutorial",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tutorial/",interval:[0,7]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Bitcoin Core",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Bitcoin Core/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"RPC",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/RPC/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Wallet/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/architecture/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-cli/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"basics",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/basics/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"novice",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/novice/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"multi-sig",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/multi-sig/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK-RN",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK-RN/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Development/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Architecture/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tor/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/wallet/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"blockchain",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/blockchain/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bindings",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bindings/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"compact_filters",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/compact_filters/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BIP157",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BIP157/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Neutrino",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Neutrino/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"guide",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/guide/",interval:[0,5]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"descriptor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/descriptor/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"paper wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/paper wallets/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"React Native",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/React Native/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"iOS",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/iOS/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Android",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Android/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"mobile",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/mobile/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-rn",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-rn/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"fee",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/fee/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"machine learning",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/machine learning/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Flutter",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Flutter/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"taproot",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/taproot/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"miniscript",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/miniscript/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"getting started",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/getting started/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"rust",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/rust/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Hardware Wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Hardware Wallets/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"coin selection",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/coin selection/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/development/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"summer of bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/summer of bitcoin/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin-cli/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"security",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/security/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"release",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/release/",interval:[0,8]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Steve Myers",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Steve Myers/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Daniela Brozzoni",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Daniela Brozzoni/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Rajarshi Maitra",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Rajarshi Maitra/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Lloyd Fournier",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Lloyd Fournier/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"waterst0ne",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/waterst0ne/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Bitcoin Zavior",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Bitcoin Zavior/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"rorp",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/rorp/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"thunderbiscuit",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/thunderbiscuit/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Riccardo Casatta",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Riccardo Casatta/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Gabriele Domenichini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Gabriele Domenichini/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Alekos Filini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Alekos Filini/",interval:[0,9]},{path:"/blog/author/Alekos Filini/page/2/",interval:[10,13]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Wszdexdrf",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Wszdexdrf/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"César Alvarez Vallero",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/César Alvarez Vallero/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Sandipan Dey",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Sandipan Dey/",interval:[0,1]}],prevText:"Prev",nextText:"Next"}],rl=n(95);const al=n.n(rl)()("plugin-blog:pagination");class cl{constructor(t,e,n){al("pagination",t);const{pages:o,prevText:i,nextText:r}=t,{path:a}=n;this._prevText=i,this._nextText=r;for(let t=0,e=o.length;tt.filter(e,t.id,t.pid)).sort(t.sorter)}setIndexPage(t){this._indexPage=t}get length(){return this._paginationPages.length}get pages(){const[t,e]=this._currentPage.interval;return this._matchedPages.slice(t,e+1)}get hasPrev(){return 0!==this.paginationIndex}get prevLink(){return this.hasPrev?this.paginationIndex-1==0&&this._indexPage?this._indexPage:this._paginationPages[this.paginationIndex-1].path:null}get hasNext(){return this.paginationIndex!==this.length-1}get nextLink(){return this.hasNext?this._paginationPages[this.paginationIndex+1].path:null}get prevText(){return this._prevText}get nextText(){return this._nextText}getSpecificPageLink(t){return this._paginationPages[t].path}}const ll=new class{constructor(t){this.paginations=t}get pages(){return Vn.$vuepress.$get("siteData").pages}getPagination(t,e,n){al("id",e),al("pid",t);const o=this.paginations.filter(n=>n.id===e&&n.pid===t)[0];return new cl(o,this.pages,n)}}(il);var sl={comment:{enabled:!1,service:""},email:{enabled:!1},feed:{rss:!1,atom:!1,json:!1}},pl=[({router:t})=>{"undefined"!=typeof process&&"server"===process.env.VUE_ENV||t.onReady(()=>{const{app:e}=t;e.$once("hook:mounted",()=>{setTimeout(()=>{const{hash:t}=document.location;if(t.length>1){const e=t.substring(1),n=document.getElementById(e);n&&n.scrollIntoView()}},500)}),document.addEventListener("click",Gc),document.addEventListener("keyup",t=>{qc(t)&&Gc(t)})})},{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:t})=>{t.component("CodeCopy",Sc)},({Vue:t})=>{t.component("Mermaid",Yc)},({Vue:t})=>t.use(Qc.a),{},{},({Vue:t})=>{const e=Object.keys(tl).map(t=>{const e=tl[t],n="$"+t;return{[n](){const{pages:t}=this.$site;return new el(e,t)},["$current"+(t.charAt(0).toUpperCase()+t.slice(1))](){const t=this.$route.meta.id;return this[n].getItemByName(t)}}}).reduce((t,e)=>(Object.assign(t,e),t),{});e.$frontmatterKey=function(){const t=this["$"+this.$route.meta.id];return t||null},t.mixin({computed:e})},({Vue:t})=>{t.mixin({computed:{$pagination(){return this.$route.meta.pid&&this.$route.meta.id?this.$getPagination(this.$route.meta.pid,this.$route.meta.id):null}},methods:{$getPagination(t,e){return e=e||t,ll.getPagination(t,e,this.$route)}}})},({Vue:t})=>{const e={$service:()=>sl};t.mixin({computed:e})}],dl=[];class ul extends class{constructor(){this.store=new Vn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Vn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(ul.prototype,{getPageAsyncComponent:ac,getLayoutAsyncComponent:cc,getAsyncComponent:lc,getVueComponent:sc});var gl={install(t){const e=new ul;t.$vuepress=e,t.prototype.$vuepress=e}};function hl(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var ml={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return dc("pageKey",e),Vn.component(e)||Vn.component(e,ac(e)),Vn.component(e)?t(e):t("")}},fl={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},vl={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},bl=(n(249),n(250),Object(Kc.a)(vl,(function(){var t=this._self._c;return t("span",[t("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[t("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),t("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),yl={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Vn.config.productionTip=!1,Vn.use(Wa),Vn.use(gl),Vn.mixin(function(t,e,n=Vn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const o=new(t(n.$vuepress.$get("siteData"))),i=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(o)),r={};return Object.keys(i).reduce((t,e)=>(e.startsWith("$")&&(t[e]=i[e].get),t),r),{computed:r}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const o in t)"/"===o?n=t[o]:0===this.$page.path.indexOf(o)&&(e=t[o]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,o=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?o?o+" | "+n:n:o||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(t,e){for(let n=0;nn||(t.hash?!Vn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,o)=>{if(hl(t,e.path))o();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";hl(t,n)?o(n):o()}else o();else{const n=e.path+"/",i=e.path+".html";hl(t,i)?o(i):hl(t,n)?o(n):o()}})}(n);const o={};try{await Promise.all(pl.filter(t=>"function"==typeof t).map(e=>e({Vue:Vn,options:o,router:n,siteData:zc,isServer:t})))}catch(t){console.error(t)}return{app:new Vn(Object.assign(o,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},dl.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file +var o=Object.freeze({}),i=Array.isArray;function r(t){return null==t}function a(t){return null!=t}function c(t){return!0===t}function l(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function s(t){return"function"==typeof t}function p(t){return null!==t&&"object"==typeof t}var d=Object.prototype.toString;function u(t){return"[object Object]"===d.call(t)}function g(t){return"[object RegExp]"===d.call(t)}function h(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function m(t){return a(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===d?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function b(t,e){for(var n=Object.create(null),o=t.split(","),i=0;i-1)return t.splice(o,1)}}var k=Object.prototype.hasOwnProperty;function _(t,e){return k.call(t,e)}function B(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var D=/-(\w)/g,x=B((function(t){return t.replace(D,(function(t,e){return e?e.toUpperCase():""}))})),P=B((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),K=/\B([A-Z])/g,S=B((function(t){return t.replace(K,"-$1").toLowerCase()}));var T=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var o=arguments.length;return o?o>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;for(var n=t.length-e,o=new Array(n);n--;)o[n]=t[n+e];return o}function C(t,e){for(var n in e)t[n]=e[n];return t}function A(t){for(var e={},n=0;n0,J=Z&&Z.indexOf("edge/")>0;Z&&Z.indexOf("android");var Q=Z&&/iphone|ipad|ipod|ios/.test(Z);Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z);var tt,et=Z&&Z.match(/firefox\/(\d+)/),nt={}.watch,ot=!1;if(G)try{var it={};Object.defineProperty(it,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var rt=function(){return void 0===tt&&(tt=!G&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),tt},at=G&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ct(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,st="undefined"!=typeof Symbol&&ct(Symbol)&&"undefined"!=typeof Reflect&&ct(Reflect.ownKeys);lt="undefined"!=typeof Set&&ct(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pt=null;function dt(t){void 0===t&&(t=null),t||pt&&pt._scope.off(),pt=t,t&&t._scope.on()}var ut=function(){function t(t,e,n,o,i,r,a,c){this.tag=t,this.data=e,this.children=n,this.text=o,this.elm=i,this.ns=void 0,this.context=r,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=c,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),gt=function(t){void 0===t&&(t="");var e=new ut;return e.text=t,e.isComment=!0,e};function ht(t){return new ut(void 0,void 0,void 0,String(t))}function mt(t){var e=new ut(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ft=0,vt=[],bt=function(){function t(){this._pending=!1,this.id=ft++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,vt.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));for(var n=0,o=e.length;n0&&(Zt((s=t(s,"".concat(n||"","_").concat(o)))[0])&&Zt(d)&&(u[p]=ht(d.text+s[0].text),s.shift()),u.push.apply(u,s)):l(s)?Zt(d)?u[p]=ht(d.text+s):""!==s&&u.push(ht(s)):Zt(s)&&Zt(d)?u[p]=ht(d.text+s.text):(c(e._isVList)&&a(s.tag)&&r(s.key)&&a(n)&&(s.key="__vlist".concat(n,"_").concat(o,"__")),u.push(s)));return u}(t):void 0}function Zt(t){return a(t)&&a(t.text)&&!1===t.isComment}function Xt(t,e){var n,o,r,c,l=null;if(i(t)||"string"==typeof t)for(l=new Array(t.length),n=0,o=t.length;n0,c=e?!!e.$stable:!a,l=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(c&&i&&i!==o&&l===i.$key&&!a&&!i.$hasNormal)return i;for(var s in r={},e)e[s]&&"$"!==s[0]&&(r[s]=me(t,n,s,e[s]))}else r={};for(var p in n)p in r||(r[p]=fe(n,p));return e&&Object.isExtensible(e)&&(e._normalized=r),H(r,"$stable",c),H(r,"$key",l),H(r,"$hasNormal",a),r}function me(t,e,n,o){var r=function(){var e=pt;dt(t);var n=arguments.length?o.apply(null,arguments):o({}),r=(n=n&&"object"==typeof n&&!i(n)?[n]:Gt(n))&&n[0];return dt(e),n&&(!r||1===n.length&&r.isComment&&!ge(r))?void 0:n};return o.proxy&&Object.defineProperty(e,n,{get:r,enumerable:!0,configurable:!0}),r}function fe(t,e){return function(){return t[e]}}function ve(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};H(e,"_v_attr_proxy",!0),be(e,t.$attrs,o,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||be(t._listenersProxy={},t.$listeners,o,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||we(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:T(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach((function(n){return It(t,e,n)}))}}}function be(t,e,n,o,i){var r=!1;for(var a in e)a in t?e[a]!==n[a]&&(r=!0):(r=!0,ye(t,a,o,i));for(var a in t)a in e||(r=!0,delete t[a]);return r}function ye(t,e,n,o){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[o][e]}})}function we(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var ke=null;function _e(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),p(t)?e.extend(t):t}function Be(t){if(i(t))for(var e=0;edocument.createEvent("Event").timeStamp&&(ln=function(){return sn.now()})}var pn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function dn(){var t,e;for(cn=ln(),rn=!0,tn.sort(pn),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);on||(on=!0,Re(dn))}}function gn(t,e){if(t){for(var n=Object.create(null),o=st?Reflect.ownKeys(t):Object.keys(t),i=0;i-1)if(r&&!_(i,"default"))a=!1;else if(""===a||a===S(t)){var l=$n(String,i.type);(l<0||c-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!g(t)&&t.test(e)}function Xn(t,e){var n=t.cache,o=t.keys,i=t._vnode;for(var r in n){var a=n[r];if(a){var c=a.name;c&&!e(c)&&Yn(n,r,o,i)}}}function Yn(t,e,n,o){var i=t[e];!i||o&&i.tag===o.tag||i.componentInstance.$destroy(),t[e]=null,w(n,e)}Vn.prototype._init=function(t){var e=this;e._uid=Wn++,e._isVue=!0,e.__v_skip=!0,e._scope=new Nt(!0),e._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),o=e._parentVnode;n.parent=e.parent,n._parentVnode=o;var i=o.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Tn(Hn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ge(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=de(e._renderChildren,i),t.$scopedSlots=n?he(t.$parent,n.data.scopedSlots,t.$slots):o,t._c=function(e,n,o,i){return De(t,e,n,o,i,!1)},t.$createElement=function(e,n,o,i){return De(t,e,n,o,i,!0)};var r=n&&n.data;Ct(t,"$attrs",r&&r.attrs||o,null,!0),Ct(t,"$listeners",e._parentListeners||o,null,!0)}(e),Qe(e,"beforeCreate",void 0,!1),function(t){var e=gn(t.$options.inject,t);e&&(Kt(!1),Object.keys(e).forEach((function(n){Ct(t,n,e[n])})),Kt(!0))}(e),Rn(e),function(t){var e=t.$options.provide;if(e){var n=s(e)?e.call(t):e;if(!p(n))return;for(var o=Ut(t),i=st?Reflect.ownKeys(n):Object.keys(n),r=0;r1?O(n):n;for(var o=O(arguments,1),i='event handler for "'.concat(t,'"'),r=0,a=n.length;rparseInt(this.max)&&Yn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Yn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Xn(t,(function(t){return Zn(e,t)}))})),this.$watch("exclude",(function(e){Xn(t,(function(t){return!Zn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Be(t),n=e&&e.componentOptions;if(n){var o=Gn(n),i=this.include,r=this.exclude;if(i&&(!o||!Zn(i,o))||r&&o&&Zn(r,o))return e;var a=this.cache,c=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[l]?(e.componentInstance=a[l].componentInstance,w(c,l),c.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:_n,extend:C,mergeOptions:Tn,defineReactive:Ct},t.set=At,t.delete=Et,t.nextTick=Re,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,C(t.options.components,Qn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=O(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Tn(this.options,t),this}}(t),qn(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Vn),Object.defineProperty(Vn.prototype,"$isServer",{get:rt}),Object.defineProperty(Vn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Vn,"FunctionalRenderContext",{value:hn}),Vn.version="2.7.14";var to=b("style,class"),eo=b("input,textarea,option,select,progress"),no=b("contenteditable,draggable,spellcheck"),oo=b("events,caret,typing,plaintext-only"),io=b("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ro="http://www.w3.org/1999/xlink",ao=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},co=function(t){return ao(t)?t.slice(6,t.length):""},lo=function(t){return null==t||!1===t};function so(t){for(var e=t.data,n=t,o=t;a(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=po(o.data,e));for(;a(n=n.parent);)n&&n.data&&(e=po(e,n.data));return function(t,e){if(a(t)||a(e))return uo(t,go(e));return""}(e.staticClass,e.class)}function po(t,e){return{staticClass:uo(t.staticClass,e.staticClass),class:a(t.class)?[t.class,e.class]:e.class}}function uo(t,e){return t?e?t+" "+e:t:e||""}function go(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Mo(t,e,n):io(e)?lo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):no(e)?t.setAttribute(e,function(t,e){return lo(e)||"false"===e?"false":"contenteditable"===t&&oo(e)?e:"true"}(e,n)):ao(e)?lo(n)?t.removeAttributeNS(ro,co(e)):t.setAttributeNS(ro,e,n):Mo(t,e,n)}function Mo(t,e,n){if(lo(n))t.removeAttribute(e);else{if(X&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var o=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",o)};t.addEventListener("input",o),t.__ieph=!0}t.setAttribute(e,n)}}var Ro={create:$o,update:$o};function Io(t,e){var n=e.elm,o=e.data,i=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(i)||r(i.staticClass)&&r(i.class)))){var c=so(e),l=n._transitionClasses;a(l)&&(c=uo(c,go(l))),c!==n._prevClass&&(n.setAttribute("class",c),n._prevClass=c)}}var Lo,No={create:Io,update:Io};function Uo(t,e,n){var o=Lo;return function i(){var r=e.apply(null,arguments);null!==r&&Ho(t,i,n,o)}}var zo=Oe&&!(et&&Number(et[1])<=53);function Wo(t,e,n,o){if(zo){var i=cn,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Lo.addEventListener(t,e,ot?{capture:n,passive:o}:n)}function Ho(t,e,n,o){(o||Lo).removeEventListener(t,e._wrapper||e,n)}function Vo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},o=t.data.on||{};Lo=e.elm||t.elm,function(t){if(a(t.__r)){var e=X?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}a(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),Ht(n,o,Wo,Ho,Uo,e.context),Lo=void 0}}var qo,Go={create:Vo,update:Vo,destroy:function(t){return Vo(t,Do)}};function Zo(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,i=e.elm,l=t.data.domProps||{},s=e.data.domProps||{};for(n in(a(s.__ob__)||c(s._v_attr_proxy))&&(s=e.data.domProps=C({},s)),l)n in s||(i[n]="");for(n in s){if(o=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===l[n])continue;1===i.childNodes.length&&i.removeChild(i.childNodes[0])}if("value"===n&&"PROGRESS"!==i.tagName){i._value=o;var p=r(o)?"":String(o);Xo(i,p)&&(i.value=p)}else if("innerHTML"===n&&fo(i.tagName)&&r(i.innerHTML)){(qo=qo||document.createElement("div")).innerHTML="".concat(o,"");for(var d=qo.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;d.firstChild;)i.appendChild(d.firstChild)}else if(o!==l[n])try{i[n]=o}catch(t){}}}}function Xo(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(a(o)){if(o.number)return v(n)!==v(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Yo={create:Zo,update:Zo},Jo=B((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var o=t.split(n);o.length>1&&(e[o[0].trim()]=o[1].trim())}})),e}));function Qo(t){var e=ti(t.style);return t.staticStyle?C(t.staticStyle,e):e}function ti(t){return Array.isArray(t)?A(t):"string"==typeof t?Jo(t):t}var ei,ni=/^--/,oi=/\s*!important$/,ii=function(t,e,n){if(ni.test(e))t.style.setProperty(e,n);else if(oi.test(n))t.style.setProperty(S(e),n.replace(oi,""),"important");else{var o=ai(e);if(Array.isArray(n))for(var i=0,r=n.length;i-1?e.split(si).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function di(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(si).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),o=" "+e+" ";n.indexOf(o)>=0;)n=n.replace(o," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function ui(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&C(e,gi(t.name||"v")),C(e,t),e}return"string"==typeof t?gi(t):void 0}}var gi=B((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),hi=G&&!Y,mi="transition",fi="transitionend",vi="animation",bi="animationend";hi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(mi="WebkitTransition",fi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(vi="WebkitAnimation",bi="webkitAnimationEnd"));var yi=G?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function wi(t){yi((function(){yi(t)}))}function ki(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),pi(t,e))}function _i(t,e){t._transitionClasses&&w(t._transitionClasses,e),di(t,e)}function Bi(t,e,n){var o=xi(t,e),i=o.type,r=o.timeout,a=o.propCount;if(!i)return n();var c="transition"===i?fi:bi,l=0,s=function(){t.removeEventListener(c,p),n()},p=function(e){e.target===t&&++l>=a&&s()};setTimeout((function(){l0&&(n="transition",p=a,d=r.length):"animation"===e?s>0&&(n="animation",p=s,d=l.length):d=(n=(p=Math.max(a,s))>0?a>s?"transition":"animation":null)?"transition"===n?r.length:l.length:0,{type:n,timeout:p,propCount:d,hasTransform:"transition"===n&&Di.test(o[mi+"Property"])}}function Pi(t,e){for(;t.length1}function Ai(t,e){!0!==e.data.show&&Si(e)}var Ei=function(t){var e,n,o={},s=t.modules,p=t.nodeOps;for(e=0;eh?w(t,r(n[v+1])?null:n[v+1].elm,n,g,v,o):g>v&&_(e,d,h)}(d,m,v,n,s):a(v)?(a(t.text)&&p.setTextContent(d,""),w(d,null,v,0,v.length-1,n)):a(m)?_(m,0,m.length-1):a(t.text)&&p.setTextContent(d,""):t.text!==e.text&&p.setTextContent(d,e.text),a(h)&&a(g=h.hook)&&a(g=g.postpatch)&&g(t,e)}}}function P(t,e,n){if(c(n)&&a(t.parent))t.parent.data.pendingInsert=e;else for(var o=0;o-1,a.selected!==r&&(a.selected=r);else if(j(Ri(a),o))return void(t.selectedIndex!==c&&(t.selectedIndex=c));i||(t.selectedIndex=-1)}}function Mi(t,e){return e.every((function(e){return!j(e,t)}))}function Ri(t){return"_value"in t?t._value:t.value}function Ii(t){t.target.composing=!0}function Li(t){t.target.composing&&(t.target.composing=!1,Ni(t.target,"input"))}function Ni(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ui(t){return!t.componentInstance||t.data&&t.data.transition?t:Ui(t.componentInstance._vnode)}var zi={model:Fi,show:{bind:function(t,e,n){var o=e.value,i=(n=Ui(n)).data&&n.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;o&&i?(n.data.show=!0,Si(n,(function(){t.style.display=r}))):t.style.display=o?r:"none"},update:function(t,e,n){var o=e.value;!o!=!e.oldValue&&((n=Ui(n)).data&&n.data.transition?(n.data.show=!0,o?Si(n,(function(){t.style.display=t.__vOriginalDisplay})):Ti(n,(function(){t.style.display="none"}))):t.style.display=o?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,o,i){i||(t.style.display=t.__vOriginalDisplay)}}},Wi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Hi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Hi(Be(e.children)):t}function Vi(t){var e={},n=t.$options;for(var o in n.propsData)e[o]=t[o];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function qi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Gi=function(t){return t.tag||ge(t)},Zi=function(t){return"show"===t.name},Xi={name:"transition",props:Wi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Gi)).length){0;var o=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var r=Hi(i);if(!r)return i;if(this._leaving)return qi(t,i);var a="__transition-".concat(this._uid,"-");r.key=null==r.key?r.isComment?a+"comment":a+r.tag:l(r.key)?0===String(r.key).indexOf(a)?r.key:a+r.key:r.key;var c=(r.data||(r.data={})).transition=Vi(this),s=this._vnode,p=Hi(s);if(r.data.directives&&r.data.directives.some(Zi)&&(r.data.show=!0),p&&p.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(r,p)&&!ge(p)&&(!p.componentInstance||!p.componentInstance._vnode.isComment)){var d=p.data.transition=C({},c);if("out-in"===o)return this._leaving=!0,Vt(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),qi(t,i);if("in-out"===o){if(ge(r))return s;var u,g=function(){u()};Vt(c,"afterEnter",g),Vt(c,"enterCancelled",g),Vt(d,"delayLeave",(function(t){u=t}))}}return i}}},Yi=C({tag:String,moveClass:String},Wi);function Ji(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Qi(t){t.data.newPos=t.elm.getBoundingClientRect()}function tr(t){var e=t.data.pos,n=t.data.newPos,o=e.left-n.left,i=e.top-n.top;if(o||i){t.data.moved=!0;var r=t.elm.style;r.transform=r.WebkitTransform="translate(".concat(o,"px,").concat(i,"px)"),r.transitionDuration="0s"}}delete Yi.mode;var er={Transition:Xi,TransitionGroup:{props:Yi,beforeMount:function(){var t=this,e=this._update;this._update=function(n,o){var i=Xe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,o)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),o=this.prevChildren=this.children,i=this.$slots.default||[],r=this.children=[],a=Vi(this),c=0;c-1?bo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:bo[t]=/HTMLUnknownElement/.test(e.toString())},C(Vn.options.directives,zi),C(Vn.options.components,er),Vn.prototype.__patch__=G?Ei:E,Vn.prototype.$mount=function(t,e){return function(t,e,n){var o;t.$el=e,t.$options.render||(t.$options.render=gt),Qe(t,"beforeMount"),o=function(){t._update(t._render(),n)},new We(t,o,E,{before:function(){t._isMounted&&!t._isDestroyed&&Qe(t,"beforeUpdate")}},!0),n=!1;var i=t._preWatchers;if(i)for(var r=0;r=0&&(e=t.slice(o),t=t.slice(0,o));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(i.path||""),s=e&&e.path||"/",p=l.path?_r(l.path,s,n||i.append):s,d=function(t,e,n){void 0===e&&(e={});var o,i=n||sr;try{o=i(t||"")}catch(t){o={}}for(var r in e){var a=e[r];o[r]=Array.isArray(a)?a.map(lr):lr(a)}return o}(l.query,i.query,o&&o.options.parseQuery),u=i.hash||l.hash;return u&&"#"!==u.charAt(0)&&(u="#"+u),{_normalized:!0,path:p,query:d,hash:u}}var zr,Wr=function(){},Hr={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),r=i.location,a=i.route,c=i.href,l={},s=n.options.linkActiveClass,p=n.options.linkExactActiveClass,d=null==s?"router-link-active":s,u=null==p?"router-link-exact-active":p,g=null==this.activeClass?d:this.activeClass,h=null==this.exactActiveClass?u:this.exactActiveClass,m=a.redirectedFrom?ur(null,Ur(a.redirectedFrom),null,n):a;l[h]=vr(o,m,this.exactPath),l[g]=this.exact||this.exactPath?l[h]:function(t,e){return 0===t.path.replace(dr,"/").indexOf(e.path.replace(dr,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(o,m);var f=l[h]?this.ariaCurrentValue:null,v=function(t){Vr(t)&&(e.replace?n.replace(r,Wr):n.push(r,Wr))},b={click:Vr};Array.isArray(this.event)?this.event.forEach((function(t){b[t]=v})):b[this.event]=v;var y={class:l},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:c,route:a,navigate:v,isActive:l[g],isExactActive:l[h]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)y.on=b,y.attrs={href:c,"aria-current":f};else{var k=function t(e){var n;if(e)for(var o=0;o-1&&(c.params[u]=n.params[u]);return c.path=Nr(p.path,c.params),l(p,c,a)}if(c.path){c.params={};for(var g=0;g-1}function Ba(t,e){return _a(t)&&t._isRouter&&(null==e||t.type===e)}function Da(t,e,n){var o=function(i){i>=t.length?n():t[i]?e(t[i],(function(){o(i+1)})):o(i+1)};o(0)}function xa(t){return function(e,n,o){var i=!1,r=0,a=null;Pa(t,(function(t,e,n,c){if("function"==typeof t&&void 0===t.cid){i=!0,r++;var l,s=Ta((function(e){var i;((i=e).__esModule||Sa&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:zr.extend(e),n.components[c]=e,--r<=0&&o()})),p=Ta((function(t){var e="Failed to resolve async component "+c+": "+t;a||(a=_a(t)?t:new Error(e),o(a))}));try{l=t(s,p)}catch(t){p(t)}if(l)if("function"==typeof l.then)l.then(s,p);else{var d=l.component;d&&"function"==typeof d.then&&d.then(s,p)}}})),i||o()}}function Pa(t,e){return Ka(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ka(t){return Array.prototype.concat.apply([],t)}var Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ta(t){var e=!1;return function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(!e)return e=!0,t.apply(this,n)}}var Oa=function(t,e){this.router=t,this.base=function(t){if(!t)if(qr){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=hr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ca(t,e,n,o){var i=Pa(t,(function(t,o,i,r){var a=function(t,e){"function"!=typeof t&&(t=zr.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,o,i,r)})):n(a,o,i,r)}));return Ka(o?i.reverse():i)}function Aa(t,e){if(e)return function(){return t.apply(e,arguments)}}Oa.prototype.listen=function(t){this.cb=t},Oa.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Oa.prototype.onError=function(t){this.errorCbs.push(t)},Oa.prototype.transitionTo=function(t,e,n){var o,i=this;try{o=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var r=this.current;this.confirmTransition(o,(function(){i.updateRoute(o),e&&e(o),i.ensureURL(),i.router.afterHooks.forEach((function(t){t&&t(o,r)})),i.ready||(i.ready=!0,i.readyCbs.forEach((function(t){t(o)})))}),(function(t){n&&n(t),t&&!i.ready&&(Ba(t,va.redirected)&&r===hr||(i.ready=!0,i.readyErrorCbs.forEach((function(e){e(t)}))))}))},Oa.prototype.confirmTransition=function(t,e,n){var o=this,i=this.current;this.pending=t;var r,a,c=function(t){!Ba(t)&&_a(t)&&(o.errorCbs.length?o.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},l=t.matched.length-1,s=i.matched.length-1;if(vr(t,i)&&l===s&&t.matched[l]===i.matched[s])return this.ensureURL(),t.hash&&ra(this.router,i,t,!1),c(((a=wa(r=i,t,va.duplicated,'Avoided redundant navigation to current location: "'+r.fullPath+'".')).name="NavigationDuplicated",a));var p=function(t,e){var n,o=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,o=ha&&n;o&&this.listeners.push(ia());var i=function(){var n=t.current,i=Fa(t.base);t.current===hr&&i===t._startLocation||t.transitionTo(i,(function(t){o&&ra(e,t,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){ma(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){fa(Br(o.base+t.fullPath)),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Fa(this.base)!==this.current.fullPath){var e=Br(this.base+this.current.fullPath);t?ma(e):fa(e)}},e.prototype.getCurrentLocation=function(){return Fa(this.base)},e}(Oa);function Fa(t){var e=window.location.pathname,n=e.toLowerCase(),o=t.toLowerCase();return!t||n!==o&&0!==n.indexOf(Br(o+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var $a=function(t){function e(e,n,o){t.call(this,e,n),o&&function(t){var e=Fa(t);if(!/^\/#/.test(e))return window.location.replace(Br(t+"/#"+e)),!0}(this.base)||ja()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=ha&&e;n&&this.listeners.push(ia());var o=function(){var e=t.current;ja()&&t.transitionTo(Ma(),(function(o){n&&ra(t.router,o,e,!0),ha||La(o.fullPath)}))},i=ha?"popstate":"hashchange";window.addEventListener(i,o),this.listeners.push((function(){window.removeEventListener(i,o)}))}},e.prototype.push=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){Ia(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this,i=this.current;this.transitionTo(t,(function(t){La(t.fullPath),ra(o.router,t,i,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Ma()!==e&&(t?Ia(e):La(e))},e.prototype.getCurrentLocation=function(){return Ma()},e}(Oa);function ja(){var t=Ma();return"/"===t.charAt(0)||(La("/"+t),!1)}function Ma(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ra(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ia(t){ha?ma(Ra(t)):window.location.hash=t}function La(t){ha?fa(Ra(t)):window.location.replace(Ra(t))}var Na=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index+1).concat(t),o.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var o=this;this.transitionTo(t,(function(t){o.stack=o.stack.slice(0,o.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var o=this.stack[n];this.confirmTransition(o,(function(){var t=e.current;e.index=n,e.updateRoute(o),e.router.afterHooks.forEach((function(e){e&&e(o,t)}))}),(function(t){Ba(t,va.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Oa),Ua=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Xr(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ha&&!1!==t.fallback,this.fallback&&(e="hash"),qr||(e="abstract"),this.mode=e,e){case"history":this.history=new Ea(this,t.base);break;case"hash":this.history=new $a(this,t.base,this.fallback);break;case"abstract":this.history=new Na(this,t.base);break;default:0}},za={currentRoute:{configurable:!0}};Ua.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},za.currentRoute.get=function(){return this.history&&this.history.current},Ua.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Ea||n instanceof $a){var o=function(t){n.setupListeners(),function(t){var o=n.current,i=e.options.scrollBehavior;ha&&i&&"fullPath"in t&&ra(e,t,o,!1)}(t)};n.transitionTo(n.getCurrentLocation(),o,o)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ua.prototype.beforeEach=function(t){return Ha(this.beforeHooks,t)},Ua.prototype.beforeResolve=function(t){return Ha(this.resolveHooks,t)},Ua.prototype.afterEach=function(t){return Ha(this.afterHooks,t)},Ua.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ua.prototype.onError=function(t){this.history.onError(t)},Ua.prototype.push=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.push(t,e,n)}));this.history.push(t,e,n)},Ua.prototype.replace=function(t,e,n){var o=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){o.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ua.prototype.go=function(t){this.history.go(t)},Ua.prototype.back=function(){this.go(-1)},Ua.prototype.forward=function(){this.go(1)},Ua.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ua.prototype.resolve=function(t,e,n){var o=Ur(t,e=e||this.history.current,n,this),i=this.match(o,e),r=i.redirectedFrom||i.fullPath;return{location:o,route:i,href:function(t,e,n){var o="hash"===n?"#"+e:e;return t?Br(t+"/"+o):o}(this.history.base,r,this.mode),normalizedTo:o,resolved:i}},Ua.prototype.getRoutes=function(){return this.matcher.getRoutes()},Ua.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Ua.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==hr&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ua.prototype,za);var Wa=Ua;function Ha(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ua.install=function t(e){if(!t.installed||zr!==e){t.installed=!0,zr=e;var n=function(t){return void 0!==t},o=function(t,e){var o=t.$options._parentVnode;n(o)&&n(o=o.data)&&n(o=o.registerRouteInstance)&&o(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed:function(){o(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",wr),e.component("RouterLink",Hr);var i=e.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},Ua.version="3.6.5",Ua.isNavigationFailure=Ba,Ua.NavigationFailureType=va,Ua.START_LOCATION=hr,qr&&window.Vue&&window.Vue.use(Ua);n(53);n(100),n(46);var Va={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(23)]).then(n.bind(null,326)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(22)]).then(n.bind(null,287)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(32)]).then(n.bind(null,262)),"components/Home":()=>Promise.all([n.e(0),n.e(27)]).then(n.bind(null,327)),"components/NavLink":()=>n.e(43).then(n.bind(null,254)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,276)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,286)),"components/Page":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,298)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(28)]).then(n.bind(null,288)),"components/PageNav":()=>Promise.all([n.e(0),n.e(24)]).then(n.bind(null,289)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,269)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(33)]).then(n.bind(null,329)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,265)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(30)]).then(n.bind(null,263)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(7)]).then(n.bind(null,256)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398)),"global-components/CodeBlock":()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388)),"global-components/CodeGroup":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)),"layouts/404":()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),NotFound:()=>Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,390)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,391)),"components/Cases":()=>Promise.all([n.e(0),n.e(25)]).then(n.bind(null,328)),"components/Footer":()=>Promise.all([n.e(0),n.e(26)]).then(n.bind(null,270)),"components/LayoutWrap":()=>Promise.all([n.e(0),n.e(1),n.e(17)]).then(n.bind(null,277)),"components/PostMeta":()=>Promise.all([n.e(0),n.e(29)]).then(n.bind(null,299)),"layouts/DirectoryPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),"layouts/FrontmatterKey":()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),"layouts/FrontmatterPagination":()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),"layouts/IndexPost":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),"layouts/Post":()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395)),DirectoryPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(11)]).then(n.bind(null,392)),FrontmatterKey:()=>Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,393)),FrontmatterPagination:()=>Promise.all([n.e(0),n.e(1),n.e(2),n.e(12)]).then(n.bind(null,394)),IndexPost:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,325)),Post:()=>Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,395))},qa={"v-330a32a2":()=>n.e(45).then(n.bind(null,399)),"v-5e744cf7":()=>n.e(47).then(n.bind(null,400)),"v-7c0c45f9":()=>n.e(48).then(n.bind(null,401)),"v-2c450c3f":()=>n.e(46).then(n.bind(null,402)),"v-8bd632d6":()=>n.e(49).then(n.bind(null,403)),"v-2cebe183":()=>n.e(34).then(n.bind(null,404)),"v-0f4d5d15":()=>n.e(50).then(n.bind(null,405)),"v-353b78e1":()=>n.e(51).then(n.bind(null,406)),"v-3eaa044d":()=>n.e(31).then(n.bind(null,407)),"v-3875825f":()=>n.e(52).then(n.bind(null,408)),"v-07ff1843":()=>n.e(53).then(n.bind(null,409)),"v-9504490e":()=>n.e(54).then(n.bind(null,410)),"v-c6756cce":()=>n.e(55).then(n.bind(null,411)),"v-56536559":()=>n.e(19).then(n.bind(null,412)),"v-f58ec8f2":()=>n.e(21).then(n.bind(null,413)),"v-2c605799":()=>n.e(57).then(n.bind(null,414)),"v-015729b9":()=>n.e(56).then(n.bind(null,415)),"v-57698579":()=>n.e(58).then(n.bind(null,416)),"v-9145467a":()=>n.e(59).then(n.bind(null,417)),"v-2cf72b39":()=>n.e(60).then(n.bind(null,418)),"v-ab5ba3ce":()=>n.e(63).then(n.bind(null,419)),"v-11d64359":()=>n.e(61).then(n.bind(null,420)),"v-d0375c8e":()=>n.e(64).then(n.bind(null,421)),"v-5d749fce":()=>n.e(62).then(n.bind(null,422)),"v-10852eea":()=>n.e(65).then(n.bind(null,423)),"v-05df4999":()=>n.e(67).then(n.bind(null,424)),"v-edd5570e":()=>n.e(66).then(n.bind(null,425)),"v-faad828e":()=>n.e(68).then(n.bind(null,426)),"v-0df1c3ce":()=>n.e(71).then(n.bind(null,427)),"v-0119984e":()=>n.e(69).then(n.bind(null,428)),"v-7c3d28f9":()=>n.e(70).then(n.bind(null,429)),"v-75d11339":()=>n.e(72).then(n.bind(null,430)),"v-1ac9ef4e":()=>n.e(73).then(n.bind(null,431)),"v-55969f39":()=>n.e(74).then(n.bind(null,432)),"v-8534b9c2":()=>n.e(75).then(n.bind(null,433)),"v-aeb70fce":()=>n.e(76).then(n.bind(null,434)),"v-4dc135e3":()=>n.e(77).then(n.bind(null,435)),"v-30c0037b":()=>Promise.all([n.e(0),n.e(36)]).then(n.bind(null,436)),"v-4d760891":()=>Promise.all([n.e(0),n.e(35)]).then(n.bind(null,437)),"v-b936290e":()=>Promise.all([n.e(0),n.e(38)]).then(n.bind(null,438)),"v-4bb7844a":()=>Promise.all([n.e(0),n.e(37)]).then(n.bind(null,439)),"v-7afdbb4e":()=>Promise.all([n.e(0),n.e(39)]).then(n.bind(null,440)),"v-4e0b610e":()=>Promise.all([n.e(0),n.e(40)]).then(n.bind(null,441)),"v-a7c24c4e":()=>Promise.all([n.e(0),n.e(41)]).then(n.bind(null,442)),"v-17019aeb":()=>Promise.all([n.e(0),n.e(42)]).then(n.bind(null,443)),"v-7a315e41":()=>n.e(78).then(n.bind(null,444)),"v-f611a14e":()=>n.e(79).then(n.bind(null,445)),"v-3acb6e6a":()=>n.e(80).then(n.bind(null,446)),"v-0b3b65ea":()=>n.e(82).then(n.bind(null,447)),"v-a76bccee":()=>n.e(83).then(n.bind(null,448)),"v-496cb7f9":()=>n.e(81).then(n.bind(null,396)),"v-05d01c19":()=>n.e(84).then(n.bind(null,449)),"v-11bf335e":()=>n.e(85).then(n.bind(null,450)),"v-29f9f21c":()=>n.e(87).then(n.bind(null,451)),"v-a9236c10":()=>n.e(86).then(n.bind(null,452)),"v-3750297a":()=>n.e(88).then(n.bind(null,453)),"v-c152529c":()=>n.e(91).then(n.bind(null,454)),"v-08589c4e":()=>n.e(90).then(n.bind(null,455)),"v-50aa6d4e":()=>n.e(92).then(n.bind(null,456)),"v-105750ce":()=>n.e(89).then(n.bind(null,457)),"v-4bcdac39":()=>n.e(93).then(n.bind(null,458))};function Ga(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const Za=/-(\w)/g,Xa=Ga(t=>t.replace(Za,(t,e)=>e?e.toUpperCase():"")),Ya=/\B([A-Z])/g,Ja=Ga(t=>t.replace(Ya,"-$1").toLowerCase()),Qa=Ga(t=>t.charAt(0).toUpperCase()+t.slice(1));function tc(t,e){if(!e)return;if(t(e))return t(e);return e.includes("-")?t(Qa(Xa(e))):t(Qa(e))||t(Ja(e))}const ec=Object.assign({},Va,qa),nc=t=>ec[t],oc=t=>qa[t],ic=t=>Va[t],rc=t=>Vn.component(t);function ac(t){return tc(oc,t)}function cc(t){return tc(ic,t)}function lc(t){return tc(nc,t)}function sc(t){return tc(rc,t)}function pc(...t){return Promise.all(t.filter(t=>t).map(async t=>{if(!sc(t)&&lc(t)){const e=await lc(t)();Vn.component(t,e.default)}}))}function dc(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}var uc=n(91),gc=n.n(uc),hc=n(92),mc=n.n(hc),fc={created(){if(this.siteMeta=this.$site.headTags.filter(([t])=>"meta"===t).map(([t,e])=>e),this.$ssrContext){const e=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(t=e)?t.map(t=>{let e="{e+=` ${n}="${mc()(t[n])}"`}),e+">"}).join("\n "):"",this.$ssrContext.canonicalLink=bc(this.$canonicalUrl)}var t},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const t=this.getMergedMetaTags();this.currentMetaTags=yc(t,this.currentMetaTags)},getMergedMetaTags(){const t=this.$page.frontmatter.meta||[];return gc()([{name:"description",content:this.$description}],t,this.siteMeta,wc)},updateCanonicalLink(){vc(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",bc(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){yc(null,this.currentMetaTags),vc()}};function vc(){const t=document.querySelector("link[rel='canonical']");t&&t.remove()}function bc(t=""){return t?``:""}function yc(t,e){if(e&&[...e].filter(t=>t.parentNode===document.head).forEach(t=>document.head.removeChild(t)),t)return t.map(t=>{const e=document.createElement("meta");return Object.keys(t).forEach(n=>{e.setAttribute(n,t[n])}),document.head.appendChild(e),e})}function wc(t){for(const e of["name","property","itemprop"])if(t.hasOwnProperty(e))return t[e]+e;return JSON.stringify(t)}var kc=n(93),_c={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(kc)()((function(){this.setActiveHash()}),300),setActiveHash(){const t=[].slice.call(document.querySelectorAll(".sidebar-link")),e=[].slice.call(document.querySelectorAll(".header-anchor")).filter(e=>t.some(t=>t.hash===e.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),i=window.innerHeight+n;for(let t=0;t=r.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Bc=n(22),Dc=n.n(Bc),xc={mounted(){Dc.a.configure({showSpinner:!1}),this.$router.beforeEach((t,e,n)=>{t.path===e.path||Vn.component(t.name)||Dc.a.start(),n()}),this.$router.afterEach(()=>{Dc.a.done(),this.isSidebarOpen=!1})}},Pc={props:{parent:Object,code:String,options:{align:String,color:String,backgroundTransition:Boolean,backgroundColor:String,successText:String,staticIcon:Boolean}},data:()=>({success:!1,originalBackground:null,originalTransition:null}),computed:{alignStyle(){let t={};return t[this.options.align]="7.5px",t},iconClass(){return this.options.staticIcon?"":"hover"}},mounted(){this.originalTransition=this.parent.style.transition,this.originalBackground=this.parent.style.background},beforeDestroy(){this.parent.style.transition=this.originalTransition,this.parent.style.background=this.originalBackground},methods:{hexToRgb(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},copyToClipboard(t){if(navigator.clipboard)navigator.clipboard.writeText(this.code).then(()=>{this.setSuccessTransitions()},()=>{});else{let t=document.createElement("textarea");document.body.appendChild(t),t.value=this.code,t.select(),document.execCommand("Copy"),t.remove(),this.setSuccessTransitions()}},setSuccessTransitions(){if(clearTimeout(this.successTimeout),this.options.backgroundTransition){this.parent.style.transition="background 350ms";let t=this.hexToRgb(this.options.backgroundColor);this.parent.style.background=`rgba(${t.r}, ${t.g}, ${t.b}, 0.1)`}this.success=!0,this.successTimeout=setTimeout(()=>{this.options.backgroundTransition&&(this.parent.style.background=this.originalBackground,this.parent.style.transition=this.originalTransition),this.success=!1},500)}}},Kc=(n(240),n(7)),Sc=Object(Kc.a)(Pc,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"code-copy"},[e("svg",{class:t.iconClass,style:t.alignStyle,attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},on:{click:t.copyToClipboard}},[e("path",{attrs:{fill:"none",d:"M0 0h24v24H0z"}}),t._v(" "),e("path",{attrs:{fill:t.options.color,d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}})]),t._v(" "),e("span",{class:t.success?"success":"",style:t.alignStyle},[t._v("\n "+t._s(t.options.successText)+"\n ")])])}),[],!1,null,"49140617",null).exports,Tc=(n(241),{updated(){this.update()},methods:{update(){setTimeout(()=>{document.querySelectorAll('div[class*="language-"] pre').forEach(t=>{if(t.classList.contains("code-copy-added"))return;let e=new(Vn.extend(Sc));e.options={align:"bottom",color:"#8F979E",backgroundTransition:!1,backgroundColor:"#0075b8",successText:"Copied!",staticIcon:!0},e.code=t.innerText,e.parent=t,e.$mount(),t.classList.add("code-copy-added"),t.appendChild(e.$el)})},100)}}}),Oc=(n(242),Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=window.Promise||function(t){function e(){}t(e,e)},i=function(t){var e=t.target;e!==x?-1!==y.indexOf(e)&&m({target:e}):h()},r=function(){if(!k&&D.original){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(_-t)>B.scrollOffset&&setTimeout(h,150)}},a=function(t){var e=t.key||t.keyCode;"Escape"!==e&&"Esc"!==e&&27!==e||h()},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t;if(t.background&&(x.style.background=t.background),t.container&&t.container instanceof Object&&(e.container=Oc({},B.container,t.container)),t.template){var n=Ac(t.template)?t.template:document.querySelector(t.template);e.template=n}return B=Oc({},B,e),y.forEach((function(t){t.dispatchEvent(Mc("medium-zoom:update",{detail:{zoom:P}}))})),P},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(Oc({},B,e))},s=function(){for(var t=arguments.length,e=Array(t),n=0;n0?e.reduce((function(t,e){return[].concat(t,Fc(e))}),[]):y;return o.forEach((function(t){t.classList.remove("medium-zoom-image"),t.dispatchEvent(Mc("medium-zoom:detach",{detail:{zoom:P}}))})),y=y.filter((function(t){return-1===o.indexOf(t)})),P},d=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.addEventListener("medium-zoom:"+t,e,n)})),w.push({type:"medium-zoom:"+t,listener:e,options:n}),P},u=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return y.forEach((function(o){o.removeEventListener("medium-zoom:"+t,e,n)})),w=w.filter((function(n){return!(n.type==="medium-zoom:"+t&&n.listener.toString()===e.toString())})),P},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},e=void 0,n=void 0;if(B.container)if(B.container instanceof Object)e=(t=Oc({},t,B.container)).width-t.left-t.right-2*B.margin,n=t.height-t.top-t.bottom-2*B.margin;else{var o=(Ac(B.container)?B.container:document.querySelector(B.container)).getBoundingClientRect(),i=o.width,r=o.height,a=o.left,c=o.top;t=Oc({},t,{width:i,height:r,left:a,top:c})}e=e||t.width-2*B.margin,n=n||t.height-2*B.margin;var l=D.zoomedHd||D.original,s=Ec(l)?e:l.naturalWidth||e,p=Ec(l)?n:l.naturalHeight||n,d=l.getBoundingClientRect(),u=d.top,g=d.left,h=d.width,m=d.height,f=Math.min(Math.max(h,s),e)/h,v=Math.min(Math.max(m,p),n)/m,b=Math.min(f,v),y="scale("+b+") translate3d("+((e-h)/2-g+B.margin+t.left)/b+"px, "+((n-m)/2-u+B.margin+t.top)/b+"px, 0)";D.zoomed.style.transform=y,D.zoomedHd&&(D.zoomedHd.style.transform=y)};return new o((function(t){if(e&&-1===y.indexOf(e))t(P);else{if(D.zoomed)t(P);else{if(e)D.original=e;else{if(!(y.length>0))return void t(P);var o=y;D.original=o[0]}if(D.original.dispatchEvent(Mc("medium-zoom:open",{detail:{zoom:P}})),_=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,k=!0,D.zoomed=jc(D.original),document.body.appendChild(x),B.template){var i=Ac(B.template)?B.template:document.querySelector(B.template);D.template=document.createElement("div"),D.template.appendChild(i.content.cloneNode(!0)),document.body.appendChild(D.template)}if(D.original.parentElement&&"PICTURE"===D.original.parentElement.tagName&&D.original.currentSrc&&(D.zoomed.src=D.original.currentSrc),document.body.appendChild(D.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),D.original.classList.add("medium-zoom-image--hidden"),D.zoomed.classList.add("medium-zoom-image--opened"),D.zoomed.addEventListener("click",h),D.zoomed.addEventListener("transitionend",(function e(){k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:opened",{detail:{zoom:P}})),t(P)})),D.original.getAttribute("data-zoom-src")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("srcset"),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading"),D.zoomedHd.src=D.zoomed.getAttribute("data-zoom-src"),D.zoomedHd.onerror=function(){clearInterval(r),console.warn("Unable to reach the zoom image target "+D.zoomedHd.src),D.zoomedHd=null,n()};var r=setInterval((function(){D.zoomedHd.complete&&(clearInterval(r),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n())}),10)}else if(D.original.hasAttribute("srcset")){D.zoomedHd=D.zoomed.cloneNode(),D.zoomedHd.removeAttribute("sizes"),D.zoomedHd.removeAttribute("loading");var a=D.zoomedHd.addEventListener("load",(function(){D.zoomedHd.removeEventListener("load",a),D.zoomedHd.classList.add("medium-zoom-image--opened"),D.zoomedHd.addEventListener("click",h),document.body.appendChild(D.zoomedHd),n()}))}else n()}}}))},h=function(){return new o((function(t){if(!k&&D.original){k=!0,document.body.classList.remove("medium-zoom--opened"),D.zoomed.style.transform="",D.zoomedHd&&(D.zoomedHd.style.transform=""),D.template&&(D.template.style.transition="opacity 150ms",D.template.style.opacity=0),D.original.dispatchEvent(Mc("medium-zoom:close",{detail:{zoom:P}})),D.zoomed.addEventListener("transitionend",(function e(){D.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(D.zoomed),D.zoomedHd&&document.body.removeChild(D.zoomedHd),document.body.removeChild(x),D.zoomed.classList.remove("medium-zoom-image--opened"),D.template&&document.body.removeChild(D.template),k=!1,D.zoomed.removeEventListener("transitionend",e),D.original.dispatchEvent(Mc("medium-zoom:closed",{detail:{zoom:P}})),D.original=null,D.zoomed=null,D.zoomedHd=null,D.template=null,t(P)}))}else t(P)}))},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target;return D.original?h():g({target:e})},f=function(){return B},v=function(){return y},b=function(){return D.original},y=[],w=[],k=!1,_=0,B=n,D={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(e)?B=e:(e||"string"==typeof e)&&s(e),B=Oc({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},B);var x=$c(B.background);document.addEventListener("click",i),document.addEventListener("keyup",a),document.addEventListener("scroll",r),window.addEventListener("resize",h);var P={open:g,close:h,toggle:m,update:c,clone:l,attach:s,detach:p,on:d,off:u,getOptions:f,getImages:v,getZoomedImage:b};return P},Ic=[fc,_c,xc,Tc,{data:()=>({zoom:null}),mounted(){this.updateZoom()},updated(){this.updateZoom()},methods:{updateZoom(){setTimeout(()=>{this.zoom&&this.zoom.detach(),this.zoom=Rc(".theme-default-content :not(a) > img",void 0)},1e3)}}}],Lc={name:"GlobalLayout",computed:{layout(){const t=this.getLayout();return dc("layout",t),Vn.component(t)}},methods:{getLayout(){if(this.$page.path){const t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},Nc=Object(Kc.a)(Lc,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),t[e].push(...n);break;default:throw new Error("Unknown option name.")}}(Nc,"mixins",Ic);const Uc=[{name:"v-330a32a2",path:"/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-330a32a2").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-5e744cf7",path:"/blog/_2024-q1-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5e744cf7").then(n)}},{path:"/blog/_2024-q1-update/index.html",redirect:"/blog/_2024-q1-update/"},{path:"/_blog/2024_q1_update.html",redirect:"/blog/_2024-q1-update/"},{name:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c0c45f9").then(n)}},{path:"/blog/bitcoin-core-rpc-demo/index.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{path:"/_blog/Bitcoin_Core_RPC_Demo.html",redirect:"/blog/bitcoin-core-rpc-demo/"},{name:"v-2c450c3f",path:"/blog/_2023-q4-update/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c450c3f").then(n)}},{path:"/blog/_2023-q4-update/index.html",redirect:"/blog/_2023-q4-update/"},{path:"/_blog/2023_q4_update.html",redirect:"/blog/_2023-q4-update/"},{name:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8bd632d6").then(n)}},{path:"/blog/bdk-cli-basics-multisig-2of3/index.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{path:"/_blog/bdk-cli_basics_multisig_2of3.html",redirect:"/blog/bdk-cli-basics-multisig-2of3/"},{name:"v-2cebe183",path:"/blog/bdk-core-pt1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cebe183").then(n)}},{path:"/blog/bdk-core-pt1/index.html",redirect:"/blog/bdk-core-pt1/"},{path:"/_blog/bdk_core_pt1.html",redirect:"/blog/bdk-core-pt1/"},{name:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0f4d5d15").then(n)}},{path:"/blog/bdk-cli-basics/index.html",redirect:"/blog/bdk-cli-basics/"},{path:"/_blog/bdk_cli_basics.html",redirect:"/blog/bdk-cli-basics/"},{name:"v-353b78e1",path:"/blog/bdk-with-tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-353b78e1").then(n)}},{path:"/blog/bdk-with-tor/index.html",redirect:"/blog/bdk-with-tor/"},{path:"/_blog/bdk_with_tor.html",redirect:"/blog/bdk-with-tor/"},{name:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3eaa044d").then(n)}},{path:"/blog/bdk-rn-making-of/index.html",redirect:"/blog/bdk-rn-making-of/"},{path:"/_blog/bdk_rn_making_of.html",redirect:"/blog/bdk-rn-making-of/"},{name:"v-3875825f",path:"/blog/bindings-scope/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-3875825f").then(n)}},{path:"/blog/bindings-scope/index.html",redirect:"/blog/bindings-scope/"},{path:"/_blog/bindings-scope.html",redirect:"/blog/bindings-scope/"},{name:"v-07ff1843",path:"/blog/compact-filters-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-07ff1843").then(n)}},{path:"/blog/compact-filters-demo/index.html",redirect:"/blog/compact-filters-demo/"},{path:"/_blog/compact_filters_demo.html",redirect:"/blog/compact-filters-demo/"},{name:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9504490e").then(n)}},{path:"/blog/descriptor-based-paper-wallet/index.html",redirect:"/blog/descriptor-based-paper-wallet/"},{path:"/_blog/descriptor_based_paper_wallet.html",redirect:"/blog/descriptor-based-paper-wallet/"},{name:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-c6756cce").then(n)}},{path:"/blog/descriptors-in-the-wild/index.html",redirect:"/blog/descriptors-in-the-wild/"},{path:"/_blog/descriptors_in_the_wild.html",redirect:"/blog/descriptors-in-the-wild/"},{name:"v-56536559",path:"/blog/exploring-bdk-flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-56536559").then(n)}},{path:"/blog/exploring-bdk-flutter/index.html",redirect:"/blog/exploring-bdk-flutter/"},{path:"/_blog/exploring_bdk_flutter.html",redirect:"/blog/exploring-bdk-flutter/"},{name:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-f58ec8f2").then(n)}},{path:"/blog/exploring-bdk-rn/index.html",redirect:"/blog/exploring-bdk-rn/"},{path:"/_blog/exploring_bdk_rn.html",redirect:"/blog/exploring-bdk-rn/"},{name:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2c605799").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{path:"/_blog/fee_estimation_for_light_clients_part_2.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-015729b9").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{path:"/_blog/fee_estimation_for_light_clients_part_1.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-57698579").then(n)}},{path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/index.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{path:"/_blog/fee_estimation_for_light_clients_part_3.html",redirect:"/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-9145467a").then(n)}},{path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/index.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{path:"/_blog/first_bdk_taproot_tx.html",redirect:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-2cf72b39").then(n)}},{path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/index.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{path:"/_blog/first_bdk_taproot_tx_part_2.html",redirect:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-ab5ba3ce").then(n)}},{path:"/blog/hidden-power-of-bitcoin/index.html",redirect:"/blog/hidden-power-of-bitcoin/"},{path:"/_blog/hidden-power-of-bitcoin.html",redirect:"/blog/hidden-power-of-bitcoin/"},{name:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-11d64359").then(n)}},{path:"/blog/getting-started-with-rust-hwi/index.html",redirect:"/blog/getting-started-with-rust-hwi/"},{path:"/_blog/getting_started_with_rust_hwi.html",redirect:"/blog/getting-started-with-rust-hwi/"},{name:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-d0375c8e").then(n)}},{path:"/blog/improving-coin-selection-in-bdk/index.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{path:"/_blog/improving_coin_selection_in_BDK.html",redirect:"/blog/improving-coin-selection-in-bdk/"},{name:"v-5d749fce",path:"/blog/2020/12/hello-world/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-5d749fce").then(n)}},{path:"/blog/2020/12/hello-world/index.html",redirect:"/blog/2020/12/hello-world/"},{path:"/_blog/hello-world.html",redirect:"/blog/2020/12/hello-world/"},{name:"v-10852eea",path:"/blog/miniscript-vulnerability/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-10852eea").then(n)}},{path:"/blog/miniscript-vulnerability/index.html",redirect:"/blog/miniscript-vulnerability/"},{path:"/_blog/miniscript_vulnerability.html",redirect:"/blog/miniscript-vulnerability/"},{name:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-05df4999").then(n)}},{path:"/blog/2021/01/release-v0.3.0/index.html",redirect:"/blog/2021/01/release-v0.3.0/"},{path:"/_blog/release-0.3.0.html",redirect:"/blog/2021/01/release-v0.3.0/"},{name:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-edd5570e").then(n)}},{path:"/blog/2020/12/release-v0.2.0/index.html",redirect:"/blog/2020/12/release-v0.2.0/"},{path:"/_blog/release-0.2.0.html",redirect:"/blog/2020/12/release-v0.2.0/"},{name:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-faad828e").then(n)}},{path:"/blog/2021/02/release-v0.4.0/index.html",redirect:"/blog/2021/02/release-v0.4.0/"},{path:"/_blog/release-0.4.0.html",redirect:"/blog/2021/02/release-v0.4.0/"},{name:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0df1c3ce").then(n)}},{path:"/blog/2021/05/release-v0.7.0/index.html",redirect:"/blog/2021/05/release-v0.7.0/"},{path:"/_blog/release-0.7.0.html",redirect:"/blog/2021/05/release-v0.7.0/"},{name:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-0119984e").then(n)}},{path:"/blog/2021/03/release-v0.5.0/index.html",redirect:"/blog/2021/03/release-v0.5.0/"},{path:"/_blog/release-0.5.0.html",redirect:"/blog/2021/03/release-v0.5.0/"},{name:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-7c3d28f9").then(n)}},{path:"/blog/2021/04/release-v0.6.0/index.html",redirect:"/blog/2021/04/release-v0.6.0/"},{path:"/_blog/release-0.6.0.html",redirect:"/blog/2021/04/release-v0.6.0/"},{name:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-75d11339").then(n)}},{path:"/blog/2021/06/release-v0.8.0/index.html",redirect:"/blog/2021/06/release-v0.8.0/"},{path:"/_blog/release-0.8.0.html",redirect:"/blog/2021/06/release-v0.8.0/"},{name:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-1ac9ef4e").then(n)}},{path:"/blog/2021/07/release-v0.9.0/index.html",redirect:"/blog/2021/07/release-v0.9.0/"},{path:"/_blog/release-0.9.0.html",redirect:"/blog/2021/07/release-v0.9.0/"},{name:"v-55969f39",path:"/blog/road-to-bdk-1/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-55969f39").then(n)}},{path:"/blog/road-to-bdk-1/index.html",redirect:"/blog/road-to-bdk-1/"},{path:"/_blog/road_to_bdk_1.html",redirect:"/blog/road-to-bdk-1/"},{name:"v-8534b9c2",path:"/blog/spending-policy-demo/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-8534b9c2").then(n)}},{path:"/blog/spending-policy-demo/index.html",redirect:"/blog/spending-policy-demo/"},{path:"/_blog/spending_policy_demo.html",redirect:"/blog/spending-policy-demo/"},{name:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-aeb70fce").then(n)}},{path:"/blog/using-bdk-with-hardware-wallets/index.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{path:"/_blog/using_bdk_with_hardware_wallets.html",redirect:"/blog/using-bdk-with-hardware-wallets/"},{name:"v-4dc135e3",path:"/blog/why-bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("Post","v-4dc135e3").then(n)}},{path:"/blog/why-bindings/index.html",redirect:"/blog/why-bindings/"},{path:"/_blog/why-bindings.html",redirect:"/blog/why-bindings/"},{name:"v-30c0037b",path:"/adoption/custodial/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-30c0037b").then(n)}},{path:"/adoption/custodial/index.html",redirect:"/adoption/custodial/"},{path:"/adoption/custodial.html",redirect:"/adoption/custodial/"},{name:"v-4d760891",path:"/adoption/all/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4d760891").then(n)}},{path:"/adoption/all/index.html",redirect:"/adoption/all/"},{path:"/adoption/all.html",redirect:"/adoption/all/"},{name:"v-b936290e",path:"/adoption/exchange/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-b936290e").then(n)}},{path:"/adoption/exchange/index.html",redirect:"/adoption/exchange/"},{path:"/adoption/exchange.html",redirect:"/adoption/exchange/"},{name:"v-4bb7844a",path:"/adoption/desktop/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bb7844a").then(n)}},{path:"/adoption/desktop/index.html",redirect:"/adoption/desktop/"},{path:"/adoption/desktop.html",redirect:"/adoption/desktop/"},{name:"v-7afdbb4e",path:"/adoption/hardware/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7afdbb4e").then(n)}},{path:"/adoption/hardware/index.html",redirect:"/adoption/hardware/"},{path:"/adoption/hardware.html",redirect:"/adoption/hardware/"},{name:"v-4e0b610e",path:"/adoption/infrastructure/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4e0b610e").then(n)}},{path:"/adoption/infrastructure/index.html",redirect:"/adoption/infrastructure/"},{path:"/adoption/infrastructure.html",redirect:"/adoption/infrastructure/"},{name:"v-a7c24c4e",path:"/adoption/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a7c24c4e").then(n)}},{path:"/adoption/mobile/index.html",redirect:"/adoption/mobile/"},{path:"/adoption/mobile.html",redirect:"/adoption/mobile/"},{name:"v-17019aeb",path:"/adoption/web/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-17019aeb").then(n)}},{path:"/adoption/web/index.html",redirect:"/adoption/web/"},{path:"/adoption/web.html",redirect:"/adoption/web/"},{name:"v-7a315e41",path:"/bdk-cli/compiler/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-7a315e41").then(n)}},{path:"/bdk-cli/compiler/index.html",redirect:"/bdk-cli/compiler/"},{path:"/bdk-cli/compiler.html",redirect:"/bdk-cli/compiler/"},{name:"v-f611a14e",path:"/bdk-cli/concept/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-f611a14e").then(n)}},{path:"/bdk-cli/concept/index.html",redirect:"/bdk-cli/concept/"},{path:"/bdk-cli/concept.html",redirect:"/bdk-cli/concept/"},{name:"v-3acb6e6a",path:"/bdk-cli/installation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3acb6e6a").then(n)}},{path:"/bdk-cli/installation/index.html",redirect:"/bdk-cli/installation/"},{path:"/bdk-cli/installation.html",redirect:"/bdk-cli/installation/"},{name:"v-0b3b65ea",path:"/bdk-cli/introduction/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-0b3b65ea").then(n)}},{path:"/bdk-cli/introduction/index.html",redirect:"/bdk-cli/introduction/"},{path:"/bdk-cli/introduction.html",redirect:"/bdk-cli/introduction/"},{name:"v-a76bccee",path:"/bdk-cli/playground/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a76bccee").then(n)}},{path:"/bdk-cli/playground/index.html",redirect:"/bdk-cli/playground/"},{path:"/bdk-cli/playground.html",redirect:"/bdk-cli/playground/"},{name:"v-496cb7f9",path:"/bdk-cli/interface/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-496cb7f9").then(n)}},{path:"/bdk-cli/interface/index.html",redirect:"/bdk-cli/interface/"},{path:"/bdk-cli/interface.html",redirect:"/bdk-cli/interface/"},{name:"v-05d01c19",path:"/bdk-cli/regtest/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-05d01c19").then(n)}},{path:"/bdk-cli/regtest/index.html",redirect:"/bdk-cli/regtest/"},{path:"/bdk-cli/regtest.html",redirect:"/bdk-cli/regtest/"},{name:"v-11bf335e",path:"/case-studies/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-11bf335e").then(n)}},{path:"/case-studies/index.html",redirect:"/case-studies/"},{path:"/case-studies.html",redirect:"/case-studies/"},{name:"v-29f9f21c",path:"/examples/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-29f9f21c").then(n)}},{path:"/examples/index.html",redirect:"/examples/"},{name:"v-a9236c10",path:"/descriptors/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-a9236c10").then(n)}},{path:"/descriptors/index.html",redirect:"/descriptors/"},{name:"v-3750297a",path:"/foundation/about/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-3750297a").then(n)}},{path:"/foundation/about/index.html",redirect:"/foundation/about/"},{path:"/foundation/about.html",redirect:"/foundation/about/"},{name:"v-c152529c",path:"/foundation/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-c152529c").then(n)}},{path:"/foundation/index.html",redirect:"/foundation/"},{name:"v-08589c4e",path:"/foundation/grants/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-08589c4e").then(n)}},{path:"/foundation/grants/index.html",redirect:"/foundation/grants/"},{path:"/foundation/grants.html",redirect:"/foundation/grants/"},{name:"v-50aa6d4e",path:"/foundation/supporters/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-50aa6d4e").then(n)}},{path:"/foundation/supporters/index.html",redirect:"/foundation/supporters/"},{path:"/foundation/supporters.html",redirect:"/foundation/supporters/"},{name:"v-105750ce",path:"/foundation/grantees/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-105750ce").then(n)}},{path:"/foundation/grantees/index.html",redirect:"/foundation/grantees/"},{path:"/foundation/grantees.html",redirect:"/foundation/grantees/"},{name:"v-4bcdac39",path:"/getting-started/",component:Nc,beforeEnter:(t,e,n)=>{pc("Layout","v-4bcdac39").then(n)}},{path:"/getting-started/index.html",redirect:"/getting-started/"},{path:"/getting-started.html",redirect:"/getting-started/"},{name:"v-424df898",path:"/blog/",component:Nc,beforeEnter:(t,e,n)=>{pc("IndexPost","v-424df898").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/index.html",redirect:"/blog/"},{name:"v-619df59e",path:"/blog/tags/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-619df59e").then(n)},meta:{pid:"tags",id:"tags"}},{path:"/blog/tags/index.html",redirect:"/blog/tags/"},{name:"v-b0968728",path:"/blog/author/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterKey","v-b0968728").then(n)},meta:{pid:"author",id:"author"}},{path:"/blog/author/index.html",redirect:"/blog/author/"},{name:"v-5f2600b8",path:"/blog/tags/BDK/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f2600b8").then(n)},meta:{pid:"tags",id:"BDK"}},{path:"/blog/tags/BDK/index.html",redirect:"/blog/tags/BDK/"},{name:"v-398e8fd4",path:"/blog/tags/project/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-398e8fd4").then(n)},meta:{pid:"tags",id:"project"}},{path:"/blog/tags/project/index.html",redirect:"/blog/tags/project/"},{name:"v-da8c869a",path:"/blog/tags/tutorial/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-da8c869a").then(n)},meta:{pid:"tags",id:"tutorial"}},{path:"/blog/tags/tutorial/index.html",redirect:"/blog/tags/tutorial/"},{name:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-62bbf2ad").then(n)},meta:{pid:"tags",id:"Bitcoin Core"}},{path:"/blog/tags/Bitcoin Core/index.html",redirect:"/blog/tags/Bitcoin Core/"},{name:"v-5f171cb0",path:"/blog/tags/RPC/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f171cb0").then(n)},meta:{pid:"tags",id:"RPC"}},{path:"/blog/tags/RPC/index.html",redirect:"/blog/tags/RPC/"},{name:"v-4696dfd8",path:"/blog/tags/Wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4696dfd8").then(n)},meta:{pid:"tags",id:"Wallet"}},{path:"/blog/tags/Wallet/index.html",redirect:"/blog/tags/Wallet/"},{name:"v-c711ccde",path:"/blog/tags/bdk-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c711ccde").then(n)},meta:{pid:"tags",id:"bdk-cli"}},{path:"/blog/tags/bdk-cli/index.html",redirect:"/blog/tags/bdk-cli/"},{name:"v-655ee4a0",path:"/blog/tags/multi-sig/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-655ee4a0").then(n)},meta:{pid:"tags",id:"multi-sig"}},{path:"/blog/tags/multi-sig/index.html",redirect:"/blog/tags/multi-sig/"},{name:"v-c4494744",path:"/blog/tags/architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-c4494744").then(n)},meta:{pid:"tags",id:"architecture"}},{path:"/blog/tags/architecture/index.html",redirect:"/blog/tags/architecture/"},{name:"v-e646a928",path:"/blog/tags/basics/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e646a928").then(n)},meta:{pid:"tags",id:"basics"}},{path:"/blog/tags/basics/index.html",redirect:"/blog/tags/basics/"},{name:"v-1fb58ffb",path:"/blog/tags/novice/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1fb58ffb").then(n)},meta:{pid:"tags",id:"novice"}},{path:"/blog/tags/novice/index.html",redirect:"/blog/tags/novice/"},{name:"v-5ef73f54",path:"/blog/tags/tor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5ef73f54").then(n)},meta:{pid:"tags",id:"tor"}},{path:"/blog/tags/tor/index.html",redirect:"/blog/tags/tor/"},{name:"v-39437010",path:"/blog/tags/wallet/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-39437010").then(n)},meta:{pid:"tags",id:"wallet"}},{path:"/blog/tags/wallet/index.html",redirect:"/blog/tags/wallet/"},{name:"v-7c8563fd",path:"/blog/tags/blockchain/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-7c8563fd").then(n)},meta:{pid:"tags",id:"blockchain"}},{path:"/blog/tags/blockchain/index.html",redirect:"/blog/tags/blockchain/"},{name:"v-876cfade",path:"/blog/tags/BDK-RN/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-876cfade").then(n)},meta:{pid:"tags",id:"BDK-RN"}},{path:"/blog/tags/BDK-RN/index.html",redirect:"/blog/tags/BDK-RN/"},{name:"v-3acc51dc",path:"/blog/tags/Development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3acc51dc").then(n)},meta:{pid:"tags",id:"Development"}},{path:"/blog/tags/Development/index.html",redirect:"/blog/tags/Development/"},{name:"v-650ae784",path:"/blog/tags/Architecture/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-650ae784").then(n)},meta:{pid:"tags",id:"Architecture"}},{path:"/blog/tags/Architecture/index.html",redirect:"/blog/tags/Architecture/"},{name:"v-1296a8fa",path:"/blog/tags/bindings/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1296a8fa").then(n)},meta:{pid:"tags",id:"bindings"}},{path:"/blog/tags/bindings/index.html",redirect:"/blog/tags/bindings/"},{name:"v-baacba64",path:"/blog/tags/compact_filters/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-baacba64").then(n)},meta:{pid:"tags",id:"compact_filters"}},{path:"/blog/tags/compact_filters/index.html",redirect:"/blog/tags/compact_filters/"},{name:"v-75ccd5f2",path:"/blog/tags/BIP157/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-75ccd5f2").then(n)},meta:{pid:"tags",id:"BIP157"}},{path:"/blog/tags/BIP157/index.html",redirect:"/blog/tags/BIP157/"},{name:"v-4fed1c23",path:"/blog/tags/Neutrino/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4fed1c23").then(n)},meta:{pid:"tags",id:"Neutrino"}},{path:"/blog/tags/Neutrino/index.html",redirect:"/blog/tags/Neutrino/"},{name:"v-a9e0285e",path:"/blog/tags/guide/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a9e0285e").then(n)},meta:{pid:"tags",id:"guide"}},{path:"/blog/tags/guide/index.html",redirect:"/blog/tags/guide/"},{name:"v-733ed37c",path:"/blog/tags/descriptor/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-733ed37c").then(n)},meta:{pid:"tags",id:"descriptor"}},{path:"/blog/tags/descriptor/index.html",redirect:"/blog/tags/descriptor/"},{name:"v-1144be8a",path:"/blog/tags/paper wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-1144be8a").then(n)},meta:{pid:"tags",id:"paper wallets"}},{path:"/blog/tags/paper wallets/index.html",redirect:"/blog/tags/paper wallets/"},{name:"v-915f8322",path:"/blog/tags/bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-915f8322").then(n)},meta:{pid:"tags",id:"bitcoin"}},{path:"/blog/tags/bitcoin/index.html",redirect:"/blog/tags/bitcoin/"},{name:"v-bf53d4d4",path:"/blog/tags/React Native/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-bf53d4d4").then(n)},meta:{pid:"tags",id:"React Native"}},{path:"/blog/tags/React Native/index.html",redirect:"/blog/tags/React Native/"},{name:"v-07eeb15e",path:"/blog/tags/Flutter/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-07eeb15e").then(n)},meta:{pid:"tags",id:"Flutter"}},{path:"/blog/tags/Flutter/index.html",redirect:"/blog/tags/Flutter/"},{name:"v-5f023740",path:"/blog/tags/iOS/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f023740").then(n)},meta:{pid:"tags",id:"iOS"}},{path:"/blog/tags/iOS/index.html",redirect:"/blog/tags/iOS/"},{name:"v-414e735e",path:"/blog/tags/Android/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-414e735e").then(n)},meta:{pid:"tags",id:"Android"}},{path:"/blog/tags/Android/index.html",redirect:"/blog/tags/Android/"},{name:"v-2c94bf22",path:"/blog/tags/mobile/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-2c94bf22").then(n)},meta:{pid:"tags",id:"mobile"}},{path:"/blog/tags/mobile/index.html",redirect:"/blog/tags/mobile/"},{name:"v-dd212a9e",path:"/blog/tags/bdk-rn/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-dd212a9e").then(n)},meta:{pid:"tags",id:"bdk-rn"}},{path:"/blog/tags/bdk-rn/index.html",redirect:"/blog/tags/bdk-rn/"},{name:"v-5f07f0f8",path:"/blog/tags/bdk/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f07f0f8").then(n)},meta:{pid:"tags",id:"bdk"}},{path:"/blog/tags/bdk/index.html",redirect:"/blog/tags/bdk/"},{name:"v-5f0447f2",path:"/blog/tags/fee/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5f0447f2").then(n)},meta:{pid:"tags",id:"fee"}},{path:"/blog/tags/fee/index.html",redirect:"/blog/tags/fee/"},{name:"v-e2317b12",path:"/blog/tags/machine learning/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-e2317b12").then(n)},meta:{pid:"tags",id:"machine learning"}},{path:"/blog/tags/machine learning/index.html",redirect:"/blog/tags/machine learning/"},{name:"v-57f3a168",path:"/blog/tags/taproot/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-57f3a168").then(n)},meta:{pid:"tags",id:"taproot"}},{path:"/blog/tags/taproot/index.html",redirect:"/blog/tags/taproot/"},{name:"v-ef7c3fa2",path:"/blog/tags/miniscript/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ef7c3fa2").then(n)},meta:{pid:"tags",id:"miniscript"}},{path:"/blog/tags/miniscript/index.html",redirect:"/blog/tags/miniscript/"},{name:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-01a03a08").then(n)},meta:{pid:"tags",id:"bitcoin-cli"}},{path:"/blog/tags/bitcoin-cli/index.html",redirect:"/blog/tags/bitcoin-cli/"},{name:"v-640144b2",path:"/blog/tags/Hardware Wallets/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-640144b2").then(n)},meta:{pid:"tags",id:"Hardware Wallets"}},{path:"/blog/tags/Hardware Wallets/index.html",redirect:"/blog/tags/Hardware Wallets/"},{name:"v-74edfe92",path:"/blog/tags/coin selection/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-74edfe92").then(n)},meta:{pid:"tags",id:"coin selection"}},{path:"/blog/tags/coin selection/index.html",redirect:"/blog/tags/coin selection/"},{name:"v-4e62fa1c",path:"/blog/tags/development/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4e62fa1c").then(n)},meta:{pid:"tags",id:"development"}},{path:"/blog/tags/development/index.html",redirect:"/blog/tags/development/"},{name:"v-0159a747",path:"/blog/tags/summer of bitcoin/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0159a747").then(n)},meta:{pid:"tags",id:"summer of bitcoin"}},{path:"/blog/tags/summer of bitcoin/index.html",redirect:"/blog/tags/summer of bitcoin/"},{name:"v-79c3de4b",path:"/blog/tags/getting started/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-79c3de4b").then(n)},meta:{pid:"tags",id:"getting started"}},{path:"/blog/tags/getting started/index.html",redirect:"/blog/tags/getting started/"},{name:"v-3fee41ed",path:"/blog/tags/rust/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3fee41ed").then(n)},meta:{pid:"tags",id:"rust"}},{path:"/blog/tags/rust/index.html",redirect:"/blog/tags/rust/"},{name:"v-0755ed11",path:"/blog/tags/security/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-0755ed11").then(n)},meta:{pid:"tags",id:"security"}},{path:"/blog/tags/security/index.html",redirect:"/blog/tags/security/"},{name:"v-543950a6",path:"/blog/tags/release/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-543950a6").then(n)},meta:{pid:"tags",id:"release"}},{path:"/blog/tags/release/index.html",redirect:"/blog/tags/release/"},{name:"v-a354115e",path:"/blog/author/Steve Myers/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a354115e").then(n)},meta:{pid:"author",id:"Steve Myers"}},{path:"/blog/author/Steve Myers/index.html",redirect:"/blog/author/Steve Myers/"},{name:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-82e16b5c").then(n)},meta:{pid:"author",id:"Rajarshi Maitra"}},{path:"/blog/author/Rajarshi Maitra/index.html",redirect:"/blog/author/Rajarshi Maitra/"},{name:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-22d0e252").then(n)},meta:{pid:"author",id:"Daniela Brozzoni"}},{path:"/blog/author/Daniela Brozzoni/index.html",redirect:"/blog/author/Daniela Brozzoni/"},{name:"v-3e6950f4",path:"/blog/author/waterst0ne/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-3e6950f4").then(n)},meta:{pid:"author",id:"waterst0ne"}},{path:"/blog/author/waterst0ne/index.html",redirect:"/blog/author/waterst0ne/"},{name:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-600b5b28").then(n)},meta:{pid:"author",id:"Lloyd Fournier"}},{path:"/blog/author/Lloyd Fournier/index.html",redirect:"/blog/author/Lloyd Fournier/"},{name:"v-d2b26530",path:"/blog/author/rorp/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-d2b26530").then(n)},meta:{pid:"author",id:"rorp"}},{path:"/blog/author/rorp/index.html",redirect:"/blog/author/rorp/"},{name:"v-37829241",path:"/blog/author/Bitcoin Zavior/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-37829241").then(n)},meta:{pid:"author",id:"Bitcoin Zavior"}},{path:"/blog/author/Bitcoin Zavior/index.html",redirect:"/blog/author/Bitcoin Zavior/"},{name:"v-5d54001e",path:"/blog/author/thunderbiscuit/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-5d54001e").then(n)},meta:{pid:"author",id:"thunderbiscuit"}},{path:"/blog/author/thunderbiscuit/index.html",redirect:"/blog/author/thunderbiscuit/"},{name:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-624fd61e").then(n)},meta:{pid:"author",id:"Riccardo Casatta"}},{path:"/blog/author/Riccardo Casatta/index.html",redirect:"/blog/author/Riccardo Casatta/"},{name:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-6b564fb4").then(n)},meta:{pid:"author",id:"Gabriele Domenichini"}},{path:"/blog/author/Gabriele Domenichini/index.html",redirect:"/blog/author/Gabriele Domenichini/"},{name:"v-ad00c09c",path:"/blog/author/Alekos Filini/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-ad00c09c").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/index.html",redirect:"/blog/author/Alekos Filini/"},{name:"v-91c10894",path:"/blog/author/Sandipan Dey/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-91c10894").then(n)},meta:{pid:"author",id:"Sandipan Dey"}},{path:"/blog/author/Sandipan Dey/index.html",redirect:"/blog/author/Sandipan Dey/"},{name:"v-4eeab648",path:"/blog/author/Wszdexdrf/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-4eeab648").then(n)},meta:{pid:"author",id:"Wszdexdrf"}},{path:"/blog/author/Wszdexdrf/index.html",redirect:"/blog/author/Wszdexdrf/"},{name:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",component:Nc,beforeEnter:(t,e,n)=>{pc("FrontmatterPagination","v-a0d840b0").then(n)},meta:{pid:"author",id:"César Alvarez Vallero"}},{path:"/blog/author/César Alvarez Vallero/index.html",redirect:"/blog/author/César Alvarez Vallero/"},{name:"v-c3507bb6",path:"/blog/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507bb6").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/2/index.html",redirect:"/blog/page/2/"},{name:"v-c3507b78",path:"/blog/page/3/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b78").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/3/index.html",redirect:"/blog/page/3/"},{name:"v-c3507b3a",path:"/blog/page/4/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-c3507b3a").then(n)},meta:{pid:"blog",id:"blog"}},{path:"/blog/page/4/index.html",redirect:"/blog/page/4/"},{name:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",component:Nc,beforeEnter:(t,e,n)=>{pc("DirectoryPagination","v-5f2ac9cb").then(n)},meta:{pid:"author",id:"Alekos Filini"}},{path:"/blog/author/Alekos Filini/page/2/index.html",redirect:"/blog/author/Alekos Filini/page/2/"},{path:"*",component:Nc}],zc={title:"Bitcoin Dev Kit Documentation",description:"The Bitcoin Dev Kit (BDK) project (originally called Magical Bitcoin 🧙) aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallet called Magical Bitcoin.",base:"/",headTags:[["meta",{name:"viewport",content:"width=device-width,initial-scale=1.0"}],["link",{rel:"preload",href:"/fonts/ibm-plex-mono-400.woff2",as:"font",crossorigin:!0}],["link",{rel:"apple-touch-icon",sizes:"180x180",href:"/img/favicon/apple-touch-icon.png"}],["link",{rel:"manifest",href:"/site.webmanifest"}],["link",{rel:"stylesheet",href:"/css/variables.css"}],["link",{name:"msapplication-config",content:"/browserconfig.xml"}],["link",{name:"msapplication-TileColor",content:"#ffffff"}],["link",{name:"theme-color",content:"#ffffff"}]],pages:[{title:"Home",frontmatter:{home:!0,heroText:"Bitcoin Dev Kit",tagline:"With BDK, you can seamlessly build cross platform mobile wallets",actionText:"Get started",actionLink:"/getting-started/",features:[{title:"Customizable",details:"Designed from the ground up to be easily customized to your application needs: blockchain backends, databases, signers, coin selection, key management and more.",image:"customizable"},{title:"Focus on what matters",details:"All of the low-level Bitcoin logic is handled by us, so you can focus on crafting custom-tailored user experiences.",image:"focus"},{title:"High performance & compact",details:"As lightweight as you need it to be and optimized to run on all modern-day embedded devices such as mobile phones, IoT devices, PoS terminals and more.",image:"mobile"}],meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{property:"og:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"With BDK, you can seamlessly build cross platform mobile wallets"},{name:"twitter:description",content:"We are building native API's for C, Swift, Java & Kotlin so you can easily integrate Bitcoin in your preferred programming language on mobile."},{name:"twitter:url",content:"https://bitcoindevkit.org/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/",relativePath:"README.md",key:"v-330a32a2",path:"/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"2024 Q1 Project Update",frontmatter:{title:"2024 Q1 Project Update",description:"2024 Q1 update on the BDK project's progress.",authors:["Steve Myers"],date:"2024-03-21",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-03-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2024 Q1 Project Update"},{property:"og:description",content:"2024 Q1 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2024 Q1 Project Update"},{name:"twitter:description",content:"2024 Q1 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2024_q1_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2024_q1_update.html",relativePath:"_blog/2024_q1_update.md",key:"v-5e744cf7",path:"/blog/_2024-q1-update/",headers:[{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"Plans for Next Quarter",slug:"plans-for-next-quarter"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"BDK wallet with Bitcoin core RPC",frontmatter:{title:"BDK wallet with Bitcoin core RPC ",description:"Tutorial showing usage of Bitcoin core backend with BDK wallet",authors:["Rajarshi Maitra"],date:"2021-08-21",tags:["tutorial","BDK","Bitcoin Core","RPC","Wallet"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2021-08-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet with Bitcoin core RPC"},{property:"og:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet with Bitcoin core RPC"},{name:"twitter:description",content:"Tutorial showing usage of Bitcoin core backend with BDK wallet"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/Bitcoin_Core_RPC_Demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, Bitcoin Core, RPC, Wallet"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Bitcoin Core"},{property:"article:tag",content:"RPC"},{property:"article:tag",content:"Wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/Bitcoin_Core_RPC_Demo.html",relativePath:"_blog/Bitcoin_Core_RPC_Demo.md",key:"v-7c0c45f9",path:"/blog/bitcoin-core-rpc-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"Setting dependencies",slug:"setting-dependencies"},{level:2,title:"Getting Descriptors",slug:"getting-descriptors"},{level:2,title:"Talking to Bitcoin Core Programmatically",slug:"talking-to-bitcoin-core-programmatically"},{level:2,title:"Get some balance in core wallet.",slug:"get-some-balance-in-core-wallet"},{level:2,title:"Setup the BDK wallet",slug:"setup-the-bdk-wallet"},{level:2,title:"Sending Sats Around",slug:"sending-sats-around"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"2023 Q4 Project Update",frontmatter:{title:"2023 Q4 Project Update",description:"2023 Q4 update on the BDK project's progress.",authors:["Steve Myers","Daniela Brozzoni"],date:"2024-02-20",tags:["BDK","project"],draft:!1,meta:[{property:"article:published_time",content:"2024-02-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"2023 Q4 Project Update"},{property:"og:description",content:"2023 Q4 update on the BDK project's progress."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"2023 Q4 Project Update"},{name:"twitter:description",content:"2023 Q4 update on the BDK project's progress."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/2023_q4_update/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, project"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"project"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/2023_q4_update.html",relativePath:"_blog/2023_q4_update.md",key:"v-2c450c3f",path:"/blog/_2023-q4-update/",headers:[{level:3,title:"This Post",slug:"this-post"},{level:3,title:"End of Year Review",slug:"end-of-year-review"},{level:3,title:"Core BDK",slug:"core-bdk"},{level:3,title:"BDK-FFI",slug:"bdk-ffi"},{level:3,title:"BDK contributors spotlight",slug:"bdk-contributors-spotlight"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"bdk-cli basics multi-sig 2 of 3 tutorial",frontmatter:{title:"bdk-cli basics multi-sig 2 of 3 tutorial",description:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend",authors:["waterst0ne"],date:"2022-10-17",tags:["tutorial","bdk-cli","multi-sig"],hidden:!1,draft:!1,meta:[{property:"article:published_time",content:"2022-10-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{property:"og:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-cli basics multi-sig 2 of 3 tutorial"},{name:"twitter:description",content:"Tutorial using command-line to create a 2 of 3 multi-sig Wallet and Spend"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk-cli_basics_multisig_2of3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk-cli, multi-sig"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"multi-sig"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk-cli_basics_multisig_2of3.html",relativePath:"_blog/bdk-cli_basics_multisig_2of3.md",key:"v-8bd632d6",path:"/blog/bdk-cli-basics-multisig-2of3/",headers:[{level:2,title:"2-of-3 Multi-Signature Descriptor Wallet using bdk-cli",slug:"2-of-3-multi-signature-descriptor-wallet-using-bdk-cli"},{level:2,title:"Overview of the tutorial",slug:"overview-of-the-tutorial"},{level:2,title:"Step 1: Generate the XPRVs (Extended-Keys) and Save to environment variables",slug:"step-1-generate-the-xprvs-extended-keys-and-save-to-environment-variables"},{level:3,title:"1a: Verify XPRV environment variables are Active",slug:"1a-verify-xprv-environment-variables-are-active"},{level:2,title:"Step 2: Generate XPUBs (Extended Public Keys) & Save to environment variables",slug:"step-2-generate-xpubs-extended-public-keys-save-to-environment-variables"},{level:3,title:"2a: Verify XPUB environment variables",slug:"2a-verify-xpub-environment-variables"},{level:2,title:"Step 3: Create Single-Wallet Descriptors",slug:"step-3-create-single-wallet-descriptors"},{level:2,title:"Step 4: Create Multi-Sig-Descriptor Wallets",slug:"step-4-create-multi-sig-descriptor-wallets"},{level:3,title:"4a: Verify Multi-Sig-Descriptor environment variables are active",slug:"4a-verify-multi-sig-descriptor-environment-variables-are-active"},{level:2,title:"Step 5: Generate Receive Address by using Multi-Sig-Descriptor Wallets",slug:"step-5-generate-receive-address-by-using-multi-sig-descriptor-wallets"},{level:2,title:"Step 6: Send Testnet Bitcoin to the newly created receive-address",slug:"step-6-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 7: Sync one of the Multi-Sig Wallets",slug:"step-7-sync-one-of-the-multi-sig-wallets"},{level:2,title:"Step 8: Check Balance Multi-Sig Wallets",slug:"step-8-check-balance-multi-sig-wallets"},{level:2,title:"Step 9: Check Multi-Sig Policies on Descriptor Wallet",slug:"step-9-check-multi-sig-policies-on-descriptor-wallet"},{level:3,title:"SpendingPolicyRequired for complex descriptors",slug:"spendingpolicyrequired-for-complex-descriptors"},{level:2,title:"Step 10: Create a Transaction (PSBT)",slug:"step-10-create-a-transaction-psbt"},{level:3,title:"Export UNSIGNED_PSBT to environment variable",slug:"export-unsigned-psbt-to-environment-variable"},{level:3,title:"Verify UNSIGNED_PSBT environment variable",slug:"verify-unsigned-psbt-environment-variable"},{level:2,title:"Step 11: SIGN the Transaction",slug:"step-11-sign-the-transaction"},{level:3,title:"1st Wallet Signs the transaction",slug:"1st-wallet-signs-the-transaction"},{level:3,title:"2nd Wallet Signs the transaction",slug:"2nd-wallet-signs-the-transaction"},{level:2,title:"Step 12: Broadcast Transaction",slug:"step-12-broadcast-transaction"},{level:3,title:"Verify Transaction",slug:"verify-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"bdk_core: a new architecture for the Bitcoin Dev Kit",frontmatter:{title:"`bdk_core`: a new architecture for the Bitcoin Dev Kit",description:"A new architecture for the Bitcoin Dev Kit",authors:["Lloyd Fournier"],date:"2022-05-09",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-05-09T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{property:"og:description",content:"A new architecture for the Bitcoin Dev Kit"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk_core: a new architecture for the Bitcoin Dev Kit"},{name:"twitter:description",content:"A new architecture for the Bitcoin Dev Kit"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_core_pt1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_core_pt1.html",relativePath:"_blog/bdk_core_pt1.md",key:"v-2cebe183",path:"/blog/bdk-core-pt1/",headers:[{level:2,title:"The separation of policy and mechanism",slug:"the-separation-of-policy-and-mechanism"},{level:2,title:"A syncing mechansim without the policy",slug:"a-syncing-mechansim-without-the-policy"},{level:3,title:"A general syncing mechanism",slug:"a-general-syncing-mechanism"},{level:3,title:"How to store and index transactions",slug:"how-to-store-and-index-transactions"},{level:3,title:"Rolling back, rolling forward and syncing to disk",slug:"rolling-back-rolling-forward-and-syncing-to-disk"},{level:2,title:"Examples",slug:"examples"},{level:3,title:"Doing an initial sync of a descriptor that may already contain coins",slug:"doing-an-initial-sync-of-a-descriptor-that-may-already-contain-coins"},{level:3,title:"Doing a sync of a wallet after you already have sync'd",slug:"doing-a-sync-of-a-wallet-after-you-already-have-syncd"},{level:3,title:"Updating state when you get the data in real time",slug:"updating-state-when-you-get-the-data-in-real-time"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",frontmatter:{title:"Command Line introduction to Bitcoin Wallet Development using bdk-cli",description:"Intro to bdk-cli and wallet dev",authors:["waterst0ne"],date:"2022-09-22",tags:["bdk-cli","basics","novice"],meta:[{property:"article:published_time",content:"2022-09-22T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{property:"og:description",content:"Intro to bdk-cli and wallet dev"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Command Line introduction to Bitcoin Wallet Development using bdk-cli"},{name:"twitter:description",content:"Intro to bdk-cli and wallet dev"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_cli_basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bdk-cli, basics, novice"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"basics"},{property:"article:tag",content:"novice"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_cli_basics.html",relativePath:"_blog/bdk_cli_basics.md",key:"v-0f4d5d15",path:"/blog/bdk-cli-basics/",headers:[{level:2,title:"Tutorial Goals",slug:"tutorial-goals"},{level:2,title:"A few things before you begin:",slug:"a-few-things-before-you-begin"},{level:3,title:"Outline of Tutorial and Installation notes:",slug:"outline-of-tutorial-and-installation-notes"},{level:3,title:"Brief Outline of Tutorial",slug:"brief-outline-of-tutorial"},{level:3,title:"Rust and Cargo installation:",slug:"rust-and-cargo-installation"},{level:3,title:"bdk-cli installation:",slug:"bdk-cli-installation"},{level:3,title:"Emoji Legend:",slug:"emoji-legend"},{level:2,title:"Step 0: Check Version of bdk-cli",slug:"step-0-check-version-of-bdk-cli"},{level:3,title:"Preview of bdk-cli help menu",slug:"preview-of-bdk-cli-help-menu"},{level:2,title:"Step 1: Seed Generate",slug:"step-1-seed-generate"},{level:3,title:"1a: Mnemonic word-list + XPRV (Extended Private Key) :key:",slug:"1a-mnemonic-word-list-xprv-extended-private-key-"},{level:3,title:"1b: Save XPRV (Extended Private Key) into environment variable",slug:"1b-save-xprv-extended-private-key-into-environment-variable"},{level:3,title:"1c: Verify environment variable XPRV_00 is active",slug:"1c-verify-environment-variable-xprv-00-is-active"},{level:3,title:"1d: Create Descriptor and Save into environment variable",slug:"1d-create-descriptor-and-save-into-environment-variable"},{level:3,title:"1e: Verify environment variable my_descriptor is active",slug:"1e-verify-environment-variable-my-descriptor-is-active"},{level:2,title:"Step 2: Generate Receive-Address",slug:"step-2-generate-receive-address"},{level:2,title:"Step 3: Send testnet bitcoin to the newly created receive-address",slug:"step-3-send-testnet-bitcoin-to-the-newly-created-receive-address"},{level:2,title:"Step 4: Sync the wallet",slug:"step-4-sync-the-wallet"},{level:2,title:"Step 5: Check the balance",slug:"step-5-check-the-balance"},{level:2,title:"Step 6: Create Transaction (PSBT)",slug:"step-6-create-transaction-psbt"},{level:3,title:"6a: export PSBT to environment-variable",slug:"6a-export-psbt-to-environment-variable"},{level:2,title:"Step 7: Sign Transaction (PSBT)",slug:"step-7-sign-transaction-psbt"},{level:3,title:"7a: export signed psbt to environment variable",slug:"7a-export-signed-psbt-to-environment-variable"},{level:2,title:"Step 8: Broadcast Transaction",slug:"step-8-broadcast-transaction"},{level:2,title:"Resources",slug:"resources"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Using BDK with Tor",frontmatter:{title:"Using BDK with Tor",description:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service",authors:["rorp"],date:"2023-01-03",tags:["tutorial","tor","wallet","blockchain"],meta:[{property:"article:published_time",content:"2023-01-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with Tor"},{property:"og:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with Tor"},{name:"twitter:description",content:"How to integrate Tor client to sync BDK wallet with tor enabled blockchain service"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_with_tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, tor, wallet, blockchain"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"tor"},{property:"article:tag",content:"wallet"},{property:"article:tag",content:"blockchain"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_with_tor.html",relativePath:"_blog/bdk_with_tor.md",key:"v-353b78e1",path:"/blog/bdk-with-tor/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisite",slug:"prerequisite"},{level:2,title:"Setting Up",slug:"setting-up"},{level:2,title:"ElectrumBlockchain",slug:"electrumblockchain"},{level:2,title:"Blocking EsploraBlockchain",slug:"blocking-esplorablockchain"},{level:2,title:"Asynchronous EsploraBlockchain",slug:"asynchronous-esplorablockchain"},{level:2,title:"CompactFiltersBlockchain",slug:"compactfiltersblockchain"},{level:2,title:"Integrated Tor daemon",slug:"integrated-tor-daemon"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"bdk-rn: Behind the scenes",frontmatter:{title:"`bdk-rn`: Behind the scenes",description:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed",authors:["Bitcoin Zavior"],date:"2022-07-10",tags:["BDK-RN","Development","Architecture"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-07-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"bdk-rn: Behind the scenes"},{property:"og:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"bdk-rn: Behind the scenes"},{name:"twitter:description",content:"bdk-rn: React Native version of BitcoinDevKit. Insight into how bdk-rn was developed"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bdk_rn_making_of/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK-RN, Development, Architecture"},{property:"article:tag",content:"BDK-RN"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bdk_rn_making_of.html",relativePath:"_blog/bdk_rn_making_of.md",key:"v-3eaa044d",path:"/blog/bdk-rn-making-of/",headers:[{level:2,title:"React Native Architecture",slug:"react-native-architecture"},{level:2,title:"Native Integration",slug:"native-integration"},{level:2,title:"Android Module",slug:"android-module"},{level:2,title:"References",slug:"references"},{level:2,title:"Feedback",slug:"feedback"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"BDK's Scope and Approach to Rust Bindings",frontmatter:{title:"BDK's Scope and Approach to Rust Bindings",description:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own.",authors:["thunderbiscuit"],date:"2023-06-02",tags:["BDK","bindings"],meta:[{property:"article:published_time",content:"2023-06-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK's Scope and Approach to Rust Bindings"},{property:"og:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK's Scope and Approach to Rust Bindings"},{name:"twitter:description",content:"An outline of BDK's approach to language bindings and how we intend on supporting others build their own."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/bindings-scope/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, bindings"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/bindings-scope.html",relativePath:"_blog/bindings-scope.md",key:"v-3875825f",path:"/blog/bindings-scope/",headers:[{level:2,title:"Current architecture",slug:"current-architecture"},{level:2,title:"Moving forward: building a family of libraries",slug:"moving-forward-building-a-family-of-libraries"},{level:2,title:"Why can't we just build one big BDK library with everything in it?",slug:"why-cant-we-just-build-one-big-bdk-library-with-everything-in-it"},{level:2,title:"Are you looking to build Rust bindings yourself?",slug:"are-you-looking-to-build-rust-bindings-yourself"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"BDK wallet as a BIP157 SPV light client",frontmatter:{title:"BDK wallet as a BIP157 SPV light client",description:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools",authors:["Rajarshi Maitra"],date:"2021-06-20",tags:["tutorial","BDK","bdk-cli","compact_filters","BIP157","Neutrino"],meta:[{property:"article:published_time",content:"2021-06-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK wallet as a BIP157 SPV light client"},{property:"og:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK wallet as a BIP157 SPV light client"},{name:"twitter:description",content:"Tutorial showing usage of compact filters (BIP157) using bdk-cli command line tools"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/compact_filters_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, BDK, bdk-cli, compact_filters, BIP157, Neutrino"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"compact_filters"},{property:"article:tag",content:"BIP157"},{property:"article:tag",content:"Neutrino"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/compact_filters_demo.html",relativePath:"_blog/compact_filters_demo.md",key:"v-07ff1843",path:"/blog/compact-filters-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Compact Filters:",slug:"compact-filters"},{level:3,title:"BDK and Compact filters",slug:"bdk-and-compact-filters"},{level:3,title:"bdk-cli",slug:"bdk-cli"},{level:2,title:"Tutorial Scope",slug:"tutorial-scope"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Install and run bitcoind",slug:"install-and-run-bitcoind"},{level:3,title:"Install and run bdk-cli",slug:"install-and-run-bdk-cli"},{level:2,title:"Tutorial",slug:"tutorial"},{level:3,title:"Bitcoin Core Wallet Generation",slug:"bitcoin-core-wallet-generation"},{level:3,title:"BDK Wallet Generation",slug:"bdk-wallet-generation"},{level:3,title:"Recieve Coins",slug:"recieve-coins"},{level:3,title:"Creating a transaction.",slug:"creating-a-transaction"},{level:3,title:"Sign and Broadcast the transaction",slug:"sign-and-broadcast-the-transaction"},{level:3,title:"Confirming the Transaction",slug:"confirming-the-transaction"},{level:3,title:"Shutdown Docker",slug:"shutdown-docker"},{level:2,title:"End Words",slug:"end-words"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Making Descriptor-based paper wallets",frontmatter:{title:"Making Descriptor-based paper wallets",description:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk",authors:["Riccardo Casatta","Steve Myers"],date:"2021-03-30",tags:["guide","descriptor","paper wallets"],meta:[{property:"article:published_time",content:"2021-03-30T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Making Descriptor-based paper wallets"},{property:"og:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Making Descriptor-based paper wallets"},{name:"twitter:description",content:"Demonstrate how to create descriptor-based paper wallet and how to spend them with bdk"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptor_based_paper_wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor, paper wallets"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"paper wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptor_based_paper_wallet.html",relativePath:"_blog/descriptor_based_paper_wallet.md",key:"v-9504490e",path:"/blog/descriptor-based-paper-wallet/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"About paper wallets",slug:"about-paper-wallets"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Example use case",slug:"example-use-case"},{level:2,title:"Creating the paper wallet",slug:"creating-the-paper-wallet"},{level:2,title:"BDK",slug:"bdk"},{level:2,title:"Funding tx",slug:"funding-tx"},{level:2,title:"Sweep tx",slug:"sweep-tx"},{level:3,title:"Step 1: Alice creates and signs a PSBT",slug:"step-1-alice-creates-and-signs-a-psbt"},{level:3,title:"Step 2: Barbara signs Alice's signed PSBT and broadcasts the tx",slug:"step-2-barbara-signs-alices-signed-psbt-and-broadcasts-the-tx"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"A Multisig between BDK and Core",frontmatter:{title:"A Multisig between BDK and Core",description:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK",authors:["Gabriele Domenichini"],date:"2020-11-18",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2020-11-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"A Multisig between BDK and Core"},{property:"og:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"A Multisig between BDK and Core"},{name:"twitter:description",content:"Guide to setup a 2-of-2 multisig using Bitcoin Core and BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/descriptors_in_the_wild/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/descriptors_in_the_wild.html",relativePath:"_blog/descriptors_in_the_wild.md",key:"v-c6756cce",path:"/blog/descriptors-in-the-wild/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"The use case",slug:"the-use-case"},{level:2,title:"The role of Descriptors",slug:"the-role-of-descriptors"},{level:2,title:"Our playground",slug:"our-playground"},{level:3,title:"1. Creating the seeds and the derived Extended Public keys",slug:"1-creating-the-seeds-and-the-derived-extended-public-keys"},{level:3,title:"2. Creation of the multi signature descriptor for each wallet",slug:"2-creation-of-the-multi-signature-descriptor-for-each-wallet"},{level:3,title:"3. Use each other's software to receive testnet coins from a faucet",slug:"3-use-each-others-software-to-receive-testnet-coins-from-a-faucet"},{level:3,title:"4. we return part of the satoshis received back to the faucet",slug:"4-we-return-part-of-the-satoshis-received-back-to-the-faucet"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"BDK-FLUTTER: Building Flutter Apps with BDK",frontmatter:{title:"BDK-FLUTTER: Building Flutter Apps with BDK",description:"A tutorial and guide to using bdk-flutter for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-10-05",tags:["bitcoin","React Native","Flutter","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-10-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-FLUTTER: Building Flutter Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-flutter for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, Flutter, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"Flutter"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_flutter.html",relativePath:"_blog/exploring_bdk_flutter.md",key:"v-56536559",path:"/blog/exploring-bdk-flutter/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-flutter",slug:"bitcoin-dev-kit-and-bdk-flutter"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up Flutter app structure",slug:"setting-up-flutter-app-structure"},{level:2,title:"Installing bdk-flutter",slug:"installing-bdk-flutter"},{level:2,title:"Configuring",slug:"configuring"},{level:2,title:"Importing bdk-flutter",slug:"importing-bdk-flutter"},{level:2,title:"Calling bdk-flutter methods",slug:"calling-bdk-flutter-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring a wallet",slug:"restoring-a-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"BDK-RN: Building React Native Apps with BDK",frontmatter:{title:"BDK-RN: Building React Native Apps with BDK",description:"A tutorial and guide to using bdk-rn for building bitcoin apps",authors:["Bitcoin Zavior"],date:"2022-08-05",tags:["bitcoin","React Native","iOS","Android","mobile","bdk-rn","bdk","tutorial","guide","wallet"],meta:[{property:"article:published_time",content:"2022-08-05T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"BDK-RN: Building React Native Apps with BDK"},{property:"og:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"BDK-RN: Building React Native Apps with BDK"},{name:"twitter:description",content:"A tutorial and guide to using bdk-rn for building bitcoin apps"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/exploring_bdk_rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bitcoin, React Native, iOS, Android, mobile, bdk-rn, bdk, tutorial, guide, wallet"},{property:"article:tag",content:"bitcoin"},{property:"article:tag",content:"React Native"},{property:"article:tag",content:"iOS"},{property:"article:tag",content:"Android"},{property:"article:tag",content:"mobile"},{property:"article:tag",content:"bdk-rn"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"wallet"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/exploring_bdk_rn.html",relativePath:"_blog/exploring_bdk_rn.md",key:"v-f58ec8f2",path:"/blog/exploring-bdk-rn/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:3,title:"Prerequisites",slug:"prerequisites"},{level:3,title:"Bitcoin Basics",slug:"bitcoin-basics"},{level:2,title:"Bitcoin Dev Kit and bdk-rn",slug:"bitcoin-dev-kit-and-bdk-rn"},{level:2,title:"Getting Started",slug:"getting-started"},{level:2,title:"Setting up styles and RN app structure",slug:"setting-up-styles-and-rn-app-structure"},{level:2,title:"Installing bdk-rn",slug:"installing-bdk-rn"},{level:2,title:"Importing bdk-rn",slug:"importing-bdk-rn"},{level:2,title:"Calling bdk-rn methods",slug:"calling-bdk-rn-methods"},{level:2,title:"Creating a wallet",slug:"creating-a-wallet"},{level:2,title:"UTXOs and balance",slug:"utxos-and-balance"},{level:2,title:"Restoring wallet",slug:"restoring-wallet"},{level:2,title:"Sending bitcoin",slug:"sending-bitcoin"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Fee estimation for light-clients (Part 2)",frontmatter:{title:"Fee estimation for light-clients (Part 2)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 2)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 2)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_2.html",relativePath:"_blog/fee_estimation_for_light_clients_part_2.md",key:"v-2c605799",path:"/blog/2021/01/fee-estimation-for-light-clients-part-2/",headers:[{level:2,title:"The dataset",slug:"the-dataset"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Fee estimation for light-clients (Part 1)",frontmatter:{title:"Fee estimation for light-clients (Part 1)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 1)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 1)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_1.html",relativePath:"_blog/fee_estimation_for_light_clients_part_1.md",key:"v-015729b9",path:"/blog/2021/01/fee-estimation-for-light-clients-part-1/",headers:[{level:2,title:"Introduction: what is fee estimation?",slug:"introduction-what-is-fee-estimation"},{level:2,title:"The problem",slug:"the-problem"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Fee estimation for light-clients (Part 3)",frontmatter:{title:"Fee estimation for light-clients (Part 3)",description:"Applying machine learning to the bitcoin fee estimation problem",authors:["Riccardo Casatta"],date:"2021-01-25",tags:["fee","machine learning"],permalink:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",meta:[{property:"article:published_time",content:"2021-01-25T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Fee estimation for light-clients (Part 3)"},{property:"og:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Fee estimation for light-clients (Part 3)"},{name:"twitter:description",content:"Applying machine learning to the bitcoin fee estimation problem"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/fee-estimation-for-light-clients-part-3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"fee, machine learning"},{property:"article:tag",content:"fee"},{property:"article:tag",content:"machine learning"}],layout:"Post"},regularPath:"/_blog/fee_estimation_for_light_clients_part_3.html",relativePath:"_blog/fee_estimation_for_light_clients_part_3.md",key:"v-57698579",path:"/blog/2021/01/fee-estimation-for-light-clients-part-3/",headers:[{level:2,title:"The model",slug:"the-model"},{level:2,title:"The prediction phase",slug:"the-prediction-phase"},{level:2,title:"Conclusion and future development",slug:"conclusion-and-future-development"},{level:2,title:"Acknowledgements",slug:"acknowledgements"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"The first BDK Taproot TX: a look at the code (Part 1)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 1)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-11-15",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1",meta:[{property:"article:published_time",content:"2021-11-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 1)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx.html",relativePath:"_blog/first_bdk_taproot_tx.md",key:"v-9145467a",path:"/blog/2021/11/first-bdk-taproot-tx-look-at-the-code-part-1/",headers:[{level:2,title:"Backstory",slug:"backstory"},{level:2,title:"rust-bitcoin",slug:"rust-bitcoin"},{level:2,title:"rust-miniscript",slug:"rust-miniscript"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"The first BDK Taproot TX: a look at the code (Part 2)",frontmatter:{title:"The first BDK Taproot TX: a look at the code (Part 2)",description:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction",authors:["Alekos Filini"],date:"2021-12-10",tags:["BDK","taproot","miniscript"],permalink:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2",meta:[{property:"article:published_time",content:"2021-12-10T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{property:"og:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The first BDK Taproot TX: a look at the code (Part 2)"},{name:"twitter:description",content:"A quick overview of the changes made to bdk, rust-miniscript and rust-bitcoin to make a Taproot transaction"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, taproot, miniscript"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"taproot"},{property:"article:tag",content:"miniscript"}],layout:"Post"},regularPath:"/_blog/first_bdk_taproot_tx_part_2.html",relativePath:"_blog/first_bdk_taproot_tx_part_2.md",key:"v-2cf72b39",path:"/blog/2021/12/first-bdk-taproot-tx-look-at-the-code-part-2/",headers:[{level:2,title:"Shortcuts",slug:"shortcuts"},{level:2,title:"Utilities",slug:"utilities"},{level:2,title:"Wrap Fallible Methods",slug:"wrap-fallible-methods"},{level:2,title:"Descriptor Metadata",slug:"descriptor-metadata"},{level:2,title:"Policy",slug:"policy"},{level:2,title:"Signer",slug:"signer"},{level:2,title:"PSBT Metadata",slug:"psbt-metadata"},{level:2,title:"descriptor!() Macro",slug:"descriptor-macro"},{level:3,title:"tr() Descriptors",slug:"tr-descriptors"},{level:3,title:"multi_a() Operator",slug:"multi-a-operator"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Hidden Powers of Miniscript Policy & Descriptors",frontmatter:{title:"Hidden Powers of Miniscript Policy & Descriptors",description:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies",authors:["Sandipan Dey","Rajarshi Maitra"],date:"2022-01-02",tags:["tutorial","bdk","bdk-cli","miniscript","descriptor","bitcoin-cli"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-01-02T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{property:"og:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hidden Powers of Miniscript Policy & Descriptors"},{name:"twitter:description",content:"Introduction to Descriptor and Miniscript, making a Multisig Wallet and Testing Miniscript Policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/hidden-power-of-bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"tutorial, bdk, bdk-cli, miniscript, descriptor, bitcoin-cli"},{property:"article:tag",content:"tutorial"},{property:"article:tag",content:"bdk"},{property:"article:tag",content:"bdk-cli"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"descriptor"},{property:"article:tag",content:"bitcoin-cli"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/hidden-power-of-bitcoin.html",relativePath:"_blog/hidden-power-of-bitcoin.md",key:"v-ab5ba3ce",path:"/blog/hidden-power-of-bitcoin/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Script",slug:"script"},{level:2,title:"Miniscript",slug:"miniscript"},{level:2,title:"Descriptors",slug:"descriptors"},{level:2,title:"Where it all comes together...",slug:"where-it-all-comes-together"},{level:3,title:"Keys and Generating Addresses",slug:"keys-and-generating-addresses"},{level:3,title:"Making a MultiSig Descriptor for Funds",slug:"making-a-multisig-descriptor-for-funds"},{level:2,title:"Retention Bonus - Smart Contract with Bitcoin",slug:"retention-bonus-smart-contract-with-bitcoin"},{level:2,title:"Inspirations",slug:"inspirations"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Getting Started with rust-hwi",frontmatter:{title:"Getting Started with rust-hwi",description:"This post will help one understand and develop for hardware wallets using BDK",authors:["Wszdexdrf"],date:"2022-08-16",tags:["BDK","Development","Hardware Wallets"],draft:!1,meta:[{property:"article:published_time",content:"2022-08-16T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Getting Started with rust-hwi"},{property:"og:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Getting Started with rust-hwi"},{name:"twitter:description",content:"This post will help one understand and develop for hardware wallets using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/getting_started_with_rust_hwi/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/getting_started_with_rust_hwi.html",relativePath:"_blog/getting_started_with_rust_hwi.md",key:"v-11d64359",path:"/blog/getting-started-with-rust-hwi/",headers:[{level:2,title:"Fundamentals",slug:"fundamentals"},{level:2,title:"Integration with BDK",slug:"integration-with-bdk"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Improving coin selection in BDK",frontmatter:{title:"Improving coin selection in BDK",description:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022",date:"2022-08-17",tags:["coin selection","BDK","development","summer of bitcoin"],authors:["César Alvarez Vallero"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-08-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Improving coin selection in BDK"},{property:"og:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Improving coin selection in BDK"},{name:"twitter:description",content:"A brief description of the work done in the coin selection module in BDK during Summer of Bitcoin 2022"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/improving_coin_selection_in_BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"coin selection, BDK, development, summer of bitcoin"},{property:"article:tag",content:"coin selection"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"development"},{property:"article:tag",content:"summer of bitcoin"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/improving_coin_selection_in_BDK.html",relativePath:"_blog/improving_coin_selection_in_BDK.md",key:"v-d0375c8e",path:"/blog/improving-coin-selection-in-bdk/",headers:[{level:2,title:"Waste",slug:"waste"},{level:3,title:"How it works?",slug:"how-it-works"},{level:3,title:"What has been done",slug:"what-has-been-done"},{level:3,title:"Work in progress",slug:"work-in-progress"},{level:2,title:"Further Improvements",slug:"further-improvements"},{level:3,title:"Privacy",slug:"privacy"},{level:3,title:"Flexibility",slug:"flexibility"},{level:2,title:"Conclusion",slug:"conclusion"},{level:2,title:"Acknowledgements",slug:"acknowledgements"},{level:2,title:"References",slug:"references"},{level:3,title:"About coin selection considerations",slug:"about-coin-selection-considerations"},{level:3,title:"About Waste metric",slug:"about-waste-metric"},{level:3,title:"About improving privacy in coin selection",slug:"about-improving-privacy-in-coin-selection"},{level:3,title:"About bdk_core",slug:"about-bdk-core"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Hello World!",frontmatter:{title:"Hello World!",description:"Getting started using the BDK library in a very simple Rust project",authors:["Alekos Filini"],date:"2020-12-18",tags:["getting started","rust"],permalink:"/blog/2020/12/hello-world/",meta:[{property:"article:published_time",content:"2020-12-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Hello World!"},{property:"og:description",content:"Getting started using the BDK library in a very simple Rust project"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Hello World!"},{name:"twitter:description",content:"Getting started using the BDK library in a very simple Rust project"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/hello-world/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"getting started, rust"},{property:"article:tag",content:"getting started"},{property:"article:tag",content:"rust"}],layout:"Post"},regularPath:"/_blog/hello-world.html",relativePath:"_blog/hello-world.md",key:"v-5d749fce",path:"/blog/2020/12/hello-world/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Design Goals",slug:"design-goals"},{level:2,title:"The Wallet Structure",slug:"the-wallet-structure"},{level:2,title:"Custom Database and Blockchain types",slug:"custom-database-and-blockchain-types"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Security Advisory: Miniscript MINIMALIF Bug",frontmatter:{title:"Security Advisory: Miniscript MINIMALIF Bug",description:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next.",authors:["Alekos Filini"],date:"2022-04-19",tags:["miniscript","security"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-04-19T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{property:"og:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Security Advisory: Miniscript MINIMALIF Bug"},{name:"twitter:description",content:"Security advisory on the recent Miniscript MINIMALIF bug. How to check if you are affected and what to do next."},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/miniscript_vulnerability/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"miniscript, security"},{property:"article:tag",content:"miniscript"},{property:"article:tag",content:"security"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/miniscript_vulnerability.html",relativePath:"_blog/miniscript_vulnerability.md",key:"v-10852eea",path:"/blog/miniscript-vulnerability/",headers:[{level:2,title:"How to check if you are vulnerable",slug:"how-to-check-if-you-are-vulnerable"},{level:2,title:"Next steps",slug:"next-steps"},{level:3,title:"If you are affected",slug:"if-you-are-affected"},{level:3,title:"Everybody",slug:"everybody"},{level:2,title:"Consequences of the update",slug:"consequences-of-the-update"},{level:2,title:"Footnote: How we analyzed the blockchain",slug:"footnote-how-we-analyzed-the-blockchain"},{level:2,title:"Correction (2022-04-25)",slug:"correction-2022-04-25"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.3.0",frontmatter:{title:"Release v0.3.0",description:"Announcing the v0.3.0 release of BDK",authors:["Alekos Filini"],date:"2021-01-20",tags:["rust","release"],permalink:"/blog/2021/01/release-v0.3.0/",meta:[{property:"article:published_time",content:"2021-01-20T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.3.0"},{property:"og:description",content:"Announcing the v0.3.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.3.0"},{name:"twitter:description",content:"Announcing the v0.3.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/01/release-v0.3.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.3.0.html",relativePath:"_blog/release-0.3.0.md",key:"v-05df4999",path:"/blog/2021/01/release-v0.3.0/",headers:[{level:2,title:"What's new in v0.3.0",slug:"whats-new-in-v030"},{level:3,title:"Less verbosity when using Wallet::new_offline()",slug:"less-verbosity-when-using-walletnew-offline"},{level:3,title:"No more error conversions in DescriptorTemplate",slug:"no-more-error-conversions-in-descriptortemplate"},{level:3,title:"A new repo for the CLI",slug:"a-new-repo-for-the-cli"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.2.0",frontmatter:{title:"Release v0.2.0",description:"Announcing the v0.2.0 release of BDK",authors:["Alekos Filini"],date:"2020-12-21",tags:["rust","release"],permalink:"/blog/2020/12/release-v0.2.0/",meta:[{property:"article:published_time",content:"2020-12-21T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.2.0"},{property:"og:description",content:"Announcing the v0.2.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.2.0"},{name:"twitter:description",content:"Announcing the v0.2.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2020/12/release-v0.2.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.2.0.html",relativePath:"_blog/release-0.2.0.md",key:"v-edd5570e",path:"/blog/2020/12/release-v0.2.0/",headers:[{level:2,title:"What's new in v0.2.0",slug:"whats-new-in-v020"},{level:3,title:"A new name",slug:"a-new-name"},{level:3,title:"Branch and Bound coin selection",slug:"branch-and-bound-coin-selection"},{level:3,title:"Key generation",slug:"key-generation"},{level:3,title:"Generic key types",slug:"generic-key-types"},{level:3,title:"Descriptor templates",slug:"descriptor-templates"},{level:3,title:"Easier creation of Blockchain and Database",slug:"easier-creation-of-blockchain-and-database"},{level:3,title:"descriptor!() macro",slug:"descriptor-macro"},{level:3,title:"Support for sortedmulti()",slug:"support-for-sortedmulti"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.4.0",frontmatter:{title:"Release v0.4.0",description:"Announcing the v0.4.0 release of BDK",authors:["Alekos Filini"],date:"2021-02-17",tags:["rust","release"],permalink:"/blog/2021/02/release-v0.4.0/",meta:[{property:"article:published_time",content:"2021-02-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.4.0"},{property:"og:description",content:"Announcing the v0.4.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.4.0"},{name:"twitter:description",content:"Announcing the v0.4.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/02/release-v0.4.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.4.0.html",relativePath:"_blog/release-0.4.0.md",key:"v-faad828e",path:"/blog/2021/02/release-v0.4.0/",headers:[{level:2,title:"What's new in v0.4.0",slug:"whats-new-in-v040"},{level:3,title:"A new API to build transaction",slug:"a-new-api-to-build-transaction"},{level:3,title:"Upgraded dependencies",slug:"upgraded-dependencies"},{level:3,title:"Compact Filters example",slug:"compact-filters-example"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.7.0",frontmatter:{title:"Release v0.7.0",description:"Announcing the v0.7.0 release of BDK",authors:["Alekos Filini"],date:"2021-05-17",tags:["rust","release"],permalink:"/blog/2021/05/release-v0.7.0/",meta:[{property:"article:published_time",content:"2021-05-17T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.7.0"},{property:"og:description",content:"Announcing the v0.7.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.7.0"},{name:"twitter:description",content:"Announcing the v0.7.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/05/release-v0.7.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.7.0.html",relativePath:"_blog/release-0.7.0.md",key:"v-0df1c3ce",path:"/blog/2021/05/release-v0.7.0/",headers:[{level:2,title:"What's new in v0.7.0",slug:"whats-new-in-v070"},{level:3,title:"New Signing API",slug:"new-signing-api"},{level:3,title:"Support Timelocks in the policy Module",slug:"support-timelocks-in-the-policy-module"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.5.0",frontmatter:{title:"Release v0.5.0",description:"Announcing the v0.5.0 release of BDK",authors:["Alekos Filini"],date:"2021-03-18",tags:["rust","release"],permalink:"/blog/2021/03/release-v0.5.0/",meta:[{property:"article:published_time",content:"2021-03-18T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.5.0"},{property:"og:description",content:"Announcing the v0.5.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.5.0"},{name:"twitter:description",content:"Announcing the v0.5.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/03/release-v0.5.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.5.0.html",relativePath:"_blog/release-0.5.0.md",key:"v-0119984e",path:"/blog/2021/03/release-v0.5.0/",headers:[{level:2,title:"What's new in v0.5.0",slug:"whats-new-in-v050"},{level:3,title:"Dual Licensing",slug:"dual-licensing"},{level:3,title:"Spending foreign UTXOs",slug:"spending-foreign-utxos"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.6.0",frontmatter:{title:"Release v0.6.0",description:"Announcing the v0.6.0 release of BDK",authors:["Alekos Filini"],date:"2021-04-15",tags:["rust","release"],permalink:"/blog/2021/04/release-v0.6.0/",meta:[{property:"article:published_time",content:"2021-04-15T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.6.0"},{property:"og:description",content:"Announcing the v0.6.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.6.0"},{name:"twitter:description",content:"Announcing the v0.6.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/04/release-v0.6.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.6.0.html",relativePath:"_blog/release-0.6.0.md",key:"v-7c3d28f9",path:"/blog/2021/04/release-v0.6.0/",headers:[{level:2,title:"What's new in v0.6.0",slug:"whats-new-in-v060"},{level:3,title:"A new way to generate addresses",slug:"a-new-way-to-generate-addresses"},{level:3,title:"Easier multiparty transaction creation",slug:"easier-multiparty-transaction-creation"},{level:3,title:"Renamed types",slug:"renamed-types"},{level:3,title:"New MSRV",slug:"new-msrv"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.8.0",frontmatter:{title:"Release v0.8.0",description:"Announcing the v0.8.0 release of BDK",authors:["Alekos Filini"],date:"2021-06-14",tags:["rust","release"],permalink:"/blog/2021/06/release-v0.8.0/",meta:[{property:"article:published_time",content:"2021-06-14T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.8.0"},{property:"og:description",content:"Announcing the v0.8.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.8.0"},{name:"twitter:description",content:"Announcing the v0.8.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/06/release-v0.8.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.8.0.html",relativePath:"_blog/release-0.8.0.md",key:"v-75d11339",path:"/blog/2021/06/release-v0.8.0/",headers:[{level:2,title:"What's new in v0.8.0",slug:"whats-new-in-v080"},{level:3,title:"Getting the Derivation Index",slug:"getting-the-derivation-index"},{level:3,title:"Explicitly Enable non-ALL Sighashes",slug:"explicitly-enable-non-all-sighashes"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Release v0.9.0",frontmatter:{title:"Release v0.9.0",description:"Announcing the v0.9.0 release of BDK",authors:["Alekos Filini"],date:"2021-07-11",tags:["rust","release"],permalink:"/blog/2021/07/release-v0.9.0/",meta:[{property:"article:published_time",content:"2021-07-11T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Release v0.9.0"},{property:"og:description",content:"Announcing the v0.9.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Release v0.9.0"},{name:"twitter:description",content:"Announcing the v0.9.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/2021/07/release-v0.9.0/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"rust, release"},{property:"article:tag",content:"rust"},{property:"article:tag",content:"release"}],layout:"Post"},regularPath:"/_blog/release-0.9.0.html",relativePath:"_blog/release-0.9.0.md",key:"v-1ac9ef4e",path:"/blog/2021/07/release-v0.9.0/",headers:[{level:2,title:"What's new in v0.9.0",slug:"whats-new-in-v090"},{level:2,title:"Bitcoin Core Blockchain Backend",slug:"bitcoin-core-blockchain-backend"},{level:2,title:"Updated TransactionDetails Struct",slug:"updated-transactiondetails-struct"},{level:2,title:"Verify Downloaded TXs",slug:"verify-downloaded-txs"},{level:2,title:"Contributors",slug:"contributors"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"The Road to BDK 1.0",frontmatter:{title:"The Road to BDK 1.0",description:"Outlining the plan for the 1.0 release of BDK",authors:["Alekos Filini"],date:"2022-10-03",tags:["architecture"],draft:!1,meta:[{property:"article:published_time",content:"2022-10-03T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"The Road to BDK 1.0"},{property:"og:description",content:"Outlining the plan for the 1.0 release of BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"The Road to BDK 1.0"},{name:"twitter:description",content:"Outlining the plan for the 1.0 release of BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/road_to_bdk_1/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"architecture"},{property:"article:tag",content:"architecture"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/road_to_bdk_1.html",relativePath:"_blog/road_to_bdk_1.md",key:"v-55969f39",path:"/blog/road-to-bdk-1/",headers:[{level:2,title:"Goals",slug:"goals"},{level:3,title:"Stable API",slug:"stable-api"},{level:3,title:"Upstreaming our code",slug:"upstreaming-our-code"},{level:3,title:"Partially Syncing a Wallet",slug:"partially-syncing-a-wallet"},{level:3,title:"no_std",slug:"no-std"},{level:3,title:"Lower MSRV",slug:"lower-msrv"},{level:2,title:"Architecture",slug:"architecture"},{level:2,title:"Timeline",slug:"timeline"},{level:2,title:"Feature Freezing BDK",slug:"feature-freezing-bdk"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Spending Policy Decoded",frontmatter:{title:"Spending Policy Decoded",description:"Demonstrate how to use a descriptor wallet with different spending policies",authors:["Steve Myers","thunderbiscuit"],date:"2021-02-23",tags:["guide","descriptor"],meta:[{property:"article:published_time",content:"2021-02-23T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Spending Policy Decoded"},{property:"og:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Spending Policy Decoded"},{name:"twitter:description",content:"Demonstrate how to use a descriptor wallet with different spending policies"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/spending_policy_demo/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"guide, descriptor"},{property:"article:tag",content:"guide"},{property:"article:tag",content:"descriptor"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/spending_policy_demo.html",relativePath:"_blog/spending_policy_demo.md",key:"v-8534b9c2",path:"/blog/spending-policy-demo/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Initial Setup",slug:"initial-setup"},{level:3,title:"Step 0: Install a recent version bdk-cli",slug:"step-0-install-a-recent-version-bdk-cli"},{level:3,title:"Step 1: Generate private extended keys",slug:"step-1-generate-private-extended-keys"},{level:3,title:"Step 2: Extract private extended keys",slug:"step-2-extract-private-extended-keys"},{level:3,title:"Step 3: Derive public extended keys",slug:"step-3-derive-public-extended-keys"},{level:3,title:"Step 4: Create wallet descriptors for each participant",slug:"step-4-create-wallet-descriptors-for-each-participant"},{level:2,title:"Policy A. Three signatures",slug:"policy-a-three-signatures"},{level:3,title:"Step 1a: Create a testnet segwit0 receive address",slug:"step-1a-create-a-testnet-segwit0-receive-address"},{level:3,title:"Step 2a: Send testnet bitcoin from a faucet to receive address",slug:"step-2a-send-testnet-bitcoin-from-a-faucet-to-receive-address"},{level:3,title:"Step 3a: Sync participant wallets and confirm balance",slug:"step-3a-sync-participant-wallets-and-confirm-balance"},{level:3,title:"Step 4a: View wallet spending policies",slug:"step-4a-view-wallet-spending-policies"},{level:3,title:"Step 5a: Create spending transaction",slug:"step-5a-create-spending-transaction"},{level:3,title:"Step 6a: Sign and finalize PSBTs",slug:"step-6a-sign-and-finalize-psbts"},{level:3,title:"Step 7a: Broadcast finalized PSBT",slug:"step-7a-broadcast-finalized-psbt"},{level:3,title:"Step 8a: Confirm transaction included in a testnet block",slug:"step-8a-confirm-transaction-included-in-a-testnet-block"},{level:2,title:"Policy B. Two signatures after a relative time lock",slug:"policy-b-two-signatures-after-a-relative-time-lock"},{level:3,title:"Step 1b: Create a new testnet receive address",slug:"step-1b-create-a-new-testnet-receive-address"},{level:3,title:"Step 2b: Fund new address from testnet faucet",slug:"step-2b-fund-new-address-from-testnet-faucet"},{level:3,title:"Step 3b: Sync wallet and confirm wallet balance",slug:"step-3b-sync-wallet-and-confirm-wallet-balance"},{level:3,title:"Step 4b: Create spending transaction",slug:"step-4b-create-spending-transaction"},{level:3,title:"Step 5b: Sign and finalize PSBTs",slug:"step-5b-sign-and-finalize-psbts"},{level:3,title:"Step 6b: Broadcast finalized PSBT",slug:"step-6b-broadcast-finalized-psbt"},{level:3,title:"Step 7b: View confirmed transaction",slug:"step-7b-view-confirmed-transaction"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Using BDK with hardware wallets",frontmatter:{title:"Using BDK with hardware wallets",description:"Tutorial showing how to send funds to a HW and then spend from it using BDK",authors:["Daniela Brozzoni"],date:"2022-10-27",tags:["BDK","Development","Hardware Wallets"],hidden:!0,draft:!1,meta:[{property:"article:published_time",content:"2022-10-27T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Using BDK with hardware wallets"},{property:"og:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Using BDK with hardware wallets"},{name:"twitter:description",content:"Tutorial showing how to send funds to a HW and then spend from it using BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/using_bdk_with_hardware_wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"BDK, Development, Hardware Wallets"},{property:"article:tag",content:"BDK"},{property:"article:tag",content:"Development"},{property:"article:tag",content:"Hardware Wallets"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/using_bdk_with_hardware_wallets.html",relativePath:"_blog/using_bdk_with_hardware_wallets.md",key:"v-aeb70fce",path:"/blog/using-bdk-with-hardware-wallets/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Prerequisites",slug:"prerequisites"},{level:2,title:"Initial setup",slug:"initial-setup"},{level:2,title:"Finding the hardware wallet",slug:"finding-the-hardware-wallet"},{level:2,title:"Receiving funds",slug:"receiving-funds"},{level:2,title:"Spending funds",slug:"spending-funds"},{level:2,title:"Conclusion",slug:"conclusion"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Why Do We Build Bindings?",frontmatter:{title:"Why Do We Build Bindings?",description:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries",authors:["thunderbiscuit"],date:"2024-05-07",tags:["bindings"],meta:[{property:"article:published_time",content:"2024-05-07T00:00:00.000Z"},{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Why Do We Build Bindings?"},{property:"og:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Why Do We Build Bindings?"},{name:"twitter:description",content:"A post exploring why the Bitcoin Dev Kit Foundation produces language bindings for its libraries"},{name:"twitter:url",content:"https://bitcoindevkit.org/_blog/why-bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"bindings"},{property:"article:tag",content:"bindings"}],layout:"Post",permalink:"/blog/:slug"},regularPath:"/_blog/why-bindings.html",relativePath:"_blog/why-bindings.md",key:"v-4dc135e3",path:"/blog/why-bindings/",headers:[{level:2,title:"Awesome! Producing Bindings Must Be Easy Right?",slug:"awesome-producing-bindings-must-be-easy-right"}],codeSwitcherOptions:{},id:"blog",pid:"blog",lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Custodial",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/custodial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/custodial.html",relativePath:"adoption/custodial.md",key:"v-30c0037b",path:"/adoption/custodial/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"All",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/all/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/all/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/all.html",relativePath:"adoption/all.md",key:"v-4d760891",path:"/adoption/all/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Exchange",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/exchange/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/exchange.html",relativePath:"adoption/exchange.md",key:"v-b936290e",path:"/adoption/exchange/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Desktop",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/desktop/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/desktop.html",relativePath:"adoption/desktop.md",key:"v-4bb7844a",path:"/adoption/desktop/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Hardware",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/hardware/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/hardware.html",relativePath:"adoption/hardware.md",key:"v-7afdbb4e",path:"/adoption/hardware/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Infrastructure",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/infrastructure/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/infrastructure.html",relativePath:"adoption/infrastructure.md",key:"v-4e0b610e",path:"/adoption/infrastructure/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Mobile",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/mobile.html",relativePath:"adoption/mobile.md",key:"v-a7c24c4e",path:"/adoption/mobile/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Web",frontmatter:{sidebar:!0,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/adoption/web/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/adoption/web/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/adoption/web.html",relativePath:"adoption/web.md",key:"v-17019aeb",path:"/adoption/web/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Compiler",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Compiler"},{property:"og:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Compiler"},{name:"twitter:description",content:'If you want to play around with more complicated spending policies, you\'ll start to find it harder and harder to manually create the descriptors. This is where the miniscript compiler comes in! The `bdk` library\nincludes a very simple compiler that can produce a descriptor given a spending policy. The syntax used to encode the spending policy is very well described in this pagehttp://bitcoin.sipa.be/miniscript/,\nspecifically in the "Policy to Miniscript compiler". The compiler included in BDK does basically the same job, but produces descriptors for `rust-miniscript` that have some minor differences from\nthe ones made by the C++ implementation used in that website.'},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/compiler/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/compiler.html",relativePath:"bdk-cli/compiler.md",key:"v-7a315e41",path:"/bdk-cli/compiler/",headers:[{level:2,title:"Introduction",slug:"introduction"},{level:2,title:"Installation",slug:"installation"},{level:2,title:"Usage",slug:"usage"},{level:2,title:"Example",slug:"example"},{level:2,title:"Troubleshooting",slug:"troubleshooting"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Concept",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Concept"},{property:"og:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Concept"},{name:"twitter:description",content:"Now, in order to better grasp some of the design choices made by BDK, it's important to understand the main concept driving the development of this project, and the goal that it's trying to\nachieve."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/concept/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/concept.html",relativePath:"bdk-cli/concept.md",key:"v-f611a14e",path:"/bdk-cli/concept/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Installation",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Installation"},{property:"og:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Installation"},{name:"twitter:description",content:"The only requirement to run the `bdk-cli` tool is a Linux/macOS system with a fairly recent Rust\ntoolchain installed. Since Linux distros tend to lag behind with updates, the quickest way to\ninstall the Rust compiler and Cargo is rustup.rshttps://rustup.rs/. You can head there and\nfollow their instructions, after which you can test if everything went fine by running"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/installation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/installation.html",relativePath:"bdk-cli/installation.md",key:"v-3acb6e6a",path:"/bdk-cli/installation/",headers:[{level:2,title:"Requirements",slug:"requirements"},{level:2,title:"Installing the bdk-cli tool",slug:"installing-the-bdk-cli-tool"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Introduction",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Introduction"},{property:"og:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Introduction"},{name:"twitter:description",content:"This can also be used as an example application to create your own command line bitcoin wallet tool using bdk."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/introduction/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/introduction.html",relativePath:"bdk-cli/introduction.md",key:"v-0b3b65ea",path:"/bdk-cli/introduction/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Playground",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Playground"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Playground"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/playground/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/playground.html",relativePath:"bdk-cli/playground.md",key:"v-a76bccee",path:"/bdk-cli/playground/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Interface",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Interface"},{property:"og:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Interface"},{name:"twitter:description",content:"Remember the `bdk-cli --help` command you ran before? Let's analyze its output here to figure out the interface:"},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/interface/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/interface.html",relativePath:"bdk-cli/interface.md",key:"v-496cb7f9",path:"/bdk-cli/interface/",headers:[{level:2,title:"Flags",slug:"flags"},{level:3,title:"Verbosity",slug:"verbosity"},{level:2,title:"Options",slug:"options"},{level:2,title:"Subcommands",slug:"subcommands"},{level:2,title:"key",slug:"key"},{level:3,title:"generate",slug:"generate"},{level:3,title:"restore",slug:"restore"},{level:3,title:"derive",slug:"derive"},{level:2,title:"wallet",slug:"wallet"},{level:3,title:"Options",slug:"options-2"},{level:2,title:"Subcommands",slug:"subcommands-2"},{level:3,title:"broadcast",slug:"broadcast"},{level:3,title:"bump_fee",slug:"bump-fee"},{level:3,title:"combine_psbt",slug:"combine-psbt"},{level:3,title:"create_tx",slug:"create-tx"},{level:3,title:"extract_psbt",slug:"extract-psbt"},{level:3,title:"finalize_psbt",slug:"finalize-psbt"},{level:3,title:"get_balance",slug:"get-balance"},{level:3,title:"get_new_address",slug:"get-new-address"},{level:3,title:"list_transactions",slug:"list-transactions"},{level:3,title:"list_unspent",slug:"list-unspent"},{level:3,title:"policies",slug:"policies"},{level:3,title:"public_descriptor",slug:"public-descriptor"},{level:3,title:"help",slug:"help"},{level:3,title:"sign",slug:"sign"},{level:3,title:"sync",slug:"sync"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Regtest",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Regtest"},{property:"og:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Regtest"},{name:"twitter:description",content:"Running the `bdk-cli` tool in regtest requires having a local Electrum server set-up. There are two main implementations, `electrs`https://github.com/romanz/electrs in Rust and `ElectrumX`https://github.com/spesmilo/electrumx in Python. Since the Rust toolchain is already required to\nuse BDK, this page will focus mostly on the former."},{name:"twitter:url",content:"https://bitcoindevkit.org/bdk-cli/regtest/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/bdk-cli/regtest.html",relativePath:"bdk-cli/regtest.md",key:"v-05d01c19",path:"/bdk-cli/regtest/",headers:[{level:2,title:"Troubleshooting",slug:"troubleshooting"},{level:2,title:"Bonus: Docker",slug:"bonus-docker"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{frontmatter:{cases:!0,sidebar:!1,tagline:"Bitcoin applications building with BDK",description:"A list of bitcoin applications and services building with BDK",actionText:"Add your project",actionLink:"https://github.com/orgs/bitcoindevkit/discussions/64",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin applications building with BDK"},{property:"og:description",content:"A list of bitcoin applications and services building with BDK"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/case-studies/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin applications building with BDK"},{name:"twitter:description",content:"A list of bitcoin applications and services building with BDK"},{name:"twitter:url",content:"https://bitcoindevkit.org/case-studies/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/case-studies.html",relativePath:"case-studies.md",key:"v-11bf335e",path:"/case-studies/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Examples",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Examples"},{property:"og:description",content:"Click the links below and learn from community-built example projects."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/examples/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Examples"},{name:"twitter:description",content:"Click the links below and learn from community-built example projects."},{name:"twitter:url",content:"https://bitcoindevkit.org/examples/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/examples/",relativePath:"examples/README.md",key:"v-29f9f21c",path:"/examples/",headers:[{level:2,title:"BDK-CLI",slug:"bdk-cli"},{level:2,title:"DevkitWallet",slug:"devkitwallet"},{level:2,title:"Padawan Wallet",slug:"padawan-wallet"},{level:2,title:"BDKSwiftExampleWallet",slug:"bdkswiftexamplewallet"},{level:2,title:"Tatooine",slug:"tatooine"},{level:2,title:"SEBA Bank Proof of reserves",slug:"seba-bank-proof-of-reserves"},{level:2,title:"Stackmate",slug:"stackmate"},{level:2,title:"Spotbit",slug:"spotbit"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Descriptors",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Descriptors"},{property:"og:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/descriptors/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Descriptors"},{name:"twitter:description",content:'Descriptors are a compact and semi-standard way to easily encode, or "describe", how scripts and subsequently, addresses of a wallet should be generated. They can be especially helpful when working with multisigs or even\nmore complex scripts, where the structure of the script itself is not trivial. They are a big step forward in making wallets more portable across different tools and apps, because for the first time they create a common\nlanguage to describe a full bitcoin script that developers can use and integrate in their software.'},{name:"twitter:url",content:"https://bitcoindevkit.org/descriptors/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/descriptors/",relativePath:"descriptors/README.md",key:"v-a9236c10",path:"/descriptors/",headers:[{level:3,title:"Compatibility Matrix",slug:"compatibility-matrix"},{level:3,title:"Examples",slug:"examples"},{level:3,title:"Implementation Details",slug:"implementation-details"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/about/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/about/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/about.html",relativePath:"foundation/about.md",key:"v-3750297a",path:"/foundation/about/",headers:[{level:2,title:"Board",slug:"board"},{level:2,title:"Operations",slug:"operations"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Bitcoin Dev Kit Foundation",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/",relativePath:"foundation/index.md",key:"v-c152529c",path:"/foundation/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Grants Program",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/grants/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/grants/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/grants.html",relativePath:"foundation/grants.md",key:"v-08589c4e",path:"/foundation/grants/",headers:[{level:2,title:"Grant Requirements",slug:"grant-requirements"},{level:2,title:"Full-time grants",slug:"full-time-grants"},{level:3,title:"Rust",slug:"rust"},{level:3,title:"Mobile / language bindings",slug:"mobile-language-bindings"},{level:2,title:"Project grants",slug:"project-grants"},{level:2,title:"Applying",slug:"applying"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Supporters",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/supporters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/supporters.html",relativePath:"foundation/supporters.md",key:"v-50aa6d4e",path:"/foundation/supporters/",codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Current Grantees (Full-Time)",frontmatter:{sidebar:!0,tagline:"Foundation",description:"Information about the Bitcoin Dev Kit Foundation",editLink:!1,lastUpdated:!1,meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Foundation"},{property:"og:description",content:"Information about the Bitcoin Dev Kit Foundation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Foundation"},{name:"twitter:description",content:"Information about the Bitcoin Dev Kit Foundation"},{name:"twitter:url",content:"https://bitcoindevkit.org/foundation/grantees/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/foundation/grantees.html",relativePath:"foundation/grantees.md",key:"v-105750ce",path:"/foundation/grantees/",headers:[{level:2,title:"Evan Lin",slug:"evan-lin"},{level:2,title:"thunderbiscuit",slug:"thunderbiscuit"},{level:2,title:"Matthew Ramsden",slug:"matthew-ramsden"},{level:2,title:"ValuedMammal",slug:"valuedmammal"},{level:2,title:"Wei Chen",slug:"wei-chen"},{level:2,title:"Manuel Gatti",slug:"manuel-gatti"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{title:"Bitcoin Dev Kit",frontmatter:{meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:title",content:"Bitcoin Dev Kit"},{property:"og:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/getting-started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:title",content:"Bitcoin Dev Kit"},{name:"twitter:description",content:"The Bitcoin Dev Kit BDKhttps://github.com/bitcoindevkit project originally called Magical Bitcoin 🧙 aims to build a collection of tools and libraries that are designed to be a solid foundation for cross platform Bitcoin wallets, along with a fully working reference implementation wallets for various platforms.\nAll BDK components are designed to be lightweight and modular so that they can be adapted for virtually any use-case: from single-sig mobile wallets to multi-billion-dollar cold storage vaults."},{name:"twitter:url",content:"https://bitcoindevkit.org/getting-started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/getting-started.html",relativePath:"getting-started.md",key:"v-4bcdac39",path:"/getting-started/",headers:[{level:2,title:"Initial Configuration",slug:"initial-configuration"},{level:2,title:"Internal Features",slug:"internal-features"},{level:2,title:"Playground",slug:"playground"},{level:2,title:"Descriptors",slug:"descriptors"}],codeSwitcherOptions:{},lastUpdated:"6/13/2024, 3:13:12 PM",lastUpdatedTimestamp:1718291592e3},{frontmatter:{layout:"IndexPost",title:"Blog",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/",key:"v-424df898",path:"/blog/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Tags",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/",key:"v-619df59e",path:"/blog/tags/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterKey",title:"Authors",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/",key:"v-b0968728",path:"/blog/author/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK/",key:"v-5f2600b8",path:"/blog/tags/BDK/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"project ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/project/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/project/",key:"v-398e8fd4",path:"/blog/tags/project/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tutorial ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tutorial/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tutorial/",key:"v-da8c869a",path:"/blog/tags/tutorial/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Core ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Bitcoin Core/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Bitcoin%20Core/",key:"v-62bbf2ad",path:"/blog/tags/Bitcoin Core/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"RPC ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/RPC/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/RPC/",key:"v-5f171cb0",path:"/blog/tags/RPC/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Wallet/",key:"v-4696dfd8",path:"/blog/tags/Wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-cli/",key:"v-c711ccde",path:"/blog/tags/bdk-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"multi-sig ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/multi-sig/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/multi-sig/",key:"v-655ee4a0",path:"/blog/tags/multi-sig/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/architecture/",key:"v-c4494744",path:"/blog/tags/architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"basics ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/basics/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/basics/",key:"v-e646a928",path:"/blog/tags/basics/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"novice ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/novice/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/novice/",key:"v-1fb58ffb",path:"/blog/tags/novice/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"tor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/tor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/tor/",key:"v-5ef73f54",path:"/blog/tags/tor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"wallet ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/wallet/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/wallet/",key:"v-39437010",path:"/blog/tags/wallet/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"blockchain ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/blockchain/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/blockchain/",key:"v-7c8563fd",path:"/blog/tags/blockchain/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BDK-RN ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BDK-RN/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BDK-RN/",key:"v-876cfade",path:"/blog/tags/BDK-RN/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Development/",key:"v-3acc51dc",path:"/blog/tags/Development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Architecture ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Architecture/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Architecture/",key:"v-650ae784",path:"/blog/tags/Architecture/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bindings ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bindings/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bindings/",key:"v-1296a8fa",path:"/blog/tags/bindings/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"compact_filters ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/compact_filters/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/compact_filters/",key:"v-baacba64",path:"/blog/tags/compact_filters/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"BIP157 ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/BIP157/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/BIP157/",key:"v-75ccd5f2",path:"/blog/tags/BIP157/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Neutrino ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Neutrino/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Neutrino/",key:"v-4fed1c23",path:"/blog/tags/Neutrino/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"guide ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/guide/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/guide/",key:"v-a9e0285e",path:"/blog/tags/guide/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"descriptor ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/descriptor/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/descriptor/",key:"v-733ed37c",path:"/blog/tags/descriptor/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"paper wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/paper wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/paper%20wallets/",key:"v-1144be8a",path:"/blog/tags/paper wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin/",key:"v-915f8322",path:"/blog/tags/bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"React Native ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/React Native/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/React%20Native/",key:"v-bf53d4d4",path:"/blog/tags/React Native/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Flutter ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Flutter/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Flutter/",key:"v-07eeb15e",path:"/blog/tags/Flutter/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"iOS ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/iOS/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/iOS/",key:"v-5f023740",path:"/blog/tags/iOS/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Android ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Android/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Android/",key:"v-414e735e",path:"/blog/tags/Android/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"mobile ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/mobile/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/mobile/",key:"v-2c94bf22",path:"/blog/tags/mobile/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk-rn ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk-rn/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk-rn/",key:"v-dd212a9e",path:"/blog/tags/bdk-rn/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bdk ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bdk/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bdk/",key:"v-5f07f0f8",path:"/blog/tags/bdk/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"fee ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/fee/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/fee/",key:"v-5f0447f2",path:"/blog/tags/fee/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"machine learning ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/machine learning/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/machine%20learning/",key:"v-e2317b12",path:"/blog/tags/machine learning/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"taproot ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/taproot/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/taproot/",key:"v-57f3a168",path:"/blog/tags/taproot/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"miniscript ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/miniscript/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/miniscript/",key:"v-ef7c3fa2",path:"/blog/tags/miniscript/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"bitcoin-cli ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/bitcoin-cli/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/bitcoin-cli/",key:"v-01a03a08",path:"/blog/tags/bitcoin-cli/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Hardware Wallets ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/Hardware Wallets/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/Hardware%20Wallets/",key:"v-640144b2",path:"/blog/tags/Hardware Wallets/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"coin selection ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/coin selection/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/coin%20selection/",key:"v-74edfe92",path:"/blog/tags/coin selection/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"development ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/development/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/development/",key:"v-4e62fa1c",path:"/blog/tags/development/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"summer of bitcoin ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/summer of bitcoin/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/summer%20of%20bitcoin/",key:"v-0159a747",path:"/blog/tags/summer of bitcoin/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"getting started ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/getting started/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/getting%20started/",key:"v-79c3de4b",path:"/blog/tags/getting started/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rust ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/rust/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/rust/",key:"v-3fee41ed",path:"/blog/tags/rust/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"security ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/security/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/security/",key:"v-0755ed11",path:"/blog/tags/security/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"release ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/tags/release/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/tags/release/",key:"v-543950a6",path:"/blog/tags/release/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Steve Myers ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Steve Myers/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Steve%20Myers/",key:"v-a354115e",path:"/blog/author/Steve Myers/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Rajarshi Maitra ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Rajarshi Maitra/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Rajarshi%20Maitra/",key:"v-82e16b5c",path:"/blog/author/Rajarshi Maitra/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Daniela Brozzoni ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Daniela Brozzoni/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Daniela%20Brozzoni/",key:"v-22d0e252",path:"/blog/author/Daniela Brozzoni/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"waterst0ne ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/waterst0ne/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/waterst0ne/",key:"v-3e6950f4",path:"/blog/author/waterst0ne/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Lloyd Fournier ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Lloyd Fournier/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Lloyd%20Fournier/",key:"v-600b5b28",path:"/blog/author/Lloyd Fournier/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"rorp ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/rorp/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/rorp/",key:"v-d2b26530",path:"/blog/author/rorp/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Bitcoin Zavior ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Bitcoin Zavior/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Bitcoin%20Zavior/",key:"v-37829241",path:"/blog/author/Bitcoin Zavior/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"thunderbiscuit ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/thunderbiscuit/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/thunderbiscuit/",key:"v-5d54001e",path:"/blog/author/thunderbiscuit/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Riccardo Casatta ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Riccardo Casatta/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Riccardo%20Casatta/",key:"v-624fd61e",path:"/blog/author/Riccardo Casatta/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Gabriele Domenichini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Gabriele Domenichini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Gabriele%20Domenichini/",key:"v-6b564fb4",path:"/blog/author/Gabriele Domenichini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Alekos Filini ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/",key:"v-ad00c09c",path:"/blog/author/Alekos Filini/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Sandipan Dey ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Sandipan Dey/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Sandipan%20Dey/",key:"v-91c10894",path:"/blog/author/Sandipan Dey/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"Wszdexdrf ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Wszdexdrf/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Wszdexdrf/",key:"v-4eeab648",path:"/blog/author/Wszdexdrf/",codeSwitcherOptions:{}},{frontmatter:{layout:"FrontmatterPagination",title:"César Alvarez Vallero ",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/César Alvarez Vallero/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/C%C3%A9sar%20Alvarez%20Vallero/",key:"v-a0d840b0",path:"/blog/author/César Alvarez Vallero/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/2/",key:"v-c3507bb6",path:"/blog/page/2/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 3",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/3/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/3/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/3/",key:"v-c3507b78",path:"/blog/page/3/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Page 4",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/page/4/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/page/4/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/page/4/",key:"v-c3507b3a",path:"/blog/page/4/",codeSwitcherOptions:{}},{frontmatter:{layout:"DirectoryPagination",title:"Alekos Filini - Page 2",meta:[{property:"og:site_name",content:"Bitcoin Dev Kit Documentation"},{property:"og:type",content:"article"},{property:"og:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{property:"og:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:url",content:"https://bitcoindevkit.org/blog/author/Alekos Filini/page/2/"},{name:"twitter:card",content:"summary"},{name:"twitter:image",content:"https://bitcoindevkit.org/card.png"},{name:"twitter:label2",content:"Filed under"},{name:"twitter:data2",content:"Bitcoin, Bitcoin Dev Kit, BDK"},{property:"article:tag",content:"Bitcoin"},{property:"article:tag",content:"Bitcoin Dev Kit"},{property:"article:tag",content:"BDK"}]},regularPath:"/blog/author/Alekos%20Filini/page/2/",key:"v-5f2ac9cb",path:"/blog/author/Alekos Filini/page/2/",codeSwitcherOptions:{}}],themeConfig:{domain:"https://bitcoindevkit.org",logo:"/img/logo.svg",displayAllHeaders:!1,repo:"bitcoindevkit/bitcoindevkit.org",docsDir:"docs",editLinks:!0,sidebarDepth:0,nav:[{text:"Docs",link:"/getting-started/"},{text:"Adoption",link:"/adoption/all.md"},{text:"Foundation",link:"/foundation/"},{text:"Blog",link:"/blog/"}],sidebar:{"/adoption/":[{title:"Built With BDK",collapsable:!1,children:[["/adoption/all.md","All"],["/adoption/mobile.md","Mobile"],["/adoption/desktop.md","Desktop"],["/adoption/hardware.md","Hardware"],["/adoption/web.md","Web"],["/adoption/custodial.md","Custodial"],["/adoption/exchange.md","Exchange"],["/adoption/infrastructure.md","Infrastructure"]]}],"/_blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/blog/":[{title:"Blog",collapsable:!1,children:[["/blog/","Articles"],["/blog/tags/","Tags"],["/blog/author/","Authors"]]}],"/foundation/":[{title:"Foundation",collapsable:!1,children:[["/foundation/about.md","About Us"],["/foundation/supporters.md","Supporters"],["/foundation/grantees.md","Grantees"],["/foundation/grants.md","Grants"]]}],"/":[{title:"Documentation",collapsable:!1,children:[["/getting-started","Getting Started"],{title:"BDK-CLI",collapsable:!0,children:["/bdk-cli/introduction","/bdk-cli/installation","/bdk-cli/concept","/bdk-cli/interface","/bdk-cli/regtest","/bdk-cli/compiler","/bdk-cli/playground"]},"/descriptors/","/examples/"]},{title:"API Reference",collapsable:!1,children:[["https://docs.rs/bdk_wallet/","Rust Stable Docs"],["https://bitcoindevkit.org/docs-rs/bdk/nightly/latest/bdk_wallet/","Rust Nightly Docs"],["https://bitcoindevkit.org/android/","Android Docs"],["https://bitcoindevkit.org/jvm/","Kotlin/JVM Docs"],["https://bitcoindevkit.org/java/","Java Docs"]]}]},footer:{links:[{title:"Docs",children:[{text:"Getting Started",link:"/getting-started/"},{text:"BDK-CLI",link:"/bdk-cli/installation/"},{text:"Descriptors",link:"/descriptors/"}]},{title:"Community",children:[{text:"GitHub",link:"https://github.com/bitcoindevkit",rel:"noopener noreferrer"},{text:"Nostr",link:"nostr:npub13dk3dke4zm9vdkucm7f6vv7vhqgkevgg3gju9kr2wzumz7nrykdq0dgnvc",rel:"noopener noreferrer"},{text:"Twitter",link:"https://twitter.com/intent/follow?screen_name=bitcoindevkit",rel:"noopener noreferrer"},{text:"Chat on Discord",link:"https://discord.gg/dstn4dQ",rel:"noopener noreferrer"}]},{title:"More",children:[{text:"Blog",link:"/blog/"},{text:"Supporters",link:"/foundation/supporters/"},{text:"BDK Foundation",link:"/foundation/"}]}],copyright:"Copyright © 2024 BDK Developers"}}},{COLOR_MODES:Wc,STORE_ATTR:Hc,setColorMode:Vc}=n(111),qc=t=>"Enter"===t.code||13===(t.keyCode||t.which),Gc=t=>{const e=t.target.matches("#algolia-search-input")&&qc(t);(t.target.matches(".ds-dropdown-menu *")||e)&&document.getElementById("algolia-search-input").blur(),t.target.matches(".ytEmbed")&&(t.preventDefault(),(t=>{const e=t.querySelector("iframe[data-src]");if(e){const t=e.getAttribute("data-src");e.setAttribute("src",t)}})(t.target))};if("undefined"==typeof process||"server"!==process.env.VUE_ENV){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?Wc[1]:Wc[0],e=window.localStorage.getItem(Hc);Vc(Wc.includes(e)?e:t)}n(243);Vn.component("Badge",()=>Promise.all([n.e(0),n.e(8)]).then(n.bind(null,398))),Vn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(9)]).then(n.bind(null,388))),Vn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,389)));n(244);var Zc={props:{color:{required:!1,default:"rgb(66, 185, 131)"}}},Xc=(n(245),Object(Kc.a)(Zc,(function(){return(0,this._self._c)("div",{staticClass:"spinner",style:{background:this.color}})}),[],!1,null,"1bbcb91a",null).exports);const Yc={name:"Mermaid",props:{id:{type:String,required:!0},graph:{type:String,required:!0}},data:()=>({svg:void 0}),render(t){return void 0===this.svg?t("Loading"):t("div",{domProps:{innerHTML:this.svg,style:"width: 100%"}})},mounted(){n.e(94).then(n.t.bind(null,384,7)).then(t=>{t.initialize({startOnLoad:!0});let e=document.createElement("div");document.body.appendChild(e),t.render(this.id,this.graph,t=>{this.svg=t,document.body.removeChild(e)},e)})},components:{Loading:Xc}};var Jc=n(94),Qc=n.n(Jc);n(246);Vn.component("CodeSwitcher",()=>n.e(44).then(n.bind(null,397)));var tl={tags:{BDK:{key:"BDK",scope:"tags",path:"/blog/tags/BDK/",pageKeys:["v-5e744cf7","v-7c0c45f9","v-2c450c3f","v-3875825f","v-07ff1843","v-9145467a","v-2cf72b39","v-11d64359","v-d0375c8e","v-aeb70fce"]},project:{key:"project",scope:"tags",path:"/blog/tags/project/",pageKeys:["v-5e744cf7","v-2c450c3f"]},tutorial:{key:"tutorial",scope:"tags",path:"/blog/tags/tutorial/",pageKeys:["v-7c0c45f9","v-8bd632d6","v-353b78e1","v-07ff1843","v-56536559","v-f58ec8f2","v-ab5ba3ce"]},"Bitcoin Core":{key:"Bitcoin Core",scope:"tags",path:"/blog/tags/Bitcoin Core/",pageKeys:["v-7c0c45f9"]},RPC:{key:"RPC",scope:"tags",path:"/blog/tags/RPC/",pageKeys:["v-7c0c45f9"]},Wallet:{key:"Wallet",scope:"tags",path:"/blog/tags/Wallet/",pageKeys:["v-7c0c45f9"]},"bdk-cli":{key:"bdk-cli",scope:"tags",path:"/blog/tags/bdk-cli/",pageKeys:["v-8bd632d6","v-0f4d5d15","v-07ff1843","v-ab5ba3ce"]},"multi-sig":{key:"multi-sig",scope:"tags",path:"/blog/tags/multi-sig/",pageKeys:["v-8bd632d6"]},architecture:{key:"architecture",scope:"tags",path:"/blog/tags/architecture/",pageKeys:["v-2cebe183","v-55969f39"]},basics:{key:"basics",scope:"tags",path:"/blog/tags/basics/",pageKeys:["v-0f4d5d15"]},novice:{key:"novice",scope:"tags",path:"/blog/tags/novice/",pageKeys:["v-0f4d5d15"]},tor:{key:"tor",scope:"tags",path:"/blog/tags/tor/",pageKeys:["v-353b78e1"]},wallet:{key:"wallet",scope:"tags",path:"/blog/tags/wallet/",pageKeys:["v-353b78e1","v-56536559","v-f58ec8f2"]},blockchain:{key:"blockchain",scope:"tags",path:"/blog/tags/blockchain/",pageKeys:["v-353b78e1"]},"BDK-RN":{key:"BDK-RN",scope:"tags",path:"/blog/tags/BDK-RN/",pageKeys:["v-3eaa044d"]},Development:{key:"Development",scope:"tags",path:"/blog/tags/Development/",pageKeys:["v-3eaa044d","v-11d64359","v-aeb70fce"]},Architecture:{key:"Architecture",scope:"tags",path:"/blog/tags/Architecture/",pageKeys:["v-3eaa044d"]},bindings:{key:"bindings",scope:"tags",path:"/blog/tags/bindings/",pageKeys:["v-3875825f","v-4dc135e3"]},compact_filters:{key:"compact_filters",scope:"tags",path:"/blog/tags/compact_filters/",pageKeys:["v-07ff1843"]},BIP157:{key:"BIP157",scope:"tags",path:"/blog/tags/BIP157/",pageKeys:["v-07ff1843"]},Neutrino:{key:"Neutrino",scope:"tags",path:"/blog/tags/Neutrino/",pageKeys:["v-07ff1843"]},guide:{key:"guide",scope:"tags",path:"/blog/tags/guide/",pageKeys:["v-9504490e","v-c6756cce","v-56536559","v-f58ec8f2","v-8534b9c2"]},descriptor:{key:"descriptor",scope:"tags",path:"/blog/tags/descriptor/",pageKeys:["v-9504490e","v-c6756cce","v-ab5ba3ce","v-8534b9c2"]},"paper wallets":{key:"paper wallets",scope:"tags",path:"/blog/tags/paper wallets/",pageKeys:["v-9504490e"]},bitcoin:{key:"bitcoin",scope:"tags",path:"/blog/tags/bitcoin/",pageKeys:["v-56536559","v-f58ec8f2"]},"React Native":{key:"React Native",scope:"tags",path:"/blog/tags/React Native/",pageKeys:["v-56536559","v-f58ec8f2"]},Flutter:{key:"Flutter",scope:"tags",path:"/blog/tags/Flutter/",pageKeys:["v-56536559"]},iOS:{key:"iOS",scope:"tags",path:"/blog/tags/iOS/",pageKeys:["v-56536559","v-f58ec8f2"]},Android:{key:"Android",scope:"tags",path:"/blog/tags/Android/",pageKeys:["v-56536559","v-f58ec8f2"]},mobile:{key:"mobile",scope:"tags",path:"/blog/tags/mobile/",pageKeys:["v-56536559","v-f58ec8f2"]},"bdk-rn":{key:"bdk-rn",scope:"tags",path:"/blog/tags/bdk-rn/",pageKeys:["v-56536559","v-f58ec8f2"]},bdk:{key:"bdk",scope:"tags",path:"/blog/tags/bdk/",pageKeys:["v-56536559","v-f58ec8f2","v-ab5ba3ce"]},fee:{key:"fee",scope:"tags",path:"/blog/tags/fee/",pageKeys:["v-2c605799","v-015729b9","v-57698579"]},"machine learning":{key:"machine learning",scope:"tags",path:"/blog/tags/machine learning/",pageKeys:["v-2c605799","v-015729b9","v-57698579"]},taproot:{key:"taproot",scope:"tags",path:"/blog/tags/taproot/",pageKeys:["v-9145467a","v-2cf72b39"]},miniscript:{key:"miniscript",scope:"tags",path:"/blog/tags/miniscript/",pageKeys:["v-9145467a","v-2cf72b39","v-ab5ba3ce","v-10852eea"]},"bitcoin-cli":{key:"bitcoin-cli",scope:"tags",path:"/blog/tags/bitcoin-cli/",pageKeys:["v-ab5ba3ce"]},"Hardware Wallets":{key:"Hardware Wallets",scope:"tags",path:"/blog/tags/Hardware Wallets/",pageKeys:["v-11d64359","v-aeb70fce"]},"coin selection":{key:"coin selection",scope:"tags",path:"/blog/tags/coin selection/",pageKeys:["v-d0375c8e"]},development:{key:"development",scope:"tags",path:"/blog/tags/development/",pageKeys:["v-d0375c8e"]},"summer of bitcoin":{key:"summer of bitcoin",scope:"tags",path:"/blog/tags/summer of bitcoin/",pageKeys:["v-d0375c8e"]},"getting started":{key:"getting started",scope:"tags",path:"/blog/tags/getting started/",pageKeys:["v-5d749fce"]},rust:{key:"rust",scope:"tags",path:"/blog/tags/rust/",pageKeys:["v-5d749fce","v-05df4999","v-edd5570e","v-faad828e","v-0df1c3ce","v-0119984e","v-7c3d28f9","v-75d11339","v-1ac9ef4e"]},security:{key:"security",scope:"tags",path:"/blog/tags/security/",pageKeys:["v-10852eea"]},release:{key:"release",scope:"tags",path:"/blog/tags/release/",pageKeys:["v-05df4999","v-edd5570e","v-faad828e","v-0df1c3ce","v-0119984e","v-7c3d28f9","v-75d11339","v-1ac9ef4e"]}},author:{"Steve Myers":{key:"Steve Myers",scope:"author",path:"/blog/author/Steve Myers/",pageKeys:["v-5e744cf7","v-2c450c3f","v-9504490e","v-8534b9c2"]},"Rajarshi Maitra":{key:"Rajarshi Maitra",scope:"author",path:"/blog/author/Rajarshi Maitra/",pageKeys:["v-7c0c45f9","v-07ff1843","v-ab5ba3ce"]},"Daniela Brozzoni":{key:"Daniela Brozzoni",scope:"author",path:"/blog/author/Daniela Brozzoni/",pageKeys:["v-2c450c3f","v-aeb70fce"]},waterst0ne:{key:"waterst0ne",scope:"author",path:"/blog/author/waterst0ne/",pageKeys:["v-8bd632d6","v-0f4d5d15"]},"Lloyd Fournier":{key:"Lloyd Fournier",scope:"author",path:"/blog/author/Lloyd Fournier/",pageKeys:["v-2cebe183"]},rorp:{key:"rorp",scope:"author",path:"/blog/author/rorp/",pageKeys:["v-353b78e1"]},"Bitcoin Zavior":{key:"Bitcoin Zavior",scope:"author",path:"/blog/author/Bitcoin Zavior/",pageKeys:["v-3eaa044d","v-56536559","v-f58ec8f2"]},thunderbiscuit:{key:"thunderbiscuit",scope:"author",path:"/blog/author/thunderbiscuit/",pageKeys:["v-3875825f","v-8534b9c2","v-4dc135e3"]},"Riccardo Casatta":{key:"Riccardo Casatta",scope:"author",path:"/blog/author/Riccardo Casatta/",pageKeys:["v-9504490e","v-2c605799","v-015729b9","v-57698579"]},"Gabriele Domenichini":{key:"Gabriele Domenichini",scope:"author",path:"/blog/author/Gabriele Domenichini/",pageKeys:["v-c6756cce"]},"Alekos Filini":{key:"Alekos Filini",scope:"author",path:"/blog/author/Alekos Filini/",pageKeys:["v-9145467a","v-2cf72b39","v-5d749fce","v-10852eea","v-05df4999","v-edd5570e","v-faad828e","v-0df1c3ce","v-0119984e","v-7c3d28f9","v-75d11339","v-1ac9ef4e","v-55969f39"]},"Sandipan Dey":{key:"Sandipan Dey",scope:"author",path:"/blog/author/Sandipan Dey/",pageKeys:["v-ab5ba3ce"]},Wszdexdrf:{key:"Wszdexdrf",scope:"author",path:"/blog/author/Wszdexdrf/",pageKeys:["v-11d64359"]},"César Alvarez Vallero":{key:"César Alvarez Vallero",scope:"author",path:"/blog/author/César Alvarez Vallero/",pageKeys:["v-d0375c8e"]}}};class el{constructor(t,e){this._metaMap=Object.assign({},t),Object.keys(this._metaMap).forEach(t=>{const{pageKeys:n}=this._metaMap[t];this._metaMap[t].pages=n.map(t=>function(t,e){for(let n=0;n{const{pages:n,path:o}=this._metaMap[e];t.push({name:e,pages:n,path:o})}),t}getItemByName(t){return this._metaMap[t]}}var nl={blog:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},tags:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1},author:(t,e)=>{const o=n(45);return o(t.frontmatter.date)-o(e.frontmatter.date)>0?-1:1}},ol={blog:function(t,e,n){return t.pid===n&&t.id===e},tags:function(t,e,n){const o=e;return["tags"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})},author:function(t,e,n){const o=e;return["author","authors"].some(e=>{const n=t.frontmatter[e];return Array.isArray(n)?n.some(t=>t==o):n==o})}},il=[{pid:"blog",id:"blog",filter:ol.blog,sorter:nl.blog,pages:[{path:"/blog/",interval:[0,9]},{path:"/blog/page/2/",interval:[10,19]},{path:"/blog/page/3/",interval:[20,29]},{path:"/blog/page/4/",interval:[30,36]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"project",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/project/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tutorial",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tutorial/",interval:[0,7]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Bitcoin Core",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Bitcoin Core/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"RPC",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/RPC/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Wallet/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-cli/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"multi-sig",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/multi-sig/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/architecture/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"basics",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/basics/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"novice",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/novice/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"tor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/tor/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"wallet",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/wallet/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"blockchain",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/blockchain/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BDK-RN",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BDK-RN/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Development/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Architecture",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Architecture/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bindings",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bindings/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"compact_filters",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/compact_filters/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"BIP157",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/BIP157/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Neutrino",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Neutrino/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"guide",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/guide/",interval:[0,5]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"descriptor",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/descriptor/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"paper wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/paper wallets/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"React Native",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/React Native/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Flutter",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Flutter/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"iOS",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/iOS/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Android",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Android/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"mobile",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/mobile/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk-rn",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk-rn/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bdk",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bdk/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"fee",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/fee/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"machine learning",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/machine learning/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"taproot",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/taproot/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"miniscript",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/miniscript/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"bitcoin-cli",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/bitcoin-cli/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Hardware Wallets",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/Hardware Wallets/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"coin selection",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/coin selection/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"development",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/development/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"summer of bitcoin",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/summer of bitcoin/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"getting started",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/getting started/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"rust",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/rust/",interval:[0,9]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"security",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/security/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"release",filter:ol.tags,sorter:nl.tags,pages:[{path:"/blog/tags/release/",interval:[0,8]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Steve Myers",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Steve Myers/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Rajarshi Maitra",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Rajarshi Maitra/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Daniela Brozzoni",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Daniela Brozzoni/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"waterst0ne",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/waterst0ne/",interval:[0,2]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Lloyd Fournier",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Lloyd Fournier/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"rorp",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/rorp/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Bitcoin Zavior",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Bitcoin Zavior/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"thunderbiscuit",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/thunderbiscuit/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Riccardo Casatta",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Riccardo Casatta/",interval:[0,4]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Gabriele Domenichini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Gabriele Domenichini/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Alekos Filini",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Alekos Filini/",interval:[0,9]},{path:"/blog/author/Alekos Filini/page/2/",interval:[10,13]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Sandipan Dey",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Sandipan Dey/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"Wszdexdrf",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/Wszdexdrf/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"author",id:"César Alvarez Vallero",filter:ol.author,sorter:nl.author,pages:[{path:"/blog/author/César Alvarez Vallero/",interval:[0,1]}],prevText:"Prev",nextText:"Next"}],rl=n(95);const al=n.n(rl)()("plugin-blog:pagination");class cl{constructor(t,e,n){al("pagination",t);const{pages:o,prevText:i,nextText:r}=t,{path:a}=n;this._prevText=i,this._nextText=r;for(let t=0,e=o.length;tt.filter(e,t.id,t.pid)).sort(t.sorter)}setIndexPage(t){this._indexPage=t}get length(){return this._paginationPages.length}get pages(){const[t,e]=this._currentPage.interval;return this._matchedPages.slice(t,e+1)}get hasPrev(){return 0!==this.paginationIndex}get prevLink(){return this.hasPrev?this.paginationIndex-1==0&&this._indexPage?this._indexPage:this._paginationPages[this.paginationIndex-1].path:null}get hasNext(){return this.paginationIndex!==this.length-1}get nextLink(){return this.hasNext?this._paginationPages[this.paginationIndex+1].path:null}get prevText(){return this._prevText}get nextText(){return this._nextText}getSpecificPageLink(t){return this._paginationPages[t].path}}const ll=new class{constructor(t){this.paginations=t}get pages(){return Vn.$vuepress.$get("siteData").pages}getPagination(t,e,n){al("id",e),al("pid",t);const o=this.paginations.filter(n=>n.id===e&&n.pid===t)[0];return new cl(o,this.pages,n)}}(il);var sl={comment:{enabled:!1,service:""},email:{enabled:!1},feed:{rss:!1,atom:!1,json:!1}},pl=[({router:t})=>{"undefined"!=typeof process&&"server"===process.env.VUE_ENV||t.onReady(()=>{const{app:e}=t;e.$once("hook:mounted",()=>{setTimeout(()=>{const{hash:t}=document.location;if(t.length>1){const e=t.substring(1),n=document.getElementById(e);n&&n.scrollIntoView()}},500)}),document.addEventListener("click",Gc),document.addEventListener("keyup",t=>{qc(t)&&Gc(t)})})},{},({Vue:t})=>{t.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({Vue:t})=>{t.component("CodeCopy",Sc)},({Vue:t})=>{t.component("Mermaid",Yc)},({Vue:t})=>t.use(Qc.a),{},{},({Vue:t})=>{const e=Object.keys(tl).map(t=>{const e=tl[t],n="$"+t;return{[n](){const{pages:t}=this.$site;return new el(e,t)},["$current"+(t.charAt(0).toUpperCase()+t.slice(1))](){const t=this.$route.meta.id;return this[n].getItemByName(t)}}}).reduce((t,e)=>(Object.assign(t,e),t),{});e.$frontmatterKey=function(){const t=this["$"+this.$route.meta.id];return t||null},t.mixin({computed:e})},({Vue:t})=>{t.mixin({computed:{$pagination(){return this.$route.meta.pid&&this.$route.meta.id?this.$getPagination(this.$route.meta.pid,this.$route.meta.id):null}},methods:{$getPagination(t,e){return e=e||t,ll.getPagination(t,e,this.$route)}}})},({Vue:t})=>{const e={$service:()=>sl};t.mixin({computed:e})}],dl=[];class ul extends class{constructor(){this.store=new Vn({data:{state:{}}})}$get(t){return this.store.state[t]}$set(t,e){Vn.set(this.store.state,t,e)}$emit(...t){this.store.$emit(...t)}$on(...t){this.store.$on(...t)}}{}Object.assign(ul.prototype,{getPageAsyncComponent:ac,getLayoutAsyncComponent:cc,getAsyncComponent:lc,getVueComponent:sc});var gl={install(t){const e=new ul;t.$vuepress=e,t.prototype.$vuepress=e}};function hl(t,e){const n=e.toLowerCase();return t.options.routes.some(t=>t.path.toLowerCase()===n)}var ml={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(t){const e=this.pageKey||this.$parent.$page.key;return dc("pageKey",e),Vn.component(e)||Vn.component(e,ac(e)),Vn.component(e)?t(e):t("")}},fl={functional:!0,props:{slotKey:String,required:!0},render:(t,{props:e,slots:n})=>t("div",{class:["content__"+e.slotKey]},n()[e.slotKey])},vl={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},bl=(n(249),n(250),Object(Kc.a)(vl,(function(){var t=this._self._c;return t("span",[t("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[t("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),t("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),t("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),yl={functional:!0,render(t,{parent:e,children:n}){if(e._isMounted)return n;e.$once("hook:mounted",()=>{e.$forceUpdate()})}};Vn.config.productionTip=!1,Vn.use(Wa),Vn.use(gl),Vn.mixin(function(t,e,n=Vn){!function(t){t.locales&&Object.keys(t.locales).forEach(e=>{t.locales[e].path=e});Object.freeze(t)}(e),n.$vuepress.$set("siteData",e);const o=new(t(n.$vuepress.$get("siteData"))),i=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(o)),r={};return Object.keys(i).reduce((t,e)=>(e.startsWith("$")&&(t[e]=i[e].get),t),r),{computed:r}}(t=>class{setPage(t){this.__page=t}get $site(){return t}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:t={}}=this.$site;let e,n;for(const o in t)"/"===o?n=t[o]:0===this.$page.path.indexOf(o)&&(e=t[o]);return e||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:t}=this.$page.frontmatter;return"string"==typeof t&&t}get $title(){const t=this.$page,{metaTitle:e}=this.$page.frontmatter;if("string"==typeof e)return e;const n=this.$siteTitle,o=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?o?o+" | "+n:n:o||"VuePress"}get $description(){const t=function(t){if(t){const e=t.filter(t=>"description"===t.name)[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(t,e){for(let n=0;nn||(t.hash?!Vn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})});!function(t){t.beforeEach((e,n,o)=>{if(hl(t,e.path))o();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){const n=e.path.replace(/\/$/,"")+".html";hl(t,n)?o(n):o()}else o();else{const n=e.path+"/",i=e.path+".html";hl(t,i)?o(i):hl(t,n)?o(n):o()}})}(n);const o={};try{await Promise.all(pl.filter(t=>"function"==typeof t).map(e=>e({Vue:Vn,options:o,router:n,siteData:zc,isServer:t})))}catch(t){console.error(t)}return{app:new Vn(Object.assign(o,{router:n,render:t=>t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},dl.map(e=>t(e)))])})),router:n}}(!1).then(({app:t,router:e})=>{e.onReady(()=>{t.$mount("#app")})})}]); \ No newline at end of file diff --git a/bdk-cli/compiler/index.html b/bdk-cli/compiler/index.html index 19754cd444..044a588d63 100644 --- a/bdk-cli/compiler/index.html +++ b/bdk-cli/compiler/index.html @@ -35,7 +35,7 @@ - + @@ -155,7 +155,7 @@ } }

# Troubleshooting

# Nothing is printed

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

- + diff --git a/bdk-cli/concept/index.html b/bdk-cli/concept/index.html index 206e5b382c..a2df0aafb5 100644 --- a/bdk-cli/concept/index.html +++ b/bdk-cli/concept/index.html @@ -31,7 +31,7 @@ - + @@ -62,7 +62,7 @@ will never contain any data that can't be recreated purely by looking at the blockchain. Keys, descriptors, Electrum endpoints are not stored in the database. This explains why you'll have to specify them every time in the command line. It can be seen more like a cache and can be safely deleted without risking funds.
  • BDK doesn't automatically "monitor" the blockchain, instead there's a sync command that has to be called by the user.
  • When you create a transaction and then sign it, it's not automatically broadcast to the network. There's a broadcast command that does this. Moreover, the command doesn't accept a normal Bitcoin raw transaction, but instead a PSBT. That's because internally transactions are always moved as PSBTs, and again, the broadcast command is just a very thin wrapper over the raw library call.
  • There are probably more of these examples, but hopefully by this point you'll have more or less understood the gist of it. If you are not a developer, some parts of this will feel weird, inefficient, hard -to understand, and that's absolutely normal. Just try to survive through the pain and you'll be rewarded!

    - + diff --git a/bdk-cli/installation/index.html b/bdk-cli/installation/index.html index bba3997379..4d5ca7efac 100644 --- a/bdk-cli/installation/index.html +++ b/bdk-cli/installation/index.html @@ -35,7 +35,7 @@ - + @@ -112,7 +112,7 @@ wallet Wallet Operations

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

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

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

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

    # sync

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

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

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

    # sync

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

    - + diff --git a/bdk-cli/introduction/index.html b/bdk-cli/introduction/index.html index 75283cb0c6..ff4f097b58 100644 --- a/bdk-cli/introduction/index.html +++ b/bdk-cli/introduction/index.html @@ -29,7 +29,7 @@ - + @@ -53,7 +53,7 @@ Blog GitHub - (opens new window)

    # Introduction

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

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

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

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

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

    - + diff --git a/bdk-cli/playground/index.html b/bdk-cli/playground/index.html index 806a065467..58e068f03c 100644 --- a/bdk-cli/playground/index.html +++ b/bdk-cli/playground/index.html @@ -27,7 +27,7 @@ - + @@ -51,7 +51,7 @@ Blog GitHub - (opens new window)

    # Playground

    - + diff --git a/bdk-cli/regtest/index.html b/bdk-cli/regtest/index.html index b447195033..3c6bd02c0b 100644 --- a/bdk-cli/regtest/index.html +++ b/bdk-cli/regtest/index.html @@ -31,7 +31,7 @@ - + @@ -60,7 +60,7 @@

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

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

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

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

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

    # Troubleshooting

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

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

    # Bonus: Docker

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

    Install 🍣 Nigiri

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

    Start Docker daemon and run Nigiri box

    $ nigiri start
    -

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

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

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

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

    - + diff --git a/blog/2020/12/hello-world/index.html b/blog/2020/12/hello-world/index.html index ddbaafa4e3..740795225d 100644 --- a/blog/2020/12/hello-world/index.html +++ b/blog/2020/12/hello-world/index.html @@ -30,7 +30,7 @@ - + @@ -147,7 +147,7 @@ txid = txid );

    # Custom Database and Blockchain types

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

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

    # Conclusion

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

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

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

    # Support for sortedmulti()

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

    # Contributors

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

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

    A special thanks to the 7 new contributors:

    - + diff --git a/blog/tags/bdk-cli/index.html b/blog/tags/bdk-cli/index.html index bbfcb38683..95597dbd6a 100644 --- a/blog/tags/bdk-cli/index.html +++ b/blog/tags/bdk-cli/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bdk-rn/index.html b/blog/tags/bdk-rn/index.html index 76540763f3..c901dddf1e 100644 --- a/blog/tags/bdk-rn/index.html +++ b/blog/tags/bdk-rn/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bdk/index.html b/blog/tags/bdk/index.html index f2764af3b6..2eeb819ff9 100644 --- a/blog/tags/bdk/index.html +++ b/blog/tags/bdk/index.html @@ -25,7 +25,7 @@ - + @@ -180,6 +180,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bindings/index.html b/blog/tags/bindings/index.html index 305ac280f2..802211820d 100644 --- a/blog/tags/bindings/index.html +++ b/blog/tags/bindings/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bitcoin-cli/index.html b/blog/tags/bitcoin-cli/index.html index d09e60ec7b..d44cd176f8 100644 --- a/blog/tags/bitcoin-cli/index.html +++ b/blog/tags/bitcoin-cli/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/bitcoin/index.html b/blog/tags/bitcoin/index.html index 720bbda7c5..9ef55b7b2a 100644 --- a/blog/tags/bitcoin/index.html +++ b/blog/tags/bitcoin/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/blockchain/index.html b/blog/tags/blockchain/index.html index e81b051029..01c3d5c3dc 100644 --- a/blog/tags/blockchain/index.html +++ b/blog/tags/blockchain/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/coin selection/index.html b/blog/tags/coin selection/index.html index 902ae5c048..799d6dacc2 100644 --- a/blog/tags/coin selection/index.html +++ b/blog/tags/coin selection/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/compact_filters/index.html b/blog/tags/compact_filters/index.html index e96fea7903..68e79a590d 100644 --- a/blog/tags/compact_filters/index.html +++ b/blog/tags/compact_filters/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/descriptor/index.html b/blog/tags/descriptor/index.html index ccc6671c59..0f57cfec6d 100644 --- a/blog/tags/descriptor/index.html +++ b/blog/tags/descriptor/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/development/index.html b/blog/tags/development/index.html index bb890148e8..08f11de398 100644 --- a/blog/tags/development/index.html +++ b/blog/tags/development/index.html @@ -25,7 +25,7 @@ - + @@ -103,6 +103,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/fee/index.html b/blog/tags/fee/index.html index 5d32cad715..1e58909eb9 100644 --- a/blog/tags/fee/index.html +++ b/blog/tags/fee/index.html @@ -25,7 +25,7 @@ - + @@ -49,7 +49,7 @@ Blog GitHub - (opens new window)
    - + diff --git a/blog/tags/getting started/index.html b/blog/tags/getting started/index.html index 0f1a158797..677207428b 100644 --- a/blog/tags/getting started/index.html +++ b/blog/tags/getting started/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/guide/index.html b/blog/tags/guide/index.html index 2cf24a1840..dcfe17e398 100644 --- a/blog/tags/guide/index.html +++ b/blog/tags/guide/index.html @@ -25,7 +25,7 @@ - + @@ -125,6 +125,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/iOS/index.html b/blog/tags/iOS/index.html index 5134504181..3e50d232b2 100644 --- a/blog/tags/iOS/index.html +++ b/blog/tags/iOS/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/index.html b/blog/tags/index.html index c91ce29690..e1bd18f61c 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 d27f8a47db..fd2a67d9f1 100644 --- a/blog/tags/miniscript/index.html +++ b/blog/tags/miniscript/index.html @@ -25,7 +25,7 @@ - + @@ -114,6 +114,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/mobile/index.html b/blog/tags/mobile/index.html index c6d1d24a6e..57e72e301c 100644 --- a/blog/tags/mobile/index.html +++ b/blog/tags/mobile/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/multi-sig/index.html b/blog/tags/multi-sig/index.html index fd46fcb59f..e4cea06749 100644 --- a/blog/tags/multi-sig/index.html +++ b/blog/tags/multi-sig/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/novice/index.html b/blog/tags/novice/index.html index 2f89e6fd2b..d2c56b16da 100644 --- a/blog/tags/novice/index.html +++ b/blog/tags/novice/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/paper wallets/index.html b/blog/tags/paper wallets/index.html index 5c321f0147..33badf0939 100644 --- a/blog/tags/paper wallets/index.html +++ b/blog/tags/paper wallets/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/project/index.html b/blog/tags/project/index.html index 92d28a6bf7..fbc711aa54 100644 --- a/blog/tags/project/index.html +++ b/blog/tags/project/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/release/index.html b/blog/tags/release/index.html index 17b934e7ab..aa6ba4da3b 100644 --- a/blog/tags/release/index.html +++ b/blog/tags/release/index.html @@ -25,7 +25,7 @@ - + @@ -158,6 +158,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/rust/index.html b/blog/tags/rust/index.html index 5989156f42..2d16b4265e 100644 --- a/blog/tags/rust/index.html +++ b/blog/tags/rust/index.html @@ -25,7 +25,7 @@ - + @@ -169,6 +169,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/security/index.html b/blog/tags/security/index.html index bddff942a5..b14a9882ab 100644 --- a/blog/tags/security/index.html +++ b/blog/tags/security/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/summer of bitcoin/index.html b/blog/tags/summer of bitcoin/index.html index fec0578108..c5f276117c 100644 --- a/blog/tags/summer of bitcoin/index.html +++ b/blog/tags/summer of bitcoin/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/taproot/index.html b/blog/tags/taproot/index.html index 3567072341..b146efa41a 100644 --- a/blog/tags/taproot/index.html +++ b/blog/tags/taproot/index.html @@ -25,7 +25,7 @@ - + @@ -92,6 +92,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/tor/index.html b/blog/tags/tor/index.html index 45ddcc6566..5abb92e84f 100644 --- a/blog/tags/tor/index.html +++ b/blog/tags/tor/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/tutorial/index.html b/blog/tags/tutorial/index.html index 77218025dd..b714f8c9e8 100644 --- a/blog/tags/tutorial/index.html +++ b/blog/tags/tutorial/index.html @@ -25,7 +25,7 @@ - + @@ -147,6 +147,6 @@
    BDK Foundation
    - + diff --git a/blog/tags/wallet/index.html b/blog/tags/wallet/index.html index 89590085c6..9f00992ab1 100644 --- a/blog/tags/wallet/index.html +++ b/blog/tags/wallet/index.html @@ -25,7 +25,7 @@ - + @@ -81,6 +81,6 @@
    BDK Foundation
    - + diff --git a/blog/using-bdk-with-hardware-wallets/index.html b/blog/using-bdk-with-hardware-wallets/index.html index 9e090cd035..be404f3061 100644 --- a/blog/using-bdk-with-hardware-wallets/index.html +++ b/blog/using-bdk-with-hardware-wallets/index.html @@ -30,7 +30,7 @@ - + @@ -181,7 +181,7 @@ blockchain.broadcast(&raw_transaction)?; println!("Transaction broadcasted! TXID: {txid}.\nExplorer URL: https://mempool.space/testnet/tx/{txid}", txid = txid); -

    # Conclusion

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

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

    - + diff --git a/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html b/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html index 947a038aa8..56eec9c99a 100644 --- a/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html +++ b/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.BlockEvent.html @@ -1,18 +1,18 @@ BlockEvent in bdk_bitcoind_rpc - Rust

    Struct bdk_bitcoind_rpc::BlockEvent

    source ·
    pub struct BlockEvent<B> {
         pub block: B,
    -    pub checkpoint: CheckPoint,
    +    pub checkpoint: CheckPoint,
     }
    Expand description

    A newly emitted block from Emitter.

    Fields§

    §block: B

    Either a full [Block] or [Header] of the new block.

    -
    §checkpoint: CheckPoint

    The checkpoint of the new block.

    -

    A [CheckPoint] is a node of a linked list of [BlockId]s. This checkpoint is linked to -all [BlockId]s originally passed in Emitter::new as well as emitted blocks since then. +

    §checkpoint: CheckPoint

    The checkpoint of the new block.

    +

    A CheckPoint is a node of a linked list of BlockIds. This checkpoint is linked to +all BlockIds originally passed in Emitter::new as well as emitted blocks since then. These blocks are guaranteed to be of the same chain.

    This is important as BDK structures require block-to-apply to be connected with another block in the original chain.

    Implementations§

    source§

    impl<B> BlockEvent<B>

    source

    pub fn block_height(&self) -> u32

    The block height of this new block.

    source

    pub fn block_hash(&self) -> BlockHash

    The block hash of this new block.

    -
    source

    pub fn connected_to(&self) -> BlockId

    The [BlockId] of a previous block that this block connects to.

    -

    This either returns a [BlockId] of a previously emitted block or from the chain we started +

    source

    pub fn connected_to(&self) -> BlockId

    The BlockId of a previous block that this block connects to.

    +

    This either returns a BlockId of a previously emitted block or from the chain we started with (passed in as last_cp in Emitter::new).

    This value is derived from BlockEvent::checkpoint.

    Trait Implementations§

    source§

    impl<B: Debug> Debug for BlockEvent<B>

    source§

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

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl<B> Freeze for BlockEvent<B>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html b/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html index 2a04dd89be..779e430544 100644 --- a/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html +++ b/docs-rs/bdk/nightly/latest/bdk_bitcoind_rpc/struct.Emitter.html @@ -1,6 +1,6 @@ Emitter in bdk_bitcoind_rpc - Rust

    Struct bdk_bitcoind_rpc::Emitter

    source ·
    pub struct Emitter<'c, C> { /* private fields */ }
    Expand description

    The Emitter is used to emit data sourced from [bitcoincore_rpc::Client].

    Refer to module-level documentation for more.

    -

    Implementations§

    source§

    impl<'c, C: RpcApi> Emitter<'c, C>

    source

    pub fn new(client: &'c C, last_cp: CheckPoint, start_height: u32) -> Self

    Construct a new Emitter.

    +

    Implementations§

    source§

    impl<'c, C: RpcApi> Emitter<'c, C>

    source

    pub fn new(client: &'c C, last_cp: CheckPoint, start_height: u32) -> Self

    Construct a new Emitter.

    last_cp informs the emitter of the chain we are starting off with. This way, the emitter can start emission from a block that connects to the original chain.

    start_height starts emission from a given height (if there are no conflicts with the diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/all.html b/docs-rs/bdk/nightly/latest/bdk_chain/all.html index 39aaa3c2ae..7b6f7fa68b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/all.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/all.html @@ -1 +1 @@ -List of all items in this crate

    \ No newline at end of file +List of all items in this crate
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/constant.BIP32_MAX_INDEX.html b/docs-rs/bdk/nightly/latest/bdk_chain/constant.BIP32_MAX_INDEX.html index c3d181804f..9ea449b782 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/constant.BIP32_MAX_INDEX.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/constant.BIP32_MAX_INDEX.html @@ -1,2 +1,2 @@ -BIP32_MAX_INDEX in bdk_chain - Rust

    Constant bdk_chain::BIP32_MAX_INDEX

    source ·
    pub const BIP32_MAX_INDEX: u32 = _; // 2_147_483_647u32
    Expand description

    Maximum BIP32 derivation index.

    +BIP32_MAX_INDEX in bdk_chain - Rust

    Constant bdk_chain::BIP32_MAX_INDEX

    source ·
    pub const BIP32_MAX_INDEX: u32 = _; // 2_147_483_647u32
    Expand description

    Maximum BIP32 derivation index.

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html b/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html index d510d23f0a..ae58ddc720 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/constant.COINBASE_MATURITY.html @@ -1,2 +1,2 @@ -COINBASE_MATURITY in bdk_chain - Rust

    Constant bdk_chain::COINBASE_MATURITY

    source ·
    pub const COINBASE_MATURITY: u32 = 100;
    Expand description

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

    +COINBASE_MATURITY in bdk_chain - Rust

    Constant bdk_chain::COINBASE_MATURITY

    source ·
    pub const COINBASE_MATURITY: u32 = 100;
    Expand description

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

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

    Crate bdk_chain

    source ·
    Expand description

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

    +bdk_chain - Rust

    Crate bdk_chain

    source ·
    Expand description

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

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

    1. Figure out what data they need to fetch.
    2. @@ -14,7 +14,7 @@
    3. Data persistence agnostic – bdk_chain does not care where you cache on-chain data, what you cache or how you retrieve it from persistent storage.
    -

    Re-exports§

    Modules§

    Re-exports§

    Modules§

    Structs§

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

    Enums§

    Constants§

    Traits§

    • Trait that “anchors” blockchain data to a specific block of height and hash.
    • An Anchor that can be constructed from a given block, block height and transaction position diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/trait.Indexer.html b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/trait.Indexer.html index a091526c24..a076202d71 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/trait.Indexer.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/indexed_tx_graph/trait.Indexer.html @@ -20,4 +20,4 @@
    source

    fn apply_changeset(&mut self, changeset: Self::ChangeSet)

    Apply changeset to itself.

    source

    fn initial_changeset(&self) -> Self::ChangeSet

    Determines the ChangeSet between self and an empty Indexer.

    source

    fn is_tx_relevant(&self, tx: &Transaction) -> bool

    Determines whether the transaction should be included in the index.

    -

    Implementors§

    \ No newline at end of file +

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/constant.DEFAULT_LOOKAHEAD.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/constant.DEFAULT_LOOKAHEAD.html new file mode 100644 index 0000000000..90037d5be8 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/constant.DEFAULT_LOOKAHEAD.html @@ -0,0 +1,2 @@ +DEFAULT_LOOKAHEAD in bdk_chain::keychain - Rust

    Constant bdk_chain::keychain::DEFAULT_LOOKAHEAD

    source ·
    pub const DEFAULT_LOOKAHEAD: u32 = 25;
    Expand description

    The default lookahead for a KeychainTxOutIndex

    +
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/enum.InsertDescriptorError.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/enum.InsertDescriptorError.html new file mode 100644 index 0000000000..2273692201 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/enum.InsertDescriptorError.html @@ -0,0 +1,37 @@ +InsertDescriptorError in bdk_chain::keychain - Rust

    Enum bdk_chain::keychain::InsertDescriptorError

    source ·
    pub enum InsertDescriptorError<K> {
    +    DescriptorAlreadyAssigned {
    +        descriptor: Descriptor<DescriptorPublicKey>,
    +        existing_assignment: K,
    +    },
    +    KeychainAlreadyAssigned {
    +        keychain: K,
    +        existing_assignment: Descriptor<DescriptorPublicKey>,
    +    },
    +}
    Expand description

    Variants§

    §

    DescriptorAlreadyAssigned

    The descriptor has already been assigned to a keychain so you can’t assign it to another

    +

    Fields

    §descriptor: Descriptor<DescriptorPublicKey>

    The descriptor you have attempted to reassign

    +
    §existing_assignment: K

    The keychain that the descriptor is already assigned to

    +
    §

    KeychainAlreadyAssigned

    The keychain is already assigned to a descriptor so you can’t reassign it

    +

    Fields

    §keychain: K

    The keychain that you have attempted to reassign

    +
    §existing_assignment: Descriptor<DescriptorPublicKey>

    The descriptor that the keychain is already assigned to

    +

    Trait Implementations§

    source§

    impl<K: Clone> Clone for InsertDescriptorError<K>

    source§

    fn clone(&self) -> InsertDescriptorError<K>

    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> Debug for InsertDescriptorError<K>

    source§

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

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

    impl<K: Debug> Display for InsertDescriptorError<K>

    source§

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

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

    impl<K: Debug> Error for InsertDescriptorError<K>

    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<K: PartialEq> PartialEq for InsertDescriptorError<K>

    source§

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

    Auto Trait Implementations§

    §

    impl<K> !Freeze for InsertDescriptorError<K>

    §

    impl<K> RefUnwindSafe for InsertDescriptorError<K>
    where + K: RefUnwindSafe,

    §

    impl<K> Send for InsertDescriptorError<K>
    where + K: Send,

    §

    impl<K> Sync for InsertDescriptorError<K>
    where + K: Sync,

    §

    impl<K> Unpin for InsertDescriptorError<K>
    where + K: Unpin,

    §

    impl<K> UnwindSafe for InsertDescriptorError<K>
    where + K: UnwindSafe,

    Blanket Implementations§

    source§

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

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

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

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

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

    source§

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

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    +
    source§

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

    source§

    fn into(self) -> U

    Calls U::from(self).

    +

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

    +
    source§

    impl<T> 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> ToString for T
    where + T: Display + ?Sized,

    source§

    default fn to_string(&self) -> String

    Converts the given value to a String. Read more
    source§

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

    §

    type Error = Infallible

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

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

    Performs the conversion.
    source§

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

    §

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

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

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

    Performs the conversion.
    §

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

    §

    fn vzip(self) -> V

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

    Module bdk_chain::keychain

    source ·
    Expand description

    Module for keychain related structures.

    +bdk_chain::keychain - Rust

    Module bdk_chain::keychain

    source ·
    Expand description

    Module for keychain related structures.

    A keychain here is a set of application-defined indexes for a miniscript descriptor where we can derive script pubkeys at a particular derivation index. The application’s index is simply anything that implements Ord.

    @@ -7,4 +7,4 @@ also maintains “revealed” and “lookahead” index counts per keychain.

    Structs§

    \ No newline at end of file +indexes [TxOut]s with them.
  • The keychain doesn’t exist. Most likley hasn’t been inserted with KeychainTxOutIndex::insert_descriptor.
  • Enums§

    Constants§

    Type Aliases§

    • A tuple of keychain index and T representing the indexed value.
    • A tuple of keychain K, derivation index (u32) and a T associated with them.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/sidebar-items.js b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/sidebar-items.js index fa5ca6e6e3..a6e50315ef 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/sidebar-items.js +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"struct":["Balance","ChangeSet","KeychainTxOutIndex"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"constant":["DEFAULT_LOOKAHEAD"],"enum":["InsertDescriptorError"],"struct":["Balance","ChangeSet","KeychainTxOutIndex","NoSuchKeychain"],"type":["Indexed","KeychainIndexed"]}; \ No newline at end of file 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 add9b35350..63b70fcfed 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/keychain/struct.ChangeSet.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.ChangeSet.html index 72096e2c9e..949d7f5ee0 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.ChangeSet.html @@ -1,25 +1,25 @@ -ChangeSet in bdk_chain::keychain - Rust

    Struct bdk_chain::keychain::ChangeSet

    source ·
    pub struct ChangeSet<K> {
    +ChangeSet in bdk_chain::keychain - Rust

    Struct bdk_chain::keychain::ChangeSet

    source ·
    pub struct ChangeSet<K> {
         pub keychains_added: BTreeMap<K, Descriptor<DescriptorPublicKey>>,
         pub last_revealed: BTreeMap<DescriptorId, u32>,
     }
    Expand description

    Represents updates to the derivation index of a KeychainTxOutIndex. It maps each keychain K to a descriptor and its last revealed index.

    -

    It can be applied to KeychainTxOutIndex with apply_changeset. `ChangeSet are -monotone in that they will never decrease the revealed derivation index.

    +

    It can be applied to KeychainTxOutIndex with apply_changeset.

    +

    The last_revealed field is monotone in that append will never decrease it. +keychains_added is not monotone, once it is set any attempt to change it is subject to the +same one-to-one keychain <-> descriptor mapping invariant as KeychainTxOutIndex itself.

    Fields§

    §keychains_added: BTreeMap<K, Descriptor<DescriptorPublicKey>>

    Contains the keychains that have been added and their respective descriptor

    §last_revealed: BTreeMap<DescriptorId, u32>

    Contains for each descriptor_id the last revealed index of derivation

    -

    Trait Implementations§

    source§

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

    source§

    fn append(&mut self, other: Self)

    Append another ChangeSet into self.

    -

    For each keychain in keychains_added in the given ChangeSet: -If the keychain already exist with a different descriptor, we overwrite the old descriptor.

    -

    For each last_revealed in the given ChangeSet: -If the keychain already exists, increase the index when the other’s index > self’s index.

    -
    source§

    fn is_empty(&self) -> bool

    Returns whether the changeset are empty.

    -
    source§

    impl<K: Clone> Clone for ChangeSet<K>

    source§

    fn clone(&self) -> ChangeSet<K>

    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> Debug for ChangeSet<K>

    source§

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

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

    impl<K> Default for ChangeSet<K>

    source§

    fn default() -> Self

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

    impl<'de, K> Deserialize<'de> for ChangeSet<K>
    where - 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<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<K: PartialEq> PartialEq for ChangeSet<K>

    source§

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

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

    Trait Implementations§

    source§

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

    source§

    fn append(&mut self, other: Self)

    Merge another ChangeSet<K> into self.

    +

    For the keychains_added field this method respects the invariants of +insert_descriptor. last_revealed always becomes the larger of the two.

    +
    source§

    fn is_empty(&self) -> bool

    Returns whether the changeset are empty.

    +
    source§

    impl<K: Clone> Clone for ChangeSet<K>

    source§

    fn clone(&self) -> ChangeSet<K>

    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> Debug for ChangeSet<K>

    source§

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

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

    impl<K> Default for ChangeSet<K>

    source§

    fn default() -> Self

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

    impl<'de, K> Deserialize<'de> for ChangeSet<K>
    where + 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<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<K: PartialEq> PartialEq for ChangeSet<K>

    source§

    fn eq(&self, other: &ChangeSet<K>) -> 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> Serialize for ChangeSet<K>
    where - K: 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<K> StructuralPartialEq for ChangeSet<K>

    Auto Trait Implementations§

    §

    impl<K> Freeze for ChangeSet<K>

    §

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

    source§

    impl<K> Serialize for ChangeSet<K>
    where + K: 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<K> StructuralPartialEq for ChangeSet<K>

    Auto Trait Implementations§

    §

    impl<K> Freeze for ChangeSet<K>

    §

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

    §

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

    §

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

    §

    impl<K> Unpin for ChangeSet<K>

    §

    impl<K> UnwindSafe for ChangeSet<K>
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html index 6dc07e0bbe..c4bcb03da3 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html @@ -1,8 +1,15 @@ -KeychainTxOutIndex in bdk_chain::keychain - Rust

    Struct bdk_chain::keychain::KeychainTxOutIndex

    source ·
    pub struct KeychainTxOutIndex<K> { /* private fields */ }
    Expand description

    KeychainTxOutIndex controls how script pubkeys are revealed for multiple keychains, and +KeychainTxOutIndex in bdk_chain::keychain - Rust

    Struct bdk_chain::keychain::KeychainTxOutIndex

    source ·
    pub struct KeychainTxOutIndex<K> { /* private fields */ }
    Expand description

    KeychainTxOutIndex controls how script pubkeys are revealed for multiple keychains, and indexes [TxOut]s with them.

    A single keychain is a chain of script pubkeys derived from a single Descriptor. Keychains are identified using the K generic. Script pubkeys are identified by the keychain that they are derived from K, as well as the derivation index u32.

    +

    There is a strict 1-to-1 relationship between descriptors and keychains. Each keychain has one +and only one descriptor and each descriptor has one and only one keychain. The +insert_descriptor method will return an error if you try and violate this invariant. This +rule is a proxy for a stronger rule: no two descriptors should produce the same script pubkey. +Having two descriptors produce the same script pubkey should cause whichever keychain derives +the script pubkey first to be the effective owner of it but you should not rely on this +behaviour. ⚠ It is up you, the developer, not to violate this invariant.

    §Revealed script pubkeys

    Tracking how script pubkeys are revealed is useful for collecting chain data. For example, if the user has requested 5 script pubkeys (to receive money with), we only need to use those @@ -15,18 +22,20 @@

    index_tx/index_txout) we scan the txouts against script pubkeys derived above the last revealed index. These additionally-derived script pubkeys are called the lookahead.

    -

    The KeychainTxOutIndex is constructed with the lookahead and cannot be altered. The -default lookahead count is 1000. Use new to set a custom lookahead.

    +

    The KeychainTxOutIndex is constructed with the lookahead and cannot be altered. See +DEFAULT_LOOKAHEAD for the value used in the Default implementation. Use new to set a +custom lookahead.

    §Unbounded script pubkey iterator

    For script-pubkey-based chain sources (such as Electrum/Esplora), an initial scan is best done by iterating though derived script pubkeys one by one and requesting transaction histories for each script pubkey. We will stop after x-number of script pubkeys have empty histories. An -unbounded script pubkey iterator is useful to pass to such a chain source.

    +unbounded script pubkey iterator is useful to pass to such a chain source because it doesn’t +require holding a reference to the index.

    Call unbounded_spk_iter to get an unbounded script pubkey iterator for a given keychain. Call all_unbounded_spk_iters to get unbounded script pubkey iterators for all keychains.

    §Change sets

    -

    Methods that can update the last revealed index or add keychains will return super::ChangeSet to report -these changes. This can be persisted for future recovery.

    +

    Methods that can update the last revealed index or add keychains will return ChangeSet to report +these changes. This should be persisted for future recovery.

    §Synopsis

    use bdk_chain::keychain::KeychainTxOutIndex;
     
    @@ -42,35 +51,12 @@ 

    §Synopsis

    let mut txout_index = KeychainTxOutIndex::<MyKeychain>::default(); -let _ = txout_index.insert_descriptor(MyKeychain::External, external_descriptor); -let _ = txout_index.insert_descriptor(MyKeychain::Internal, internal_descriptor); -let _ = txout_index.insert_descriptor(MyKeychain::MyAppUser { user_id: 42 }, descriptor_42); +let _ = txout_index.insert_descriptor(MyKeychain::External, external_descriptor)?; +let _ = txout_index.insert_descriptor(MyKeychain::Internal, internal_descriptor)?; +let _ = txout_index.insert_descriptor(MyKeychain::MyAppUser { user_id: 42 }, descriptor_42)?; let new_spk_for_user = txout_index.reveal_next_spk(&MyKeychain::MyAppUser{ user_id: 42 });
    -

    §Non-recommend keychain to descriptor assignments

    -

    A keychain (K) is used to identify a descriptor. However, the following keychain to descriptor -arrangements result in behavior that is harder to reason about and is not recommended.

    -

    §Multiple keychains identifying the same descriptor

    -

    Although a single keychain variant can only identify a single descriptor, multiple keychain -variants can identify the same descriptor.

    -

    If multiple keychains identify the same descriptor:

    -
      -
    1. Methods that take in a keychain (such as reveal_next_spk) will work normally when any -keychain (that identifies that descriptor) is passed in.
    2. -
    3. Methods that return data which associates with a descriptor (such as outpoints, -txouts, unused_spks, etc.) the method will return the highest-ranked keychain variant -that identifies the descriptor. Rank is determined by the Ord implementation of the keychain -type.
    4. -
    -

    This arrangement is not recommended since some methods will return a single keychain variant -even though multiple keychain variants identify the same descriptor.

    -

    §Reassigning the descriptor of a single keychain

    -

    Descriptors added to KeychainTxOutIndex are never removed. However, a keychain that -identifies a descriptor can be reassigned to identify a different descriptor. This may result in -a situation where a descriptor has no associated keychain(s), and relevant [TxOut]s, -[OutPoint]s and [Script]s (of that descriptor) will not be return by KeychainTxOutIndex. -Therefore, reassigning the descriptor of a single keychain is not recommended.

    -

    Implementations§

    source§

    impl<K> KeychainTxOutIndex<K>

    source

    pub fn new(lookahead: u32) -> Self

    Construct a KeychainTxOutIndex with the given lookahead.

    +

    Implementations§

    source§

    impl<K> KeychainTxOutIndex<K>

    source

    pub fn new(lookahead: u32) -> Self

    Construct a KeychainTxOutIndex with the given lookahead.

    The lookahead is the number of script pubkeys to derive and cache from the internal descriptors over and above the last revealed script index. Without a lookahead the index will miss outputs you own when processing transactions whose output script pubkeys lie @@ -78,33 +64,31 @@

    Refer to struct-level docs for more about lookahead.

    -

    source§

    impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K>

    Methods that are re-exposed from the internal SpkTxOutIndex.

    -
    source

    pub fn inner(&self) -> &SpkTxOutIndex<(DescriptorId, u32)>

    Return a reference to the internal SpkTxOutIndex.

    +
    source§

    impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K>

    Methods that are re-exposed from the internal SpkTxOutIndex.

    +
    source

    pub fn inner(&self) -> &SpkTxOutIndex<(K, u32)>

    Return a reference to the internal SpkTxOutIndex.

    WARNING: The internal index will contain lookahead spks. Refer to struct-level docs for more about lookahead.

    -
    source

    pub fn outpoints( - &self -) -> impl DoubleEndedIterator<Item = ((K, u32), OutPoint)> + '_

    Get the set of indexed outpoints, corresponding to tracked keychains.

    -
    source

    pub fn txouts( +

    source

    pub fn outpoints(&self) -> &BTreeSet<KeychainIndexed<K, OutPoint>>

    Get the set of indexed outpoints, corresponding to tracked keychains.

    +
    source

    pub fn txouts( &self -) -> impl DoubleEndedIterator<Item = (K, u32, OutPoint, &TxOut)> + '_

    Iterate over known txouts that spend to tracked script pubkeys.

    -
    source

    pub fn txouts_in_tx( +) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, (OutPoint, &TxOut)>> + ExactSizeIterator

    Iterate over known txouts that spend to tracked script pubkeys.

    +
    source

    pub fn txouts_in_tx( &self, txid: Txid -) -> impl DoubleEndedIterator<Item = (K, u32, OutPoint, &TxOut)>

    Finds all txouts on a transaction that has previously been scanned and indexed.

    -
    source

    pub fn txout(&self, outpoint: OutPoint) -> Option<(K, u32, &TxOut)>

    Return the [TxOut] of outpoint if it has been indexed, and if it corresponds to a +) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, (OutPoint, &TxOut)>>

    Finds all txouts on a transaction that has previously been scanned and indexed.

    +
    source

    pub fn txout(&self, outpoint: OutPoint) -> Option<KeychainIndexed<K, &TxOut>>

    Return the [TxOut] of outpoint if it has been indexed, and if it corresponds to a tracked keychain.

    The associated keychain and keychain index of the txout’s spk is also returned.

    This calls SpkTxOutIndex::txout internally.

    -
    source

    pub fn spk_at_index(&self, keychain: K, index: u32) -> Option<&Script>

    Return the script that exists under the given keychain’s index.

    +
    source

    pub fn spk_at_index(&self, keychain: K, index: u32) -> Option<&Script>

    Return the script that exists under the given keychain’s index.

    This calls SpkTxOutIndex::spk_at_index internally.

    -
    source

    pub fn index_of_spk(&self, script: &Script) -> Option<(K, u32)>

    Returns the keychain and keychain index associated with the spk.

    +
    source

    pub fn index_of_spk(&self, script: &Script) -> Option<&(K, u32)>

    Returns the keychain and keychain index associated with the spk.

    This calls SpkTxOutIndex::index_of_spk internally.

    -
    source

    pub fn is_used(&self, keychain: K, index: u32) -> bool

    Returns whether the spk under the keychain’s index has been used.

    +
    source

    pub fn is_used(&self, keychain: K, index: u32) -> bool

    Returns whether the spk under the keychain’s index has been used.

    Here, “unused” means that after the script pubkey was stored in the index, the index has never scanned a transaction output with it.

    This calls SpkTxOutIndex::is_used internally.

    -
    source

    pub fn mark_used(&mut self, keychain: K, index: u32) -> bool

    Marks the script pubkey at index as used even though the tracker hasn’t seen an output +

    source

    pub fn mark_used(&mut self, keychain: K, index: u32) -> bool

    Marks the script pubkey at index as used even though the tracker hasn’t seen an output with it.

    This only has an effect when the index had been added to self already and was unused.

    Returns whether the spk under the given keychain and index is successfully @@ -114,12 +98,12 @@

    index on keychain used until you call unmark_used.

    This calls SpkTxOutIndex::mark_used internally.

    -

    source

    pub fn unmark_used(&mut self, keychain: K, index: u32) -> bool

    Undoes the effect of mark_used. Returns whether the index is inserted back into +

    source

    pub fn unmark_used(&mut self, keychain: K, index: u32) -> bool

    Undoes the effect of mark_used. Returns whether the index is inserted back into unused.

    Note that if self has scanned an output with this script pubkey, then this will have no effect.

    This calls SpkTxOutIndex::unmark_used internally.

    -
    source

    pub fn sent_and_received( +

    source

    pub fn sent_and_received( &self, tx: &Transaction, range: impl RangeBounds<K> @@ -128,7 +112,7 @@

    received when it is on an output. For sent to be computed correctly, the output being spent must have already been scanned by the index. Calculating received just uses the [Transaction] outputs directly, so it will be correct even if it has not been scanned.

    -

    source

    pub fn net_value( +

    source

    pub fn net_value( &self, tx: &Transaction, range: impl RangeBounds<K> @@ -136,53 +120,55 @@

    takes from the transaction outputs in the index. Shorthand for calling sent_and_received and subtracting sent from received.

    This calls SpkTxOutIndex::net_value internally.

    -

    source§

    impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K>

    source

    pub fn keychains( +

    source§

    impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K>

    source

    pub fn keychains( &self -) -> impl DoubleEndedIterator<Item = (&K, &Descriptor<DescriptorPublicKey>)> + ExactSizeIterator + '_

    Return the map of the keychain to descriptors.

    -
    source

    pub fn insert_descriptor( +) -> impl DoubleEndedIterator<Item = (&K, &Descriptor<DescriptorPublicKey>)> + ExactSizeIterator + '_

    Return all keychains and their corresponding descriptors.

    +
    source

    pub fn insert_descriptor( &mut self, keychain: K, descriptor: Descriptor<DescriptorPublicKey> -) -> ChangeSet<K>

    Insert a descriptor with a keychain associated to it.

    -

    Adding a descriptor means you will be able to derive new script pubkeys under it -and the txout index will discover transaction outputs with those script pubkeys.

    -

    When trying to add a keychain that already existed under a different descriptor, or a descriptor -that already existed with a different keychain, the old keychain (or descriptor) will be -overwritten.

    -
    source

    pub fn get_descriptor( +) -> Result<ChangeSet<K>, InsertDescriptorError<K>>

    Insert a descriptor with a keychain associated to it.

    +

    Adding a descriptor means you will be able to derive new script pubkeys under it and the +txout index will discover transaction outputs with those script pubkeys (once they’ve been +derived and added to the index).

    +

    keychain <-> descriptor is a one-to-one mapping that cannot be changed. Attempting to do so +will return a InsertDescriptorError<K>.

    +
    source

    pub fn get_descriptor( &self, keychain: &K ) -> Option<&Descriptor<DescriptorPublicKey>>

    Gets the descriptor associated with the keychain. Returns None if the keychain doesn’t have a descriptor associated with it.

    -
    source

    pub fn lookahead(&self) -> u32

    Get the lookahead setting.

    +
    source

    pub fn lookahead(&self) -> u32

    Get the lookahead setting.

    Refer to new for more information on the lookahead.

    -
    source

    pub fn lookahead_to_target(&mut self, keychain: &K, target_index: u32)

    Store lookahead scripts until target_index (inclusive).

    +
    source

    pub fn lookahead_to_target(&mut self, keychain: &K, target_index: u32)

    Store lookahead scripts until target_index (inclusive).

    This does not change the global lookahead setting.

    -
    source

    pub fn unbounded_spk_iter( +

    source

    pub fn unbounded_spk_iter( &self, keychain: &K ) -> Option<SpkIterator<Descriptor<DescriptorPublicKey>>>

    Get an unbounded spk iterator over a given keychain. Returns None if the provided keychain doesn’t exist

    -
    source

    pub fn all_unbounded_spk_iters( +

    source

    pub fn all_unbounded_spk_iters( &self ) -> BTreeMap<K, SpkIterator<Descriptor<DescriptorPublicKey>>>

    Get unbounded spk iterators for all keychains.

    -
    source

    pub fn revealed_spks( +

    source

    pub fn revealed_spks( &self, range: impl RangeBounds<K> -) -> impl DoubleEndedIterator<Item = (&K, u32, &Script)> + Clone

    Iterate over revealed spks of keychains in range

    -
    source

    pub fn revealed_keychain_spks<'a>( +) -> impl Iterator<Item = KeychainIndexed<K, &Script>>

    Iterate over revealed spks of keychains in range

    +
    source

    pub fn revealed_keychain_spks<'a>( &'a self, keychain: &'a K -) -> impl DoubleEndedIterator<Item = (u32, &Script)> + 'a

    Iterate over revealed spks of the given keychain.

    -
    source

    pub fn unused_spks( +) -> impl DoubleEndedIterator<Item = Indexed<&Script>> + 'a

    Iterate over revealed spks of the given keychain with ascending indices.

    +

    This is a double ended iterator so you can easily reverse it to get an iterator where +the script pubkeys that were most recently revealed are first.

    +
    source

    pub fn unused_spks( &self -) -> impl DoubleEndedIterator<Item = (K, u32, &Script)> + Clone

    Iterate over revealed, but unused, spks of all keychains.

    -
    source

    pub fn unused_keychain_spks( +) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, &Script>> + Clone

    Iterate over revealed, but unused, spks of all keychains.

    +
    source

    pub fn unused_keychain_spks( &self, keychain: &K -) -> impl DoubleEndedIterator<Item = (u32, &Script)> + Clone

    Iterate over revealed, but unused, spks of the given keychain. +) -> impl DoubleEndedIterator<Item = Indexed<&Script>> + Clone

    Iterate over revealed, but unused, spks of the given keychain. Returns an empty iterator if the provided keychain doesn’t exist.

    -
    source

    pub fn next_index(&self, keychain: &K) -> Option<(u32, bool)>

    Get the next derivation index for keychain. The next index is the index after the last revealed +

    source

    pub fn next_index(&self, keychain: &K) -> Option<(u32, bool)>

    Get the next derivation index for keychain. The next index is the index after the last revealed derivation index.

    The second field in the returned tuple represents whether the next derivation index is new. There are two scenarios where the next derivation index is reused (not new):

    @@ -192,77 +178,75 @@

    Not checking the second field of the tuple may result in address reuse.

    Returns None if the provided keychain doesn’t exist.

    -

    source

    pub fn last_revealed_indices(&self) -> BTreeMap<K, u32>

    Get the last derivation index that is revealed for each keychain.

    +
    source

    pub fn last_revealed_indices(&self) -> BTreeMap<K, u32>

    Get the last derivation index that is revealed for each keychain.

    Keychains with no revealed indices will not be included in the returned BTreeMap.

    -
    source

    pub fn last_revealed_index(&self, keychain: &K) -> Option<u32>

    Get the last derivation index revealed for keychain. Returns None if the keychain doesn’t +

    source

    pub fn last_revealed_index(&self, keychain: &K) -> Option<u32>

    Get the last derivation index revealed for keychain. Returns None if the keychain doesn’t exist, or if the keychain doesn’t have any revealed scripts.

    -
    source

    pub fn reveal_to_target_multi( +

    source

    pub fn reveal_to_target_multi( &mut self, keychains: &BTreeMap<K, u32> -) -> (BTreeMap<K, SpkIterator<Descriptor<DescriptorPublicKey>>>, ChangeSet<K>)

    Convenience method to call Self::reveal_to_target on multiple keychains.

    -
    source

    pub fn reveal_to_target( +) -> ChangeSet<K>

    Convenience method to call Self::reveal_to_target on multiple keychains.

    +
    source

    pub fn reveal_to_target( &mut self, keychain: &K, target_index: u32 -) -> Option<(SpkIterator<Descriptor<DescriptorPublicKey>>, ChangeSet<K>)>

    Reveals script pubkeys of the keychain’s descriptor up to and including the +) -> Option<(Vec<Indexed<ScriptBuf>>, ChangeSet<K>)>

    Reveals script pubkeys of the keychain’s descriptor up to and including the target_index.

    If the target_index cannot be reached (due to the descriptor having no wildcard and/or the target_index is in the hardened index range), this method will make a best-effort and reveal up to the last possible index.

    -

    This returns an iterator of newly revealed indices (alongside their scripts) and a -super::ChangeSet, which reports updates to the latest revealed index. If no new script +

    This returns list of newly revealed indices (alongside their scripts) and a +ChangeSet, which reports updates to the latest revealed index. If no new script pubkeys are revealed, then both of these will be empty.

    Returns None if the provided keychain doesn’t exist.

    -
    source

    pub fn reveal_next_spk( +

    source

    pub fn reveal_next_spk( &mut self, keychain: &K -) -> Option<((u32, &Script), ChangeSet<K>)>

    Attempts to reveal the next script pubkey for keychain.

    +) -> Option<(Indexed<ScriptBuf>, ChangeSet<K>)>

    Attempts to reveal the next script pubkey for keychain.

    Returns the derivation index of the revealed script pubkey, the revealed script pubkey and a -super::ChangeSet which represents changes in the last revealed index (if any). +ChangeSet which represents changes in the last revealed index (if any). Returns None if the provided keychain doesn’t exist.

    When a new script cannot be revealed, we return the last revealed script and an empty -super::ChangeSet. There are two scenarios when a new script pubkey cannot be derived:

    +ChangeSet. There are two scenarios when a new script pubkey cannot be derived:

    1. The descriptor has no wildcard and already has one script revealed.
    2. The descriptor has already revealed scripts up to the numeric bound.
    3. There is no descriptor associated with the given keychain.
    -
    source

    pub fn next_unused_spk( +

    source

    pub fn next_unused_spk( &mut self, keychain: &K -) -> Option<((u32, &Script), ChangeSet<K>)>

    Gets the next unused script pubkey in the keychain. I.e., the script pubkey with the lowest +) -> Option<(Indexed<ScriptBuf>, ChangeSet<K>)>

    Gets the next unused script pubkey in the keychain. I.e., the script pubkey with the lowest index that has not been used yet.

    This will derive and reveal a new script pubkey if no more unused script pubkeys exist.

    If the descriptor has no wildcard and already has a used script pubkey or if a descriptor has used all scripts up to the derivation bounds, then the last derived script pubkey will be returned.

    -

    Returns None if the provided keychain doesn’t exist.

    -
    source

    pub fn keychain_outpoints<'a>( +

    Returns None if there are no script pubkeys that have been used and no new script pubkey +could be revealed (see reveal_next_spk for when this happens).

    +

    source

    pub fn keychain_outpoints<'a>( &'a self, keychain: &'a K -) -> impl DoubleEndedIterator<Item = (u32, OutPoint)> + 'a

    Iterate over all [OutPoint]s that have TxOuts with script pubkeys derived from +) -> impl DoubleEndedIterator<Item = Indexed<OutPoint>> + 'a

    Iterate over all [OutPoint]s that have TxOuts with script pubkeys derived from keychain.

    -
    source

    pub fn keychain_outpoints_in_range<'a>( +

    source

    pub fn keychain_outpoints_in_range<'a>( &'a self, range: impl RangeBounds<K> + 'a -) -> impl DoubleEndedIterator<Item = (&'a K, u32, OutPoint)> + 'a

    Iterate over [OutPoint]s that have script pubkeys derived from keychains in range.

    -
    source

    pub fn last_used_index(&self, keychain: &K) -> Option<u32>

    Returns the highest derivation index of the keychain where KeychainTxOutIndex has +) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, OutPoint>> + 'a

    Iterate over [OutPoint]s that have script pubkeys derived from keychains in range.

    +
    source

    pub fn last_used_index(&self, keychain: &K) -> Option<u32>

    Returns the highest derivation index of the keychain where KeychainTxOutIndex has found a [TxOut] with it’s script pubkey.

    -
    source

    pub fn last_used_indices(&self) -> BTreeMap<K, u32>

    Returns the highest derivation index of each keychain that KeychainTxOutIndex has found +

    source

    pub fn last_used_indices(&self) -> BTreeMap<K, u32>

    Returns the highest derivation index of each keychain that KeychainTxOutIndex has found a [TxOut] with it’s script pubkey.

    -
    source

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

    Applies the derivation changeset to the KeychainTxOutIndex, as specified in the -ChangeSet::append documentation:

    -
      -
    • Extends the number of derived scripts per keychain
    • -
    • Adds new descriptors introduced
    • -
    • If a descriptor is introduced for a keychain that already had a descriptor, overwrites -the old descriptor
    • -
    -

    Trait Implementations§

    source§

    impl<K: Clone> Clone for KeychainTxOutIndex<K>

    source§

    fn clone(&self) -> KeychainTxOutIndex<K>

    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> Debug for KeychainTxOutIndex<K>

    source§

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

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

    impl<K> Default for KeychainTxOutIndex<K>

    source§

    fn default() -> Self

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

    impl<K: Clone + Ord + Debug> Indexer for KeychainTxOutIndex<K>

    §

    type ChangeSet = ChangeSet<K>

    The resultant “changeset” when new transaction data is indexed.
    source§

    fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet

    Scan and index the given outpoint and txout.
    source§

    fn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet

    Scans a transaction for relevant outpoints, which are stored and indexed internally.
    source§

    fn initial_changeset(&self) -> Self::ChangeSet

    Determines the ChangeSet between self and an empty Indexer.
    source§

    fn apply_changeset(&mut self, changeset: Self::ChangeSet)

    Apply changeset to itself.
    source§

    fn is_tx_relevant(&self, tx: &Transaction) -> bool

    Determines whether the transaction should be included in the index.

    Auto Trait Implementations§

    §

    impl<K> Freeze for KeychainTxOutIndex<K>

    §

    impl<K> RefUnwindSafe for KeychainTxOutIndex<K>
    where +
    source

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

    Applies the ChangeSet<K> to the KeychainTxOutIndex<K>

    +

    Keychains added by the keychains_added field of ChangeSet<K> respect the one-to-one +keychain <-> descriptor invariant by silently ignoring attempts to violate it (but will +panic if debug_assertions are enabled).

    +

    Trait Implementations§

    source§

    impl<K: Clone> Clone for KeychainTxOutIndex<K>

    source§

    fn clone(&self) -> KeychainTxOutIndex<K>

    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> Debug for KeychainTxOutIndex<K>

    source§

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

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

    impl<K> Default for KeychainTxOutIndex<K>

    source§

    fn default() -> Self

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

    impl<K: Clone + Ord + Debug> Indexer for KeychainTxOutIndex<K>

    §

    type ChangeSet = ChangeSet<K>

    The resultant “changeset” when new transaction data is indexed.
    source§

    fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet

    Scan and index the given outpoint and txout.
    source§

    fn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet

    Scans a transaction for relevant outpoints, which are stored and indexed internally.
    source§

    fn initial_changeset(&self) -> Self::ChangeSet

    Determines the ChangeSet between self and an empty Indexer.
    source§

    fn apply_changeset(&mut self, changeset: Self::ChangeSet)

    Apply changeset to itself.
    source§

    fn is_tx_relevant(&self, tx: &Transaction) -> bool

    Determines whether the transaction should be included in the index.

    Auto Trait Implementations§

    §

    impl<K> Freeze for KeychainTxOutIndex<K>

    §

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

    §

    impl<K> Send for KeychainTxOutIndex<K>
    where K: Send,

    §

    impl<K> Sync for KeychainTxOutIndex<K>
    where - K: Sync,

    §

    impl<K> Unpin for KeychainTxOutIndex<K>

    §

    impl<K> UnwindSafe for KeychainTxOutIndex<K>
    where - K: RefUnwindSafe,

    Blanket Implementations§

    source§

    impl<T> Any for T
    where + K: Sync,

    §

    impl<K> Unpin for KeychainTxOutIndex<K>
    where + K: Unpin,

    §

    impl<K> UnwindSafe for KeychainTxOutIndex<K>

    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/keychain/struct.NoSuchKeychain.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.NoSuchKeychain.html new file mode 100644 index 0000000000..41dae2bfb9 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.NoSuchKeychain.html @@ -0,0 +1,23 @@ +NoSuchKeychain in bdk_chain::keychain - Rust

    Struct bdk_chain::keychain::NoSuchKeychain

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

    The keychain doesn’t exist. Most likley hasn’t been inserted with KeychainTxOutIndex::insert_descriptor.

    +

    Trait Implementations§

    source§

    impl<K: Clone> Clone for NoSuchKeychain<K>

    source§

    fn clone(&self) -> NoSuchKeychain<K>

    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> Debug for NoSuchKeychain<K>

    source§

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

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

    impl<K: Debug> Display for NoSuchKeychain<K>

    source§

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

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

    impl<K: PartialEq> PartialEq for NoSuchKeychain<K>

    source§

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

    source§

    impl<K> StructuralPartialEq for NoSuchKeychain<K>

    Auto Trait Implementations§

    §

    impl<K> Freeze for NoSuchKeychain<K>
    where + K: Freeze,

    §

    impl<K> RefUnwindSafe for NoSuchKeychain<K>
    where + K: RefUnwindSafe,

    §

    impl<K> Send for NoSuchKeychain<K>
    where + K: Send,

    §

    impl<K> Sync for NoSuchKeychain<K>
    where + K: Sync,

    §

    impl<K> Unpin for NoSuchKeychain<K>
    where + K: Unpin,

    §

    impl<K> UnwindSafe for NoSuchKeychain<K>
    where + K: UnwindSafe,

    Blanket Implementations§

    source§

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

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

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

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

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

    source§

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

    Mutably borrows from an owned value. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    +
    source§

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

    source§

    fn into(self) -> U

    Calls U::from(self).

    +

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

    +
    source§

    impl<T> 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> ToString for T
    where + T: Display + ?Sized,

    source§

    default fn to_string(&self) -> String

    Converts the given value to a String. Read more
    source§

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

    §

    type Error = Infallible

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

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

    Performs the conversion.
    source§

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

    §

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

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

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

    Performs the conversion.
    §

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

    §

    fn vzip(self) -> V

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/constant.DEFAULT_LOOKAHEAD.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/constant.DEFAULT_LOOKAHEAD.html new file mode 100644 index 0000000000..76e08381e4 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/constant.DEFAULT_LOOKAHEAD.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../../bdk_chain/keychain/constant.DEFAULT_LOOKAHEAD.html...

    + + + \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/enum.InsertDescriptorError.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/enum.InsertDescriptorError.html new file mode 100644 index 0000000000..e19d71f784 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/enum.InsertDescriptorError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../../bdk_chain/keychain/enum.InsertDescriptorError.html...

    + + + \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/struct.NoSuchKeychain.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/struct.NoSuchKeychain.html new file mode 100644 index 0000000000..a070bbc020 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/txout_index/struct.NoSuchKeychain.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../../bdk_chain/keychain/struct.NoSuchKeychain.html...

    + + + \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.Indexed.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.Indexed.html new file mode 100644 index 0000000000..ad1d312faf --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.Indexed.html @@ -0,0 +1,2 @@ +Indexed in bdk_chain::keychain - Rust

    Type Alias bdk_chain::keychain::Indexed

    source ·
    pub type Indexed<T> = (u32, T);
    Expand description

    A tuple of keychain index and T representing the indexed value.

    +
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.KeychainIndexed.html b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.KeychainIndexed.html new file mode 100644 index 0000000000..7514b24a86 --- /dev/null +++ b/docs-rs/bdk/nightly/latest/bdk_chain/keychain/type.KeychainIndexed.html @@ -0,0 +1,2 @@ +KeychainIndexed in bdk_chain::keychain - Rust

    Type Alias bdk_chain::keychain::KeychainIndexed

    source ·
    pub type KeychainIndexed<K, T> = ((K, u32), T);
    Expand description

    A tuple of keychain K, derivation index (u32) and a T associated with them.

    +
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html index eafd573b9f..fc29f9155c 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/index.html @@ -1,2 +1,2 @@ -bdk_chain::spk_client - Rust

    Module bdk_chain::spk_client

    source ·
    Expand description

    Helper types for spk-based blockchain clients.

    +bdk_chain::spk_client - Rust

    Module bdk_chain::spk_client

    source ·
    Expand description

    Helper types for spk-based blockchain clients.

    Structs§

    • Data required to perform a spk-based blockchain client full scan.
    • Data returned from a spk-based blockchain client full scan.
    • Data required to perform a spk-based blockchain client sync.
    • Data returned from a spk-based blockchain client sync.
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html index 84c3e1bc4a..4df95fbd32 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanRequest.html @@ -1,6 +1,6 @@ -FullScanRequest in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::FullScanRequest

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

    Struct bdk_chain::spk_client::FullScanRequest

    source ·
    pub struct FullScanRequest<K> {
         pub chain_tip: CheckPoint,
    -    pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = (u32, ScriptBuf)> + Send>>,
    +    pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = Indexed<ScriptBuf>> + Send>>,
     }
    Expand description

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

    A client full scan iterates through all the scripts for the given keychains, fetching relevant data until some stop gap number of scripts is found that have no data. This operation is @@ -8,9 +8,9 @@ used scripts is not known. The full scan process also updates the chain from the given CheckPoint.

    Fields§

    §chain_tip: CheckPoint

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

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

    Iterators of script pubkeys indexed by the keychain index.

    -

    Implementations§

    source§

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

    source

    pub fn from_chain_tip(chain_tip: CheckPoint) -> Self

    Construct a new FullScanRequest from a given chain_tip.

    -
    source

    pub fn from_keychain_txout_index( +

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

    Iterators of script pubkeys indexed by the keychain index.

    +

    Implementations§

    source§

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

    source

    pub fn from_chain_tip(chain_tip: CheckPoint) -> Self

    Construct a new FullScanRequest from a given chain_tip.

    +
    source

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

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

    -

    source

    pub fn set_spks_for_keychain( +

    source

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

    Set the [Script]s for a given keychain.

    This consumes the FullScanRequest and returns the updated one.

    -
    source

    pub fn chain_spks_for_keychain( +

    source

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

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

    This consumes the FullScanRequest and returns the updated one.

    -
    source

    pub fn inspect_spks_for_all_keychains( +

    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn inspect_spks_for_keychain( +

    source

    pub fn inspect_spks_for_keychain( self, keychain: K, inspect: impl FnMut(u32, &Script) + Send + Sync + 'static diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html index 5d736d9069..ed7e72fd07 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.FullScanResult.html @@ -1,4 +1,4 @@ -FullScanResult in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::FullScanResult

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

    Struct bdk_chain::spk_client::FullScanResult

    source ·
    pub struct FullScanResult<K, A = ConfirmationTimeHeightAnchor> {
         pub graph_update: TxGraph<A>,
         pub chain_update: CheckPoint,
         pub last_active_indices: BTreeMap<K, u32>,
    diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html
    index 3dfb9db580..d60833cd8e 100644
    --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html
    +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncRequest.html
    @@ -1,4 +1,4 @@
    -SyncRequest in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::SyncRequest

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

    Struct bdk_chain::spk_client::SyncRequest

    source ·
    pub struct SyncRequest {
         pub chain_tip: CheckPoint,
         pub spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>,
         pub txids: Box<dyn ExactSizeIterator<Item = Txid> + Send>,
    @@ -11,53 +11,53 @@
     
    §spks: Box<dyn ExactSizeIterator<Item = ScriptBuf> + Send>

    Transactions that spend from or to these indexed script pubkeys.

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

    Transactions with these txids.

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

    Transactions with these outpoints or spent from these outpoints.

    -

    Implementations§

    source§

    impl SyncRequest

    source

    pub fn from_chain_tip(cp: CheckPoint) -> Self

    Construct a new SyncRequest from a given cp tip.

    -
    source

    pub fn set_spks( +

    Implementations§

    source§

    impl SyncRequest

    source

    pub fn from_chain_tip(cp: CheckPoint) -> Self

    Construct a new SyncRequest from a given cp tip.

    +
    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn set_txids( +

    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn set_outpoints( +

    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn chain_spks( +

    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn chain_txids( +

    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn chain_outpoints( +

    source

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

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn inspect_spks( +

    source

    pub fn inspect_spks( self, inspect: impl FnMut(&Script) + Send + Sync + 'static ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn inspect_txids( +

    source

    pub fn inspect_txids( self, inspect: impl FnMut(&Txid) + Send + Sync + 'static ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

    pub fn inspect_outpoints( +

    source

    pub fn inspect_outpoints( self, inspect: impl FnMut(&OutPoint) + Send + Sync + 'static ) -> Self

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

    This consumes the SyncRequest and returns the updated one.

    -
    source

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

    source

    pub fn populate_with_revealed_spks<K: Clone + Ord + Debug + Send + Sync>( self, index: &KeychainTxOutIndex<K>, spk_range: impl RangeBounds<K> diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html index 09d1a71604..05504948a6 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/spk_client/struct.SyncResult.html @@ -1,4 +1,4 @@ -SyncResult in bdk_chain::spk_client - Rust

    Struct bdk_chain::spk_client::SyncResult

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

    Struct bdk_chain::spk_client::SyncResult

    source ·
    pub struct SyncResult<A = ConfirmationTimeHeightAnchor> {
         pub graph_update: TxGraph<A>,
         pub chain_update: CheckPoint,
     }
    Expand description

    Data returned from a spk-based blockchain client sync.

    diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkIterator.html b/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkIterator.html index 90a05303ff..72ebd1892d 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkIterator.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkIterator.html @@ -1,4 +1,4 @@ -SpkIterator in bdk_chain - Rust

    Struct bdk_chain::SpkIterator

    source ·
    pub struct SpkIterator<D> { /* private fields */ }
    Expand description

    An iterator for derived script pubkeys.

    +SpkIterator in bdk_chain - Rust

    Struct bdk_chain::SpkIterator

    source ·
    pub struct SpkIterator<D> { /* private fields */ }
    Expand description

    An iterator for derived script pubkeys.

    SpkIterator is an implementation of the Iterator trait which possesses its own next() and nth() functions, both of which circumvent the unnecessary intermediate derivations required when using their default implementations.

    @@ -9,20 +9,20 @@

    §Examples

    let mut spk_iter = SpkIterator::new(&descriptor); assert_eq!(spk_iter.next(), Some((0, external_spk_0))); assert_eq!(spk_iter.next(), None);
    -

    Implementations§

    source§

    impl<D> SpkIterator<D>
    where - D: Borrow<Descriptor<DescriptorPublicKey>>,

    source

    pub fn new(descriptor: D) -> Self

    Create a new script pubkey iterator from descriptor.

    +

    Implementations§

    source§

    impl<D> SpkIterator<D>
    where + D: Borrow<Descriptor<DescriptorPublicKey>>,

    source

    pub fn new(descriptor: D) -> Self

    Create a new script pubkey iterator from descriptor.

    This iterates from derivation index 0 and stops at index 0x7FFFFFFF (as specified in BIP-32). Non-wildcard descriptors will only return one script pubkey at derivation index 0.

    Use new_with_range to create an iterator with a specified derivation index range.

    -
    source

    pub fn new_with_range<R>(descriptor: D, range: R) -> Self
    where +

    source

    pub fn new_with_range<R>(descriptor: D, range: R) -> Self
    where R: RangeBounds<u32>,

    Create a new script pubkey iterator from descriptor and a given range.

    Non-wildcard descriptors will only emit a single script pubkey (at derivation index 0). Wildcard descriptors have an end-bound of 0x7FFFFFFF (inclusive).

    Refer to new for more.

    -
    source

    pub fn descriptor(&self) -> &D

    Get a reference to the internal descriptor.

    -

    Trait Implementations§

    source§

    impl<D: Clone> Clone for SpkIterator<D>

    source§

    fn clone(&self) -> SpkIterator<D>

    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<D> Iterator for SpkIterator<D>
    where - D: Borrow<Descriptor<DescriptorPublicKey>>,

    §

    type Item = (u32, ScriptBuf)

    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 nth(&mut self, n: usize) -> Option<Self::Item>

    Returns the nth element of the iterator. Read more
    source§

    fn next_chunk<const N: usize>( +

    source

    pub fn descriptor(&self) -> &D

    Get a reference to the internal descriptor.

    +

    Trait Implementations§

    source§

    impl<D: Clone> Clone for SpkIterator<D>

    source§

    fn clone(&self) -> SpkIterator<D>

    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<D> Iterator for SpkIterator<D>
    where + D: Borrow<Descriptor<DescriptorPublicKey>>,

    §

    type Item = (u32, ScriptBuf)

    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 nth(&mut self, n: usize) -> Option<Self::Item>

    Returns the nth element of the iterator. 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 @@ -224,4 +224,4 @@

    §Examples

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

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkTxOutIndex.html b/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkTxOutIndex.html index 9d187bf4c6..d7eaed0252 100644 --- a/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkTxOutIndex.html +++ b/docs-rs/bdk/nightly/latest/bdk_chain/struct.SpkTxOutIndex.html @@ -10,7 +10,7 @@ in there in the first place. SpkTxOutIndex is intentionally monotone – you cannot delete or modify txouts that have been indexed. To find out which txouts from the index are actually in the chain or unspent, you must use other sources of information like a TxGraph.

    -

    Implementations§

    source§

    impl<I: Clone + Ord> SpkTxOutIndex<I>

    source

    pub fn scan(&mut self, tx: &Transaction) -> BTreeSet<I>

    Scans a transaction’s outputs for matching script pubkeys.

    +

    Implementations§

    source§

    impl<I: Clone + Ord + Debug> SpkTxOutIndex<I>

    source

    pub fn scan(&mut self, tx: &Transaction) -> BTreeSet<I>

    Scans a transaction’s outputs for matching script pubkeys.

    Typically, this is used in two situations:

    1. After loading transaction data from the disk, you may scan over all the txouts to restore all @@ -88,7 +88,7 @@
      §Example
      have scanned the TxOuts the transaction is spending. For example, if you want to filter out all the transactions in a block that are irrelevant, you must first scan all the transactions in the block and only then use this method.

      -

    Trait Implementations§

    source§

    impl<I: Clone> Clone for SpkTxOutIndex<I>

    source§

    fn clone(&self) -> SpkTxOutIndex<I>

    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<I: Debug> Debug for SpkTxOutIndex<I>

    source§

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

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

    impl<I> Default for SpkTxOutIndex<I>

    source§

    fn default() -> Self

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

    impl<I: Clone + Ord> Indexer for SpkTxOutIndex<I>

    §

    type ChangeSet = ()

    The resultant “changeset” when new transaction data is indexed.
    source§

    fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet

    Scan and index the given outpoint and txout.
    source§

    fn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet

    Scans a transaction for relevant outpoints, which are stored and indexed internally.
    source§

    fn initial_changeset(&self) -> Self::ChangeSet

    Determines the ChangeSet between self and an empty Indexer.
    source§

    fn apply_changeset(&mut self, _changeset: Self::ChangeSet)

    Apply changeset to itself.
    source§

    fn is_tx_relevant(&self, tx: &Transaction) -> bool

    Determines whether the transaction should be included in the index.

    Auto Trait Implementations§

    §

    impl<I> Freeze for SpkTxOutIndex<I>

    §

    impl<I> RefUnwindSafe for SpkTxOutIndex<I>
    where +

    Trait Implementations§

    source§

    impl<I: Clone> Clone for SpkTxOutIndex<I>

    source§

    fn clone(&self) -> SpkTxOutIndex<I>

    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<I: Debug> Debug for SpkTxOutIndex<I>

    source§

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

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

    impl<I> Default for SpkTxOutIndex<I>

    source§

    fn default() -> Self

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

    impl<I: Clone + Ord + Debug> Indexer for SpkTxOutIndex<I>

    §

    type ChangeSet = ()

    The resultant “changeset” when new transaction data is indexed.
    source§

    fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet

    Scan and index the given outpoint and txout.
    source§

    fn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet

    Scans a transaction for relevant outpoints, which are stored and indexed internally.
    source§

    fn initial_changeset(&self) -> Self::ChangeSet

    Determines the ChangeSet between self and an empty Indexer.
    source§

    fn apply_changeset(&mut self, _changeset: Self::ChangeSet)

    Apply changeset to itself.
    source§

    fn is_tx_relevant(&self, tx: &Transaction) -> bool

    Determines whether the transaction should be included in the index.

    Auto Trait Implementations§

    §

    impl<I> Freeze for SpkTxOutIndex<I>

    §

    impl<I> RefUnwindSafe for SpkTxOutIndex<I>
    where I: RefUnwindSafe,

    §

    impl<I> Send for SpkTxOutIndex<I>
    where I: Send,

    §

    impl<I> Sync for SpkTxOutIndex<I>
    where I: Sync,

    §

    impl<I> Unpin for SpkTxOutIndex<I>
    where 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 a66af4af0b..617b897aad 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_esplora/index.html b/docs-rs/bdk/nightly/latest/bdk_esplora/index.html index c1da0d6692..55a92b025b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/index.html @@ -27,6 +27,6 @@

    §Usage

    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 -via a new TxGraph to be appended to any existing TxGraph data.

    +via a new TxGraph to be appended to any existing TxGraph data.

    Refer to example_esplora for a complete example.

    Re-exports§

    • pub use esplora_client;

    Traits§

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

    Type Aliases§

    • [esplora_client::Error]
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html index 5160dad7e5..3bd6af68e8 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraAsyncExt.html @@ -2,35 +2,35 @@ // Required methods fn full_scan<'life0, 'async_trait, K>( &'life0 self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize - ) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>> + ) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>> where K: 'async_trait + Ord + Clone + Send, Self: 'async_trait, 'life0: 'async_trait; fn sync<'life0, 'async_trait>( &'life0 self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize - ) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>> + ) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
    Expand description

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

    Refer to crate-level documentation for more.

    Required Methods§

    source

    fn full_scan<'life0, 'async_trait, K>( &'life0 self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
    where +) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
    where K: 'async_trait + Ord + Clone + Send, Self: 'async_trait, 'life0: 'async_trait,

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

    • request: struct with data required to perform a spk-based blockchain client full scan, -see [FullScanRequest]
    • +see FullScanRequest

    The full scan for each keychain stops after a gap of stop_gap script pubkeys with no associated transactions. parallel_requests specifies the max number of HTTP requests to @@ -46,30 +46,30 @@

    §Note

    A stop_gap of 0 will be treated as a stop_gap of 1.

    source

    fn sync<'life0, 'async_trait>( &'life0 self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
    where +) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
    where Self: 'async_trait, 'life0: 'async_trait,

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

    +specified and return a TxGraph.

    • request: struct with data required to perform a spk-based blockchain client sync, see -[SyncRequest]
    • +SyncRequest

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

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl EsploraAsyncExt for AsyncClient

    source§

    fn full_scan<'life0, 'async_trait, K>( &'life0 self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
    where +) -> Pin<Box<dyn Future<Output = Result<FullScanResult<K>, Box<Error>>> + Send + 'async_trait>>
    where K: 'async_trait + Ord + Clone + Send, Self: 'async_trait, 'life0: 'async_trait,

    source§

    fn sync<'life0, 'async_trait>( &'life0 self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
    where +) -> Pin<Box<dyn Future<Output = Result<SyncResult, Box<Error>>> + Send + 'async_trait>>
    where Self: 'async_trait, 'life0: 'async_trait,

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html index 7b84dbda2d..48d83be333 100644 --- a/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html +++ b/docs-rs/bdk/nightly/latest/bdk_esplora/trait.EsploraExt.html @@ -2,27 +2,27 @@ // Required methods fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize - ) -> Result<FullScanResult<K>, Error>; + ) -> Result<FullScanResult<K>, Error>; fn sync( &self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize - ) -> Result<SyncResult, Error>; + ) -> Result<SyncResult, Error>; }
    Expand description

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

    Refer to crate-level documentation for more.

    Required Methods§

    source

    fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Result<FullScanResult<K>, Error>

    Scan keychain scripts for transactions against Esplora, returning an update that can be +) -> Result<FullScanResult<K>, Error>

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

    • request: struct with data required to perform a spk-based blockchain client full scan, -see [FullScanRequest]
    • +see FullScanRequest

    The full scan for each keychain stops after a gap of stop_gap script pubkeys with no associated transactions. parallel_requests specifies the max number of HTTP requests to @@ -38,23 +38,23 @@

    §Note

    A stop_gap of 0 will be treated as a stop_gap of 1.

    source

    fn sync( &self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Result<SyncResult, Error>

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

    +) -> Result<SyncResult, Error>

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

    • request: struct with data required to perform a spk-based blockchain client sync, see -[SyncRequest]
    • +SyncRequest

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

    Object Safety§

    This trait is not object safe.

    Implementations on Foreign Types§

    source§

    impl EsploraExt for BlockingClient

    source§

    fn full_scan<K: Ord + Clone>( &self, - request: FullScanRequest<K>, + request: FullScanRequest<K>, stop_gap: usize, parallel_requests: usize -) -> Result<FullScanResult<K>, Error>

    source§

    fn sync( +) -> Result<FullScanResult<K>, Error>

    source§

    fn sync( &self, - request: SyncRequest, + request: SyncRequest, parallel_requests: usize -) -> Result<SyncResult, Error>

    Implementors§

    \ No newline at end of file +) -> Result<SyncResult, Error>

    Implementors§

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html b/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html index 4e79113f87..ffa6aec7bd 100644 --- a/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html +++ b/docs-rs/bdk/nightly/latest/bdk_file_store/struct.Store.html @@ -1,7 +1,7 @@ Store in bdk_file_store - Rust

    Struct bdk_file_store::Store

    source ·
    pub struct Store<C>
    where C: Sync + Send,
    { /* private fields */ }
    Expand description

    Persists an append-only list of changesets (C) to a single file.

    Implementations§

    source§

    impl<C> Store<C>
    where - C: Append + Serialize + DeserializeOwned + Send + Sync,

    source

    pub fn create_new<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>

    source

    pub fn create_new<P>(magic: &[u8], file_path: P) -> Result<Self, FileError>
    where P: AsRef<Path>,

    Create a new Store file in write-only mode; error if the file exists.

    magic is the prefixed bytes to write to the new file. This will be checked when opening the Store in the future with open.

    @@ -41,7 +41,7 @@
    §Errors
    directly after the appended changeset.

    Trait Implementations§

    source§

    impl<C> Debug for Store<C>
    where C: Sync + Send + Debug,

    source§

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

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

    impl<C> PersistBackend<C> for Store<C>
    where - C: Append + Serialize + DeserializeOwned + Send + Sync,

    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<C> Freeze for Store<C>

    §

    impl<C> RefUnwindSafe for Store<C>

    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<C> Freeze for Store<C>

    §

    impl<C> RefUnwindSafe for Store<C>
    where C: RefUnwindSafe,

    §

    impl<C> Send for Store<C>

    §

    impl<C> Sync for Store<C>

    §

    impl<C> Unpin for Store<C>
    where C: Unpin,

    §

    impl<C> UnwindSafe for Store<C>
    where C: UnwindSafe,

    Blanket Implementations§

    source§

    impl<T> Any for T
    where diff --git a/docs-rs/bdk/nightly/latest/bdk_persist/index.html b/docs-rs/bdk/nightly/latest/bdk_persist/index.html index 1f32907d66..d844e13214 100644 --- a/docs-rs/bdk/nightly/latest/bdk_persist/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_persist/index.html @@ -1,5 +1,5 @@ bdk_persist - Rust

    Crate bdk_persist

    source ·
    Expand description

    §BDK Persist

    This crate is home to the PersistBackend trait which defines the behavior of a database to perform the task of persisting changes made to BDK data structures.

    The Persist type provides a convenient wrapper around a PersistBackend that allows staging changes before committing them.

    -

    Structs§

    Structs§

    Traits§

    \ 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 e752303242..7c0c6a7a5b 100644 --- a/docs-rs/bdk/nightly/latest/bdk_persist/struct.CombinedChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk_persist/struct.CombinedChangeSet.html @@ -1,15 +1,15 @@ CombinedChangeSet in bdk_persist - Rust

    Struct bdk_persist::CombinedChangeSet

    source ·
    pub struct CombinedChangeSet<K, A> {
    -    pub chain: ChangeSet,
    -    pub indexed_tx_graph: ChangeSet<A, ChangeSet<K>>,
    +    pub chain: ChangeSet,
    +    pub indexed_tx_graph: ChangeSet<A, ChangeSet<K>>,
         pub network: Option<Network>,
    -}
    Expand description

    Changes from a combination of [bdk_chain] structures.

    -

    Fields§

    §chain: ChangeSet

    Changes to the LocalChain.

    -
    §indexed_tx_graph: ChangeSet<A, ChangeSet<K>>

    Changes to IndexedTxGraph.

    +}
    Expand description

    Changes from a combination of bdk_chain structures.

    +

    Fields§

    §chain: ChangeSet

    Changes to the LocalChain.

    +
    §indexed_tx_graph: ChangeSet<A, ChangeSet<K>>

    Changes to IndexedTxGraph.

    §network: Option<Network>

    Stores the network type of the transaction data.

    -

    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 +

    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_persist/struct.Persist.html b/docs-rs/bdk/nightly/latest/bdk_persist/struct.Persist.html index 54fec6dbe9..9dfe37191d 100644 --- a/docs-rs/bdk/nightly/latest/bdk_persist/struct.Persist.html +++ b/docs-rs/bdk/nightly/latest/bdk_persist/struct.Persist.html @@ -4,7 +4,7 @@ Persist::stage can be used to stage changes first and then Persist::commit can be used to write changes to disk.

    Implementations§

    source§

    impl<C> Persist<C>
    where - C: Default + Append,

    source

    pub fn new(backend: impl PersistBackend<C> + Send + Sync + 'static) -> Self

    Create a new Persist from PersistBackend.

    + C: Default + Append,
    source

    pub fn new(backend: impl PersistBackend<C> + Send + Sync + 'static) -> Self

    Create a new Persist from PersistBackend.

    source

    pub fn stage(&mut self, changeset: C)

    Stage a changeset to be committed later with commit.

    source

    pub fn staged(&self) -> &C

    Get the changes that have not been committed yet.

    source

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

    Commit the staged changes to the underlying persistence backend.

    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 aa0e58d7ee..033c9727ae 100644 --- a/docs-rs/bdk/nightly/latest/bdk_sqlite/struct.Store.html +++ b/docs-rs/bdk/nightly/latest/bdk_sqlite/struct.Store.html @@ -2,10 +2,10 @@

    The changesets loaded or stored represent changes to keychain and blockchain data.

    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].

    + 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 K: Ord + for<'de> Deserialize<'de> + Serialize + Send, - A: Anchor + 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>

    §

    impl<K, A> Send for Store<K, A>
    where 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 0057b90bff..0a90975ab9 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 @@ -236,8 +236,8 @@
    §Errors

    This function will return an error if hardened derivation is attempted.

    Trait Implementations§

    §

    impl<Pk> Clone for Descriptor<Pk>
    where 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
    §

    impl<Pk> Debug for Descriptor<Pk>
    where - 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 + Pk: MiniscriptKey,
    §

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

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

    impl DescriptorExt for Descriptor<DescriptorPublicKey>

    source§

    fn dust_value(&self) -> u64

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

    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: FromStrKey,

    §

    fn deserialize<D>( deserializer: D 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 d1d09c9ff6..7b1b191cf1 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, @@ -26,7 +26,7 @@
    §

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

    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/error/index.html b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/index.html index 3e0ac10330..097dee9880 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/descriptor/error/index.html @@ -1,2 +1,2 @@ -bdk_wallet::descriptor::error - Rust

    Module bdk_wallet::descriptor::error

    source ·
    Expand description

    Descriptor errors

    +bdk_wallet::descriptor::error - Rust

    Module bdk_wallet::descriptor::error

    source ·
    Expand description

    Descriptor errors

    Enums§

    • Errors related to the parsing and usage of descriptors
    \ No newline at end of file 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 1b0bc5ab28..2166108f27 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 @@ -12,7 +12,7 @@
    §

    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 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/index.html b/docs-rs/bdk/nightly/latest/bdk_wallet/index.html index 3054669bf6..a8d4162836 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/index.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/index.html @@ -167,4 +167,4 @@

    §Contribut submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

    -

    Re-exports§

    • pub extern crate bitcoin;
    • pub extern crate miniscript;
    • pub use descriptor::template;
    • pub use descriptor::HdKeyPaths;
    • pub use wallet::signer;
    • pub use wallet::signer::SignOptions;
    • pub use wallet::tx_builder::TxBuilder;
    • pub use wallet::Wallet;
    • pub use bdk_chain as chain;

    Modules§

    Macros§

    • Macro to write full descriptors with code
    • Macro to write descriptor fragments with code

    Structs§

    Enums§

    Functions§

    • Get the version of BDK at runtime

    \ No newline at end of file +

    Re-exports§

    Modules§

    Macros§

    • Macro to write full descriptors with code
    • Macro to write descriptor fragments with code

    Structs§

    Enums§

    Functions§

    • Get the version of BDK at runtime
    \ No newline at end of file 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 ec2cc48cde..741a0d760d 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 @@ -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/struct.LocalOutput.html b/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html index cbeae4c490..77fd14d2e3 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/struct.LocalOutput.html @@ -4,14 +4,14 @@ pub keychain: KeychainKind, pub is_spent: bool, pub derivation_index: u32, - pub confirmation_time: ConfirmationTime, + pub confirmation_time: ConfirmationTime, }
    Expand description

    An unspent output owned by a Wallet.

    Fields§

    §outpoint: OutPoint

    Reference to a transaction output

    §txout: TxOut

    Transaction output

    §keychain: KeychainKind

    Type of keychain

    §is_spent: bool

    Whether this UTXO is spent or not

    §derivation_index: u32

    The derivation index for the script pubkey in the wallet

    -
    §confirmation_time: ConfirmationTime

    The confirmation time for transaction containing this utxo

    +
    §confirmation_time: ConfirmationTime

    The confirmation time for transaction containing this utxo

    Trait Implementations§

    source§

    impl Clone for LocalOutput

    source§

    fn clone(&self) -> LocalOutput

    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 LocalOutput

    source§

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

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

    impl<'de> Deserialize<'de> for LocalOutput

    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 Hash for LocalOutput

    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, 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 01ba10f8ec..340e1feb92 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 @@ -1,11 +1,11 @@ ApplyBlockError in bdk_wallet::wallet - Rust

    Enum bdk_wallet::wallet::ApplyBlockError

    source ·
    pub enum ApplyBlockError {
    -    CannotConnect(CannotConnectError),
    +    CannotConnect(CannotConnectError),
         UnexpectedConnectedToHash {
             connected_to_hash: BlockHash,
             expected_hash: BlockHash,
         },
     }
    Expand description

    An error that may occur when applying a block to Wallet.

    -

    Variants§

    §

    CannotConnect(CannotConnectError)

    Occurs when the update chain cannot connect with original chain.

    +

    Variants§

    §

    CannotConnect(CannotConnectError)

    Occurs when the update chain cannot connect with original chain.

    §

    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.

    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 757717ea5a..e2e00ba488 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 3bacfea4dc..3207507e47 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 Display for Balance

    source§

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

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

    impl Serialize for Balance

    §

    fn serialize<__S>( +sufficient, and should not be overridden without very good reason.

    source§

    impl Serialize for Balance

    source§

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

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

    impl Eq for Balance

    §

    impl StructuralPartialEq for Balance

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    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 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.Update.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/struct.Update.html index 2ab63dc181..a40fd518fb 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 @@ -1,14 +1,14 @@ Update in bdk_wallet::wallet - Rust

    Struct bdk_wallet::wallet::Update

    source ·
    pub struct Update {
         pub last_active_indices: BTreeMap<KeychainKind, u32>,
    -    pub graph: TxGraph<ConfirmationTimeHeightAnchor>,
    -    pub chain: Option<CheckPoint>,
    +    pub graph: TxGraph<ConfirmationTimeHeightAnchor>,
    +    pub chain: Option<CheckPoint>,
     }
    Expand description

    An update to Wallet.

    -

    It updates [bdk_chain::keychain::KeychainTxOutIndex], [bdk_chain::TxGraph] and [local_chain::LocalChain] atomically.

    +

    It updates bdk_chain::keychain::KeychainTxOutIndex, bdk_chain::TxGraph and local_chain::LocalChain atomically.

    Fields§

    §last_active_indices: BTreeMap<KeychainKind, u32>

    Contains the last active derivation indices per keychain (K), which is used to update the -[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§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 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 5a9e18d2e0..d652145427 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, @@ -83,7 +83,7 @@

    §Panics

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

    -
    source

    pub fn reveal_next_address( +

    source

    pub fn reveal_next_address( &mut self, keychain: KeychainKind ) -> Result<AddressInfo>

    Attempt to reveal the next address of the given keychain.

    @@ -93,7 +93,7 @@
    §Panics
    then returns the last revealed address.

    §Errors

    If writing to persistent storage fails.

    -
    source

    pub fn reveal_addresses_to( +

    source

    pub fn reveal_addresses_to( &mut self, keychain: KeychainKind, index: u32 @@ -104,7 +104,7 @@

    §Errors
    no new addresses are returned.

    §Errors

    If writing to persistent storage fails.

    -
    source

    pub fn next_unused_address( +

    source

    pub fn next_unused_address( &mut self, keychain: KeychainKind ) -> Result<AddressInfo>

    Get the next unused address for the given keychain, i.e. the address with the lowest @@ -113,54 +113,54 @@

    §Errors
    are available. See also reveal_next_address.

    §Errors

    If writing to persistent storage fails.

    -
    source

    pub fn mark_used(&mut self, keychain: KeychainKind, index: u32) -> bool

    Marks an address used of the given keychain at index.

    +
    source

    pub fn mark_used(&mut self, keychain: KeychainKind, index: u32) -> bool

    Marks an address used of the given keychain at index.

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

    -
    source

    pub fn unmark_used(&mut self, keychain: KeychainKind, index: u32) -> bool

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

    source

    pub fn unmark_used(&mut self, keychain: KeychainKind, index: u32) -> bool

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

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

    -
    source

    pub fn list_unused_addresses( +

    source

    pub fn list_unused_addresses( &self, keychain: KeychainKind ) -> impl DoubleEndedIterator<Item = AddressInfo> + '_

    List addresses that are revealed but unused.

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

    -
    source

    pub fn is_mine(&self, script: &Script) -> bool

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

    -
    source

    pub fn derivation_of_spk(&self, spk: &Script) -> Option<(KeychainKind, u32)>

    Finds how the wallet derived the script pubkey spk.

    +
    source

    pub fn is_mine(&self, script: &Script) -> bool

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

    +
    source

    pub fn derivation_of_spk(&self, spk: &Script) -> Option<(KeychainKind, u32)>

    Finds how the wallet derived the script pubkey spk.

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

    -
    source

    pub fn list_unspent(&self) -> impl Iterator<Item = LocalOutput> + '_

    Return the list of unspent outputs of this wallet

    -
    source

    pub fn list_output(&self) -> impl Iterator<Item = LocalOutput> + '_

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

    +
    source

    pub fn list_unspent(&self) -> impl Iterator<Item = LocalOutput> + '_

    Return the list of unspent outputs of this wallet

    +
    source

    pub fn list_output(&self) -> impl Iterator<Item = LocalOutput> + '_

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

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

    -
    source

    pub fn checkpoints(&self) -> CheckPointIter

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

    -
    source

    pub fn latest_checkpoint(&self) -> CheckPoint

    Returns the latest checkpoint.

    -
    source

    pub fn all_unbounded_spk_iters( +

    source

    pub fn checkpoints(&self) -> CheckPointIter

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

    +
    source

    pub fn latest_checkpoint(&self) -> CheckPoint

    Returns the latest checkpoint.

    +
    source

    pub fn all_unbounded_spk_iters( &self -) -> BTreeMap<KeychainKind, impl Iterator<Item = (u32, ScriptBuf)> + Clone>

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

    +) -> BTreeMap<KeychainKind, impl Iterator<Item = Indexed<ScriptBuf>> + Clone>

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

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

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

    -
    source

    pub fn unbounded_spk_iter( +

    source

    pub fn unbounded_spk_iter( &self, keychain: KeychainKind -) -> impl Iterator<Item = (u32, ScriptBuf)> + Clone

    Get an unbounded script pubkey iterator for the given keychain.

    +) -> impl Iterator<Item = Indexed<ScriptBuf>> + Clone

    Get an unbounded script pubkey iterator for the given keychain.

    See all_unbounded_spk_iters for more documentation

    -
    source

    pub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput>

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

    source

    pub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput>

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

    -
    source

    pub fn insert_txout(&mut self, outpoint: OutPoint, txout: TxOut)

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

    +
    source

    pub fn insert_txout(&mut self, outpoint: OutPoint, txout: TxOut)

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

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

    Any inserted TxOuts are not persisted until commit is called.

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

    -
    source

    pub fn calculate_fee( +

    source

    pub fn calculate_fee( &self, tx: &Transaction -) -> Result<Amount, CalculateFeeError>

    Calculates the fee of a given transaction. Returns [Amount::ZERO] if tx is a coinbase transaction.

    +) -> Result<Amount, CalculateFeeError>

    Calculates the fee of a given transaction. Returns [Amount::ZERO] if tx is a coinbase transaction.

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

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

    @@ -170,10 +170,10 @@
    §Examples
    let tx = &psbt.clone().extract_tx().expect("tx");
     let fee = wallet.calculate_fee(tx).expect("fee");
    -
    source

    pub fn calculate_fee_rate( +

    source

    pub fn calculate_fee_rate( &self, tx: &Transaction -) -> Result<FeeRate, CalculateFeeError>

    Calculate the [FeeRate] for a given transaction.

    +) -> Result<FeeRate, CalculateFeeError>

    Calculate the [FeeRate] for a given transaction.

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

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

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

    pub fn sent_and_received(&self, tx: &Transaction) -> (Amount, Amount)

    Compute the tx’s sent and received [Amount]s.

    +
    source

    pub fn sent_and_received(&self, tx: &Transaction) -> (Amount, Amount)

    Compute the tx’s sent and received [Amount]s.

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

    @@ -193,15 +193,15 @@
    §Examples
    let tx = &psbt.clone().extract_tx().expect("tx");
     let (sent, received) = wallet.sent_and_received(tx);
    -
    source

    pub fn get_tx( +

    source

    pub fn get_tx( &self, txid: Txid -) -> Option<CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>>

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

    +) -> Option<CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>>

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

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

      -
    • Blocks that the transaction is Anchored in. These may or may not be blocks that exist +
    • Blocks that the transaction is Anchored in. These may or may not be blocks that exist in the best chain.
    • -
    • The [ChainPosition] of the transaction in the best chain - whether the transaction is +
    • The ChainPosition of the transaction in the best chain - whether the transaction is confirmed or unconfirmed. If the transaction is confirmed, the anchor which proves the confirmation is provided. If the transaction is unconfirmed, the unix timestamp of when the transaction was last seen in the mempool is provided.
    • @@ -234,17 +234,17 @@
      §Examples
      last_seen, ), }
    -
    source

    pub fn insert_checkpoint( +

    source

    pub fn insert_checkpoint( &mut self, - block_id: BlockId -) -> Result<bool, AlterCheckPointError>

    Add a new checkpoint to the wallet’s internal view of the chain. + block_id: BlockId +) -> Result<bool, AlterCheckPointError>

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

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

    -
    source

    pub fn insert_tx( +

    source

    pub fn insert_tx( &mut self, tx: Transaction, - position: ConfirmationTime + position: ConfirmationTime ) -> Result<bool, InsertTxError>

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

    Returns whether anything changed with the transaction insertion (e.g. false if the @@ -255,19 +255,19 @@

    §Examples

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

    -
    source

    pub fn transactions( +

    source

    pub fn transactions( &self -) -> impl Iterator<Item = CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>> + '_

    Iterate over the transactions in the wallet.

    -
    source

    pub fn balance(&self) -> Balance

    Return the balance, separated into available, trusted-pending, untrusted-pending and immature +) -> impl Iterator<Item = CanonicalTx<'_, Arc<Transaction>, ConfirmationTimeHeightAnchor>> + '_

    Iterate over the transactions in the wallet.

    +
    source

    pub fn balance(&self) -> Balance

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

    -
    source

    pub fn add_signer( +

    source

    pub fn add_signer( &mut self, keychain: KeychainKind, ordering: SignerOrdering, signer: Arc<dyn TransactionSigner> )

    Add an external signer

    See the signer module for an example.

    -
    source

    pub fn get_signers(&self, keychain: KeychainKind) -> Arc<SignersContainer>

    Get the signers

    +
    source

    pub fn get_signers(&self, keychain: KeychainKind) -> Arc<SignersContainer>

    Get the signers

    §Example
    let descriptor = "wpkh(tprv8ZgxMBicQKsPe73PBRSmNbTfbcsZnwWhz5eVmhHpi31HW29Z7mc9B4cWGRQzopNUzZUT391DeDJxL2PefNunWyLgqCKRMDkU1s2s8bAfoSk/84'/1'/0'/0/*)";
     let change_descriptor = "wpkh(tprv8ZgxMBicQKsPe73PBRSmNbTfbcsZnwWhz5eVmhHpi31HW29Z7mc9B4cWGRQzopNUzZUT391DeDJxL2PefNunWyLgqCKRMDkU1s2s8bAfoSk/84'/1'/0'/1/*)";
    @@ -278,7 +278,7 @@ 
    §Example
    } Ok::<(), Box<dyn std::error::Error>>(())
    -
    source

    pub fn build_tx(&mut self) -> TxBuilder<'_, DefaultCoinSelectionAlgorithm>

    Start building a transaction.

    +
    source

    pub fn build_tx(&mut self) -> TxBuilder<'_, DefaultCoinSelectionAlgorithm>

    Start building a transaction.

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

    §Example
    let psbt = {
    @@ -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.

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

    pub fn sign( +

    source

    pub fn sign( &self, psbt: &mut Psbt, sign_options: SignOptions @@ -335,14 +335,14 @@

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

    pub fn policies( +

    source

    pub fn policies( &self, keychain: KeychainKind ) -> Result<Option<Policy>, DescriptorError>

    Return the spending policies for the wallet’s descriptor

    -
    source

    pub fn public_descriptor(&self, keychain: KeychainKind) -> &ExtendedDescriptor

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

    source

    pub fn public_descriptor(&self, keychain: KeychainKind) -> &ExtendedDescriptor

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

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

    -
    source

    pub fn finalize_psbt( +

    source

    pub fn finalize_psbt( &self, psbt: &mut Psbt, sign_options: SignOptions @@ -352,56 +352,56 @@

    §Example
    for further information.

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

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

    -
    source

    pub fn secp_ctx(&self) -> &Secp256k1<All>

    Return the secp256k1 context used for all signing operations

    -
    source

    pub fn get_descriptor_for_keychain( +

    source

    pub fn secp_ctx(&self) -> &Secp256k1<All>

    Return the secp256k1 context used for all signing operations

    +
    source

    pub fn get_descriptor_for_keychain( &self, keychain: KeychainKind ) -> &ExtendedDescriptor

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

    -
    source

    pub fn derivation_index(&self, keychain: KeychainKind) -> Option<u32>

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

    source

    pub fn derivation_index(&self, keychain: KeychainKind) -> Option<u32>

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

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

    +
    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).

    +) -> 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 -) -> Result<(), CannotConnectError>

    Introduces a block of height to the wallet, and tries to connect it to the +) -> Result<(), CannotConnectError>

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

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

    -
    source

    pub fn apply_block_connected_to( +

    source

    pub fn apply_block_connected_to( &mut self, block: &Block, height: u32, - connected_to: BlockId -) -> Result<(), ApplyHeaderError>

    Applies relevant transactions from block of height to the wallet, and connects the + connected_to: BlockId +) -> Result<(), ApplyHeaderError>

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

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

    -
    source

    pub fn apply_unconfirmed_txs<'t>( +LocalChain. Relevant transactions are filtered from the block and inserted into the +internal TxGraph.

    +

    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 +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 +`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/type.ChangeSet.html b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/type.ChangeSet.html index 73d467633e..34a12cb0cc 100644 --- a/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/type.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/bdk_wallet/wallet/type.ChangeSet.html @@ -1,9 +1,9 @@ -ChangeSet in bdk_wallet::wallet - Rust

    Type Alias bdk_wallet::wallet::ChangeSet

    source ·
    pub type ChangeSet = CombinedChangeSet<KeychainKind, ConfirmationTimeHeightAnchor>;
    Expand description

    The changes made to a wallet by applying an Update.

    +ChangeSet in bdk_wallet::wallet - Rust

    Type Alias bdk_wallet::wallet::ChangeSet

    source ·
    pub type ChangeSet = CombinedChangeSet<KeychainKind, ConfirmationTimeHeightAnchor>;
    Expand description

    The changes made to a wallet by applying an Update.

    Aliased Type§

    struct ChangeSet {
         pub chain: BTreeMap<u32, Option<BlockHash>>,
    -    pub indexed_tx_graph: ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<KeychainKind>>,
    +    pub indexed_tx_graph: ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<KeychainKind>>,
         pub network: Option<Network>,
     }

    Fields§

    §chain: BTreeMap<u32, Option<BlockHash>>

    Changes to the LocalChain.

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

    Changes to IndexedTxGraph.

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

    Changes to IndexedTxGraph.

    §network: Option<Network>

    Stores the network type of the transaction data.

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html b/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html index d5d66e6bf7..45b0aec17f 100644 --- a/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html @@ -1 +1 @@ -ChangeSet in example_bitcoind_rpc_polling - Rust

    Type Alias example_bitcoind_rpc_polling::ChangeSet

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

    Type Alias example_bitcoind_rpc_polling::ChangeSet

    source ·
    pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<Keychain>>);
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html b/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html index ddc241fe6e..491b30d7cc 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html +++ b/docs-rs/bdk/nightly/latest/example_cli/fn.create_tx.html @@ -1,4 +1,4 @@ -create_tx in example_cli - Rust

    Function example_cli::create_tx

    source ·
    pub fn create_tx<A: Anchor, O: ChainOracle>(
    +create_tx in example_cli - Rust

    Function example_cli::create_tx

    source ·
    pub fn create_tx<A: Anchor, O: ChainOracle>(
         graph: &mut KeychainTxGraph<A>,
         chain: &O,
         keymap: &BTreeMap<DescriptorPublicKey, DescriptorSecretKey>,
    @@ -6,4 +6,4 @@
         address: Address,
         value: u64
     ) -> Result<(Transaction, Option<CreateTxChange>)>
    where - O::Error: Error + Send + Sync + 'static,
    \ No newline at end of file + O::Error: Error + Send + Sync + 'static,
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html b/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html index b1a87a8108..e8badee105 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html +++ b/docs-rs/bdk/nightly/latest/example_cli/fn.handle_commands.html @@ -1,4 +1,4 @@ -handle_commands in example_cli - Rust

    Function example_cli::handle_commands

    source ·
    pub fn handle_commands<CS: Subcommand, S: Args, A: Anchor, O: ChainOracle, C>(
    +handle_commands in example_cli - Rust

    Function example_cli::handle_commands

    source ·
    pub fn handle_commands<CS: Subcommand, S: Args, A: Anchor, O: ChainOracle, C>(
         graph: &Mutex<KeychainTxGraph<A>>,
         db: &Mutex<Persist<C>>,
         chain: &Mutex<O>,
    @@ -7,5 +7,5 @@
         broadcast: impl FnOnce(S, &Transaction) -> Result<()>,
         cmd: Commands<CS, S>
     ) -> Result<()>
    where - O::Error: Error + Send + Sync + 'static, - C: Default + Append + DeserializeOwned + Serialize + From<KeychainChangeSet<A>>,
    \ No newline at end of file + O::Error: Error + Send + Sync + 'static, + C: Default + Append + DeserializeOwned + Serialize + From<KeychainChangeSet<A>>,
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/fn.init.html b/docs-rs/bdk/nightly/latest/example_cli/fn.init.html index b53a610ea4..243fa083f0 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/fn.init.html +++ b/docs-rs/bdk/nightly/latest/example_cli/fn.init.html @@ -1,7 +1,7 @@ -init in example_cli - Rust

    Function example_cli::init

    source ·
    pub fn init<CS: Subcommand, S: Args, C>(
    +init in example_cli - Rust

    Function example_cli::init

    source ·
    pub fn init<CS: Subcommand, S: Args, C>(
         db_magic: &[u8],
         db_default_path: &str
     ) -> Result<Init<CS, S, C>>
    where - C: Default + Append + Serialize + DeserializeOwned + Send + Sync + 'static,
    Expand description

    Parses command line arguments and initializes all components, creating + C: Default + Append + Serialize + DeserializeOwned + Send + Sync + 'static,

    Expand description

    Parses command line arguments and initializes all components, creating a file store with the given parameters, or loading one if it exists.

    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html b/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html index d1ac50fd8f..3fd14ad7b1 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html +++ b/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html @@ -1,5 +1,5 @@ -planned_utxos in example_cli - Rust

    Function example_cli::planned_utxos

    source ·
    pub fn planned_utxos<A: Anchor, O: ChainOracle, K: Clone + CanDerive>(
    +planned_utxos in example_cli - Rust

    Function example_cli::planned_utxos

    source ·
    pub fn planned_utxos<A: Anchor, O: ChainOracle, K: Clone + CanDerive>(
         graph: &KeychainTxGraph<A>,
         chain: &O,
         assets: &Assets<K>
    -) -> Result<Vec<PlannedUtxo<K, A>>, O::Error>
    \ No newline at end of file +) -> Result<Vec<PlannedUtxo<K, A>>, O::Error>
    \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/index.html b/docs-rs/bdk/nightly/latest/example_cli/index.html index f3a1e90733..a0fd798cb5 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/index.html +++ b/docs-rs/bdk/nightly/latest/example_cli/index.html @@ -1,2 +1,2 @@ -example_cli - Rust

    Crate example_cli

    source ·

    Re-exports§

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

    Structs§

    Enums§

    Functions§

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

      Crate example_cli

      source ·

      Re-exports§

      Structs§

      Enums§

      Functions§

      Type Aliases§

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/struct.CreateTxChange.html b/docs-rs/bdk/nightly/latest/example_cli/struct.CreateTxChange.html index 5aaa356a40..82fe0c39e4 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/struct.CreateTxChange.html +++ b/docs-rs/bdk/nightly/latest/example_cli/struct.CreateTxChange.html @@ -1,8 +1,8 @@ CreateTxChange in example_cli - Rust

      Struct example_cli::CreateTxChange

      source ·
      pub struct CreateTxChange {
      -    pub index_changeset: ChangeSet<Keychain>,
      +    pub index_changeset: ChangeSet<Keychain>,
           pub change_keychain: Keychain,
           pub index: u32,
      -}

      Fields§

      §index_changeset: ChangeSet<Keychain>§change_keychain: Keychain§index: u32

      Auto Trait Implementations§

      Blanket Implementations§

      source§

      impl<T> Any for T
      where +}

      Fields§

      §index_changeset: ChangeSet<Keychain>§change_keychain: Keychain§index: u32

      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/struct.Init.html b/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html index a8054682ce..dfc6f6e062 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html +++ b/docs-rs/bdk/nightly/latest/example_cli/struct.Init.html @@ -1,13 +1,13 @@ -Init in example_cli - Rust

      Struct example_cli::Init

      source ·
      pub struct Init<CS: Subcommand, S: Args, C> {
      +Init in example_cli - Rust

      Struct example_cli::Init

      source ·
      pub struct Init<CS: Subcommand, S: Args, C> {
           pub args: Args<CS, S>,
           pub keymap: KeyMap,
      -    pub index: KeychainTxOutIndex<Keychain>,
      +    pub index: KeychainTxOutIndex<Keychain>,
           pub db: Mutex<Persist<C>>,
           pub init_changeset: C,
       }
      Expand description

      The initial state returned by init.

      Fields§

      §args: Args<CS, S>

      Arguments parsed by the cli.

      §keymap: KeyMap

      Descriptor keymap.

      -
      §index: KeychainTxOutIndex<Keychain>

      Keychain-txout index.

      +
      §index: KeychainTxOutIndex<Keychain>

      Keychain-txout index.

      §db: Mutex<Persist<C>>

      Persistence backend.

      §init_changeset: C

      Initial changeset.

      Auto Trait Implementations§

      §

      impl<CS, S, C> !Freeze for Init<CS, S, C>

      §

      impl<CS, S, C> RefUnwindSafe for Init<CS, S, C>
      where diff --git a/docs-rs/bdk/nightly/latest/example_cli/type.KeychainChangeSet.html b/docs-rs/bdk/nightly/latest/example_cli/type.KeychainChangeSet.html index 0ecea609e6..ed9191b483 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/type.KeychainChangeSet.html +++ b/docs-rs/bdk/nightly/latest/example_cli/type.KeychainChangeSet.html @@ -1 +1 @@ -KeychainChangeSet in example_cli - Rust

      Type Alias example_cli::KeychainChangeSet

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

      Type Alias example_cli::KeychainChangeSet

      source ·
      pub type KeychainChangeSet<A> = (ChangeSet, ChangeSet<A, ChangeSet<Keychain>>);
      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html b/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html index 1a92e2720e..0c4c6027c4 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html +++ b/docs-rs/bdk/nightly/latest/example_cli/type.KeychainTxGraph.html @@ -1,5 +1,5 @@ -KeychainTxGraph in example_cli - Rust

      Type Alias example_cli::KeychainTxGraph

      source ·
      pub type KeychainTxGraph<A> = IndexedTxGraph<A, KeychainTxOutIndex<Keychain>>;

      Aliased Type§

      struct KeychainTxGraph<A> {
      -    pub index: KeychainTxOutIndex<Keychain>,
      +KeychainTxGraph in example_cli - Rust

      Type Alias example_cli::KeychainTxGraph

      source ·
      pub type KeychainTxGraph<A> = IndexedTxGraph<A, KeychainTxOutIndex<Keychain>>;

      Aliased Type§

      struct KeychainTxGraph<A> {
      +    pub index: KeychainTxOutIndex<Keychain>,
           /* private fields */
      -}

      Fields§

      §index: KeychainTxOutIndex<Keychain>

      Transaction index.

      +}

      Fields§

      §index: KeychainTxOutIndex<Keychain>

      Transaction index.

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_cli/type.PlannedUtxo.html b/docs-rs/bdk/nightly/latest/example_cli/type.PlannedUtxo.html index 426d5cfa9a..85cd9e4793 100644 --- a/docs-rs/bdk/nightly/latest/example_cli/type.PlannedUtxo.html +++ b/docs-rs/bdk/nightly/latest/example_cli/type.PlannedUtxo.html @@ -1 +1 @@ -PlannedUtxo in example_cli - Rust

      Type Alias example_cli::PlannedUtxo

      source ·
      pub type PlannedUtxo<K, A> = (Plan<K>, FullTxOut<A>);
      \ No newline at end of file +PlannedUtxo in example_cli - Rust

      Type Alias example_cli::PlannedUtxo

      source ·
      pub type PlannedUtxo<K, A> = (Plan<K>, FullTxOut<A>);
      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html b/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html index d61dd2103e..0856f6cfb4 100644 --- a/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html +++ b/docs-rs/bdk/nightly/latest/example_electrum/fn.main.html @@ -1 +1 @@ -main in example_electrum - Rust

      Function example_electrum::main

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

      Function example_electrum::main

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

      Crate example_electrum

      source ·

      Structs§

      Enums§

      Constants§

      Functions§

      Type Aliases§

      \ No newline at end of file +example_electrum - Rust

      Crate example_electrum

      source ·

      Structs§

      Enums§

      Constants§

      Functions§

      Type Aliases§

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_electrum/type.ChangeSet.html b/docs-rs/bdk/nightly/latest/example_electrum/type.ChangeSet.html index 3ec31251e2..b0594e467a 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/example_esplora/fn.main.html b/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html index d08beeb163..870f1cced5 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/fn.main.html @@ -1 +1 @@ -main in example_esplora - Rust

      Function example_esplora::main

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

      Function example_esplora::main

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

      Crate example_esplora

      source ·

      Structs§

      Enums§

      Constants§

      Functions§

      Type Aliases§

      \ No newline at end of file +example_esplora - Rust

      Crate example_esplora

      source ·

      Structs§

      Enums§

      Constants§

      Functions§

      Type Aliases§

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html b/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html index f5b9f8ca41..182d9d1563 100644 --- a/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html +++ b/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html @@ -1 +1 @@ -ChangeSet in example_esplora - Rust

      Type Alias example_esplora::ChangeSet

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

      Type Alias example_esplora::ChangeSet

      source ·
      pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<Keychain>>);
      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/search-index.js b/docs-rs/bdk/nightly/latest/search-index.js index 535547b922..ab6263decb 100644 --- a/docs-rs/bdk/nightly/latest/search-index.js +++ b/docs-rs/bdk/nightly/latest/search-index.js @@ -1,6 +1,6 @@ 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::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_chain",{"t":"KKKSFSKGFGFPPKFRFEEEFFEPPNNMNNNOOMNNNNNENNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNONNNNNMNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNMNNNNNNOONNNNCNNNNNNNNNNNNMNNNMNONNNCCNENNNNNONNNNNNNNNNNNDNNNNNONCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNONNNNNNNNNNNNNNNNNNNNNNNOOOFRFKNNNMNNNNNNNNNNNNNNNNNNNNNNNOOMMOMNNNNNNNNMNNNNNNNNNNNFFSPIGPIFFNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNONNNNNNNOOOOFGPFIFFPFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNONNNNNNNFFFFNNNNNNNNNNNOONOONNNNNNNOONNNNNNNNNOONNNNNOONNNNNNNNONNNNNNNNGFFPPFFFFNNNOONNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNONOONNNNNNNNNNNNNNNNNN","n":["Anchor","AnchorFromBlockPosition","Append","BIP32_MAX_INDEX","BlockId","COINBASE_MATURITY","ChainOracle","ChainPosition","ConfirmationHeightAnchor","ConfirmationTime","ConfirmationTimeHeightAnchor","Confirmed","Confirmed","DescriptorExt","DescriptorId","Error","FullTxOut","Indexed","IndexedTxGraph","KeychainIndexed","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","DEFAULT_LOOKAHEAD","DescriptorAlreadyAssigned","Indexed","InsertDescriptorError","KeychainAlreadyAssigned","KeychainIndexed","KeychainTxOutIndex","NoSuchKeychain","add","all_unbounded_spk_iters","append","apply_changeset","apply_changeset","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","confirmed","default","default","default","deserialize","deserialize","eq","eq","eq","eq","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","get_descriptor","immature","index_of_spk","index_tx","index_txout","initial_changeset","inner","insert_descriptor","into","into","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_owned","to_owned","to_string","to_string","to_string","total","trusted_pending","trusted_spendable","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","txout","txouts","txouts_in_tx","type_id","type_id","type_id","type_id","type_id","unbounded_spk_iter","unmark_used","untrusted_pending","unused_keychain_spks","unused_spks","vzip","vzip","vzip","vzip","vzip","descriptor","existing_assignment","existing_assignment","keychain","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"],[271,"bdk_chain::ConfirmationTime"],[274,"bdk_chain::indexed_tx_graph"],[331,"bdk_chain::keychain"],[470,"bdk_chain::keychain::InsertDescriptorError"],[474,"bdk_chain::local_chain"],[616,"bdk_chain::spk_client"],[680,"bdk_chain::tx_graph"],[841,"bdk_chain::spk_txout_index"],[842,"bitcoin::blockdata::script::owned"],[843,"alloc::collections::btree::map"],[844,"core::clone"],[845,"core::cmp"],[846,"core::fmt"],[847,"bdk_chain::descriptor_ext"],[848,"bdk_chain::tx_data_traits"],[849,"bdk_chain::chain_data"],[850,"bitcoin_hashes::sha256"],[851,"bdk_chain::spk_iter"],[852,"core::option"],[853,"miniscript::descriptor::key"],[854,"miniscript::descriptor"],[855,"core::borrow"],[856,"core::result"],[857,"serde::de"],[858,"bitcoin::blockdata::block"],[859,"bitcoin_hashes"],[860,"bdk_chain::chain_oracle"],[861,"core::hash"],[862,"core::slice::index"],[863,"bitcoin::blockdata::script::borrowed"],[864,"bitcoin::blockdata::transaction"],[865,"bitcoin_units::amount"],[866,"core::ops::range"],[867,"alloc::collections::btree::set"],[868,"core::iter::traits::double_ended"],[869,"serde::ser"],[870,"alloc::string"],[871,"core::iter::traits::exact_size"],[872,"core::any"],[873,"core::iter::traits::collect"],[874,"core::default"],[875,"bdk_chain::keychain::txout_index"],[876,"alloc::vec"],[877,"core::iter::traits::iterator"],[878,"core::marker"],[879,"core::ops::function"],[880,"core::convert"],[881,"alloc::sync"],[882,"std::collections::hash::set"]],"i":[0,0,0,0,0,0,0,0,0,0,0,20,21,0,0,46,0,0,0,0,0,0,0,20,21,1,8,9,10,11,12,11,12,14,1,8,8,8,8,0,1,20,21,10,11,12,22,8,8,23,1,20,21,10,11,12,22,8,23,22,1,20,21,10,11,12,22,8,23,1,20,21,10,11,12,22,8,23,20,20,21,10,11,12,22,8,11,12,9,9,20,11,12,12,1,10,11,12,23,30,21,10,11,12,8,30,8,20,21,10,11,12,22,8,1,20,21,10,11,12,22,8,8,8,8,1,20,21,21,10,10,10,11,12,22,8,8,23,42,10,11,12,8,8,8,8,8,8,46,20,21,10,11,12,8,10,10,8,1,1,1,0,1,1,1,20,21,10,11,12,22,8,23,23,46,20,21,22,14,22,22,1,1,1,0,0,1,0,1,23,23,23,23,22,1,1,20,21,10,11,12,22,8,1,1,1,0,21,10,11,12,8,22,1,0,8,1,20,21,10,11,12,22,8,23,8,8,1,20,21,10,11,12,22,8,23,1,20,21,10,11,12,22,8,23,0,1,22,1,1,1,20,21,10,11,12,22,8,23,21,1,1,1,20,21,10,11,12,22,8,23,110,111,110,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,79,0,0,79,0,0,0,77,78,75,78,78,78,79,75,80,77,78,79,75,80,77,78,79,75,80,77,78,79,75,80,77,77,78,75,77,75,77,79,75,80,77,78,79,79,75,80,80,77,77,78,79,75,80,77,78,77,78,78,78,78,78,78,78,79,75,80,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,78,79,75,80,77,79,80,77,77,77,77,78,79,75,80,77,78,79,75,80,77,78,78,78,78,79,75,80,77,78,78,77,78,78,78,79,75,80,77,112,112,113,113,0,0,90,0,0,0,0,90,0,0,85,85,85,85,91,93,91,85,87,92,89,90,93,91,85,87,92,89,90,91,85,87,92,89,90,91,85,87,92,89,90,85,91,85,87,92,89,90,91,91,85,87,87,92,92,89,89,90,90,93,91,85,87,92,89,90,91,85,85,85,91,85,85,91,85,85,91,91,92,85,91,85,93,91,85,87,92,89,90,93,91,85,91,85,91,93,92,91,91,91,85,85,91,85,87,92,89,90,87,92,89,90,93,91,85,87,92,89,90,89,93,91,85,87,92,89,90,93,91,85,87,92,89,90,92,93,91,85,87,92,89,90,0,0,0,0,94,114,97,115,94,114,97,115,94,94,97,94,97,94,114,115,94,114,97,115,94,97,97,114,115,94,94,97,97,94,94,114,97,115,115,94,94,94,94,97,94,94,97,94,114,97,115,94,114,97,115,94,94,114,97,115,94,114,97,115,0,0,0,102,102,0,0,0,0,70,70,74,103,74,74,70,70,70,70,70,107,108,70,103,104,102,74,107,108,70,103,104,102,74,70,104,107,107,108,108,70,103,104,74,70,103,104,74,103,104,70,74,103,74,70,70,103,104,102,74,70,70,70,70,103,104,102,102,74,107,108,70,103,104,102,74,70,70,70,70,70,70,70,70,70,70,70,107,108,70,103,104,102,74,107,108,70,74,74,103,70,70,74,70,107,108,70,103,104,74,70,103,104,74,102,70,70,70,107,108,70,103,104,102,74,70,70,107,108,70,103,104,102,74,70,103,104,70,70,103,74,74,74,107,108,70,103,104,102,74,70,107,108,70,103,104,102,74,70,70,70],"f":"`````````````````````````{{{d{{b{c}}}}}{{d{{h{cf}}}}}{jln}}{{}A`}{{{d{Ab}}}Ad}{{{d{Ad}}}Ad}{{{d{Af}}}Ad}{{{d{Ah}}}Ad}``{{{d{AjAl}}Al}An}{{{d{Aj{b{c}}}}e}An{jln}{}}{{{d{A`}}}{{d{c}}}{}}{{{d{A`}}}{{d{B`}}}}{{{d{A`}}}{{d{{Bd{Bb}}}}}}{{{d{A`}}}{{d{{Bf{Bb}}}}}}`{{{d{c}}}{{d{e}}}{}{}}000000100{{{d{Ajc}}}{{d{Aje}}}{}{}}00000000`{{{d{{b{c}}}}}{{b{c}}}j}{{{d{{Bh{c}}}}}{{Bh{c}}}j}{{{d{Bj}}}Bj}={{{d{Af}}}Af}{{{d{Ah}}}Ah}{{{d{{Bl{c}}}}}{{Bl{c}}}j}{{{d{A`}}}A`}{{{d{{Bn{c}}}}}{{Bn{c}}}j}{{{d{c}}{d{Aje}}}An{}{}}00000000{{{Bh{{d{c}}}}}{{Bh{c}}}j}{{{d{{Bh{c}}}}{d{{Bh{c}}}}}C`l}{{{d{Bj}}{d{Bj}}}C`}{{{d{Ad}}{d{Ad}}}C`}{{{d{Af}}{d{Af}}}C`}{{{d{Ah}}{d{Ah}}}C`}{{{d{{Bl{c}}}}{d{{Bl{c}}}}}C`l}{{{d{A`}}{d{A`}}}C`}``{{{d{Ab}}}Cb}0{{{d{{Bh{c}}}}}{{Cd{Cb}}}Ab}{{{d{Af}}}Cb}{{{d{Ah}}}Cb}`{{}{{b{c}}}{}}{{}Ad}{{}Af}{{}Ah}{{{d{{Bn{c}}}}}{{d{c}}}{{Cj{{Ch{Cf}}}}}}{{{d{Cl}}}A`}{c{{Cn{Bj}}}D`}{c{{Cn{Ad}}}D`}{c{{Cn{Af}}}D`}{c{{Cn{Ah}}}D`}{c{{Cn{A`}}}D`}{{{d{Cl}}}Db}{{}c{}}{{{d{{Bh{c}}}}{d{{Bh{c}}}}}DdDf}{{{d{Bj}}{d{Bj}}}Dd}{{{d{Ad}}{d{Ad}}}Dd}{{{d{Af}}{d{Af}}}Dd}{{{d{Ah}}{d{Ah}}}Dd}{{{d{{Bl{c}}}}{d{{Bl{c}}}}}DdDf}{{{d{A`}}{d{A`}}}Dd}{{{d{{b{c}}}}{d{AjDh}}}Djn}{{{d{{Bh{c}}}}{d{AjDh}}}Djn}{{{d{Bj}}{d{AjDh}}}Dj}{{{d{Ad}}{d{AjDh}}}Dj}{{{d{Af}}{d{AjDh}}}Dj}{{{d{Ah}}{d{AjDh}}}Dj}{{{d{{Bl{c}}}}{d{AjDh}}}Djn}{{{d{A`}}{d{AjDh}}}Dj}000{cc{}}0{{{Bh{Ah}}}Bj}11{{{Dn{{d{Cb}}{d{Dl}}}}}Ad}{{{Dn{CbDl}}}Ad}333{B`A`}44{{{d{E`}}AdEb}Ed}{{{d{E`}}AdEb}Ad}{{{d{E`}}AdEb}Af}{{{d{E`}}AdEb}Ah}{cA`{}}05{{{d{{Bf{Bb}}}}}{{Cn{A`Ef}}}}0{{{d{Eh}}}{{Cn{A`c}}}{}}{{{d{{El{}{{Ej{c}}}}}}}{{Cn{Adc}}}n}{{{d{{Bh{c}}}}{d{Aje}}}AnEnF`}{{{d{Bj}}{d{Ajc}}}AnF`}{{{d{Ad}}{d{Ajc}}}AnF`}{{{d{Af}}{d{Ajc}}}AnF`}{{{d{Ah}}{d{Ajc}}}AnF`}{{{d{A`}}{d{Ajc}}}AnF`}``{{{d{A`}}c}{{d{e}}}{{Fb{{Bf{Bb}}}}}{}}{{{d{{b{c}}}}{d{Fd}}}{{Cd{{d{c}}}}}{jln}}{{{d{Aj{b{c}}}}{d{Ff}}}e{jln}{}}{{{d{Aj{b{c}}}}Fh{d{Fj}}}e{jln}{}}`{{{d{{b{c}}}}}e{jln}{}}{{{d{Aj{b{c}}}}cf}Dd{jln}}{ce{}{}}000000000{{{d{{El{}{{Ej{c}}}}}}AdAd}{{Cn{{Cd{Dd}}c}}}n}{{{d{{Bh{c}}}}}Dd{}}{{{d{Bj}}}Dd}{{{d{{Bl{c}}}}Cb}DdAb}{{{d{Al}}}Dd}1`{{{d{{b{c}}}}{d{Ff}}}Dd{jln}}0{{{d{{b{c}}}}{d{c}}}Dd{jln}}``{{{d{Aj{b{c}}}}{d{c}}}Dd{jln}}`{{{d{{b{c}}}}{d{Ff}}e}Fl{jln}{{Fn{c}}}}{c{{Bn{c}}}{{Cj{{Ch{Cf}}}}}}{{ce}{{Bn{c}}}{{Cj{{Ch{Cf}}}}}{{Fn{Cb}}}}{{{d{Aj{Bn{c}}}}}{{Cd{e}}}{{Cj{{Ch{Cf}}}}}{}}{{{d{Aj{Bn{c}}}}Eb}{{Cd{e}}}{{Cj{{Ch{Cf}}}}}{}}`{{{d{{b{c}}}}}{{d{{G`{{Dn{cFh}}}}}}}{jln}}{{{d{{b{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh}}}}}}}}}{jln}{{Fn{c}}}}{{{d{{Bh{c}}}}{d{{Bh{c}}}}}{{Cd{C`}}}Gf}{{{d{Bj}}{d{Bj}}}{{Cd{C`}}}}{{{d{Ad}}{d{Ad}}}{{Cd{C`}}}}{{{d{Af}}{d{Af}}}{{Cd{C`}}}}{{{d{Ah}}{d{Ah}}}{{Cd{C`}}}}{{{d{{Bl{c}}}}{d{{Bl{c}}}}}{{Cd{C`}}}Gf}{{{d{A`}}{d{A`}}}{{Cd{C`}}}}{{{d{Aj{b{c}}}}{d{Ff}}}{{G`{c}}}{jln}}{{{d{Aj{b{c}}}}Fh{d{Fj}}}{{Cd{{d{c}}}}}{jln}}{{{d{{b{c}}}}{d{Ff}}e}{{Dn{GhGh}}}{jln}{{Fn{c}}}}`{{{d{Bj}}c}CnGj}{{{d{Ad}}c}CnGj}{{{d{Af}}c}CnGj}{{{d{Ah}}c}CnGj}{{{d{A`}}c}CnGj}`{{{d{{b{c}}}}{d{c}}}{{Cd{{d{Fd}}}}}{jln}}`{A`c{}}{{{d{c}}}e{}{}}00000000{A`B`}{{{d{c}}}Gl{}}{c{{Cn{e}}}{}{}}00000000000000000`{{{d{{b{c}}}}Fh}{{Cd{{Dn{{d{c}}{d{Fj}}}}}}}{jln}}`{{{d{{b{c}}}}}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh{d{Fj}}}}}}}}Gn}}}{jln}}{{{d{{b{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{{d{c}}Fh{d{Fj}}}}}}}}}}}{jln}}{{{d{c}}}Hb{}}00000000{DbBj}{{{d{Aj{b{c}}}}{d{c}}}Dd{jln}}{{{d{{b{c}}}}e}{{`{{Gd{}{{Gb{{Dn{{d{c}}{d{Fd}}}}}}}}j}}}{jln}{{Fn{c}}}}{ce{}{}}00000000```````{{{d{Aj{Hd{ce}}}}{Hd{ce}}}AnAbAl}{{{d{Aj{Hf{ce}}}}E`Cb}{{Hd{c}}}{EdAb}Hh}{{{d{Aj{Hf{ce}}}}{d{E`}}Cb}{{Hd{c}}}{EdAb}Hh}{{{d{Aj{Hh{}{{Hj{c}}}}}}c}An{}}{{{d{Aj{Hf{ce}}}}{Hd{c}}}AnAbHh}{{{d{Aj{Hf{ce}}}}{Hl{c}}}{{Hd{c}}}AbHh}{{{d{{Hf{ce}}}}}{{d{{Hl{c}}}}}{}{}}{{{d{Aj{Hf{ce}}}}i}{{Hd{c}}}AbHh{{Hn{}{{Gb{c}}}}}{{Hn{}{{Gb{{Dn{{d{Ff}}g}}}}}}}}{{{d{Aj{Hf{ce}}}}g}{{Hd{c}}}AbHh{{Hn{}{{Gb{{Dn{{d{Ff}}Db}}}}}}}}{{{d{Aj{Hf{ce}}}}g}{{Hd{c}}}AbHh{{Hn{}{{Gb{{Dn{FfDb}}}}}}}}{{{d{c}}}{{d{e}}}{}{}}0{{{d{Ajc}}}{{d{Aje}}}{}{}}0{{{d{{Hd{ce}}}}}{{Hd{ce}}}jj}{{{d{c}}{d{Aje}}}An{}{}}{{}{{Hf{ce}}}{}I`}{{}{{Hd{ce}}}{}I`}{c{{Cn{{Hd{eg}}}}}D`{lIb}Ib}{{{d{{Hd{ce}}}}{d{{Hd{ce}}}}}DdDfDf}{{{d{{Hf{ce}}}}{d{AjDh}}}Djnn}{{{d{{Hd{ce}}}}{d{AjDh}}}Djnn}{cc{}}0{{{Id{c}}}{{Hd{ce}}}{}I`}{{{If{c}}}{{Hd{e{If{c}}}}}{}{}}{{{d{{Hf{ce}}}}}{{d{{Hl{c}}}}}{}{}}``{{{d{Aj{Hh{}{{Hj{c}}}}}}{d{Ff}}}c{}}{{{d{Aj{Hh{}{{Hj{c}}}}}}Fh{d{Fj}}}c{}}`{{{d{{Hh{}{{Hj{c}}}}}}}c{}}{{{d{{Hf{ce}}}}}{{Hd{c}}}AbHh}{{{d{Aj{Hf{ce}}}}H`c}{{Hd{c}}}AbHh}{{{d{Aj{Hf{ce}}}}H`Db}{{Hd{c}}}AbHh}{{{d{Aj{Hf{ce}}}}Ff}{{Hd{c}}}AbHh}{{{d{Aj{Hf{ce}}}}FhFj}{{Hd{c}}}AbHh}{ce{}{}}0{{{d{{Hd{ce}}}}}DdAbAl}{{{d{{Hh{}{{Hj{c}}}}}}{d{Ff}}}Dd{}}{c{{Hf{ec}}}{}{}}{{{d{{Hd{ce}}}}g}Cn{lIh}IhGj}{{{d{c}}}e{}{}}{c{{Cn{e}}}{}{}}000{{{d{c}}}Hb{}}077``````````{{IjIj}Ij}{{{d{{Il{c}}}}}{{h{c{Bn{{Ch{Cf}}}}}}}{jln}}{{{d{Aj{If{c}}}}{If{c}}}Anl}{{{d{Aj{Il{c}}}}e}An{jln}{}}{{{d{Aj{Il{c}}}}{If{c}}}An{jln}}{{{d{c}}}{{d{e}}}{}{}}0000{{{d{Ajc}}}{{d{Aje}}}{}{}}0000{{{d{{Il{c}}}}}{{Il{c}}}j}{{{d{{In{c}}}}}{{In{c}}}j}{{{d{{If{c}}}}}{{If{c}}}j}{{{d{{J`{c}}}}}{{J`{c}}}j}{{{d{Ij}}}Ij}{{{d{c}}{d{Aje}}}An{}{}}0000`{{}{{Il{c}}}{}}{{}{{If{c}}}{}}{{}Ij}{c{{Cn{{If{e}}}}}D`{lIb}}{c{{Cn{Ij}}}D`}{{{d{{In{c}}}}{d{{In{c}}}}}DdDf}{{{d{{If{c}}}}{d{{If{c}}}}}DdDf}{{{d{{J`{c}}}}{d{{J`{c}}}}}DdDf}{{{d{Ij}}{d{Ij}}}Dd}{{{d{{Il{c}}}}{d{AjDh}}}Djn}{{{d{{In{c}}}}{d{AjDh}}}Djn}0{{{d{{If{c}}}}{d{AjDh}}}Djn}{{{d{{J`{c}}}}{d{AjDh}}}Djn}0{{{d{Ij}}{d{AjDh}}}Dj}0{cc{}}0000{{{d{{Il{c}}}}{d{c}}}{{Cd{{d{{Ch{Cf}}}}}}}{jln}}`{{{d{{Il{c}}}}{d{Fd}}}{{Cd{{d{{Dn{cCb}}}}}}}{jln}}{{{d{Aj{Il{c}}}}{d{Ff}}}e{jln}{}}{{{d{Aj{Il{c}}}}Fh{d{Fj}}}e{jln}{}}{{{d{{Il{c}}}}}e{jln}{}}{{{d{{Il{c}}}}}{{d{{b{{Dn{cCb}}}}}}}{jln}}{{{d{Aj{Il{c}}}}c{Ch{Cf}}}{{Cn{{If{c}}{In{c}}}}}{jln}}{ce{}{}}0000{{{d{{If{c}}}}}Ddl}{{{d{{Il{c}}}}{d{Ff}}}Dd{jln}}{{{d{{Il{c}}}}cCb}Dd{jln}}{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Jb{Fh}}}}}}}}}{jln}}{{{d{{Il{c}}}}e}{{`{{Gd{}{{Gb{{Jd{cFh}}}}}}}}}{jln}{{Fn{c}}}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Dn{{d{c}}{d{{Ch{Cf}}}}}}}}}}Gn}}}{jln}}``{{{d{{Il{c}}}}{d{c}}}{{Cd{Cb}}}{jln}}{{{d{{Il{c}}}}}{{h{cCb}}}{jln}}10{{{d{{Il{c}}}}}Cb{jln}}{{{d{Aj{Il{c}}}}{d{c}}Cb}An{jln}}{{{d{Aj{Il{c}}}}cCb}Dd{jln}}{{{d{{Il{c}}}}{d{Ff}}e}Fl{jln}{{Fn{c}}}}{Cb{{Il{c}}}{}}{{{d{{Il{c}}}}{d{c}}}{{Cd{{Dn{CbDd}}}}}{jln}}{{{d{Aj{Il{c}}}}{d{c}}}{{Cd{{Dn{{Jb{f}}{If{c}}}}}}}{jln}}{{{d{{Il{c}}}}}{{d{{G`{{Jd{cFh}}}}}}}{jln}}1{{{d{Aj{Il{c}}}}{d{c}}Cb}{{Cd{{Dn{{Jf{{Jb{f}}}}{If{c}}}}}}}{jln}}{{{d{Aj{Il{c}}}}{d{{h{cCb}}}}}{{If{c}}}{jln}}{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Jb{{d{Fd}}}}}}}}}}}{jln}}{{{d{{Il{c}}}}e}{{`{{Jh{}{{Gb{{Jd{c{d{Fd}}}}}}}}}}}{jln}{{Fn{c}}}}{{{d{{Il{c}}}}{d{Ff}}e}{{Dn{GhGh}}}{jln}{{Fn{c}}}}{{{d{{If{c}}}}e}Cn{lIh}Gj}{{{d{Ij}}c}CnGj}{{{d{{Il{c}}}}cCb}{{Cd{{d{Fd}}}}}{jln}}{{{d{c}}}e{}{}}0000{{{d{c}}}Gl{}}00{{{d{Ij}}}Gh}`0{c{{Cn{e}}}{}{}}000000000{{{d{{Il{c}}}}Fh}{{Cd{{Jd{c{d{Fj}}}}}}}{jln}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Jd{c{Dn{Fh{d{Fj}}}}}}}}}}Gn}}}{jln}}{{{d{{Il{c}}}}H`}{{`{{Gd{}{{Gb{{Jd{c{Dn{Fh{d{Fj}}}}}}}}}}}}}{jln}}{{{d{c}}}Hb{}}0000{{{d{{Il{c}}}}{d{c}}}{{Cd{{Bn{{Ch{Cf}}}}}}}{jln}}{{{d{Aj{Il{c}}}}cCb}Dd{jln}}`{{{d{{Il{c}}}}{d{c}}}{{`{{Gd{}{{Gb{{Jb{{d{Fd}}}}}}}}j}}}{jln}}{{{d{{Il{c}}}}}{{`{{Gd{}{{Gb{{Jd{c{d{Fd}}}}}}}}j}}}{jln}}{ce{}{}}0000``````````````{{{d{AjJj}}{d{Jl}}}{{Cn{AnJn}}}}{{{d{AjJj}}{d{K`}}Cb}{{Cn{JlKb}}}}{{{d{AjJj}}{d{K`}}CbAd}{{Cn{JlKd}}}}{{{d{AjJj}}Kf}{{Cn{JlKb}}}}{{{d{Kf}}}Ad}{{{d{c}}}{{d{e}}}{}{}}000000{{{d{Ajc}}}{{d{Aje}}}{}{}}000000{{{d{Kf}}}Kf}{{{d{Jj}}}Jj}{{{d{Jn}}}Jn}{{{d{Kh}}}Kh}{{{d{Kb}}}Kb}{{{d{Kd}}}Kd}{{{d{c}}{d{Aje}}}An{}{}}00000{{{d{AjJj}}Ad}{{Cn{JlJn}}}}{{{d{Kf}}{d{Kf}}}Dd}{{{d{Jj}}{d{Jj}}}Dd}{{{d{Jn}}{d{Jn}}}Dd}{{{d{Kh}}{d{Kh}}}Dd}{{{d{Kb}}{d{Kb}}}Dd}{{{d{Kd}}{d{Kd}}}Dd}{{Kfc}{{Cn{KfKf}}}{{Hn{}{{Gb{Ad}}}}}}{{{d{Kf}}{d{AjDh}}}Dj}{{{d{Jj}}{d{AjDh}}}Dj}{{{d{Jn}}{d{AjDh}}}Dj}0{{{d{Kh}}{d{AjDh}}}Dj}0{{{d{Kb}}{d{AjDh}}}Dj}0{{{d{Kd}}{d{AjDh}}}Dj}0{cc{}}000000{c{{Cn{Kf{Cd{Kf}}}}}{{Hn{}{{Gb{Ad}}}}}}{{{h{CbDl}}}{{Cn{JjJn}}}}{Jl{{Cn{JjJn}}}}{Dl{{Dn{JjJl}}}}{{{d{K`}}Cb}Kf}{Kf{{Cn{JjJn}}}}{{{d{Jj}}}Dl}{{{d{Kf}}Cb}{{Cd{Kf}}}}{{{d{Jj}}Cb}{{Cd{Kf}}}}{{{d{Jj}}}{{Cn{Adc}}}{}}{{{d{Kf}}}Dl}{{{d{Kf}}}Cb}`{{{d{Jj}}}Jl}{{KfAd}Kf}{{{d{AjJj}}Ad}{{Cn{JlKh}}}}{ce{}{}}0000000{Kfc{}}{{{d{Jj}}AdAd}{{Cn{{Cd{Dd}}c}}}{}}{{{d{Kf}}}Kj}{{{d{Jj}}}Kj}{AdKf}{{{d{AjKj}}}{{Cd{c}}}{}}`{{{d{Kf}}}{{Cd{Kf}}}}{{KfAd}{{Cn{KfKf}}}}{{{d{Kf}}c}{{`{{Jh{}{{Gb{Kf}}}}}}}{{Fn{Cb}}}}{{{d{Jj}}c}{{`{{Jh{}{{Gb{Kf}}}}}}}{{Fn{Cb}}}}{{{d{Jj}}}Kf}{{{d{c}}}e{}{}}00000{{{d{c}}}Gl{}}000{c{{Cn{e}}}{}{}}000000`0000000{{{d{c}}}Hb{}}000000`???????````{{{d{c}}}{{d{e}}}{}{}}000{{{d{Ajc}}}{{d{Aje}}}{}{}}000{{Kle}Kl{{Gn{}{{Gb{Fh}}}}Kn}{{Hn{}{{L`{c}}{Gb{Fh}}}}}}{{Kle}Kl{{Gn{}{{Gb{f}}}}Kn}{{Hn{}{{L`{c}}{Gb{f}}}}}}{{{Lb{c}}cg}{{Lb{c}}}{lj}{{Jh{}{{Gb{{Jb{f}}}}}}Kn}{{Hn{}{{L`{e}}}}}}``{{Kle}Kl{{Gn{}{{Gb{H`}}}}Kn}{{Hn{}{{L`{c}}{Gb{H`}}}}}}``{cc{}}000{KfKl}{Kf{{Lb{c}}}{lj}}{{Kf{d{{Il{c}}}}}{{Lb{c}}}{nlj}}``{{Klc}Kl{{Ld{{d{Fh}}}}KnLf}}{{Klc}Kl{{Ld{{d{Fd}}}}KnLf}}{{{Lb{c}}e}{{Lb{c}}}{Knlj}{{Ld{cCb{d{Fd}}}}KnLfj}}{{{Lb{c}}ce}{{Lb{c}}}{Knlj}{{Ld{Cb{d{Fd}}}}KnLf}}{{Klc}Kl{{Ld{{d{H`}}}}KnLf}}{ce{}{}}000``{{Kl{d{{Il{c}}}}e}Kl{jlnKnLf}{{Fn{c}}}}{{Kle}Kl{{Gn{}{{Gb{Fh}}}}Kn}{{Hn{}{{L`{c}}}}}}{{Kle}Kl{{Gn{}{{Gb{f}}}}Kn}{{Hn{}{{L`{c}}}}}}>{{Kle}Kl{{Gn{}{{Gb{H`}}}}Kn}{{Hn{}{{L`{c}}}}}}``{c{{Cn{e}}}{}{}}0000000`{{{d{c}}}Hb{}}0006666`````````{{{d{{Hl{c}}}}}{{d{{G`{{Dn{cH`}}}}}}}{}}{{{d{{Hl{c}}}}}{{`{{Jh{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}{{{d{{Id{c}}}}}{{`{{Jh{}{{Gb{Cb}}}}}}}Ab}``{{{d{Aj{Id{c}}}}{Id{c}}}Anl}{{{d{Aj{Hl{c}}}}{Id{c}}}An{jl}}{{{d{Aj{Hl{c}}}}{Hl{c}}}{{Id{c}}}{jl}}{{{d{{Hl{c}}}}}{{d{{Hl{c}}}}}{}}{{{d{{Hl{c}}}}{d{e}}Adik}IjAb{{El{}{{Ej{Lh}}}}}j{{Hn{}{{Gb{{Dn{gFh}}}}}}}{{Ld{{d{g}}{d{Fd}}}{{Lj{Dd}}}}}}{{{d{Aj{Hl{c}}}}e}{{Id{c}}}{jl}{{Hn{}{{Gb{{Dn{FfDb}}}}}}}}{{{d{c}}}{{d{e}}}{}{}}000000{{{d{Ajc}}}{{d{Aje}}}{}{}}000000{{{d{{Hl{c}}}}{d{Ff}}}{{Cn{GhLl}}}{}}`{c{{Cd{Fl}}}{}}{c{{Cd{Gh}}}{}}01{{{d{{Hl{c}}}}}{{Hl{c}}}j}{{{d{{Ln{ce}}}}}{{Ln{ce}}}jj}{{{d{{M`{ce}}}}}{{M`{ce}}}jj}{{{d{{Id{c}}}}}{{Id{c}}}j}{{{d{c}}{d{Aje}}}An{}{}}000{{{d{{Ln{ce}}}}{d{{Ln{ce}}}}}C`ll}{{{d{{M`{ce}}}}{d{{M`{ce}}}}}C`ll}{{}{{Hl{c}}}{}}{{}{{Id{c}}}{}}{{{d{{Ln{ce}}}}}{{d{g}}}{}{}{}}{c{{Cn{{Id{e}}}}}D`{lIb}}{{{d{{Hl{c}}}}{d{Ff}}}{{`{{Jh{}{{Gb{{Dn{EbH`}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{{Hl{c}}}}}DdDf}{{{d{{Ln{ce}}}}{d{{Ln{ce}}}}}DdDfDf}{{{d{{M`{ce}}}}{d{{M`{ce}}}}}DdDfDf}{{{d{Ll}}{d{Ll}}}Dd}{{{d{{Id{c}}}}{d{{Id{c}}}}}DdDf}{{{d{{Hl{c}}}}{d{e}}Adi}{{`{{Jh{}{{Gb{{Dn{g{Bl{c}}}}}}}}}}}Ab{{El{}{{Ej{Lh}}}}}j{{Hn{}{{Gb{{Dn{gFh}}}}}}}}0{{{d{{Hl{c}}}}}{{`{{Jh{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{AjDh}}}Djn}{{{d{{Ln{ce}}}}{d{AjDh}}}Djnn}{{{d{{M`{ce}}}}{d{AjDh}}}Djnn}{{{d{Ll}}{d{AjDh}}}Dj}0{{{d{{Id{c}}}}{d{AjDh}}}Djn}{cc{}}000000{{{d{{Hl{c}}}}}{{`{{Jh{}{{Gb{{Ln{{Mb{Ff}}c}}}}}}}}}{}}{{{d{{Hl{c}}}}{d{e}}AdH`}{{Cd{{Bh{{d{c}}}}}}}Ab{{El{}{{Ej{Lh}}}}}}{{{d{{Hl{c}}}}{d{e}}AdFh}{{Cd{{Dn{{Bh{{d{c}}}}H`}}}}}Ab{{El{}{{Ej{Lh}}}}}}{{{d{{Hl{c}}}}H`}{{Cd{{Mb{Ff}}}}}{}}{{{d{{Hl{c}}}}H`}{{Cd{{Ln{{Mb{Ff}}c}}}}}{}}{{{d{{Hl{c}}}}Fh}{{Cd{{d{Fj}}}}}{}}{{{d{{Hl{c}}}}}{{Id{c}}}{jl}}{{{d{Aj{Hl{c}}}}H`c}{{Id{c}}}{jl}}{{{d{Aj{Hl{c}}}}H`Db}{{Id{c}}}{jl}}{{{d{Aj{Hl{c}}}}e}{{Id{c}}}{jl}{{Md{{Mb{Ff}}}}}}{{{d{Aj{Hl{c}}}}FhFj}{{Id{c}}}{jl}}{ce{}{}}00000000{{{d{{Hl{c}}}}}Dd{}}{{{d{{Id{c}}}}}Ddl}``{{{d{{Hl{c}}}}{d{e}}Ad}{{`{{Jh{}{{Gb{{M`{{Mb{Ff}}c}}}}}}}}}AbEl}{{{Hl{c}}g}{{Hl{e}}}{jl}{jl}{{Ld{c}{{Lj{e}}}}}}{{{Id{c}}g}{{Id{e}}}ll{{Ld{c}{{Lj{e}}}}}}{c{{Hl{e}}}{{Hn{}{{Gb{Ff}}}}}{jl}}{{{d{Aj{Mf{cg}}}}}{{Cd{i}}}{}{}{{Ld{Eb{Mb{Ff}}}{{Lj{{Cd{e}}}}}}}{}}{{{d{Aj{Mh{cg}}}}}{{Cd{i}}}{}{}{{Ld{EbH`}{{Lj{{Cd{e}}}}}}}{}}{{{d{{Hl{c}}}}Fh}{{d{{Mj{H`}}}}}{}}{{{d{{Ln{ce}}}}{d{{Ln{ce}}}}}{{Cd{C`}}}GfGf}{{{d{{M`{ce}}}}{d{{M`{ce}}}}}{{Cd{C`}}}GfGf}{{{d{{Id{c}}}}e}Cn{lIh}Gj}{{{d{c}}}e{}{}}000{{{d{c}}}Gl{}}{{{d{{Hl{c}}}}{d{e}}Adik}{{Cn{Ij}}}AbElj{{Hn{}{{Gb{{Dn{gFh}}}}}}}{{Ld{{d{g}}{d{Fd}}}{{Lj{Dd}}}}}}{{{d{{Hl{c}}}}{d{e}}Adi}{{`{{Jh{}{{Gb{{Cn{{Dn{g{Bl{c}}}}}}}}}}}}}AbElj{{Hn{}{{Gb{{Dn{gFh}}}}}}}}0{c{{Cn{e}}}{}{}}000000{{{d{{Hl{c}}}}{d{e}}AdH`}{{Cn{{Cd{{Bh{{d{c}}}}}}}}}AbEl}{{{d{{Hl{c}}}}{d{e}}AdFh}{{Cn{{Cd{{Dn{{Bh{{d{c}}}}H`}}}}}}}AbEl}2222222{{{d{{Hl{c}}}}{d{e}}Ad}{{`{{Jh{}{{Gb{{Cn{{M`{{Mb{Ff}}c}}}}}}}}}}}AbEl}``{{{d{{Hl{c}}}}H`}{{Cd{{h{Cb{d{Fj}}}}}}}{}}{{{d{{Hl{c}}}}H`}{{`{{Gd{}{{Gb{{Dn{Cb{d{{Mj{H`}}}}}}}}}}}}}{}}`{{{d{{Id{c}}}}}{{`{{Jh{}{{Gb{{Dn{Fh{d{Fj}}}}}}}}}}}{}}``{{{d{c}}}Hb{}}000000{{{d{Aj{Hl{c}}}}Db}{{Id{c}}}{jl}}{ce{}{}}000000{{{d{{Hl{c}}}}ei}{{Mf{ci}}}{jl}{{Md{{Mb{Ff}}}}}{}{{Ld{Eb{Mb{Ff}}}{{Lj{{Cd{g}}}}}}}}{{{d{{Hl{c}}}}{d{Ff}}g}{{Mh{cg}}}{}{}{{Ld{EbH`}{{Lj{{Cd{e}}}}}}}}{{{d{{Hl{c}}}}H`g}{{Mh{cg}}}{jl}{}{{Ld{EbH`}{{Lj{{Cd{e}}}}}}}}","D":"BNj","p":[[5,"SpkTxOutIndex",0,841],[1,"reference"],[5,"ScriptBuf",842],[5,"BTreeMap",843],[10,"Clone",844],[10,"Ord",845],[10,"Debug",846],[5,"DescriptorId",0,847],[10,"Anchor",0,848],[5,"BlockId",0,849],[5,"ConfirmationHeightAnchor",0,849],[5,"ConfirmationTimeHeightAnchor",0,849],[0,"mut"],[10,"Append",0,848],[1,"unit"],[5,"Hash",850],[1,"u8"],[1,"array"],[1,"slice"],[6,"ChainPosition",0,849],[6,"ConfirmationTime",0,849],[5,"FullTxOut",0,849],[5,"SpkIterator",0,851],[6,"Ordering",845],[1,"u32"],[6,"Option",852],[6,"DescriptorPublicKey",853],[6,"Descriptor",854],[10,"Borrow",855],[10,"DescriptorExt",0,847],[6,"Result",856],[10,"Deserializer",857],[1,"u64"],[1,"bool"],[10,"PartialEq",845],[5,"Formatter",846],[8,"Result",846],[5,"BlockHash",858],[1,"tuple"],[5,"Block",858],[1,"usize"],[10,"AnchorFromBlockPosition",0,848],[5,"FromSliceError",859],[1,"str"],[17,"Error"],[10,"ChainOracle",0,860],[10,"Hash",861],[10,"Hasher",861],[10,"SliceIndex",862],[5,"Script",863],[5,"Transaction",864],[5,"OutPoint",864],[5,"TxOut",864],[5,"SignedAmount",865],[10,"RangeBounds",866],[5,"BTreeSet",867],[17,"Item"],[10,"DoubleEndedIterator",868],[10,"PartialOrd",845],[5,"Amount",865],[10,"Serializer",869],[5,"String",870],[10,"ExactSizeIterator",871],[5,"Txid",864],[5,"TypeId",872],[5,"ChangeSet",274],[5,"IndexedTxGraph",274],[10,"Indexer",274],[17,"ChangeSet"],[5,"TxGraph",680],[10,"IntoIterator",873],[10,"Default",874],[10,"Deserialize",857],[5,"ChangeSet",680],[5,"ChangeSet",331,875],[10,"Serialize",869],[5,"Balance",331],[5,"KeychainTxOutIndex",331,875],[6,"InsertDescriptorError",331,875],[5,"NoSuchKeychain",331,875],[8,"Indexed",331],[8,"KeychainIndexed",331],[5,"Vec",876],[10,"Iterator",877],[5,"LocalChain",474],[8,"ChangeSet",474],[5,"MissingGenesisError",474],[5,"Header",858],[5,"CannotConnectError",474],[6,"ApplyHeaderError",474],[5,"CheckPoint",474],[5,"AlterCheckPointError",474],[5,"CheckPointIter",474],[5,"SyncRequest",616],[10,"Send",878],[17,"IntoIter"],[5,"FullScanRequest",616],[10,"FnMut",879],[10,"Sync",878],[6,"Infallible",880],[17,"Output"],[6,"CalculateFeeError",680],[5,"TxNode",680],[5,"CanonicalTx",680],[5,"Arc",881],[10,"Into",880],[5,"TxAncestors",680],[5,"TxDescendants",680],[5,"HashSet",882],[15,"Confirmed",271],[15,"Unconfirmed",271],[15,"DescriptorAlreadyAssigned",470],[15,"KeychainAlreadyAssigned",470],[5,"SyncResult",616],[5,"FullScanResult",616]],"r":[[0,848],[1,848],[2,848],[3,851],[4,849],[6,860],[7,849],[8,849],[9,849],[10,849],[13,847],[14,847],[16,849],[17,331],[18,274],[19,331],[20,851],[21,841],[22,680],[332,875],[333,875],[336,875],[339,875],[340,875]],"b":[[37,"impl-AsRef%3C%5Bu8;+%3C%24hash+as+%24crate::Hash%3E::LEN%5D%3E-for-DescriptorId"],[38,"impl-AsRef%3C%5Bu8%5D%3E-for-DescriptorId"],[121,"impl-Debug-for-DescriptorId"],[122,"impl-LowerHex-for-DescriptorId"],[123,"impl-Display-for-DescriptorId"],[124,"impl-UpperHex-for-DescriptorId"],[130,"impl-From%3C(%26u32,+%26BlockHash)%3E-for-BlockId"],[131,"impl-From%3C(u32,+BlockHash)%3E-for-BlockId"],[302,"impl-From%3CChangeSet%3CA%3E%3E-for-ChangeSet%3CA,+IA%3E"],[303,"impl-From%3CChangeSet%3CK%3E%3E-for-ChangeSet%3CA,+ChangeSet%3CK%3E%3E"],[344,"impl-Indexer-for-KeychainTxOutIndex%3CK%3E"],[345,"impl-KeychainTxOutIndex%3CK%3E"],[377,"impl-Debug-for-InsertDescriptorError%3CK%3E"],[378,"impl-Display-for-InsertDescriptorError%3CK%3E"],[380,"impl-Debug-for-NoSuchKeychain%3CK%3E"],[381,"impl-Display-for-NoSuchKeychain%3CK%3E"],[382,"impl-Display-for-Balance"],[383,"impl-Debug-for-Balance"],[525,"impl-Display-for-MissingGenesisError"],[526,"impl-Debug-for-MissingGenesisError"],[527,"impl-Debug-for-AlterCheckPointError"],[528,"impl-Display-for-AlterCheckPointError"],[529,"impl-Debug-for-CannotConnectError"],[530,"impl-Display-for-CannotConnectError"],[531,"impl-Debug-for-ApplyHeaderError"],[532,"impl-Display-for-ApplyHeaderError"],[746,"impl-Debug-for-CalculateFeeError"],[747,"impl-Display-for-CalculateFeeError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAANQBSgASAAIAFwAAABsAAAAdAAIAIwABACYAFQA9ABEAUAAGAFwAAQBfAAMAZQAEAGsAEgCAAAAAgwABAIgAAACMAAQAkgACAJYABQCeAAAAoAABAKMAAACuAAAAtwAAALwAAADAAAEAxQAGAM8ABQDYAAkA4wASAPsACAAHAQgAFwEAAB0BAAAhAQsALwEBAD8BAABCAQkAVgEAAFkBAABbARMAcAEQAIkBAgCUAQAArQEBALABBwC7AQkAyAEEANIBBADqARkABQIFAAwCCQAmAgAANAICADoCAABBAhAAUwINAGICBgBtAgcAmAIHAKECBwC3AgAAugIAAL0CDQDNAhEA4AIEAOgCBQAHAwEACgMAABEDAQAUAwcAHwMGACgDBgA4AwYAQAMGAA=="}],\ ["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"}],\ @@ -10,7 +10,7 @@ var searchIndex = new Map(JSON.parse('[\ ["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::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"}],\ +["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,254,254,254,94,255,24,0,0,0,0,0,0,31,0,0,33,0,0,35,94,255,24,0,0,0,94,255,24,35,31,0,94,255,24,94,255,24,94,255,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,256,256,256,257,258,259,258,259,258,259,258,259,258,259,260,261,262,263,264,265,265,264,266,267,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,268,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,268,30,35,103,268,30,268,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,202,0,201,198,199,200,0,0,0,200,200,200,199,199,199,0,0,198,199,200,198,199,200,202,0,0,169,170,194,170,170,170,170,170,170,170,169,170,183,194,198,199,200,201,202,169,170,183,194,198,199,200,201,202,170,170,170,170,170,214,183,170,169,183,169,183,0,170,169,169,183,194,170,170,170,169,169,194,0,0,170,169,169,170,183,194,194,198,198,199,199,200,200,201,201,202,202,169,170,183,183,183,194,198,199,200,201,202,170,170,170,170,170,183,169,194,214,170,170,170,169,170,183,194,198,199,200,201,202,211,170,194,170,183,170,170,170,170,170,170,170,170,214,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,169,170,0,170,170,170,170,169,183,169,194,198,199,200,201,202,169,170,169,169,169,170,183,194,198,199,200,201,202,169,170,183,194,198,199,200,201,202,0,170,169,170,183,194,198,199,200,201,202,170,170,169,169,170,183,194,198,199,200,201,202,0,269,269,270,270,271,272,271,272,273,273,228,228,0,229,0,0,0,0,0,228,0,229,0,228,229,227,223,224,225,228,229,227,223,224,225,223,224,225,223,224,225,226,223,224,225,0,223,224,225,227,227,228,228,229,227,223,224,225,228,229,227,223,224,225,228,229,227,223,224,225,227,225,227,227,223,224,225,228,228,229,227,223,224,225,228,229,227,223,224,225,228,229,227,223,224,225,228,229,227,223,224,225,274,274,275,276,276,275,276,0,207,230,0,207,207,190,207,190,207,207,0,207,207,207,207,207,230,207,207,207,207,207,207,190,190,207,190,230,207,207,230,207,190,230,207,190,230,230,230,230,207,207,190,190,230,207,207,207,207,207,207,190,230,207,190,230,230,207,190,230,207,190,230,207,190,230,207,190,230,207,190,277,277,278,278,279,280,0,0,281,232,232,232,232,232,232,232,232,232,232,232,232,281,232,232,232,232,232,232,232,237,233,237,197,233,237,197,0,197,197,197,234,197,197,197,197,197,197,197,237,233,234,197,197,0,0,0,0,0,0,0,0,234,0,0,197,197,70,196,196,70,196,233,197,234,235,171,70,196,237,233,197,234,235,171,70,196,237,70,233,234,235,171,70,196,237,233,234,235,171,70,196,237,233,171,171,70,196,237,235,238,235,235,235,233,234,171,237,70,233,197,197,234,235,171,70,196,237,233,233,233,197,197,197,197,234,235,171,70,196,237,233,238,235,235,235,70,233,197,234,235,171,70,196,237,235,70,233,171,70,196,196,245,235,235,235,172,235,196,70,196,233,234,235,171,70,196,237,197,196,196,233,197,234,235,171,70,196,237,233,197,234,235,171,70,196,237,233,197,234,235,171,70,196,237,233,197,234,235,171,70,196,237,282,0,0,251,250,250,0,248,248,248,250,251,0,0,249,251,189,189,189,189,189,189,189,189,189,189,249,248,251,250,189,249,248,251,250,189,189,251,250,189,251,250,251,250,189,189,251,250,189,189,189,189,189,251,250,189,189,189,189,249,249,248,248,251,250,189,249,248,251,250,251,250,189,189,249,248,251,250,189,189,189,189,189,251,250,189,189,189,251,189,251,250,249,248,189,249,248,251,250,189,249,248,251,250,189,249,248,251,250,189,189,189,249,248,251,250,283,283],"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{`{{AF`{}{{AEl{{AEn{Hb}}}}}}G`}}}}}}{{{d{jAEd}}{d{AFb}}Dh}{{Af{AbAFd}}}}{{{d{jAEd}}{d{AFb}}DhAFf}{{Af{AbAFh}}}}{{{d{jAEd}}c}Ab{{AFl{}{{AEl{{Ij{{d{AFj}}H`}}}}}}}}{{{d{jAEd}}c}{{Af{AbAFd}}}{{AG`{AFn}}}}{{{d{AEd}}}{{d{{AGd{AGb}}}}}}{{{d{AEd}}}AEb}{{{d{c}}}{{d{e}}}{}{}}00000000{{{d{jc}}}{{d{je}}}{}{}}00000000{{{d{jAEd}}AGf}{{Af{{AGj{AGh}}AGl}}}}{{{d{jAEd}}}{{AGj{AGh}}}}{{{d{AEd}}{d{AFj}}}{{Af{ADnAGn}}}}{{{d{AEd}}{d{AFj}}}{{Af{AE`AGn}}}}{{{d{jAEd}}{d{AFj}}}Ab}``{{{d{AEd}}}AH`}{{{d{AEb}}}AEb}{{{d{AFn}}}AFn}{{{d{c}}{d{je}}}Ab{}{}}0`{{{d{jAEd}}}{{AHb{Aj}}}}`{{}AEb}{{}AFn}{{{d{AHd}}}{{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{AHd}}{d{AHd}}}Aj}``{{{d{AEd}}{d{jAHf}}AHh}{{Af{AjAHj}}}}{{{d{AEb}}{d{jAl}}}{{Af{AbIl}}}}0{{{d{AEd}}{d{jAl}}}An}{{{d{AFn}}{d{jAl}}}An}{{{d{AHd}}{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{{{d{AId}}{d{jAl}}}An}0{cc{}}0{{{AIf{b}}}AFn}1{AIhAFn}222222{{{d{AEd}}b}{{d{Kl}}}}{{{d{AEd}}l{Bd{AIj}}Aj}{{Af{AIlAIn}}}}{{{d{AEd}}b}{{AEj{Hl}}}}{{{d{AEd}}AGf}{{Bd{{AJ`{{AEj{AFj}}AGb}}}}}}{{{d{AEd}}Bb}{{Bd{l}}}}````{{{d{jAEd}}AFf}{{Af{AjAJb}}}}{{{d{jAEd}}AFjAJd}{{Af{AjAIb}}}}{{{d{jAEd}}BbBj}Ab}{ce{}{}}00000000{{{d{AJf}}{d{If}}}Aj}{{{d{AEd}}{d{If}}}Aj}`{{{d{AEd}}}{{`{{AF`{}{{AEl{{Ij{{d{b}}{d{Kl}}}}}}}}}}}}`{{{d{AEd}}}AJh}{{{d{AEd}}}{{`{{AF`{}{{AEl{l}}}}}}}}0{{{d{AEd}}b}{{`{{AJj{}{{AEl{AHd}}}}}}}}{c{{Af{AEdAHn}}}{{AJn{AJl}}AK`AKb}}{{{d{AEd}}}{{d{AKd}}}}{{{d{jAEd}}bDh}Aj}{{{d{AEd}}}Cb}`{{cceCb}{{Af{AEdAHl}}}Kj{{AJn{AJl}}AK`AKb}}{{ccCb}{{Af{AEdId}}}Kj}{{ccCbAKf}{{Af{AEdId}}}Kj}{{cceCb}{{Af{AEdAI`}}}Kj{{AJn{AJl}}AK`AKb}}{{cceCbAKf}{{Af{AEdAI`}}}Kj{{AJn{AJl}}AK`AKb}}{{cceCbAKf}{{Af{AEdAHl}}}Kj{{AJn{AJl}}AK`AKb}}{{{d{AEd}}b}Dh}{{{d{jAEd}}b}{{AHb{AHd}}}}{{{d{AEd}}bDh}AHd}{{{d{AEd}}b}{{Af{{Bd{Ib}}Id}}}}{{{d{AEd}}b}{{d{Kl}}}}{{{d{jAEd}}bDh}{{AHb{{`{{AF`{}{{AEl{AHd}}}}}}}}}}4{{{d{AEd}}}{{d{{Gd{I`}}}}}}{{{d{AEd}}{d{AFj}}}{{Ij{ADnADn}}}}{{{d{AEb}}c}AfBh}{{{d{AEd}}{d{jAHf}}AHh}{{Af{AjAHj}}}}`{{{d{AEd}}}{{d{{AKh{b}}}}}}{{{d{AEd}}}{{d{AJl}}}}{{{d{AEd}}}{{AKj{b}}}}{{{d{AEd}}}AKl}{{{d{c}}}e{}{}}0{{{d{c}}}Ml{}}000000{{{d{AEb}}}ADn}{{{d{AEd}}}{{`{{AF`{}{{AEl{{AJ`{{AEj{AFj}}AGb}}}}}}}}}}`1{c{{Af{e}}}{}{}}00000000000000000`{{{d{AEd}}}{{d{{AGd{AGb}}}}}}{{{d{c}}}Bl{}}00000000{{{d{AEd}}b}{{`{{AF`{}{{AEl{{AEn{Hb}}}}}}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{AKn}}}AKn}{{{d{AL`}}}AL`}{{{d{ALb}}}ALb}{{{d{c}}{d{je}}}Ab{}{}}00{{{d{ALd}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALfALh}}}}{{{d{AKn}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALfALh}}}}{{{d{AL`}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALfALh}}}}{{{d{ALb}}{Dn{n}}{Dn{n}}AE`H`{d{If}}}{{Af{ALfALh}}}}{{H`AE`{d{If}}}ALj}{{}AKn}{{}AL`}{{}ALb}``{{{d{ALh}}{d{jAl}}}An}0{{{d{ALj}}{d{jAl}}}An}{{{d{ALf}}{d{jAl}}}An}{{{d{AKn}}{d{jAl}}}An}{{{d{AL`}}{d{jAl}}}An}{{{d{ALb}}{d{jAl}}}An}{cc{}}00000{ce{}{}}00000{{{d{ALf}}}H`}{H`ALb}`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{ALl}}}ALl}{{{d{c}}{d{je}}}Ab{}{}}{{{d{ALl}}{d{jAl}}}An}0{{{d{AIn}}{d{jAl}}}An}0{{{d{AGl}}{d{jAl}}}An}0>{NfAIn}?{ALhAIn}{ALnAIn}{IdAIn}{ALlAIn}{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{AM`}}}{{Bd{Ml}}}}{{{d{AM`}}}Ml}{c{{Af{AM`}}}Ah}{{{d{AEd}}{d{Bn}}Aj}{{Af{AM`{d{Bn}}}}}}{{{d{AM`}}{d{jAl}}}An}0<{{{d{Bn}}}{{Af{AM`c}}}{}}<``{{{d{AM`}}c}AfBh};::9=`````````````````````````````````````{{{d{jHl}}AMbAEf{AEj{AEh}}}{{Bd{{AEj{AEh}}}}}}``{{{d{Hl}}{d{{Gd{I`}}}}}Kn}`::::::::99999999{{Kn{d{{C`{Df}}}}{d{{Gd{I`}}}}}Hl}{{{d{AMb}}}AMb}{{{d{AMd}}}AMd}{{{d{{AMf{c}}}}}{{AMf{c}}}{G`AMhABjG`}}{{{d{AEf}}}AEf}{{{d{Hl}}}Hl}{{{d{AHh}}}AHh}{{{d{AMj}}}AMj}{{{d{c}}{d{je}}}Ab{}{}}000000{{{d{AMb}}{d{AMb}}}Ad}{{{d{AEf}}{d{AEf}}}Ad}{{}AEf}{{}Hl}{{}AHh}{{}AMj}{{{d{{AMf{c}}}}}{{d{e}}}{AMhABjG`}{}}{{{d{AMl}}}{{Bd{Ln}}}}{{{d{{AMf{AMn}}}}}{{Bd{Ln}}}}{{{d{{AMf{{AN`{AC`}}}}}}}{{Bd{Ln}}}}{{{d{{AMf{{ANb{AC`}}}}}}}{{Bd{Ln}}}}{{{d{AMb}}{d{AMb}}}Aj}{{{d{AMd}}{d{AMd}}}Aj}{{{d{AEf}}{d{AEf}}}Aj}{{{d{AMj}}{d{AMj}}}Aj}{{{d{Hl}}AMb}{{Bd{{d{{AEj{AEh}}}}}}}}{{{d{AMb}}{d{jAl}}}An}{{{d{AHj}}{d{jAl}}}An}0{{{d{AMd}}{d{jAl}}}An}{{{d{{AMf{c}}}}{d{jAl}}}An{ABjAMhABjG`}}{{{d{AEf}}{d{jAl}}}An}{{{d{Hl}}{d{jAl}}}An}{{{d{AHh}}{d{jAl}}}An}{{{d{AMj}}{d{jAl}}}An}{FhAMb}{ADhAMb}{cc{}}{ANdAHj}{ANfAHj}{ANhAHj}3333333{{{d{AMb}}{d{jc}}}AbB`}{{{d{AMl}}{d{{Gd{I`}}}}}AMb}{{{d{{AMf{AMn}}}}{d{{Gd{I`}}}}}AMb}{{{d{{AMf{{AN`{AC`}}}}}}{d{{Gd{I`}}}}}AMb}{{{d{{AMf{{ANb{AC`}}}}}}{d{{Gd{I`}}}}}AMb}{{{d{Hl}}}{{Dn{{d{AMb}}}}}}{ce{}{}}0000000{{cAMd}{{AMf{c}}}{AMhABjG`}}{{}Hl}{{{d{AMb}}{d{AMb}}}{{Bd{Ad}}}}{{{d{AEf}}{d{AEf}}}{{Bd{Ad}}}}{{{d{jHl}}AMbAEf}{{Bd{{AEj{AEh}}}}}}``{{{d{ANj}}{d{jAHf}}Kd{d{AHh}}{d{{Gd{I`}}}}}{{Af{AbAHj}}}}{{{d{{AMf{{AN`{AC`}}}}}}{d{jAHf}}Kd{d{AHh}}{d{{Gd{I`}}}}}{{Af{AbAHj}}}}{{{d{{AMf{{ANb{AC`}}}}}}{d{jAHf}}Kd{d{AHh}}{d{{Gd{I`}}}}}{{Af{AbAHj}}}}{{{d{{AMf{AMn}}}}{d{jAHf}}Kd{d{AHh}}{d{{Gd{I`}}}}}{{Af{AbAHj}}}}{{{d{AEh}}{d{jAHf}}{d{AHh}}{d{{Gd{I`}}}}}{{Af{AbAHj}}}}{{{d{c}}{d{jAHf}}{d{AHh}}{d{{Gd{I`}}}}}{{Af{AbAHj}}}{}}`{{{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{AGj{c}}}}{d{e}}}{{d{j{AGj{c}}}}}{}{{ANn{ANl}}}}{{{d{j{AGj{c}}}}BbAIlKd}{{Af{{d{j{AGj{c}}}}AO`}}}{}}{{{d{j{AGj{c}}}}BbAIlKdBf}{{Af{{d{j{AGj{c}}}}AO`}}}{}}{{{d{j{AGj{c}}}}}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}HbADn}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}Bb}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}Bb}{{Af{{d{j{AGj{c}}}}AOb}}}{}}{{{d{j{AGj{c}}}}{d{{h{Bb}}}}}{{Af{{d{j{AGj{c}}}}AOb}}}{}}{{{d{j{AGj{c}}}}Aj}{{d{j{AGj{c}}}}}{}}{{{d{c}}}{{d{e}}}{}{}}0000{{{d{jc}}}{{d{je}}}{}{}}0000{{{d{j{AGj{c}}}}AOd}{{d{j{AGj{c}}}}}{}}{{{d{{AGj{c}}}}}{{AGj{c}}}G`}{{{d{AOf}}}AOf}{{{d{AOd}}}AOd}{{{d{c}}{d{je}}}Ab{}{}}00{{{d{AOf}}{d{AOf}}}Ad}{{{d{AOd}}{d{AOd}}}Ad}{{{AGj{c}}e}{{AGj{e}}}{}ALd}{{{d{j{AGj{c}}}}Dh}{{d{j{AGj{c}}}}}{}}{{}AOf}{{}AOd}{{{d{j{AGj{c}}}}}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}Hb}{{d{j{AGj{c}}}}}{}}11{{{d{j{AGj{c}}}}Bf}{{d{j{AGj{c}}}}}{}}{{{d{AOf}}{d{AOf}}}Aj}{{{d{AOd}}{d{AOd}}}Aj}{{{d{j{AGj{c}}}}ADn}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}AE`}{{d{j{AGj{c}}}}}{}}{{{AGj{c}}}{{Af{AHfAIn}}}ALd}{{{d{{AGj{c}}}}{d{jAl}}}AnABj}{{{d{AOb}}{d{jAl}}}An}0{{{d{AO`}}{d{jAl}}}An}0{{{d{AOf}}{d{jAl}}}An}{{{d{AOd}}{d{jAl}}}An}{cc{}}0000{{{d{AOf}}{d{jc}}}AbB`}{{{d{AOd}}{d{jc}}}AbB`}?{ce{}{}}0000{{{d{j{AGj{c}}}}}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}AOh}{{d{j{AGj{c}}}}}{}}11{{{d{j{AGj{c}}}}AOf}{{d{j{AGj{c}}}}}{}}{{{d{AOf}}{d{AOf}}}{{Bd{Ad}}}}{{{d{AOd}}{d{AOd}}}{{Bd{Ad}}}}{{{d{j{AGj{c}}}}{M`{Ml{Dn{Kd}}}}b}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}{Dn{{Ij{HbADn}}}}}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}AIj}{{d{j{AGj{c}}}}}{}}{{{d{AOf}}{d{jAFj}}}Ab}{{{d{c}}}e{}{}}00{{{d{c}}}Ml{}}0{c{{Af{e}}}{}{}}000000000{{{d{c}}}Bl{}}0000{{{d{j{AGj{c}}}}{Dn{Bb}}}{{d{j{AGj{c}}}}}{}}{{{d{j{AGj{c}}}}AOj}{{d{j{AGj{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"],[8,"Indexed",1790],[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_chain/bdk_chain-desc-0-.js b/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js index cf0ce0c1be..e6cdf28ae9 100644 --- a/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js +++ b/docs-rs/bdk/nightly/latest/search.desc/bdk_chain/bdk_chain-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("bdk_chain", 0, "This crate is a collection of core structures for Bitcoin …\nTrait that “anchors” blockchain data to a specific …\nAn Anchor that can be constructed from a given block, …\nTrait that makes an object appendable.\nMaximum BIP32 derivation index.\nA reference to a block in the canonical chain.\nHow many confirmations are needed f or a coinbase output …\nRepresents a service that tracks the blockchain.\nRepresents the observed position of some chain data.\nAn Anchor implementation that also records the exact …\nBlock height and timestamp at which a transaction is …\nAn Anchor implementation that also records the exact …\nThe chain data is seen as confirmed, and in anchored by A.\nThe transaction is confirmed\nA trait to extend the functionality of a miniscript …\nRepresents the ID of a descriptor, defined as the sha256 …\nError type.\nA TxOut with as much data as we can retrieve about it\nAn iterator for derived script pubkeys.\nAn index storing TxOuts that have a script pubkey that …\nThe chain data is not confirmed and last seen in the …\nThe transaction is unconfirmed\nThe script pubkeys that are being tracked by the index.\nReturns the BlockId that the associated blockchain data is …\nThe anchor block.\nThe anchor block.\nAppend another object of the same type onto self.\nReturns a reference to the inner hash (sha256, sh256d …\nThe position of the transaction in outpoint in the overall …\nMaps a ChainPosition<&A> into a ChainPosition<A> by …\nThe exact confirmation height of the transaction.\nThe confirmation height of the transaction being anchored.\nGet the upper bound of the chain data’s confirmation …\nGet the upper bound of the chain data’s confirmation …\nDetermines the upper bound of the confirmation height.\nThe confirmation time of the transaction being anchored.\nGet a reference to the internal descriptor.\nReturns the descriptor id, calculated as the sha256 of the …\nReturns the minimum value (in satoshis) at which an output …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct the anchor from a given block, block height and …\nCreates this wrapper type from the inner hash type.\nGet the best chain’s chain tip.\nThe hash of the block.\nThe height of the block.\nReturns the index associated with the script pubkey.\nContains the IndexedTxGraph and associated types. Refer to …\nAdds a script pubkey to scan for. Returns false and does …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether block of BlockId exists as an ancestor …\nReturns whether ChainPosition is confirmed or not.\nReturns whether ConfirmationTime is the confirmed variant.\nWhether the utxo is/was/will be spendable with chain tip.\nReturns whether the structure is considered empty.\nWhether the txout is considered mature.\nWhether this output is on a coinbase transaction.\nWhether any of the inputs of this transaction spend a …\nReturns whether the script pubkey at index has been used …\nModule for keychain related structures.\nThe LocalChain is a local implementation of ChainOracle.\nMarks the script pubkey at index as used even though it …\nComputes the net value transfer effect of tx on the script …\nCreate a new script pubkey iterator from descriptor.\nCreate a new script pubkey iterator from descriptor and a …\nThe location of the TxOut.\nGet a reference to the set of indexed outpoints.\nIterates over all the outputs with script pubkeys in an …\nScans a transaction’s outputs for matching script …\nScan a single TxOut for a matching script pubkey and …\nComputes the total value transfer effect tx has on the …\nThe txid and chain position of the transaction (if any) …\nReturns the script that has been inserted at the index.\nHelper types for spk-based blockchain clients.\nReturns the inner hash (sha256, sh256d etc.).\nModule for structures that store and traverse transactions.\nReturns the txout and script pubkey index of the TxOut at …\nThe TxOut.\nIterate over all known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nConstruct an unconfirmed variant using the given last_seen …\nUndoes the effect of mark_used. Returns whether the index …\nIterates over all unused script pubkeys in an index range.\nConfirmation height.\nThe last-seen timestamp in unix seconds.\nConfirmation time in unix seconds.\nRepresents changes to an IndexedTxGraph.\nThe resultant “changeset” when new transaction data is …\nThe IndexedTxGraph combines a TxGraph and an Indexer …\nUtilities for indexing transaction data.\nBatch insert all transactions of the given block of height.\nBatch insert all transactions of the given block of height…\nApply changeset to itself.\nApplies the ChangeSet to the IndexedTxGraph.\nApply an update directly.\nBatch insert transactions, filtering out those that are …\nBatch insert unconfirmed transactions, filtering out those …\nBatch insert unconfirmed transactions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet a reference of the internal transaction graph.\nTxGraph changeset.\nTransaction index.\nScans a transaction for relevant outpoints, which are …\nScan and index the given outpoint and txout.\nIndexer changeset.\nDetermines the ChangeSet between self and an empty Indexer.\nDetermines the ChangeSet between self and an empty …\nInsert an anchor for a given transaction.\nInsert a unix timestamp of when a transaction is seen in …\nInsert and index a transaction into the graph.\nInsert a floating txout of given outpoint.\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether the transaction should be included in …\nConstruct a new IndexedTxGraph with a given index.\nBalance, differentiated into various categories.\nRepresents updates to the derivation index of a …\nKeychainTxOutIndex controls how script pubkeys are …\nGet unbounded spk iterators for all keychains.\nAppend another ChangeSet into self.\nApplies the derivation changeset to the KeychainTxOutIndex…\nConfirmed and immediately spendable balance\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGets the descriptor associated with the keychain. Returns …\nAll coinbase outputs not yet matured\nReturns the keychain and keychain index associated with …\nReturn a reference to the internal SpkTxOutIndex.\nInsert a descriptor with a keychain associated to it.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns whether the changeset are empty.\nReturns whether the spk under the keychain’s index has …\nIterate over all OutPoints that have TxOuts with script …\nIterate over OutPoints that have script pubkeys derived …\nReturn the map of the keychain to descriptors.\nContains the keychains that have been added and their …\nContains for each descriptor_id the last revealed index of …\nGet the last derivation index revealed for keychain. …\nGet the last derivation index that is revealed for each …\nReturns the highest derivation index of the keychain where …\nReturns the highest derivation index of each keychain that …\nGet the lookahead setting.\nStore lookahead scripts until target_index (inclusive).\nMarks the script pubkey at index as used even though the …\nComputes the net value that this transaction gives to the …\nConstruct a KeychainTxOutIndex with the given lookahead.\nGet the next derivation index for keychain. The next index …\nGets the next unused script pubkey in the keychain. I.e., …\nGet the set of indexed outpoints, corresponding to tracked …\nAttempts to reveal the next script pubkey for keychain.\nReveals script pubkeys of the keychain’s descriptor up …\nConvenience method to call Self::reveal_to_target on …\nIterate over revealed spks of the given keychain.\nIterate over revealed spks of keychains in range\nComputes the total value transfer effect tx has on the …\nReturn the script that exists under the given keychain’s …\nGet the whole balance visible to the wallet.\nUnconfirmed UTXOs generated by a wallet tx\nGet sum of trusted_pending and confirmed coins.\nReturn the TxOut of outpoint if it has been indexed, and …\nIterate over known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nGet an unbounded spk iterator over a given keychain. …\nUndoes the effect of mark_used. Returns whether the index …\nUnconfirmed UTXOs received from an external wallet\nIterate over revealed, but unused, spks of the given …\nIterate over revealed, but unused, spks of all keychains.\nRepresents a failure when trying to insert/remove a …\nThe error type for LocalChain::apply_header_connected_to.\nOccurs when the update cannot connect with the original …\nOccurs when an update does not have a common checkpoint …\nThe ChangeSet represents changes to LocalChain.\nA LocalChain checkpoint is used to find the agreement …\nIterates over checkpoints backwards.\nOccurs when connected_to block conflicts with either the …\nThis is a local implementation of ChainOracle.\nAn error which occurs when a LocalChain is constructed …\nApply the given changeset.\nUpdate the chain with a given Header connecting it with …\nUpdate the chain with a given Header at height which you …\nApplies the given update to the chain.\nGet the BlockId of the checkpoint.\nRemoves blocks from (and inclusive of) the given block_id.\nExtends the checkpoint linked list by a iterator of block …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a checkpoint from a list of BlockIds in …\nConstructs a LocalChain from a BTreeMap of height to …\nConstruct a LocalChain from an initial changeset.\nConstruct LocalChain from genesis hash.\nConstruct a checkpoint from the given header and block …\nConstruct a LocalChain from a given checkpoint tip.\nGet the genesis hash.\nGet checkpoint at height.\nGet checkpoint at given height (if it exists).\nGet the block hash of the checkpoint.\nGet the height of the checkpoint.\nThe checkpoint’s height.\nDerives an initial ChangeSet, meaning that it can be …\nInserts block_id at its height within the chain.\nInsert a BlockId.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIterate from this checkpoint in descending height.\nIterate over checkpoints in descending height order.\nConstruct a new base block at the front of a linked list.\nThe original checkpoint’s block hash which cannot be …\nGet the previous checkpoint in the chain\nPuts another checkpoint onto the linked list representing …\nIterate checkpoints over a height range.\nIterate checkpoints over a height range.\nGet the highest checkpoint.\nThe suggested checkpoint to include to connect the two …\nThe attempted update to the original_block hash.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client full scan.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client sync.\nChain on additional OutPoints that will be synced against.\nChain on additional Scripts that will be synced against.\nChain on additional Scripts that will be synced against.\nA checkpoint for the current chain LocalChain::tip. The …\nA checkpoint for the current LocalChain::tip. The full …\nChain on additional Txids that will be synced against.\nThe update to apply to the receiving LocalChain.\nThe update to apply to the receiving TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a new SyncRequest from a given cp tip.\nConstruct a new FullScanRequest from a given chain_tip.\nConstruct a new FullScanRequest from a given chain_tip and …\nThe update to apply to the receiving TxGraph.\nThe update to apply to the receiving LocalChain.\nAdd a closure that will be called for OutPoints previously …\nAdd a closure that will be called for Scripts previously …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for Txids previously …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nLast active indices for the corresponding keychains (K).\nTransactions with these outpoints or spent from these …\nPopulate the request with revealed script pubkeys from …\nSet the OutPoints that will be synced against.\nSet the Scripts that will be synced against.\nSet the Scripts for a given keychain.\nSet the Txids that will be synced against.\nTransactions that spend from or to these indexed script …\nIterators of script pubkeys indexed by the keychain index.\nTransactions with these txids.\nErrors returned by TxGraph::calculate_fee.\nA transaction that is included in the chain, or is still …\nThe ChangeSet represents changes to a TxGraph.\nMissing TxOut for one or more of the inputs of the tx\nWhen the transaction is invalid according to the graph it …\nAn iterator that traverses ancestors of a given root …\nAn iterator that traverses transaction descendants.\nA graph of transactions and spends.\nA transaction node in the TxGraph.\nGet all transaction anchors known by TxGraph.\nIterate over all tx outputs known by TxGraph.\nIterates over the heights of that the new transaction …\nThe blocks that the transaction is “anchored” in.\nAdded anchors.\nApplies ChangeSet to TxGraph.\nExtends this graph with another so that self becomes the …\nGet the total balance of outpoints that are in chain of …\nBatch insert unconfirmed transactions.\nCalculates the fee of a given transaction. Returns …\nHow the transaction is observed as (confirmed or …\nGiven a transaction, return an iterator of txids that …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nIterate over floating txouts known by TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIterate over all full transactions in the graph.\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nGet a transaction by txid. This only returns Some for full …\nGet a transaction node by txid. This only returns Some for …\nObtains a single tx output (if any) at the specified …\nDetermines the ChangeSet between self and an empty TxGraph.\nInserts the given anchor into TxGraph.\nInserts the given seen_at for txid into TxGraph.\nInserts the given transaction into TxGraph.\nInserts the given TxOut at OutPoint.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the graph has any transactions or outputs in it.\nAdded last-seen unix timestamps of transactions.\nThe last-seen unix timestamp of the transaction as …\nList graph transactions that are in chain with chain_tip.\nTransform the TxGraph to have Anchors of another type.\nTransform the ChangeSet to have Anchors of another type.\nConstruct a new TxGraph from a list of transactions.\nThe transactions spending from this output.\nGet the total balance of outpoints that are in chain of …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nList graph transactions that are in chain with chain_tip.\nA partial or full representation of the transaction.\nThe transaction node (as part of the graph).\nReturns known outputs of a given txid.\nIterates over the transactions spending from txid.\nTxid of the transaction.\nIterates over all outpoints contained within ChangeSet.\nAdded txouts.\nAdded transactions.\nUpdate the last seen time for all unconfirmed transactions.\nCreates an iterator that filters and maps ancestor …\nCreates an iterator that both filters and maps conflicting …\nCreates an iterator that filters and maps descendants from …") \ No newline at end of file +searchState.loadedDescShard("bdk_chain", 0, "This crate is a collection of core structures for Bitcoin …\nTrait that “anchors” blockchain data to a specific …\nAn Anchor that can be constructed from a given block, …\nTrait that makes an object appendable.\nMaximum BIP32 derivation index.\nA reference to a block in the canonical chain.\nHow many confirmations are needed f or a coinbase output …\nRepresents a service that tracks the blockchain.\nRepresents the observed position of some chain data.\nAn Anchor implementation that also records the exact …\nBlock height and timestamp at which a transaction is …\nAn Anchor implementation that also records the exact …\nThe chain data is seen as confirmed, and in anchored by A.\nThe transaction is confirmed\nA trait to extend the functionality of a miniscript …\nRepresents the ID of a descriptor, defined as the sha256 …\nError type.\nA TxOut with as much data as we can retrieve about it\nAn iterator for derived script pubkeys.\nAn index storing TxOuts that have a script pubkey that …\nThe chain data is not confirmed and last seen in the …\nThe transaction is unconfirmed\nThe script pubkeys that are being tracked by the index.\nReturns the BlockId that the associated blockchain data is …\nThe anchor block.\nThe anchor block.\nAppend another object of the same type onto self.\nReturns a reference to the inner hash (sha256, sh256d …\nThe position of the transaction in outpoint in the overall …\nMaps a ChainPosition<&A> into a ChainPosition<A> by …\nThe exact confirmation height of the transaction.\nThe confirmation height of the transaction being anchored.\nGet the upper bound of the chain data’s confirmation …\nGet the upper bound of the chain data’s confirmation …\nDetermines the upper bound of the confirmation height.\nThe confirmation time of the transaction being anchored.\nGet a reference to the internal descriptor.\nReturns the descriptor id, calculated as the sha256 of the …\nReturns the minimum value (in satoshis) at which an output …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct the anchor from a given block, block height and …\nCreates this wrapper type from the inner hash type.\nGet the best chain’s chain tip.\nThe hash of the block.\nThe height of the block.\nReturns the index associated with the script pubkey.\nContains the IndexedTxGraph and associated types. Refer to …\nAdds a script pubkey to scan for. Returns false and does …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether block of BlockId exists as an ancestor …\nReturns whether ChainPosition is confirmed or not.\nReturns whether ConfirmationTime is the confirmed variant.\nWhether the utxo is/was/will be spendable with chain tip.\nReturns whether the structure is considered empty.\nWhether the txout is considered mature.\nWhether this output is on a coinbase transaction.\nWhether any of the inputs of this transaction spend a …\nReturns whether the script pubkey at index has been used …\nModule for keychain related structures.\nThe LocalChain is a local implementation of ChainOracle.\nMarks the script pubkey at index as used even though it …\nComputes the net value transfer effect of tx on the script …\nCreate a new script pubkey iterator from descriptor.\nCreate a new script pubkey iterator from descriptor and a …\nThe location of the TxOut.\nGet a reference to the set of indexed outpoints.\nIterates over all the outputs with script pubkeys in an …\nScans a transaction’s outputs for matching script …\nScan a single TxOut for a matching script pubkey and …\nComputes the total value transfer effect tx has on the …\nThe txid and chain position of the transaction (if any) …\nReturns the script that has been inserted at the index.\nHelper types for spk-based blockchain clients.\nReturns the inner hash (sha256, sh256d etc.).\nModule for structures that store and traverse transactions.\nReturns the txout and script pubkey index of the TxOut at …\nThe TxOut.\nIterate over all known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nConstruct an unconfirmed variant using the given last_seen …\nUndoes the effect of mark_used. Returns whether the index …\nIterates over all unused script pubkeys in an index range.\nConfirmation height.\nThe last-seen timestamp in unix seconds.\nConfirmation time in unix seconds.\nRepresents changes to an IndexedTxGraph.\nThe resultant “changeset” when new transaction data is …\nThe IndexedTxGraph combines a TxGraph and an Indexer …\nUtilities for indexing transaction data.\nBatch insert all transactions of the given block of height.\nBatch insert all transactions of the given block of height…\nApply changeset to itself.\nApplies the ChangeSet to the IndexedTxGraph.\nApply an update directly.\nBatch insert transactions, filtering out those that are …\nBatch insert unconfirmed transactions, filtering out those …\nBatch insert unconfirmed transactions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet a reference of the internal transaction graph.\nTxGraph changeset.\nTransaction index.\nScans a transaction for relevant outpoints, which are …\nScan and index the given outpoint and txout.\nIndexer changeset.\nDetermines the ChangeSet between self and an empty Indexer.\nDetermines the ChangeSet between self and an empty …\nInsert an anchor for a given transaction.\nInsert a unix timestamp of when a transaction is seen in …\nInsert and index a transaction into the graph.\nInsert a floating txout of given outpoint.\nCalls U::from(self).\nCalls U::from(self).\nDetermines whether the transaction should be included in …\nConstruct a new IndexedTxGraph with a given index.\nBalance, differentiated into various categories.\nRepresents updates to the derivation index of a …\nThe default lookahead for a KeychainTxOutIndex\nThe descriptor has already been assigned to a keychain so …\nA tuple of keychain index and T representing the indexed …\nError returned from KeychainTxOutIndex::insert_descriptor\nThe keychain is already assigned to a descriptor so you can…\nA tuple of keychain K, derivation index (u32) and a T …\nKeychainTxOutIndex controls how script pubkeys are …\nThe keychain doesn’t exist. Most likley hasn’t been …\nGet unbounded spk iterators for all keychains.\nMerge another ChangeSet<K> into self.\nApplies the ChangeSet<K> to the KeychainTxOutIndex<K>\nConfirmed and immediately spendable balance\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGets the descriptor associated with the keychain. Returns …\nAll coinbase outputs not yet matured\nReturns the keychain and keychain index associated with …\nReturn a reference to the internal SpkTxOutIndex.\nInsert a descriptor with a keychain associated to it.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns whether the changeset are empty.\nReturns whether the spk under the keychain’s index has …\nIterate over all OutPoints that have TxOuts with script …\nIterate over OutPoints that have script pubkeys derived …\nReturn all keychains and their corresponding descriptors.\nContains the keychains that have been added and their …\nContains for each descriptor_id the last revealed index of …\nGet the last derivation index revealed for keychain. …\nGet the last derivation index that is revealed for each …\nReturns the highest derivation index of the keychain where …\nReturns the highest derivation index of each keychain that …\nGet the lookahead setting.\nStore lookahead scripts until target_index (inclusive).\nMarks the script pubkey at index as used even though the …\nComputes the net value that this transaction gives to the …\nConstruct a KeychainTxOutIndex with the given lookahead.\nGet the next derivation index for keychain. The next index …\nGets the next unused script pubkey in the keychain. I.e., …\nGet the set of indexed outpoints, corresponding to tracked …\nAttempts to reveal the next script pubkey for keychain.\nReveals script pubkeys of the keychain’s descriptor up …\nConvenience method to call Self::reveal_to_target on …\nIterate over revealed spks of the given keychain with …\nIterate over revealed spks of keychains in range\nComputes the total value transfer effect tx has on the …\nReturn the script that exists under the given keychain’s …\nGet the whole balance visible to the wallet.\nUnconfirmed UTXOs generated by a wallet tx\nGet sum of trusted_pending and confirmed coins.\nReturn the TxOut of outpoint if it has been indexed, and …\nIterate over known txouts that spend to tracked script …\nFinds all txouts on a transaction that has previously been …\nGet an unbounded spk iterator over a given keychain. …\nUndoes the effect of mark_used. Returns whether the index …\nUnconfirmed UTXOs received from an external wallet\nIterate over revealed, but unused, spks of the given …\nIterate over revealed, but unused, spks of all keychains.\nThe descriptor you have attempted to reassign\nThe keychain that the descriptor is already assigned to\nThe descriptor that the keychain is already assigned to\nThe keychain that you have attempted to reassign\nRepresents a failure when trying to insert/remove a …\nThe error type for LocalChain::apply_header_connected_to.\nOccurs when the update cannot connect with the original …\nOccurs when an update does not have a common checkpoint …\nThe ChangeSet represents changes to LocalChain.\nA LocalChain checkpoint is used to find the agreement …\nIterates over checkpoints backwards.\nOccurs when connected_to block conflicts with either the …\nThis is a local implementation of ChainOracle.\nAn error which occurs when a LocalChain is constructed …\nApply the given changeset.\nUpdate the chain with a given Header connecting it with …\nUpdate the chain with a given Header at height which you …\nApplies the given update to the chain.\nGet the BlockId of the checkpoint.\nRemoves blocks from (and inclusive of) the given block_id.\nExtends the checkpoint linked list by a iterator of block …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a checkpoint from a list of BlockIds in …\nConstructs a LocalChain from a BTreeMap of height to …\nConstruct a LocalChain from an initial changeset.\nConstruct LocalChain from genesis hash.\nConstruct a checkpoint from the given header and block …\nConstruct a LocalChain from a given checkpoint tip.\nGet the genesis hash.\nGet checkpoint at height.\nGet checkpoint at given height (if it exists).\nGet the block hash of the checkpoint.\nGet the height of the checkpoint.\nThe checkpoint’s height.\nDerives an initial ChangeSet, meaning that it can be …\nInserts block_id at its height within the chain.\nInsert a BlockId.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIterate from this checkpoint in descending height.\nIterate over checkpoints in descending height order.\nConstruct a new base block at the front of a linked list.\nThe original checkpoint’s block hash which cannot be …\nGet the previous checkpoint in the chain\nPuts another checkpoint onto the linked list representing …\nIterate checkpoints over a height range.\nIterate checkpoints over a height range.\nGet the highest checkpoint.\nThe suggested checkpoint to include to connect the two …\nThe attempted update to the original_block hash.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client full scan.\nData required to perform a spk-based blockchain client …\nData returned from a spk-based blockchain client sync.\nChain on additional OutPoints that will be synced against.\nChain on additional Scripts that will be synced against.\nChain on additional Scripts that will be synced against.\nA checkpoint for the current chain LocalChain::tip. The …\nA checkpoint for the current LocalChain::tip. The full …\nChain on additional Txids that will be synced against.\nThe update to apply to the receiving LocalChain.\nThe update to apply to the receiving TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a new SyncRequest from a given cp tip.\nConstruct a new FullScanRequest from a given chain_tip.\nConstruct a new FullScanRequest from a given chain_tip and …\nThe update to apply to the receiving TxGraph.\nThe update to apply to the receiving LocalChain.\nAdd a closure that will be called for OutPoints previously …\nAdd a closure that will be called for Scripts previously …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for every Script …\nAdd a closure that will be called for Txids previously …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nLast active indices for the corresponding keychains (K).\nTransactions with these outpoints or spent from these …\nPopulate the request with revealed script pubkeys from …\nSet the OutPoints that will be synced against.\nSet the Scripts that will be synced against.\nSet the Scripts for a given keychain.\nSet the Txids that will be synced against.\nTransactions that spend from or to these indexed script …\nIterators of script pubkeys indexed by the keychain index.\nTransactions with these txids.\nErrors returned by TxGraph::calculate_fee.\nA transaction that is included in the chain, or is still …\nThe ChangeSet represents changes to a TxGraph.\nMissing TxOut for one or more of the inputs of the tx\nWhen the transaction is invalid according to the graph it …\nAn iterator that traverses ancestors of a given root …\nAn iterator that traverses transaction descendants.\nA graph of transactions and spends.\nA transaction node in the TxGraph.\nGet all transaction anchors known by TxGraph.\nIterate over all tx outputs known by TxGraph.\nIterates over the heights of that the new transaction …\nThe blocks that the transaction is “anchored” in.\nAdded anchors.\nApplies ChangeSet to TxGraph.\nExtends this graph with another so that self becomes the …\nGet the total balance of outpoints that are in chain of …\nBatch insert unconfirmed transactions.\nCalculates the fee of a given transaction. Returns …\nHow the transaction is observed as (confirmed or …\nGiven a transaction, return an iterator of txids that …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nIterate over floating txouts known by TxGraph.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIterate over all full transactions in the graph.\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nGet a transaction by txid. This only returns Some for full …\nGet a transaction node by txid. This only returns Some for …\nObtains a single tx output (if any) at the specified …\nDetermines the ChangeSet between self and an empty TxGraph.\nInserts the given anchor into TxGraph.\nInserts the given seen_at for txid into TxGraph.\nInserts the given transaction into TxGraph.\nInserts the given TxOut at OutPoint.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the graph has any transactions or outputs in it.\nAdded last-seen unix timestamps of transactions.\nThe last-seen unix timestamp of the transaction as …\nList graph transactions that are in chain with chain_tip.\nTransform the TxGraph to have Anchors of another type.\nTransform the ChangeSet to have Anchors of another type.\nConstruct a new TxGraph from a list of transactions.\nThe transactions spending from this output.\nGet the total balance of outpoints that are in chain of …\nGet a filtered list of outputs from the given outpoints …\nGet a filtered list of unspent outputs (UTXOs) from the …\nGet the position of the transaction in chain with tip …\nGet the txid of the spending transaction and where the …\nList graph transactions that are in chain with chain_tip.\nA partial or full representation of the transaction.\nThe transaction node (as part of the graph).\nReturns known outputs of a given txid.\nIterates over the transactions spending from txid.\nTxid of the transaction.\nIterates over all outpoints contained within ChangeSet.\nAdded txouts.\nAdded transactions.\nUpdate the last seen time for all unconfirmed transactions.\nCreates an iterator that filters and maps ancestor …\nCreates an iterator that both filters and maps conflicting …\nCreates an iterator that filters and maps descendants from …") \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain.rs.html index 7bc85dbfb0..06f5d9d5e4 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain.rs.html @@ -71,6 +71,11 @@ 71 72 73 +74 +75 +76 +77 +78

      //! Module for keychain related structures.
       //!
       //! A keychain here is a set of application-defined indexes for a miniscript descriptor where we can
      @@ -85,7 +90,7 @@
       
       #[cfg(feature = "miniscript")]
       mod txout_index;
      -use bitcoin::Amount;
      +use bitcoin::{Amount, ScriptBuf};
       #[cfg(feature = "miniscript")]
       pub use txout_index::*;
       
      @@ -122,6 +127,11 @@
           }
       }
       
      +/// A tuple of keychain index and `T` representing the indexed value.
      +pub type Indexed<T> = (u32, T);
      +/// A tuple of keychain `K`, derivation index (`u32`) and a `T` associated with them.
      +pub type KeychainIndexed<K, T> = ((K, u32), T);
      +
       impl core::fmt::Display for Balance {
           fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
               write!(
      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 57bbfb1acc..5b2880638f 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
      @@ -937,38 +937,6 @@
       937
       938
       939
      -940
      -941
      -942
      -943
      -944
      -945
      -946
      -947
      -948
      -949
      -950
      -951
      -952
      -953
      -954
      -955
      -956
      -957
      -958
      -959
      -960
      -961
      -962
      -963
      -964
      -965
      -966
      -967
      -968
      -969
      -970
      -971
       
      use crate::{
           collections::*,
           indexed_tx_graph::Indexer,
      @@ -976,88 +944,18 @@
           spk_iter::BIP32_MAX_INDEX,
           DescriptorExt, DescriptorId, SpkIterator, SpkTxOutIndex,
       };
      -use bitcoin::{hashes::Hash, Amount, OutPoint, Script, SignedAmount, Transaction, TxOut, Txid};
      +use alloc::{borrow::ToOwned, vec::Vec};
      +use bitcoin::{Amount, OutPoint, Script, SignedAmount, Transaction, TxOut, Txid};
       use core::{
           fmt::Debug,
           ops::{Bound, RangeBounds},
       };
       
      +use super::*;
       use crate::Append;
       
      -/// Represents updates to the derivation index of a [`KeychainTxOutIndex`].
      -/// It maps each keychain `K` to a descriptor and its last revealed index.
      -///
      -/// It can be applied to [`KeychainTxOutIndex`] with [`apply_changeset`]. [`ChangeSet] are
      -/// monotone in that they will never decrease the revealed derivation index.
      -///
      -/// [`KeychainTxOutIndex`]: crate::keychain::KeychainTxOutIndex
      -/// [`apply_changeset`]: crate::keychain::KeychainTxOutIndex::apply_changeset
      -#[derive(Clone, Debug, PartialEq)]
      -#[cfg_attr(
      -    feature = "serde",
      -    derive(serde::Deserialize, serde::Serialize),
      -    serde(
      -        crate = "serde_crate",
      -        bound(
      -            deserialize = "K: Ord + serde::Deserialize<'de>",
      -            serialize = "K: Ord + serde::Serialize"
      -        )
      -    )
      -)]
      -#[must_use]
      -pub struct ChangeSet<K> {
      -    /// Contains the keychains that have been added and their respective descriptor
      -    pub keychains_added: BTreeMap<K, Descriptor<DescriptorPublicKey>>,
      -    /// Contains for each descriptor_id the last revealed index of derivation
      -    pub last_revealed: BTreeMap<DescriptorId, u32>,
      -}
      -
      -impl<K: Ord> Append for ChangeSet<K> {
      -    /// Append another [`ChangeSet`] into self.
      -    ///
      -    /// For each keychain in `keychains_added` in the given [`ChangeSet`]:
      -    /// If the keychain already exist with a different descriptor, we overwrite the old descriptor.
      -    ///
      -    /// For each `last_revealed` in the given [`ChangeSet`]:
      -    /// If the keychain already exists, increase the index when the other's index > self's index.
      -    fn append(&mut self, other: Self) {
      -        // We use `extend` instead of `BTreeMap::append` due to performance issues with `append`.
      -        // Refer to https://github.com/rust-lang/rust/issues/34666#issuecomment-675658420
      -        self.keychains_added.extend(other.keychains_added);
      -
      -        // for `last_revealed`, entries of `other` will take precedence ONLY if it is greater than
      -        // what was originally in `self`.
      -        for (desc_id, index) in other.last_revealed {
      -            use crate::collections::btree_map::Entry;
      -            match self.last_revealed.entry(desc_id) {
      -                Entry::Vacant(entry) => {
      -                    entry.insert(index);
      -                }
      -                Entry::Occupied(mut entry) => {
      -                    if *entry.get() < index {
      -                        entry.insert(index);
      -                    }
      -                }
      -            }
      -        }
      -    }
      -
      -    /// Returns whether the changeset are empty.
      -    fn is_empty(&self) -> bool {
      -        self.last_revealed.is_empty() && self.keychains_added.is_empty()
      -    }
      -}
      -
      -impl<K> Default for ChangeSet<K> {
      -    fn default() -> Self {
      -        Self {
      -            last_revealed: BTreeMap::default(),
      -            keychains_added: BTreeMap::default(),
      -        }
      -    }
      -}
      -
      -const DEFAULT_LOOKAHEAD: u32 = 25;
      +/// The default lookahead for a [`KeychainTxOutIndex`]
      +pub const DEFAULT_LOOKAHEAD: u32 = 25;
       
       /// [`KeychainTxOutIndex`] controls how script pubkeys are revealed for multiple keychains, and
       /// indexes [`TxOut`]s with them.
      @@ -1066,6 +964,14 @@
       /// are identified using the `K` generic. Script pubkeys are identified by the keychain that they
       /// are derived from `K`, as well as the derivation index `u32`.
       ///
      +/// There is a strict 1-to-1 relationship between descriptors and keychains. Each keychain has one
      +/// and only one descriptor and each descriptor has one and only one keychain. The
      +/// [`insert_descriptor`] method will return an error if you try and violate this invariant. This
      +/// rule is a proxy for a stronger rule: no two descriptors should produce the same script pubkey.
      +/// Having two descriptors produce the same script pubkey should cause whichever keychain derives
      +/// the script pubkey first to be the effective owner of it but you should not rely on this
      +/// behaviour. ⚠ It is up you, the developer, not to violate this invariant.
      +///
       /// # Revealed script pubkeys
       ///
       /// Tracking how script pubkeys are revealed is useful for collecting chain data. For example, if
      @@ -1083,23 +989,25 @@
       /// above the last revealed index. These additionally-derived script pubkeys are called the
       /// lookahead.
       ///
      -/// The [`KeychainTxOutIndex`] is constructed with the `lookahead` and cannot be altered. The
      -/// default `lookahead` count is 1000. Use [`new`] to set a custom `lookahead`.
      +/// The [`KeychainTxOutIndex`] is constructed with the `lookahead` and cannot be altered. See
      +/// [`DEFAULT_LOOKAHEAD`] for the value used in the `Default` implementation. Use [`new`] to set a
      +/// custom `lookahead`.
       ///
       /// # Unbounded script pubkey iterator
       ///
       /// For script-pubkey-based chain sources (such as Electrum/Esplora), an initial scan is best done
       /// by iterating though derived script pubkeys one by one and requesting transaction histories for
       /// each script pubkey. We will stop after x-number of script pubkeys have empty histories. An
      -/// unbounded script pubkey iterator is useful to pass to such a chain source.
      +/// unbounded script pubkey iterator is useful to pass to such a chain source because it doesn't
      +/// require holding a reference to the index.
       ///
       /// Call [`unbounded_spk_iter`] to get an unbounded script pubkey iterator for a given keychain.
       /// Call [`all_unbounded_spk_iters`] to get unbounded script pubkey iterators for all keychains.
       ///
       /// # Change sets
       ///
      -/// Methods that can update the last revealed index or add keychains will return [`super::ChangeSet`] to report
      -/// these changes. This can be persisted for future recovery.
      +/// Methods that can update the last revealed index or add keychains will return [`ChangeSet`] to report
      +/// these changes. This should be persisted for future recovery.
       ///
       /// ## Synopsis
       ///
      @@ -1124,77 +1032,38 @@
       /// # let (external_descriptor,_) = Descriptor::<DescriptorPublicKey>::parse_descriptor(&secp, "tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/0/*)").unwrap();
       /// # let (internal_descriptor,_) = Descriptor::<DescriptorPublicKey>::parse_descriptor(&secp, "tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/1/*)").unwrap();
       /// # let (descriptor_42, _) = Descriptor::<DescriptorPublicKey>::parse_descriptor(&secp, "tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/2/*)").unwrap();
      -/// let _ = txout_index.insert_descriptor(MyKeychain::External, external_descriptor);
      -/// let _ = txout_index.insert_descriptor(MyKeychain::Internal, internal_descriptor);
      -/// let _ = txout_index.insert_descriptor(MyKeychain::MyAppUser { user_id: 42 }, descriptor_42);
      +/// let _ = txout_index.insert_descriptor(MyKeychain::External, external_descriptor)?;
      +/// let _ = txout_index.insert_descriptor(MyKeychain::Internal, internal_descriptor)?;
      +/// let _ = txout_index.insert_descriptor(MyKeychain::MyAppUser { user_id: 42 }, descriptor_42)?;
       ///
       /// let new_spk_for_user = txout_index.reveal_next_spk(&MyKeychain::MyAppUser{ user_id: 42 });
      +/// # Ok::<_, bdk_chain::keychain::InsertDescriptorError<_>>(())
       /// ```
       ///
      -/// # Non-recommend keychain to descriptor assignments
      -///
      -/// A keychain (`K`) is used to identify a descriptor. However, the following keychain to descriptor
      -/// arrangements result in behavior that is harder to reason about and is not recommended.
      -///
      -/// ## Multiple keychains identifying the same descriptor
      -///
      -/// Although a single keychain variant can only identify a single descriptor, multiple keychain
      -/// variants can identify the same descriptor.
      -///
      -/// If multiple keychains identify the same descriptor:
      -/// 1. Methods that take in a keychain (such as [`reveal_next_spk`]) will work normally when any
      -/// keychain (that identifies that descriptor) is passed in.
      -/// 2. Methods that return data which associates with a descriptor (such as [`outpoints`],
      -/// [`txouts`], [`unused_spks`], etc.) the method will return the highest-ranked keychain variant
      -/// that identifies the descriptor. Rank is determined by the [`Ord`] implementation of the keychain
      -/// type.
      -///
      -/// This arrangement is not recommended since some methods will return a single keychain variant
      -/// even though multiple keychain variants identify the same descriptor.
      -///
      -/// ## Reassigning the descriptor of a single keychain
      -///
      -/// Descriptors added to [`KeychainTxOutIndex`] are never removed. However, a keychain that
      -/// identifies a descriptor can be reassigned to identify a different descriptor. This may result in
      -/// a situation where a descriptor has no associated keychain(s), and relevant [`TxOut`]s,
      -/// [`OutPoint`]s and [`Script`]s (of that descriptor) will not be return by [`KeychainTxOutIndex`].
      -/// Therefore, reassigning the descriptor of a single keychain is not recommended.
      -///
       /// [`Ord`]: core::cmp::Ord
       /// [`SpkTxOutIndex`]: crate::spk_txout_index::SpkTxOutIndex
       /// [`Descriptor`]: crate::miniscript::Descriptor
      -/// [`reveal_to_target`]: KeychainTxOutIndex::reveal_to_target
      -/// [`reveal_next_spk`]: KeychainTxOutIndex::reveal_next_spk
      -/// [`revealed_keychain_spks`]: KeychainTxOutIndex::revealed_keychain_spks
      -/// [`revealed_spks`]: KeychainTxOutIndex::revealed_spks
      -/// [`index_tx`]: KeychainTxOutIndex::index_tx
      -/// [`index_txout`]: KeychainTxOutIndex::index_txout
      -/// [`new`]: KeychainTxOutIndex::new
      -/// [`unbounded_spk_iter`]: KeychainTxOutIndex::unbounded_spk_iter
      -/// [`all_unbounded_spk_iters`]: KeychainTxOutIndex::all_unbounded_spk_iters
      -/// [`outpoints`]: KeychainTxOutIndex::outpoints
      -/// [`txouts`]: KeychainTxOutIndex::txouts
      -/// [`unused_spks`]: KeychainTxOutIndex::unused_spks
      +/// [`reveal_to_target`]: Self::reveal_to_target
      +/// [`reveal_next_spk`]: Self::reveal_next_spk
      +/// [`revealed_keychain_spks`]: Self::revealed_keychain_spks
      +/// [`revealed_spks`]: Self::revealed_spks
      +/// [`index_tx`]: Self::index_tx
      +/// [`index_txout`]: Self::index_txout
      +/// [`new`]: Self::new
      +/// [`unbounded_spk_iter`]: Self::unbounded_spk_iter
      +/// [`all_unbounded_spk_iters`]: Self::all_unbounded_spk_iters
      +/// [`outpoints`]: Self::outpoints
      +/// [`txouts`]: Self::txouts
      +/// [`unused_spks`]: Self::unused_spks
      +/// [`insert_descriptor`]: Self::insert_descriptor
       #[derive(Clone, Debug)]
       pub struct KeychainTxOutIndex<K> {
      -    inner: SpkTxOutIndex<(DescriptorId, u32)>,
      -    // keychain -> (descriptor, descriptor id) map
      -    keychains_to_descriptors: BTreeMap<K, (DescriptorId, Descriptor<DescriptorPublicKey>)>,
      -    // descriptor id -> keychain set
      -    // Because different keychains can have the same descriptor, we rank keychains by `Ord` so that
      -    // that the first keychain variant (according to `Ord`) has the highest rank. When associated
      -    // data (such as spks, outpoints) are returned with a keychain, we return the highest-ranked
      -    // keychain with it.
      -    descriptor_ids_to_keychain_set: HashMap<DescriptorId, BTreeSet<K>>,
      -    // descriptor_id -> descriptor map
      -    // This is a "monotone" map, meaning that its size keeps growing, i.e., we never delete
      -    // descriptors from it. This is useful for revealing spks for descriptors that don't have
      -    // keychains associated.
      -    descriptor_ids_to_descriptors: BTreeMap<DescriptorId, Descriptor<DescriptorPublicKey>>,
      -    // last revealed indexes
      -    last_revealed: BTreeMap<DescriptorId, u32>,
      -    // lookahead settings for each keychain
      -    lookahead: u32,
      +    inner: SpkTxOutIndex<(K, u32)>,
      +    keychain_to_descriptor_id: BTreeMap<K, DescriptorId>,
      +    descriptor_id_to_keychain: HashMap<DescriptorId, K>,
      +    descriptors: HashMap<DescriptorId, Descriptor<DescriptorPublicKey>>,
      +    last_revealed: HashMap<DescriptorId, u32>,
      +    lookahead: u32,
       }
       
       impl<K> Default for KeychainTxOutIndex<K> {
      @@ -1204,36 +1073,40 @@
       }
       
       impl<K: Clone + Ord + Debug> Indexer for KeychainTxOutIndex<K> {
      -    type ChangeSet = super::ChangeSet<K>;
      +    type ChangeSet = ChangeSet<K>;
       
           fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet {
      -        match self.inner.scan_txout(outpoint, txout).cloned() {
      -            Some((descriptor_id, index)) => {
      -                // We want to reveal spks for descriptors that aren't tracked by any keychain, and
      -                // so we call reveal with descriptor_id
      -                let (_, changeset) = self.reveal_to_target_with_id(descriptor_id, index)
      -                    .expect("descriptors are added in a monotone manner, there cannot be a descriptor id with no corresponding descriptor");
      -                changeset
      +        let mut changeset = ChangeSet::default();
      +        if let Some((keychain, index)) = self.inner.scan_txout(outpoint, txout).cloned() {
      +            let did = self
      +                .keychain_to_descriptor_id
      +                .get(&keychain)
      +                .expect("invariant");
      +            if self.last_revealed.get(did) < Some(&index) {
      +                self.last_revealed.insert(*did, index);
      +                changeset.last_revealed.insert(*did, index);
      +                self.replenish_inner_index(*did, &keychain, self.lookahead);
                   }
      -            None => super::ChangeSet::default(),
               }
      +        changeset
           }
       
           fn index_tx(&mut self, tx: &bitcoin::Transaction) -> Self::ChangeSet {
      -        let mut changeset = super::ChangeSet::<K>::default();
      +        let mut changeset = ChangeSet::<K>::default();
      +        let txid = tx.compute_txid();
               for (op, txout) in tx.output.iter().enumerate() {
      -            changeset.append(self.index_txout(OutPoint::new(tx.compute_txid(), op as u32), txout));
      +            changeset.append(self.index_txout(OutPoint::new(txid, op as u32), txout));
               }
               changeset
           }
       
           fn initial_changeset(&self) -> Self::ChangeSet {
      -        super::ChangeSet {
      +        ChangeSet {
                   keychains_added: self
                       .keychains()
                       .map(|(k, v)| (k.clone(), v.clone()))
                       .collect(),
      -            last_revealed: self.last_revealed.clone(),
      +            last_revealed: self.last_revealed.clone().into_iter().collect(),
               }
           }
       
      @@ -1260,10 +1133,10 @@
           pub fn new(lookahead: u32) -> Self {
               Self {
                   inner: SpkTxOutIndex::default(),
      -            keychains_to_descriptors: BTreeMap::new(),
      -            descriptor_ids_to_keychain_set: HashMap::new(),
      -            descriptor_ids_to_descriptors: BTreeMap::new(),
      -            last_revealed: BTreeMap::new(),
      +            keychain_to_descriptor_id: Default::default(),
      +            descriptors: Default::default(),
      +            descriptor_id_to_keychain: Default::default(),
      +            last_revealed: Default::default(),
                   lookahead,
               }
           }
      @@ -1271,50 +1144,37 @@
       
       /// Methods that are *re-exposed* from the internal [`SpkTxOutIndex`].
       impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
      -    /// Get the highest-ranked keychain that is currently associated with the given `desc_id`.
      -    fn keychain_of_desc_id(&self, desc_id: &DescriptorId) -> Option<&K> {
      -        let keychains = self.descriptor_ids_to_keychain_set.get(desc_id)?;
      -        keychains.iter().next()
      -    }
      -
           /// Return a reference to the internal [`SpkTxOutIndex`].
           ///
           /// **WARNING:** The internal index will contain lookahead spks. Refer to
           /// [struct-level docs](KeychainTxOutIndex) for more about `lookahead`.
      -    pub fn inner(&self) -> &SpkTxOutIndex<(DescriptorId, u32)> {
      +    pub fn inner(&self) -> &SpkTxOutIndex<(K, u32)> {
               &self.inner
           }
       
           /// Get the set of indexed outpoints, corresponding to tracked keychains.
      -    pub fn outpoints(&self) -> impl DoubleEndedIterator<Item = ((K, u32), OutPoint)> + '_ {
      -        self.inner
      -            .outpoints()
      -            .iter()
      -            .filter_map(|((desc_id, index), op)| {
      -                let keychain = self.keychain_of_desc_id(desc_id)?;
      -                Some(((keychain.clone(), *index), *op))
      -            })
      +    pub fn outpoints(&self) -> &BTreeSet<KeychainIndexed<K, OutPoint>> {
      +        self.inner.outpoints()
           }
       
           /// Iterate over known txouts that spend to tracked script pubkeys.
      -    pub fn txouts(&self) -> impl DoubleEndedIterator<Item = (K, u32, OutPoint, &TxOut)> + '_ {
      -        self.inner.txouts().filter_map(|((desc_id, i), op, txo)| {
      -            let keychain = self.keychain_of_desc_id(desc_id)?;
      -            Some((keychain.clone(), *i, op, txo))
      -        })
      +    pub fn txouts(
      +        &self,
      +    ) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, (OutPoint, &TxOut)>> + ExactSizeIterator
      +    {
      +        self.inner
      +            .txouts()
      +            .map(|(index, op, txout)| (index.clone(), (op, txout)))
           }
       
           /// Finds all txouts on a transaction that has previously been scanned and indexed.
           pub fn txouts_in_tx(
               &self,
               txid: Txid,
      -    ) -> impl DoubleEndedIterator<Item = (K, u32, OutPoint, &TxOut)> {
      +    ) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, (OutPoint, &TxOut)>> {
               self.inner
                   .txouts_in_tx(txid)
      -            .filter_map(|((desc_id, i), op, txo)| {
      -                let keychain = self.keychain_of_desc_id(desc_id)?;
      -                Some((keychain.clone(), *i, op, txo))
      -            })
      +            .map(|(index, op, txout)| (index.clone(), (op, txout)))
           }
       
           /// Return the [`TxOut`] of `outpoint` if it has been indexed, and if it corresponds to a
      @@ -1323,27 +1183,24 @@
           /// The associated keychain and keychain index of the txout's spk is also returned.
           ///
           /// This calls [`SpkTxOutIndex::txout`] internally.
      -    pub fn txout(&self, outpoint: OutPoint) -> Option<(K, u32, &TxOut)> {
      -        let ((descriptor_id, index), txo) = self.inner.txout(outpoint)?;
      -        let keychain = self.keychain_of_desc_id(descriptor_id)?;
      -        Some((keychain.clone(), *index, txo))
      +    pub fn txout(&self, outpoint: OutPoint) -> Option<KeychainIndexed<K, &TxOut>> {
      +        self.inner
      +            .txout(outpoint)
      +            .map(|(index, txout)| (index.clone(), txout))
           }
       
           /// Return the script that exists under the given `keychain`'s `index`.
           ///
           /// This calls [`SpkTxOutIndex::spk_at_index`] internally.
           pub fn spk_at_index(&self, keychain: K, index: u32) -> Option<&Script> {
      -        let descriptor_id = self.keychains_to_descriptors.get(&keychain)?.0;
      -        self.inner.spk_at_index(&(descriptor_id, index))
      +        self.inner.spk_at_index(&(keychain.clone(), index))
           }
       
           /// Returns the keychain and keychain index associated with the spk.
           ///
           /// This calls [`SpkTxOutIndex::index_of_spk`] internally.
      -    pub fn index_of_spk(&self, script: &Script) -> Option<(K, u32)> {
      -        let (desc_id, last_index) = self.inner.index_of_spk(script)?;
      -        let keychain = self.keychain_of_desc_id(desc_id)?;
      -        Some((keychain.clone(), *last_index))
      +    pub fn index_of_spk(&self, script: &Script) -> Option<&(K, u32)> {
      +        self.inner.index_of_spk(script)
           }
       
           /// Returns whether the spk under the `keychain`'s `index` has been used.
      @@ -1353,11 +1210,7 @@
           ///
           /// This calls [`SpkTxOutIndex::is_used`] internally.
           pub fn is_used(&self, keychain: K, index: u32) -> bool {
      -        let descriptor_id = self.keychains_to_descriptors.get(&keychain).map(|k| k.0);
      -        match descriptor_id {
      -            Some(descriptor_id) => self.inner.is_used(&(descriptor_id, index)),
      -            None => false,
      -        }
      +        self.inner.is_used(&(keychain, index))
           }
       
           /// Marks the script pubkey at `index` as used even though the tracker hasn't seen an output
      @@ -1377,11 +1230,7 @@
           ///
           /// [`unmark_used`]: Self::unmark_used
           pub fn mark_used(&mut self, keychain: K, index: u32) -> bool {
      -        let descriptor_id = self.keychains_to_descriptors.get(&keychain).map(|k| k.0);
      -        match descriptor_id {
      -            Some(descriptor_id) => self.inner.mark_used(&(descriptor_id, index)),
      -            None => false,
      -        }
      +        self.inner.mark_used(&(keychain, index))
           }
       
           /// Undoes the effect of [`mark_used`]. Returns whether the `index` is inserted back into
      @@ -1394,11 +1243,7 @@
           ///
           /// [`mark_used`]: Self::mark_used
           pub fn unmark_used(&mut self, keychain: K, index: u32) -> bool {
      -        let descriptor_id = self.keychains_to_descriptors.get(&keychain).map(|k| k.0);
      -        match descriptor_id {
      -            Some(descriptor_id) => self.inner.unmark_used(&(descriptor_id, index)),
      -            None => false,
      -        }
      +        self.inner.unmark_used(&(keychain, index))
           }
       
           /// Computes the total value transfer effect `tx` has on the script pubkeys belonging to the
      @@ -1428,71 +1273,72 @@
       }
       
       impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
      -    /// Return the map of the keychain to descriptors.
      +    /// Return all keychains and their corresponding descriptors.
           pub fn keychains(
               &self,
           ) -> impl DoubleEndedIterator<Item = (&K, &Descriptor<DescriptorPublicKey>)> + ExactSizeIterator + '_
           {
      -        self.keychains_to_descriptors
      +        self.keychain_to_descriptor_id
                   .iter()
      -            .map(|(k, (_, d))| (k, d))
      +            .map(|(k, did)| (k, self.descriptors.get(did).expect("invariant")))
           }
       
           /// Insert a descriptor with a keychain associated to it.
           ///
      -    /// Adding a descriptor means you will be able to derive new script pubkeys under it
      -    /// and the txout index will discover transaction outputs with those script pubkeys.
      +    /// Adding a descriptor means you will be able to derive new script pubkeys under it and the
      +    /// txout index will discover transaction outputs with those script pubkeys (once they've been
      +    /// derived and added to the index).
           ///
      -    /// When trying to add a keychain that already existed under a different descriptor, or a descriptor
      -    /// that already existed with a different keychain, the old keychain (or descriptor) will be
      -    /// overwritten.
      +    /// keychain <-> descriptor is a one-to-one mapping that cannot be changed. Attempting to do so
      +    /// will return a [`InsertDescriptorError<K>`].
           pub fn insert_descriptor(
               &mut self,
               keychain: K,
               descriptor: Descriptor<DescriptorPublicKey>,
      -    ) -> super::ChangeSet<K> {
      -        let mut changeset = super::ChangeSet::<K>::default();
      -        let desc_id = descriptor.descriptor_id();
      -
      -        let old_desc = self
      -            .keychains_to_descriptors
      -            .insert(keychain.clone(), (desc_id, descriptor.clone()));
      -
      -        if let Some((old_desc_id, _)) = old_desc {
      -            // nothing needs to be done if caller reinsterted the same descriptor under the same
      -            // keychain
      -            if old_desc_id == desc_id {
      -                return changeset;
      +    ) -> Result<ChangeSet<K>, InsertDescriptorError<K>> {
      +        let mut changeset = ChangeSet::<K>::default();
      +        let did = descriptor.descriptor_id();
      +        if !self.keychain_to_descriptor_id.contains_key(&keychain)
      +            && !self.descriptor_id_to_keychain.contains_key(&did)
      +        {
      +            self.descriptors.insert(did, descriptor.clone());
      +            self.keychain_to_descriptor_id.insert(keychain.clone(), did);
      +            self.descriptor_id_to_keychain.insert(did, keychain.clone());
      +            self.replenish_inner_index(did, &keychain, self.lookahead);
      +            changeset
      +                .keychains_added
      +                .insert(keychain.clone(), descriptor);
      +        } else {
      +            if let Some(existing_desc_id) = self.keychain_to_descriptor_id.get(&keychain) {
      +                let descriptor = self.descriptors.get(existing_desc_id).expect("invariant");
      +                if *existing_desc_id != did {
      +                    return Err(InsertDescriptorError::KeychainAlreadyAssigned {
      +                        existing_assignment: descriptor.clone(),
      +                        keychain,
      +                    });
      +                }
                   }
      -            // we should remove old descriptor that is associated with this keychain as the index
      -            // is designed to track one descriptor per keychain (however different keychains can
      -            // share the same descriptor)
      -            let _is_keychain_removed = self
      -                .descriptor_ids_to_keychain_set
      -                .get_mut(&old_desc_id)
      -                .expect("we must have already inserted this descriptor")
      -                .remove(&keychain);
      -            debug_assert!(_is_keychain_removed);
      -        }
       
      -        self.descriptor_ids_to_keychain_set
      -            .entry(desc_id)
      -            .or_default()
      -            .insert(keychain.clone());
      -        self.descriptor_ids_to_descriptors
      -            .insert(desc_id, descriptor.clone());
      -        self.replenish_lookahead(&keychain, self.lookahead);
      +            if let Some(existing_keychain) = self.descriptor_id_to_keychain.get(&did) {
      +                let descriptor = self.descriptors.get(&did).expect("invariant").clone();
       
      -        changeset
      -            .keychains_added
      -            .insert(keychain.clone(), descriptor);
      -        changeset
      +                if *existing_keychain != keychain {
      +                    return Err(InsertDescriptorError::DescriptorAlreadyAssigned {
      +                        existing_assignment: existing_keychain.clone(),
      +                        descriptor,
      +                    });
      +                }
      +            }
      +        }
      +
      +        Ok(changeset)
           }
       
           /// Gets the descriptor associated with the keychain. Returns `None` if the keychain doesn't
           /// have a descriptor associated with it.
           pub fn get_descriptor(&self, keychain: &K) -> Option<&Descriptor<DescriptorPublicKey>> {
      -        self.keychains_to_descriptors.get(keychain).map(|(_, d)| d)
      +        let did = self.keychain_to_descriptor_id.get(keychain)?;
      +        self.descriptors.get(did)
           }
       
           /// Get the lookahead setting.
      @@ -1514,35 +1360,41 @@
                       .filter(|&index| index > 0);
       
                   if let Some(temp_lookahead) = temp_lookahead {
      -                self.replenish_lookahead(keychain, temp_lookahead);
      +                self.replenish_inner_index_keychain(keychain, temp_lookahead);
                   }
               }
           }
       
      -    fn replenish_lookahead(&mut self, keychain: &K, lookahead: u32) {
      -        let descriptor_opt = self.keychains_to_descriptors.get(keychain).cloned();
      -        if let Some((descriptor_id, descriptor)) = descriptor_opt {
      -            let next_store_index = self.next_store_index(descriptor_id);
      -            let next_reveal_index = self.last_revealed.get(&descriptor_id).map_or(0, |v| *v + 1);
      +    fn replenish_inner_index_did(&mut self, did: DescriptorId, lookahead: u32) {
      +        if let Some(keychain) = self.descriptor_id_to_keychain.get(&did).cloned() {
      +            self.replenish_inner_index(did, &keychain, lookahead);
      +        }
      +    }
       
      -            for (new_index, new_spk) in SpkIterator::new_with_range(
      -                descriptor,
      -                next_store_index..next_reveal_index + lookahead,
      -            ) {
      -                let _inserted = self.inner.insert_spk((descriptor_id, new_index), new_spk);
      -                debug_assert!(_inserted, "replenish lookahead: must not have existing spk: keychain={:?}, lookahead={}, next_store_index={}, next_reveal_index={}", keychain, lookahead, next_store_index, next_reveal_index);
      -            }
      +    fn replenish_inner_index_keychain(&mut self, keychain: &K, lookahead: u32) {
      +        if let Some(did) = self.keychain_to_descriptor_id.get(keychain) {
      +            self.replenish_inner_index(*did, keychain, lookahead);
               }
           }
       
      -    fn next_store_index(&self, descriptor_id: DescriptorId) -> u32 {
      -        self.inner()
      +    /// Syncs the state of the inner spk index after changes to a keychain
      +    fn replenish_inner_index(&mut self, did: DescriptorId, keychain: &K, lookahead: u32) {
      +        let descriptor = self.descriptors.get(&did).expect("invariant");
      +        let next_store_index = self
      +            .inner
                   .all_spks()
      -            // This range is keeping only the spks with descriptor_id equal to
      -            // `descriptor_id`. We don't use filter here as range is more optimized.
      -            .range((descriptor_id, u32::MIN)..(descriptor_id, u32::MAX))
      +            .range(&(keychain.clone(), u32::MIN)..=&(keychain.clone(), u32::MAX))
                   .last()
      -            .map_or(0, |((_, index), _)| *index + 1)
      +            .map_or(0, |((_, index), _)| *index + 1);
      +        let next_reveal_index = self.last_revealed.get(&did).map_or(0, |v| *v + 1);
      +        for (new_index, new_spk) in
      +            SpkIterator::new_with_range(descriptor, next_store_index..next_reveal_index + lookahead)
      +        {
      +            let _inserted = self
      +                .inner
      +                .insert_spk((keychain.clone(), new_index), new_spk);
      +            debug_assert!(_inserted, "replenish lookahead: must not have existing spk: keychain={:?}, lookahead={}, next_store_index={}, next_reveal_index={}", keychain, lookahead, next_store_index, next_reveal_index);
      +        }
           }
       
           /// Get an unbounded spk iterator over a given `keychain`. Returns `None` if the provided
      @@ -1551,7 +1403,7 @@
               &self,
               keychain: &K,
           ) -> Option<SpkIterator<Descriptor<DescriptorPublicKey>>> {
      -        let descriptor = self.keychains_to_descriptors.get(keychain)?.1.clone();
      +        let descriptor = self.get_descriptor(keychain)?.clone();
               Some(SpkIterator::new(descriptor))
           }
       
      @@ -1559,9 +1411,14 @@
           pub fn all_unbounded_spk_iters(
               &self,
           ) -> BTreeMap<K, SpkIterator<Descriptor<DescriptorPublicKey>>> {
      -        self.keychains_to_descriptors
      +        self.keychain_to_descriptor_id
                   .iter()
      -            .map(|(k, (_, descriptor))| (k.clone(), SpkIterator::new(descriptor.clone())))
      +            .map(|(k, did)| {
      +                (
      +                    k.clone(),
      +                    SpkIterator::new(self.descriptors.get(did).expect("invariant").clone()),
      +                )
      +            })
                   .collect()
           }
       
      @@ -1569,44 +1426,63 @@
           pub fn revealed_spks(
               &self,
               range: impl RangeBounds<K>,
      -    ) -> impl DoubleEndedIterator<Item = (&K, u32, &Script)> + Clone {
      -        self.keychains_to_descriptors
      -            .range(range)
      -            .flat_map(|(_, (descriptor_id, _))| {
      -                let start = Bound::Included((*descriptor_id, u32::MIN));
      -                let end = match self.last_revealed.get(descriptor_id) {
      -                    Some(last_revealed) => Bound::Included((*descriptor_id, *last_revealed)),
      -                    None => Bound::Excluded((*descriptor_id, u32::MIN)),
      -                };
      -
      -                self.inner
      -                    .all_spks()
      -                    .range((start, end))
      -                    .map(|((descriptor_id, i), spk)| {
      -                        (
      -                            self.keychain_of_desc_id(descriptor_id)
      -                                .expect("must have keychain"),
      -                            *i,
      -                            spk.as_script(),
      -                        )
      -                    })
      -            })
      +    ) -> impl Iterator<Item = KeychainIndexed<K, &Script>> {
      +        let start = range.start_bound();
      +        let end = range.end_bound();
      +        let mut iter_last_revealed = self
      +            .keychain_to_descriptor_id
      +            .range((start, end))
      +            .map(|(k, did)| (k, self.last_revealed.get(did).cloned()));
      +        let mut iter_spks = self
      +            .inner
      +            .all_spks()
      +            .range(self.map_to_inner_bounds((start, end)));
      +        let mut current_keychain = iter_last_revealed.next();
      +        // The reason we need a tricky algorithm is because of the "lookahead" feature which means
      +        // that some of the spks in the SpkTxoutIndex will not have been revealed yet. So we need to
      +        // filter out those spks that are above the last_revealed for that keychain. To do this we
      +        // iterate through the last_revealed for each keychain and the spks for each keychain in
      +        // tandem. This minimizes BTreeMap queries.
      +        core::iter::from_fn(move || loop {
      +            let ((keychain, index), spk) = iter_spks.next()?;
      +            // We need to find the last revealed that matches the current spk we are considering so
      +            // we skip ahead.
      +            while current_keychain?.0 < keychain {
      +                current_keychain = iter_last_revealed.next();
      +            }
      +            let (current_keychain, last_revealed) = current_keychain?;
      +
      +            if current_keychain == keychain && Some(*index) <= last_revealed {
      +                break Some(((keychain.clone(), *index), spk.as_script()));
      +            }
      +        })
           }
       
      -    /// Iterate over revealed spks of the given `keychain`.
      +    /// Iterate over revealed spks of the given `keychain` with ascending indices.
      +    ///
      +    /// This is a double ended iterator so you can easily reverse it to get an iterator where
      +    /// the script pubkeys that were most recently revealed are first.
           pub fn revealed_keychain_spks<'a>(
               &'a self,
               keychain: &'a K,
      -    ) -> impl DoubleEndedIterator<Item = (u32, &Script)> + 'a {
      -        self.revealed_spks(keychain..=keychain)
      -            .map(|(_, i, spk)| (i, spk))
      +    ) -> impl DoubleEndedIterator<Item = Indexed<&Script>> + 'a {
      +        let end = self
      +            .last_revealed_index(keychain)
      +            .map(|v| v + 1)
      +            .unwrap_or(0);
      +        self.inner
      +            .all_spks()
      +            .range((keychain.clone(), 0)..(keychain.clone(), end))
      +            .map(|((_, index), spk)| (*index, spk.as_script()))
           }
       
           /// Iterate over revealed, but unused, spks of all keychains.
      -    pub fn unused_spks(&self) -> impl DoubleEndedIterator<Item = (K, u32, &Script)> + Clone {
      -        self.keychains_to_descriptors.keys().flat_map(|keychain| {
      +    pub fn unused_spks(
      +        &self,
      +    ) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, &Script>> + Clone {
      +        self.keychain_to_descriptor_id.keys().flat_map(|keychain| {
                   self.unused_keychain_spks(keychain)
      -                .map(|(i, spk)| (keychain.clone(), i, spk))
      +                .map(|(i, spk)| ((keychain.clone(), i), spk))
               })
           }
       
      @@ -1615,18 +1491,14 @@
           pub fn unused_keychain_spks(
               &self,
               keychain: &K,
      -    ) -> impl DoubleEndedIterator<Item = (u32, &Script)> + Clone {
      -        let desc_id = self
      -            .keychains_to_descriptors
      -            .get(keychain)
      -            .map(|(desc_id, _)| *desc_id)
      -            // We use a dummy desc id if we can't find the real one in our map. In this way,
      -            // if this method was to be called with a non-existent keychain, we would return an
      -            // empty iterator
      -            .unwrap_or_else(|| DescriptorId::from_byte_array([0; 32]));
      -        let next_i = self.last_revealed.get(&desc_id).map_or(0, |&i| i + 1);
      +    ) -> impl DoubleEndedIterator<Item = Indexed<&Script>> + Clone {
      +        let end = match self.keychain_to_descriptor_id.get(keychain) {
      +            Some(did) => self.last_revealed.get(did).map(|v| *v + 1).unwrap_or(0),
      +            None => 0,
      +        };
      +
               self.inner
      -            .unused_spks((desc_id, u32::MIN)..(desc_id, next_i))
      +            .unused_spks((keychain.clone(), 0)..(keychain.clone(), end))
                   .map(|((_, i), spk)| (*i, spk))
           }
       
      @@ -1643,8 +1515,9 @@
           ///
           /// Returns None if the provided `keychain` doesn't exist.
           pub fn next_index(&self, keychain: &K) -> Option<(u32, bool)> {
      -        let (descriptor_id, descriptor) = self.keychains_to_descriptors.get(keychain)?;
      -        let last_index = self.last_revealed.get(descriptor_id).cloned();
      +        let did = self.keychain_to_descriptor_id.get(keychain)?;
      +        let last_index = self.last_revealed.get(did).cloned();
      +        let descriptor = self.descriptors.get(did).expect("invariant");
       
               // we can only get the next index if the wildcard exists.
               let has_wildcard = descriptor.has_wildcard();
      @@ -1671,7 +1544,7 @@
               self.last_revealed
                   .iter()
                   .filter_map(|(desc_id, index)| {
      -                let keychain = self.keychain_of_desc_id(desc_id)?;
      +                let keychain = self.descriptor_id_to_keychain.get(desc_id)?;
                       Some((keychain.clone(), *index))
                   })
                   .collect()
      @@ -1680,91 +1553,21 @@
           /// Get the last derivation index revealed for `keychain`. Returns None if the keychain doesn't
           /// exist, or if the keychain doesn't have any revealed scripts.
           pub fn last_revealed_index(&self, keychain: &K) -> Option<u32> {
      -        let descriptor_id = self.keychains_to_descriptors.get(keychain)?.0;
      -        self.last_revealed.get(&descriptor_id).cloned()
      +        let descriptor_id = self.keychain_to_descriptor_id.get(keychain)?;
      +        self.last_revealed.get(descriptor_id).cloned()
           }
       
           /// Convenience method to call [`Self::reveal_to_target`] on multiple keychains.
      -    pub fn reveal_to_target_multi(
      -        &mut self,
      -        keychains: &BTreeMap<K, u32>,
      -    ) -> (
      -        BTreeMap<K, SpkIterator<Descriptor<DescriptorPublicKey>>>,
      -        super::ChangeSet<K>,
      -    ) {
      -        let mut changeset = super::ChangeSet::default();
      -        let mut spks = BTreeMap::new();
      +    pub fn reveal_to_target_multi(&mut self, keychains: &BTreeMap<K, u32>) -> ChangeSet<K> {
      +        let mut changeset = ChangeSet::default();
       
               for (keychain, &index) in keychains {
      -            if let Some((new_spks, new_changeset)) = self.reveal_to_target(keychain, index) {
      -                if !new_changeset.is_empty() {
      -                    spks.insert(keychain.clone(), new_spks);
      -                    changeset.append(new_changeset.clone());
      -                }
      +            if let Some((_, new_changeset)) = self.reveal_to_target(keychain, index) {
      +                changeset.append(new_changeset);
                   }
               }
       
      -        (spks, changeset)
      -    }
      -
      -    /// Convenience method to call `reveal_to_target` with a descriptor_id instead of a keychain.
      -    /// This is useful for revealing spks of descriptors for which we don't have a keychain
      -    /// tracked.
      -    /// Refer to the `reveal_to_target` documentation for more.
      -    ///
      -    /// Returns None if the provided `descriptor_id` doesn't correspond to a tracked descriptor.
      -    fn reveal_to_target_with_id(
      -        &mut self,
      -        descriptor_id: DescriptorId,
      -        target_index: u32,
      -    ) -> Option<(
      -        SpkIterator<Descriptor<DescriptorPublicKey>>,
      -        super::ChangeSet<K>,
      -    )> {
      -        let descriptor = self
      -            .descriptor_ids_to_descriptors
      -            .get(&descriptor_id)?
      -            .clone();
      -        let has_wildcard = descriptor.has_wildcard();
      -
      -        let target_index = if has_wildcard { target_index } else { 0 };
      -        let next_reveal_index = self
      -            .last_revealed
      -            .get(&descriptor_id)
      -            .map_or(0, |index| *index + 1);
      -
      -        debug_assert!(next_reveal_index + self.lookahead >= self.next_store_index(descriptor_id));
      -
      -        // If the target_index is already revealed, we are done
      -        if next_reveal_index > target_index {
      -            return Some((
      -                SpkIterator::new_with_range(descriptor, next_reveal_index..next_reveal_index),
      -                super::ChangeSet::default(),
      -            ));
      -        }
      -
      -        // We range over the indexes that are not stored and insert their spks in the index.
      -        // Indexes from next_reveal_index to next_reveal_index + lookahead are already stored (due
      -        // to lookahead), so we only range from next_reveal_index + lookahead to target + lookahead
      -        let range = next_reveal_index + self.lookahead..=target_index + self.lookahead;
      -        for (new_index, new_spk) in SpkIterator::new_with_range(descriptor.clone(), range) {
      -            let _inserted = self.inner.insert_spk((descriptor_id, new_index), new_spk);
      -            debug_assert!(_inserted, "must not have existing spk");
      -            debug_assert!(
      -                has_wildcard || new_index == 0,
      -                "non-wildcard descriptors must not iterate past index 0"
      -            );
      -        }
      -
      -        let _old_index = self.last_revealed.insert(descriptor_id, target_index);
      -        debug_assert!(_old_index < Some(target_index));
      -        Some((
      -            SpkIterator::new_with_range(descriptor, next_reveal_index..target_index + 1),
      -            super::ChangeSet {
      -                keychains_added: BTreeMap::new(),
      -                last_revealed: core::iter::once((descriptor_id, target_index)).collect(),
      -            },
      -        ))
      +        changeset
           }
       
           /// Reveals script pubkeys of the `keychain`'s descriptor **up to and including** the
      @@ -1774,50 +1577,62 @@
           /// the `target_index` is in the hardened index range), this method will make a best-effort and
           /// reveal up to the last possible index.
           ///
      -    /// This returns an iterator of newly revealed indices (alongside their scripts) and a
      -    /// [`super::ChangeSet`], which reports updates to the latest revealed index. If no new script
      +    /// This returns list of newly revealed indices (alongside their scripts) and a
      +    /// [`ChangeSet`], which reports updates to the latest revealed index. If no new script
           /// pubkeys are revealed, then both of these will be empty.
           ///
           /// Returns None if the provided `keychain` doesn't exist.
      +    #[must_use]
           pub fn reveal_to_target(
               &mut self,
               keychain: &K,
               target_index: u32,
      -    ) -> Option<(
      -        SpkIterator<Descriptor<DescriptorPublicKey>>,
      -        super::ChangeSet<K>,
      -    )> {
      -        let descriptor_id = self.keychains_to_descriptors.get(keychain)?.0;
      -        self.reveal_to_target_with_id(descriptor_id, target_index)
      +    ) -> Option<(Vec<Indexed<ScriptBuf>>, ChangeSet<K>)> {
      +        let mut changeset = ChangeSet::default();
      +        let mut spks: Vec<Indexed<ScriptBuf>> = vec![];
      +        while let Some((i, new)) = self.next_index(keychain) {
      +            if !new || i > target_index {
      +                break;
      +            }
      +            match self.reveal_next_spk(keychain) {
      +                Some(((i, spk), change)) => {
      +                    spks.push((i, spk));
      +                    changeset.append(change);
      +                }
      +                None => break,
      +            }
      +        }
      +
      +        Some((spks, changeset))
           }
       
           /// Attempts to reveal the next script pubkey for `keychain`.
           ///
           /// Returns the derivation index of the revealed script pubkey, the revealed script pubkey and a
      -    /// [`super::ChangeSet`] which represents changes in the last revealed index (if any).
      +    /// [`ChangeSet`] which represents changes in the last revealed index (if any).
           /// Returns None if the provided keychain doesn't exist.
           ///
           /// When a new script cannot be revealed, we return the last revealed script and an empty
      -    /// [`super::ChangeSet`]. There are two scenarios when a new script pubkey cannot be derived:
      +    /// [`ChangeSet`]. There are two scenarios when a new script pubkey cannot be derived:
           ///
           ///  1. The descriptor has no wildcard and already has one script revealed.
           ///  2. The descriptor has already revealed scripts up to the numeric bound.
           ///  3. There is no descriptor associated with the given keychain.
      -    pub fn reveal_next_spk(
      -        &mut self,
      -        keychain: &K,
      -    ) -> Option<((u32, &Script), super::ChangeSet<K>)> {
      -        let descriptor_id = self.keychains_to_descriptors.get(keychain)?.0;
      -        let (next_index, _) = self.next_index(keychain).expect("We know keychain exists");
      -        let changeset = self
      -            .reveal_to_target(keychain, next_index)
      -            .expect("We know keychain exists")
      -            .1;
      +    pub fn reveal_next_spk(&mut self, keychain: &K) -> Option<(Indexed<ScriptBuf>, ChangeSet<K>)> {
      +        let (next_index, new) = self.next_index(keychain)?;
      +        let mut changeset = ChangeSet::default();
      +
      +        if new {
      +            let did = self.keychain_to_descriptor_id.get(keychain)?;
      +            self.last_revealed.insert(*did, next_index);
      +            changeset.last_revealed.insert(*did, next_index);
      +            self.replenish_inner_index(*did, keychain, self.lookahead);
      +        }
               let script = self
                   .inner
      -            .spk_at_index(&(descriptor_id, next_index))
      -            .expect("script must already be stored");
      -        Some(((next_index, script), changeset))
      +            .spk_at_index(&(keychain.clone(), next_index))
      +            .expect("we just inserted it");
      +        Some(((next_index, script.into()), changeset))
           }
       
           /// Gets the next unused script pubkey in the keychain. I.e., the script pubkey with the lowest
      @@ -1829,23 +1644,17 @@
           /// has used all scripts up to the derivation bounds, then the last derived script pubkey will be
           /// returned.
           ///
      -    /// Returns None if the provided keychain doesn't exist.
      -    pub fn next_unused_spk(
      -        &mut self,
      -        keychain: &K,
      -    ) -> Option<((u32, &Script), super::ChangeSet<K>)> {
      -        let need_new = self.unused_keychain_spks(keychain).next().is_none();
      -        // this rather strange branch is needed because of some lifetime issues
      -        if need_new {
      -            self.reveal_next_spk(keychain)
      -        } else {
      -            Some((
      -                self.unused_keychain_spks(keychain)
      -                    .next()
      -                    .expect("we already know next exists"),
      -                super::ChangeSet::default(),
      -            ))
      -        }
      +    /// Returns `None` if there are no script pubkeys that have been used and no new script pubkey
      +    /// could be revealed (see [`reveal_next_spk`] for when this happens).
      +    ///
      +    /// [`reveal_next_spk`]: Self::reveal_next_spk
      +    pub fn next_unused_spk(&mut self, keychain: &K) -> Option<(Indexed<ScriptBuf>, ChangeSet<K>)> {
      +        let next_unused = self
      +            .unused_keychain_spks(keychain)
      +            .next()
      +            .map(|(i, spk)| ((i, spk.to_owned()), ChangeSet::default()));
      +
      +        next_unused.or_else(|| self.reveal_next_spk(keychain))
           }
       
           /// Iterate over all [`OutPoint`]s that have `TxOut`s with script pubkeys derived from
      @@ -1853,45 +1662,30 @@
           pub fn keychain_outpoints<'a>(
               &'a self,
               keychain: &'a K,
      -    ) -> impl DoubleEndedIterator<Item = (u32, OutPoint)> + 'a {
      +    ) -> impl DoubleEndedIterator<Item = Indexed<OutPoint>> + 'a {
               self.keychain_outpoints_in_range(keychain..=keychain)
      -            .map(move |(_, i, op)| (i, op))
      +            .map(|((_, i), op)| (i, op))
           }
       
           /// Iterate over [`OutPoint`]s that have script pubkeys derived from keychains in `range`.
           pub fn keychain_outpoints_in_range<'a>(
               &'a self,
               range: impl RangeBounds<K> + 'a,
      -    ) -> impl DoubleEndedIterator<Item = (&'a K, u32, OutPoint)> + 'a {
      -        let bounds = self.map_to_inner_bounds(range);
      +    ) -> impl DoubleEndedIterator<Item = KeychainIndexed<K, OutPoint>> + 'a {
               self.inner
      -            .outputs_in_range(bounds)
      -            .map(move |((desc_id, i), op)| {
      -                let keychain = self
      -                    .keychain_of_desc_id(desc_id)
      -                    .expect("keychain must exist");
      -                (keychain, *i, op)
      -            })
      +            .outputs_in_range(self.map_to_inner_bounds(range))
      +            .map(|((k, i), op)| ((k.clone(), *i), op))
           }
       
      -    fn map_to_inner_bounds(
      -        &self,
      -        bound: impl RangeBounds<K>,
      -    ) -> impl RangeBounds<(DescriptorId, u32)> {
      -        let get_desc_id = |keychain| {
      -            self.keychains_to_descriptors
      -                .get(keychain)
      -                .map(|(desc_id, _)| *desc_id)
      -                .unwrap_or_else(|| DescriptorId::from_byte_array([0; 32]))
      -        };
      +    fn map_to_inner_bounds(&self, bound: impl RangeBounds<K>) -> impl RangeBounds<(K, u32)> {
               let start = match bound.start_bound() {
      -            Bound::Included(keychain) => Bound::Included((get_desc_id(keychain), u32::MIN)),
      -            Bound::Excluded(keychain) => Bound::Excluded((get_desc_id(keychain), u32::MAX)),
      +            Bound::Included(keychain) => Bound::Included((keychain.clone(), u32::MIN)),
      +            Bound::Excluded(keychain) => Bound::Excluded((keychain.clone(), u32::MAX)),
                   Bound::Unbounded => Bound::Unbounded,
               };
               let end = match bound.end_bound() {
      -            Bound::Included(keychain) => Bound::Included((get_desc_id(keychain), u32::MAX)),
      -            Bound::Excluded(keychain) => Bound::Excluded((get_desc_id(keychain), u32::MIN)),
      +            Bound::Included(keychain) => Bound::Included((keychain.clone(), u32::MAX)),
      +            Bound::Excluded(keychain) => Bound::Excluded((keychain.clone(), u32::MIN)),
                   Bound::Unbounded => Bound::Unbounded,
               };
       
      @@ -1907,7 +1701,7 @@
           /// Returns the highest derivation index of each keychain that [`KeychainTxOutIndex`] has found
           /// a [`TxOut`] with it's script pubkey.
           pub fn last_used_indices(&self) -> BTreeMap<K, u32> {
      -        self.keychains_to_descriptors
      +        self.keychain_to_descriptor_id
                   .iter()
                   .filter_map(|(keychain, _)| {
                       self.last_used_index(keychain)
      @@ -1916,28 +1710,170 @@
                   .collect()
           }
       
      -    /// Applies the derivation changeset to the [`KeychainTxOutIndex`], as specified in the
      -    /// [`ChangeSet::append`] documentation:
      -    /// - Extends the number of derived scripts per keychain
      -    /// - Adds new descriptors introduced
      -    /// - If a descriptor is introduced for a keychain that already had a descriptor, overwrites
      -    /// the old descriptor
      -    pub fn apply_changeset(&mut self, changeset: super::ChangeSet<K>) {
      +    /// Applies the `ChangeSet<K>` to the [`KeychainTxOutIndex<K>`]
      +    ///
      +    /// Keychains added by the `keychains_added` field of `ChangeSet<K>` respect the one-to-one
      +    /// keychain <-> descriptor invariant by silently ignoring attempts to violate it (but will
      +    /// panic if `debug_assertions` are enabled).
      +    pub fn apply_changeset(&mut self, changeset: ChangeSet<K>) {
               let ChangeSet {
                   keychains_added,
                   last_revealed,
               } = changeset;
               for (keychain, descriptor) in keychains_added {
      -            let _ = self.insert_descriptor(keychain, descriptor);
      +            let _ignore_invariant_violation = self.insert_descriptor(keychain, descriptor);
               }
      -        let last_revealed = last_revealed
      -            .into_iter()
      -            .filter_map(|(desc_id, index)| {
      -                let keychain = self.keychain_of_desc_id(&desc_id)?;
      -                Some((keychain.clone(), index))
      -            })
      -            .collect();
      -        let _ = self.reveal_to_target_multi(&last_revealed);
      +
      +        for (&desc_id, &index) in &last_revealed {
      +            let v = self.last_revealed.entry(desc_id).or_default();
      +            *v = index.max(*v);
      +        }
      +
      +        for did in last_revealed.keys() {
      +            self.replenish_inner_index_did(*did, self.lookahead);
      +        }
      +    }
      +}
      +
      +#[derive(Clone, Debug, PartialEq)]
      +/// Error returned from [`KeychainTxOutIndex::insert_descriptor`]
      +pub enum InsertDescriptorError<K> {
      +    /// The descriptor has already been assigned to a keychain so you can't assign it to another
      +    DescriptorAlreadyAssigned {
      +        /// The descriptor you have attempted to reassign
      +        descriptor: Descriptor<DescriptorPublicKey>,
      +        /// The keychain that the descriptor is already assigned to
      +        existing_assignment: K,
      +    },
      +    /// The keychain is already assigned to a descriptor so you can't reassign it
      +    KeychainAlreadyAssigned {
      +        /// The keychain that you have attempted to reassign
      +        keychain: K,
      +        /// The descriptor that the keychain is already assigned to
      +        existing_assignment: Descriptor<DescriptorPublicKey>,
      +    },
      +}
      +
      +impl<K: core::fmt::Debug> core::fmt::Display for InsertDescriptorError<K> {
      +    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
      +        match self {
      +            InsertDescriptorError::DescriptorAlreadyAssigned {
      +                existing_assignment: existing,
      +                descriptor,
      +            } => {
      +                write!(
      +                    f,
      +                    "attempt to re-assign descriptor {descriptor:?} already assigned to {existing:?}"
      +                )
      +            }
      +            InsertDescriptorError::KeychainAlreadyAssigned {
      +                existing_assignment: existing,
      +                keychain,
      +            } => {
      +                write!(
      +                    f,
      +                    "attempt to re-assign keychain {keychain:?} already assigned to {existing:?}"
      +                )
      +            }
      +        }
      +    }
      +}
      +
      +#[cfg(feature = "std")]
      +impl<K: core::fmt::Debug> std::error::Error for InsertDescriptorError<K> {}
      +
      +/// Represents updates to the derivation index of a [`KeychainTxOutIndex`].
      +/// It maps each keychain `K` to a descriptor and its last revealed index.
      +///
      +/// It can be applied to [`KeychainTxOutIndex`] with [`apply_changeset`].
      +///
      +/// The `last_revealed` field is monotone in that [`append`] will never decrease it.
      +/// `keychains_added` is *not* monotone, once it is set any attempt to change it is subject to the
      +/// same *one-to-one* keychain <-> descriptor mapping invariant as [`KeychainTxOutIndex`] itself.
      +///
      +/// [`KeychainTxOutIndex`]: crate::keychain::KeychainTxOutIndex
      +/// [`apply_changeset`]: crate::keychain::KeychainTxOutIndex::apply_changeset
      +/// [`append`]: Self::append
      +#[derive(Clone, Debug, PartialEq)]
      +#[cfg_attr(
      +    feature = "serde",
      +    derive(serde::Deserialize, serde::Serialize),
      +    serde(
      +        crate = "serde_crate",
      +        bound(
      +            deserialize = "K: Ord + serde::Deserialize<'de>",
      +            serialize = "K: Ord + serde::Serialize"
      +        )
      +    )
      +)]
      +#[must_use]
      +pub struct ChangeSet<K> {
      +    /// Contains the keychains that have been added and their respective descriptor
      +    pub keychains_added: BTreeMap<K, Descriptor<DescriptorPublicKey>>,
      +    /// Contains for each descriptor_id the last revealed index of derivation
      +    pub last_revealed: BTreeMap<DescriptorId, u32>,
      +}
      +
      +impl<K: Ord> Append for ChangeSet<K> {
      +    /// Merge another [`ChangeSet<K>`] into self.
      +    ///
      +    /// For the `keychains_added` field this method respects the invariants of
      +    /// [`insert_descriptor`]. `last_revealed` always becomes the larger of the two.
      +    ///
      +    /// [`insert_descriptor`]: KeychainTxOutIndex::insert_descriptor
      +    fn append(&mut self, other: Self) {
      +        for (new_keychain, new_descriptor) in other.keychains_added {
      +            // enforce 1-to-1 invariance
      +            if !self.keychains_added.contains_key(&new_keychain)
      +                // FIXME: very inefficient
      +                && self
      +                    .keychains_added
      +                    .values()
      +                    .all(|descriptor| descriptor != &new_descriptor)
      +            {
      +                self.keychains_added.insert(new_keychain, new_descriptor);
      +            }
      +        }
      +
      +        // for `last_revealed`, entries of `other` will take precedence ONLY if it is greater than
      +        // what was originally in `self`.
      +        for (desc_id, index) in other.last_revealed {
      +            use crate::collections::btree_map::Entry;
      +            match self.last_revealed.entry(desc_id) {
      +                Entry::Vacant(entry) => {
      +                    entry.insert(index);
      +                }
      +                Entry::Occupied(mut entry) => {
      +                    if *entry.get() < index {
      +                        entry.insert(index);
      +                    }
      +                }
      +            }
      +        }
      +    }
      +
      +    /// Returns whether the changeset are empty.
      +    fn is_empty(&self) -> bool {
      +        self.last_revealed.is_empty() && self.keychains_added.is_empty()
      +    }
      +}
      +
      +impl<K> Default for ChangeSet<K> {
      +    fn default() -> Self {
      +        Self {
      +            last_revealed: BTreeMap::default(),
      +            keychains_added: BTreeMap::default(),
      +        }
      +    }
      +}
      +
      +#[derive(Clone, Debug, Eq, PartialEq)]
      +/// The keychain doesn't exist. Most likley hasn't been inserted with [`KeychainTxOutIndex::insert_descriptor`].
      +pub struct NoSuchKeychain<K>(K);
      +
      +impl<K: Debug> core::fmt::Display for NoSuchKeychain<K> {
      +    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
      +        write!(f, "no such keychain {:?} exists", &self.0)
           }
       }
       

      \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html index 4e559488b5..166f1b5c10 100644 --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/lib.rs.html @@ -95,6 +95,7 @@ 95 96 97 +98
      //! This crate is a collection of core structures for [Bitcoin Dev Kit].
       //!
       //! The goal of this crate is to give wallets the mechanisms needed to:
      @@ -125,6 +126,7 @@
       pub mod indexed_tx_graph;
       pub use indexed_tx_graph::IndexedTxGraph;
       pub mod keychain;
      +pub use keychain::{Indexed, KeychainIndexed};
       pub mod local_chain;
       mod tx_data_traits;
       pub mod tx_graph;
      diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html
      index 754934a2d9..e535161658 100644
      --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html
      +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_client.rs.html
      @@ -385,10 +385,12 @@
       385
       386
       387
      +388
       
    //! Helper types for spk-based blockchain clients.
     
     use crate::{
    -    collections::BTreeMap, local_chain::CheckPoint, ConfirmationTimeHeightAnchor, TxGraph,
    +    collections::BTreeMap, keychain::Indexed, local_chain::CheckPoint,
    +    ConfirmationTimeHeightAnchor, TxGraph,
     };
     use alloc::{boxed::Box, vec::Vec};
     use bitcoin::{OutPoint, Script, ScriptBuf, Txid};
    @@ -553,7 +555,7 @@
             self.chain_spks(
                 index
                     .revealed_spks(spk_range)
    -                .map(|(_, _, spk)| spk.to_owned())
    +                .map(|(_, spk)| spk.to_owned())
                     .collect::<Vec<_>>(),
             )
         }
    @@ -582,7 +584,7 @@
         /// [`LocalChain::tip`]: crate::local_chain::LocalChain::tip
         pub chain_tip: CheckPoint,
         /// Iterators of script pubkeys indexed by the keychain index.
    -    pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = (u32, ScriptBuf)> + Send>>,
    +    pub spks_by_keychain: BTreeMap<K, Box<dyn Iterator<Item = Indexed<ScriptBuf>> + Send>>,
     }
     
     impl<K: Ord + Clone> FullScanRequest<K> {
    @@ -625,7 +627,7 @@
         pub fn set_spks_for_keychain(
             mut self,
             keychain: K,
    -        spks: impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send + 'static>,
    +        spks: impl IntoIterator<IntoIter = impl Iterator<Item = Indexed<ScriptBuf>> + Send + 'static>,
         ) -> Self {
             self.spks_by_keychain
                 .insert(keychain, Box::new(spks.into_iter()));
    @@ -639,7 +641,7 @@
         pub fn chain_spks_for_keychain(
             mut self,
             keychain: K,
    -        spks: impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send + 'static>,
    +        spks: impl IntoIterator<IntoIter = impl Iterator<Item = Indexed<ScriptBuf>> + Send + 'static>,
         ) -> Self {
             match self.spks_by_keychain.remove(&keychain) {
                 // clippy here suggests to remove `into_iter` from `spks.into_iter()`, but doing so
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_iter.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_iter.rs.html
    index 491aad8f58..7584951c30 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_iter.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_chain/spk_iter.rs.html
    @@ -265,8 +265,14 @@
     265
     266
     267
    +268
    +269
    +270
    +271
    +272
     
    use crate::{
         bitcoin::{secp256k1::Secp256k1, ScriptBuf},
    +    keychain::Indexed,
         miniscript::{Descriptor, DescriptorPublicKey},
     };
     use core::{borrow::Borrow, ops::Bound, ops::RangeBounds};
    @@ -364,7 +370,7 @@
     where
         D: Borrow<Descriptor<DescriptorPublicKey>>,
     {
    -    type Item = (u32, ScriptBuf);
    +    type Item = Indexed<ScriptBuf>;
     
         fn next(&mut self) -> Option<Self::Item> {
             // For non-wildcard descriptors, we expect the first element to be Some((0, spk)), then None after.
    @@ -425,8 +431,12 @@
             let (external_descriptor,_) = Descriptor::<DescriptorPublicKey>::parse_descriptor(&secp, "tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/0/*)").unwrap();
             let (internal_descriptor,_) = Descriptor::<DescriptorPublicKey>::parse_descriptor(&secp, "tr([73c5da0a/86'/0'/0']xprv9xgqHN7yz9MwCkxsBPN5qetuNdQSUttZNKw1dcYTV4mkaAFiBVGQziHs3NRSWMkCzvgjEe3n9xV8oYywvM8at9yRqyaZVz6TYYhX98VjsUk/1/*)").unwrap();
     
    -        let _ = txout_index.insert_descriptor(TestKeychain::External, external_descriptor.clone());
    -        let _ = txout_index.insert_descriptor(TestKeychain::Internal, internal_descriptor.clone());
    +        let _ = txout_index
    +            .insert_descriptor(TestKeychain::External, external_descriptor.clone())
    +            .unwrap();
    +        let _ = txout_index
    +            .insert_descriptor(TestKeychain::Internal, internal_descriptor.clone())
    +            .unwrap();
     
             (txout_index, external_descriptor, internal_descriptor)
         }
    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 7869f2354e..f0f493f0d1 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
    @@ -384,7 +384,7 @@
         }
     }
     
    -impl<I: Clone + Ord> Indexer for SpkTxOutIndex<I> {
    +impl<I: Clone + Ord + core::fmt::Debug> Indexer for SpkTxOutIndex<I> {
         type ChangeSet = ();
     
         fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet {
    @@ -408,7 +408,7 @@
         }
     }
     
    -impl<I: Clone + Ord> SpkTxOutIndex<I> {
    +impl<I: Clone + Ord + core::fmt::Debug> SpkTxOutIndex<I> {
         /// Scans a transaction's outputs for matching script pubkeys.
         ///
         /// Typically, this is used in two situations:
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html
    index 38baa80197..7516b889a3 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_esplora/async_ext.rs.html
    @@ -592,13 +592,13 @@
     
     use async_trait::async_trait;
     use bdk_chain::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult};
    -use bdk_chain::Anchor;
     use bdk_chain::{
         bitcoin::{BlockHash, OutPoint, ScriptBuf, TxOut, Txid},
         collections::BTreeMap,
         local_chain::CheckPoint,
         BlockId, ConfirmationTimeHeightAnchor, TxGraph,
     };
    +use bdk_chain::{Anchor, Indexed};
     use esplora_client::{Amount, TxStatus};
     use futures::{stream::FuturesOrdered, TryStreamExt};
     
    @@ -826,7 +826,7 @@
         client: &esplora_client::AsyncClient,
         keychain_spks: BTreeMap<
             K,
    -        impl IntoIterator<IntoIter = impl Iterator<Item = (u32, ScriptBuf)> + Send> + Send,
    +        impl IntoIterator<IntoIter = impl Iterator<Item = Indexed<ScriptBuf>> + Send> + Send,
         >,
         stop_gap: usize,
         parallel_requests: usize,
    diff --git a/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html b/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html
    index 6da4a77492..f5c655ed8f 100644
    --- a/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/bdk_esplora/blocking_ext.rs.html
    @@ -790,12 +790,12 @@
     
     use bdk_chain::collections::BTreeMap;
     use bdk_chain::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult};
    -use bdk_chain::Anchor;
     use bdk_chain::{
         bitcoin::{Amount, BlockHash, OutPoint, ScriptBuf, TxOut, Txid},
         local_chain::CheckPoint,
         BlockId, ConfirmationTimeHeightAnchor, TxGraph,
     };
    +use bdk_chain::{Anchor, Indexed};
     use esplora_client::TxStatus;
     
     use crate::anchor_from_status;
    @@ -1003,7 +1003,7 @@
     /// [`KeychainTxOutIndex`](bdk_chain::keychain::KeychainTxOutIndex).
     fn full_scan_for_index_and_graph_blocking<K: Ord + Clone>(
         client: &esplora_client::BlockingClient,
    -    keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, ScriptBuf)>>,
    +    keychain_spks: BTreeMap<K, impl IntoIterator<Item = Indexed<ScriptBuf>>>,
         stop_gap: usize,
         parallel_requests: usize,
     ) -> Result<(TxGraph<ConfirmationTimeHeightAnchor>, BTreeMap<K, u32>), Error> {
    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 d34b64b023..a91b6a2cd5 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
    @@ -125,7 +125,6 @@
     125
     126
     127
    -128
     
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -151,7 +150,6 @@
         HardenedDerivationXpub,
         /// The descriptor contains multipath keys
         MultiPath,
    -
         /// Error thrown while working with [`keys`](crate::keys)
         Key(crate::keys::KeyError),
         /// Error while extracting and manipulating policies
    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 60fd767cc7..e482c5642e 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
    @@ -2598,6 +2598,17 @@
     2598
     2599
     2600
    +2601
    +2602
    +2603
    +2604
    +2605
    +2606
    +2607
    +2608
    +2609
    +2610
    +2611
     
    // Bitcoin Dev Kit
     // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
     //
    @@ -2629,7 +2640,7 @@
         spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult},
         tx_graph::{CanonicalTx, TxGraph},
         Append, BlockId, ChainPosition, ConfirmationTime, ConfirmationTimeHeightAnchor, FullTxOut,
    -    IndexedTxGraph,
    +    Indexed, IndexedTxGraph,
     };
     use bdk_persist::{Persist, PersistBackend};
     use bitcoin::secp256k1::{All, Secp256k1};
    @@ -3352,7 +3363,8 @@
     
             Ok(AddressInfo {
                 index,
    -            address: Address::from_script(spk, self.network).expect("must have address form"),
    +            address: Address::from_script(spk.as_script(), self.network)
    +                .expect("must have address form"),
                 keychain,
             })
         }
    @@ -3372,7 +3384,7 @@
             keychain: KeychainKind,
             index: u32,
         ) -> anyhow::Result<impl Iterator<Item = AddressInfo> + '_> {
    -        let (spk_iter, index_changeset) = self
    +        let (spks, index_changeset) = self
                 .indexed_graph
                 .index
                 .reveal_to_target(&keychain, index)
    @@ -3381,7 +3393,7 @@
             self.persist
                 .stage_and_commit(indexed_tx_graph::ChangeSet::from(index_changeset).into())?;
     
    -        Ok(spk_iter.map(move |(index, spk)| AddressInfo {
    +        Ok(spks.into_iter().map(move |(index, spk)| AddressInfo {
                 index,
                 address: Address::from_script(&spk, self.network).expect("must have address form"),
                 keychain,
    @@ -3409,7 +3421,8 @@
     
             Ok(AddressInfo {
                 index,
    -            address: Address::from_script(spk, self.network).expect("must have address form"),
    +            address: Address::from_script(spk.as_script(), self.network)
    +                .expect("must have address form"),
                 keychain,
             })
         }
    @@ -3461,7 +3474,7 @@
         ///
         /// Will only return `Some(_)` if the wallet has given out the spk.
         pub fn derivation_of_spk(&self, spk: &Script) -> Option<(KeychainKind, u32)> {
    -        self.indexed_graph.index.index_of_spk(spk)
    +        self.indexed_graph.index.index_of_spk(spk).cloned()
         }
     
         /// Return the list of unspent outputs of this wallet
    @@ -3471,7 +3484,7 @@
                 .filter_chain_unspents(
                     &self.chain,
                     self.chain.tip().block_id(),
    -                self.indexed_graph.index.outpoints(),
    +                self.indexed_graph.index.outpoints().iter().cloned(),
                 )
                 .map(|((k, i), full_txo)| new_local_utxo(k, i, full_txo))
         }
    @@ -3485,7 +3498,7 @@
                 .filter_chain_txouts(
                     &self.chain,
                     self.chain.tip().block_id(),
    -                self.indexed_graph.index.outpoints(),
    +                self.indexed_graph.index.outpoints().iter().cloned(),
                 )
                 .map(|((k, i), full_txo)| new_local_utxo(k, i, full_txo))
         }
    @@ -3510,7 +3523,7 @@
         /// script pubkeys the wallet is storing internally).
         pub fn all_unbounded_spk_iters(
             &self,
    -    ) -> BTreeMap<KeychainKind, impl Iterator<Item = (u32, ScriptBuf)> + Clone> {
    +    ) -> BTreeMap<KeychainKind, impl Iterator<Item = Indexed<ScriptBuf>> + Clone> {
             self.indexed_graph.index.all_unbounded_spk_iters()
         }
     
    @@ -3522,7 +3535,7 @@
         pub fn unbounded_spk_iter(
             &self,
             keychain: KeychainKind,
    -    ) -> impl Iterator<Item = (u32, ScriptBuf)> + Clone {
    +    ) -> impl Iterator<Item = Indexed<ScriptBuf>> + Clone {
             self.indexed_graph
                 .index
                 .unbounded_spk_iter(&keychain)
    @@ -3532,7 +3545,7 @@
         /// Returns the utxo owned by this wallet corresponding to `outpoint` if it exists in the
         /// wallet's database.
         pub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput> {
    -        let (keychain, index, _) = self.indexed_graph.index.txout(op)?;
    +        let ((keychain, index), _) = self.indexed_graph.index.txout(op)?;
             self.indexed_graph
                 .graph()
                 .filter_chain_unspents(
    @@ -3807,7 +3820,7 @@
             self.indexed_graph.graph().balance(
                 &self.chain,
                 self.chain.tip().block_id(),
    -            self.indexed_graph.index.outpoints(),
    +            self.indexed_graph.index.outpoints().iter().cloned(),
                 |&(k, _), _| k == KeychainKind::Internal,
             )
         }
    @@ -4111,7 +4124,6 @@
                         .index
                         .next_unused_spk(&change_keychain)
                         .expect("keychain must exist");
    -                let spk = spk.into();
                     self.indexed_graph.index.mark_used(change_keychain, index);
                     self.persist
                         .stage(ChangeSet::from(indexed_tx_graph::ChangeSet::from(
    @@ -4299,7 +4311,7 @@
                         .into();
     
                     let weighted_utxo = match txout_index.index_of_spk(&txout.script_pubkey) {
    -                    Some((keychain, derivation_index)) => {
    +                    Some(&(keychain, derivation_index)) => {
                             let satisfaction_weight = self
                                 .get_descriptor_for_keychain(keychain)
                                 .max_weight_to_satisfy()
    @@ -4344,7 +4356,7 @@
                 for (index, txout) in tx.output.iter().enumerate() {
                     let change_keychain = KeychainKind::Internal;
                     match txout_index.index_of_spk(&txout.script_pubkey) {
    -                    Some((keychain, _)) if keychain == change_keychain => {
    +                    Some((keychain, _)) if *keychain == change_keychain => {
                             change_index = Some(index)
                         }
                         _ => {}
    @@ -4615,13 +4627,13 @@
                 if let Some((keychain, index)) = txout_index.index_of_spk(&txout.script_pubkey) {
                     // NOTE: unmark_used will **not** make something unused if it has actually been used
                     // by a tx in the tracker. It only removes the superficial marking.
    -                txout_index.unmark_used(keychain, index);
    +                txout_index.unmark_used(*keychain, *index);
                 }
             }
         }
     
         fn get_descriptor_for_txout(&self, txout: &TxOut) -> Option<DerivedDescriptor> {
    -        let (keychain, child) = self
    +        let &(keychain, child) = self
                 .indexed_graph
                 .index
                 .index_of_spk(&txout.script_pubkey)?;
    @@ -4837,7 +4849,7 @@
         ) -> Result<psbt::Input, CreateTxError> {
             // Try to find the prev_script in our db to figure out if this is internal or external,
             // and the derivation index
    -        let (keychain, child) = self
    +        let &(keychain, child) = self
                 .indexed_graph
                 .index
                 .index_of_spk(&utxo.txout.script_pubkey)
    @@ -4885,7 +4897,7 @@
     
             // Try to figure out the keychain and derivation for every input and output
             for (is_input, index, out) in utxos.into_iter() {
    -            if let Some((keychain, child)) =
    +            if let Some(&(keychain, child)) =
                     self.indexed_graph.index.index_of_spk(&out.script_pubkey)
                 {
                     let desc = self.get_descriptor_for_keychain(keychain);
    @@ -4931,7 +4943,7 @@
                 None => ChangeSet::default(),
             };
     
    -        let (_, index_changeset) = self
    +        let index_changeset = self
                 .indexed_graph
                 .index
                 .reveal_to_target_multi(&update.last_active_indices);
    @@ -5136,17 +5148,27 @@
     ) -> Result<(Arc<SignersContainer>, Arc<SignersContainer>), DescriptorError> {
         let descriptor = into_wallet_descriptor_checked(descriptor, secp, network)?;
         let change_descriptor = into_wallet_descriptor_checked(change_descriptor, secp, network)?;
    -    if descriptor.0 == change_descriptor.0 {
    -        return Err(DescriptorError::ExternalAndInternalAreTheSame);
    -    }
    -
         let (descriptor, keymap) = descriptor;
         let signers = Arc::new(SignersContainer::build(keymap, &descriptor, secp));
    -    let _ = index.insert_descriptor(KeychainKind::External, descriptor);
    +    let _ = index
    +        .insert_descriptor(KeychainKind::External, descriptor)
    +        .expect("this is the first descriptor we're inserting");
     
         let (descriptor, keymap) = change_descriptor;
         let change_signers = Arc::new(SignersContainer::build(keymap, &descriptor, secp));
    -    let _ = index.insert_descriptor(KeychainKind::Internal, descriptor);
    +    let _ = index
    +        .insert_descriptor(KeychainKind::Internal, descriptor)
    +        .map_err(|e| {
    +            use bdk_chain::keychain::InsertDescriptorError;
    +            match e {
    +                InsertDescriptorError::DescriptorAlreadyAssigned { .. } => {
    +                    crate::descriptor::error::Error::ExternalAndInternalAreTheSame
    +                }
    +                InsertDescriptorError::KeychainAlreadyAssigned { .. } => {
    +                    unreachable!("this is the first time we're assigning internal")
    +                }
    +            }
    +        })?;
     
         Ok((signers, change_signers))
     }
    diff --git a/docs-rs/bdk/nightly/latest/src/example_bitcoind_rpc_polling/main.rs.html b/docs-rs/bdk/nightly/latest/src/example_bitcoind_rpc_polling/main.rs.html
    index bd917525dc..8adbc39aa3 100644
    --- a/docs-rs/bdk/nightly/latest/src/example_bitcoind_rpc_polling/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/example_bitcoind_rpc_polling/main.rs.html
    @@ -595,7 +595,7 @@
                             graph.graph().balance(
                                 &*chain,
                                 synced_to.block_id(),
    -                            graph.index.outpoints(),
    +                            graph.index.outpoints().iter().cloned(),
                                 |(k, _), _| k == &Keychain::Internal,
                             )
                         };
    @@ -719,7 +719,7 @@
                             graph.graph().balance(
                                 &*chain,
                                 synced_to.block_id(),
    -                            graph.index.outpoints(),
    +                            graph.index.outpoints().iter().cloned(),
                                 |(k, _), _| k == &Keychain::Internal,
                             )
                         };
    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 5043c503e8..71f3a8521b 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
    @@ -734,9 +734,6 @@
     734
     735
     736
    -737
    -738
    -739
     
    pub use anyhow;
     use anyhow::Context;
     use bdk_coin_select::{coin_select_bnb, CoinSelector, CoinSelectorOpt, WeightedValue};
    @@ -1004,9 +1001,6 @@
             .expect("Must exist");
         changeset.append(change_changeset);
     
    -    // Clone to drop the immutable reference.
    -    let change_script = change_script.into();
    -
         let change_plan = bdk_tmp_plan::plan_satisfaction(
             &graph
                 .index
    @@ -1166,7 +1160,7 @@
         let outpoints = graph.index.outpoints();
         graph
             .graph()
    -        .try_filter_chain_unspents(chain, chain_tip, outpoints)
    +        .try_filter_chain_unspents(chain, chain_tip, outpoints.iter().cloned())
             .filter_map(|r| -> Option<Result<PlannedUtxo<K, A>, _>> {
                 let (k, i, full_txo) = match r {
                     Err(err) => return Some(Err(err)),
    @@ -1220,8 +1214,8 @@
                             local_chain::ChangeSet::default(),
                             indexed_tx_graph::ChangeSet::from(index_changeset),
                         )))?;
    -                    let addr =
    -                        Address::from_script(spk, network).context("failed to derive address")?;
    +                    let addr = Address::from_script(spk.as_script(), network)
    +                        .context("failed to derive address")?;
                         println!("[address @ {}] {}", spk_i, addr);
                         Ok(())
                     }
    @@ -1266,7 +1260,7 @@
                 let balance = graph.graph().try_balance(
                     chain,
                     chain.get_chain_tip()?,
    -                graph.index.outpoints(),
    +                graph.index.outpoints().iter().cloned(),
                     |(k, _), _| k == &Keychain::Internal,
                 )?;
     
    @@ -1307,7 +1301,7 @@
                     } => {
                         let txouts = graph
                             .graph()
    -                        .try_filter_chain_txouts(chain, chain_tip, outpoints)
    +                        .try_filter_chain_txouts(chain, chain_tip, outpoints.iter().cloned())
                             .filter(|r| match r {
                                 Ok((_, full_txo)) => match (spent, unspent) {
                                     (true, false) => full_txo.spent_by.is_some(),
    @@ -1448,7 +1442,7 @@
         // them in the index here. However, the keymap is not stored in the database.
         let (descriptor, mut keymap) =
             Descriptor::<DescriptorPublicKey>::parse_descriptor(&secp, &args.descriptor)?;
    -    let _ = index.insert_descriptor(Keychain::External, descriptor);
    +    let _ = index.insert_descriptor(Keychain::External, descriptor)?;
     
         if let Some((internal_descriptor, internal_keymap)) = args
             .change_descriptor
    @@ -1457,7 +1451,7 @@
             .transpose()?
         {
             keymap.extend(internal_keymap);
    -        let _ = index.insert_descriptor(Keychain::Internal, internal_descriptor);
    +        let _ = index.insert_descriptor(Keychain::Internal, internal_descriptor)?;
         }
     
         let mut db_backend = match Store::<C>::open_or_create_new(db_magic, &args.db_path) {
    diff --git a/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html b/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html
    index 2c9fbba4f0..18a9a0b9fa 100644
    --- a/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/example_electrum/main.rs.html
    @@ -351,6 +351,10 @@
     351
     352
     353
    +354
    +355
    +356
    +357
     
    use std::{
         io::{self, Write},
         sync::Mutex,
    @@ -581,9 +585,9 @@
                     let all_spks = graph
                         .index
                         .revealed_spks(..)
    -                    .map(|(k, i, spk)| (k.to_owned(), i, spk.to_owned()))
    +                    .map(|(index, spk)| (index, spk.to_owned()))
                         .collect::<Vec<_>>();
    -                request = request.chain_spks(all_spks.into_iter().map(|(k, spk_i, spk)| {
    +                request = request.chain_spks(all_spks.into_iter().map(|((k, spk_i), spk)| {
                         eprint!("Scanning {}: {}", k, spk_i);
                         spk
                     }));
    @@ -592,10 +596,10 @@
                     let unused_spks = graph
                         .index
                         .unused_spks()
    -                    .map(|(k, i, spk)| (k, i, spk.to_owned()))
    +                    .map(|(index, spk)| (index, spk.to_owned()))
                         .collect::<Vec<_>>();
                     request =
    -                    request.chain_spks(unused_spks.into_iter().map(move |(k, spk_i, spk)| {
    +                    request.chain_spks(unused_spks.into_iter().map(move |((k, spk_i), spk)| {
                             eprint!(
                                 "Checking if address {} {}:{} has been used",
                                 Address::from_script(&spk, args.network).unwrap(),
    @@ -611,7 +615,11 @@
     
                     let utxos = graph
                         .graph()
    -                    .filter_chain_unspents(&*chain, chain_tip.block_id(), init_outpoints)
    +                    .filter_chain_unspents(
    +                        &*chain,
    +                        chain_tip.block_id(),
    +                        init_outpoints.iter().cloned(),
    +                    )
                         .map(|(_, utxo)| utxo)
                         .collect::<Vec<_>>();
                     request = request.chain_outpoints(utxos.into_iter().map(|utxo| {
    @@ -691,7 +699,7 @@
             let mut indexed_tx_graph_changeset =
                 indexed_tx_graph::ChangeSet::<ConfirmationHeightAnchor, _>::default();
             if let Some(keychain_update) = keychain_update {
    -            let (_, keychain_changeset) = graph.index.reveal_to_target_multi(&keychain_update);
    +            let keychain_changeset = graph.index.reveal_to_target_multi(&keychain_update);
                 indexed_tx_graph_changeset.append(keychain_changeset.into());
             }
             indexed_tx_graph_changeset.append(graph.apply_update(graph_update));
    diff --git a/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html b/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html
    index 8c7cc986f1..7123c3c136 100644
    --- a/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html
    +++ b/docs-rs/bdk/nightly/latest/src/example_esplora/main.rs.html
    @@ -361,6 +361,10 @@
     361
     362
     363
    +364
    +365
    +366
    +367
     
    use std::{
         collections::BTreeSet,
         io::{self, Write},
    @@ -567,7 +571,7 @@
                 // addresses derived so we need to derive up to last active addresses the scan found
                 // before adding the transactions.
                 (chain.apply_update(update.chain_update)?, {
    -                let (_, index_changeset) = graph
    +                let index_changeset = graph
                         .index
                         .reveal_to_target_multi(&update.last_active_indices);
                     let mut indexed_tx_graph_changeset = graph.apply_update(update.graph_update);
    @@ -608,7 +612,7 @@
                         let all_spks = graph
                             .index
                             .revealed_spks(..)
    -                        .map(|(k, i, spk)| (k.to_owned(), i, spk.to_owned()))
    +                        .map(|((k, i), spk)| (k, i, spk.to_owned()))
                             .collect::<Vec<_>>();
                         request = request.chain_spks(all_spks.into_iter().map(|(k, i, spk)| {
                             eprint!("scanning {}:{}", k, i);
    @@ -621,10 +625,10 @@
                         let unused_spks = graph
                             .index
                             .unused_spks()
    -                        .map(|(k, i, spk)| (k, i, spk.to_owned()))
    +                        .map(|(index, spk)| (index, spk.to_owned()))
                             .collect::<Vec<_>>();
                         request =
    -                        request.chain_spks(unused_spks.into_iter().map(move |(k, i, spk)| {
    +                        request.chain_spks(unused_spks.into_iter().map(move |((k, i), spk)| {
                                 eprint!(
                                     "Checking if address {} {}:{} has been used",
                                     Address::from_script(&spk, args.network).unwrap(),
    @@ -643,7 +647,11 @@
                         let init_outpoints = graph.index.outpoints();
                         let utxos = graph
                             .graph()
    -                        .filter_chain_unspents(&*chain, local_tip.block_id(), init_outpoints)
    +                        .filter_chain_unspents(
    +                            &*chain,
    +                            local_tip.block_id(),
    +                            init_outpoints.iter().cloned(),
    +                        )
                             .map(|(_, utxo)| utxo)
                             .collect::<Vec<_>>();
                         request = request.chain_outpoints(
    diff --git a/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Append.js b/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Append.js
    index f233683400..07fbb5e61e 100644
    --- a/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Append.js
    +++ b/docs-rs/bdk/nightly/latest/trait.impl/bdk_chain/tx_data_traits/trait.Append.js
    @@ -1,4 +1,4 @@
     (function() {var implementors = {
     "bdk_chain":[],
    -"bdk_persist":[["impl<K: Ord, A: Anchor> Append for CombinedChangeSet<K, A>"]]
    +"bdk_persist":[["impl<K: Ord, A: Anchor> Append for 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/bdk_persist/persist/trait.PersistBackend.js b/docs-rs/bdk/nightly/latest/trait.impl/bdk_persist/persist/trait.PersistBackend.js
    index 52fe17caf5..cccad41209 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_file_store":[["impl<C> PersistBackend<C> for Store<C>"]], "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/clone/trait.Clone.js b/docs-rs/bdk/nightly/latest/trait.impl/core/clone/trait.Clone.js index 63ca09f61c..bec1ab5391 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/clone/trait.Clone.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/clone/trait.Clone.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk_chain":[["impl Clone for ConfirmationTime"],["impl Clone for ApplyHeaderError"],["impl Clone for Balance"],["impl Clone for AlterCheckPointError"],["impl Clone for CannotConnectError"],["impl Clone for CheckPoint"],["impl Clone for LocalChain"],["impl Clone for MissingGenesisError"],["impl Clone for BlockId"],["impl Clone for ConfirmationHeightAnchor"],["impl Clone for ConfirmationTimeHeightAnchor"],["impl Clone for DescriptorId"],["impl<'a, T: Clone, A: Clone> Clone for CanonicalTx<'a, T, A>"],["impl<'a, T: Clone, A: Clone> Clone for TxNode<'a, T, A>"],["impl<A: Clone> Clone for ChainPosition<A>"],["impl<A: Clone> Clone for FullTxOut<A>"],["impl<A: Clone> Clone for ChangeSet<A>"],["impl<A: Clone> Clone for TxGraph<A>"],["impl<A: Clone, IA: Clone> Clone for ChangeSet<A, IA>"],["impl<D: Clone> Clone for SpkIterator<D>"],["impl<I: Clone> Clone for SpkTxOutIndex<I>"],["impl<K: Clone> Clone for ChangeSet<K>"],["impl<K: Clone> Clone for KeychainTxOutIndex<K>"]], +"bdk_chain":[["impl Clone for ConfirmationTime"],["impl Clone for ApplyHeaderError"],["impl Clone for Balance"],["impl Clone for AlterCheckPointError"],["impl Clone for CannotConnectError"],["impl Clone for CheckPoint"],["impl Clone for LocalChain"],["impl Clone for MissingGenesisError"],["impl Clone for BlockId"],["impl Clone for ConfirmationHeightAnchor"],["impl Clone for ConfirmationTimeHeightAnchor"],["impl Clone for DescriptorId"],["impl<'a, T: Clone, A: Clone> Clone for CanonicalTx<'a, T, A>"],["impl<'a, T: Clone, A: Clone> Clone for TxNode<'a, T, A>"],["impl<A: Clone> Clone for ChainPosition<A>"],["impl<A: Clone> Clone for FullTxOut<A>"],["impl<A: Clone> Clone for ChangeSet<A>"],["impl<A: Clone> Clone for TxGraph<A>"],["impl<A: Clone, IA: Clone> Clone for ChangeSet<A, IA>"],["impl<D: Clone> Clone for SpkIterator<D>"],["impl<I: Clone> Clone for SpkTxOutIndex<I>"],["impl<K: Clone> Clone for InsertDescriptorError<K>"],["impl<K: Clone> Clone for ChangeSet<K>"],["impl<K: Clone> Clone for KeychainTxOutIndex<K>"],["impl<K: Clone> Clone for NoSuchKeychain<K>"]], "bdk_coin_select":[["impl Clone for ExcessStrategyKind"],["impl Clone for SelectionConstraint"],["impl Clone for CoinSelectorOpt"],["impl Clone for ExcessStrategy"],["impl Clone for Selection"],["impl Clone for SelectionError"],["impl Clone for WeightedValue"],["impl<'a> Clone for CoinSelector<'a>"]], "bdk_persist":[["impl<K: Clone, A: Clone> Clone for CombinedChangeSet<K, A>"]], "bdk_tmp_plan":[["impl Clone for SigningError"],["impl Clone for SatisfactionMaterial"],["impl<AK: Clone> Clone for Plan<AK>"],["impl<Ak: Clone> Clone for RequiredSignatures<Ak>"],["impl<Ak: Clone> Clone for PlanKey<Ak>"],["impl<Ak: Clone> Clone for Requirements<Ak>"],["impl<K: Clone> Clone for Assets<K>"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.Eq.js b/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.Eq.js index 53b5dffb5f..8134cd02ff 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.Eq.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.Eq.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk_chain":[["impl Eq for ConfirmationTime"],["impl Eq for CalculateFeeError"],["impl Eq for Balance"],["impl Eq for BlockId"],["impl Eq for ConfirmationHeightAnchor"],["impl Eq for ConfirmationTimeHeightAnchor"],["impl Eq for DescriptorId"],["impl<'a, T: Eq, A: Eq> Eq for CanonicalTx<'a, T, A>"],["impl<'a, T: Eq, A: Eq> Eq for TxNode<'a, T, A>"],["impl<A: Eq> Eq for ChainPosition<A>"],["impl<A: Eq> Eq for FullTxOut<A>"]], +"bdk_chain":[["impl Eq for ConfirmationTime"],["impl Eq for CalculateFeeError"],["impl Eq for Balance"],["impl Eq for BlockId"],["impl Eq for ConfirmationHeightAnchor"],["impl Eq for ConfirmationTimeHeightAnchor"],["impl Eq for DescriptorId"],["impl<'a, T: Eq, A: Eq> Eq for CanonicalTx<'a, T, A>"],["impl<'a, T: Eq, A: Eq> Eq for TxNode<'a, T, A>"],["impl<A: Eq> Eq for ChainPosition<A>"],["impl<A: Eq> Eq for FullTxOut<A>"],["impl<K: Eq> Eq for NoSuchKeychain<K>"]], "bdk_coin_select":[["impl Eq for ExcessStrategyKind"],["impl Eq for SelectionConstraint"]], "bdk_wallet":[["impl Eq for PkOrF"],["impl Eq for PolicyError"],["impl Eq for Satisfaction"],["impl Eq for SatisfiableItem"],["impl Eq for KeychainKind"],["impl Eq for Utxo"],["impl Eq for ScriptContextEnum"],["impl Eq for SignerContext"],["impl Eq for SignerId"],["impl Eq for TapLeavesOptions"],["impl Eq for ChangeSpendPolicy"],["impl Eq for TxOrdering"],["impl Eq for Condition"],["impl Eq for Policy"],["impl Eq for LocalOutput"],["impl Eq for WeightedUtxo"],["impl Eq for SignerOrdering"],["impl Eq for AddressInfo"]], "example_cli":[["impl Eq for Keychain"]] diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.PartialEq.js b/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.PartialEq.js index f19cf22bc4..147e590700 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.PartialEq.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/cmp/trait.PartialEq.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk_chain":[["impl PartialEq for ConfirmationTime"],["impl PartialEq for ApplyHeaderError"],["impl PartialEq for CalculateFeeError"],["impl PartialEq for Balance"],["impl PartialEq for AlterCheckPointError"],["impl PartialEq for CannotConnectError"],["impl PartialEq for CheckPoint"],["impl PartialEq for LocalChain"],["impl PartialEq for MissingGenesisError"],["impl PartialEq for BlockId"],["impl PartialEq for ConfirmationHeightAnchor"],["impl PartialEq for ConfirmationTimeHeightAnchor"],["impl PartialEq for DescriptorId"],["impl<'a, T: PartialEq, A: PartialEq> PartialEq for CanonicalTx<'a, T, A>"],["impl<'a, T: PartialEq, A: PartialEq> PartialEq for TxNode<'a, T, A>"],["impl<A: PartialEq> PartialEq for ChainPosition<A>"],["impl<A: PartialEq> PartialEq for FullTxOut<A>"],["impl<A: PartialEq> PartialEq for ChangeSet<A>"],["impl<A: PartialEq> PartialEq for TxGraph<A>"],["impl<A: PartialEq, IA: PartialEq> PartialEq for ChangeSet<A, IA>"],["impl<K: PartialEq> PartialEq for ChangeSet<K>"]], +"bdk_chain":[["impl PartialEq for ConfirmationTime"],["impl PartialEq for ApplyHeaderError"],["impl PartialEq for CalculateFeeError"],["impl PartialEq for Balance"],["impl PartialEq for AlterCheckPointError"],["impl PartialEq for CannotConnectError"],["impl PartialEq for CheckPoint"],["impl PartialEq for LocalChain"],["impl PartialEq for MissingGenesisError"],["impl PartialEq for BlockId"],["impl PartialEq for ConfirmationHeightAnchor"],["impl PartialEq for ConfirmationTimeHeightAnchor"],["impl PartialEq for DescriptorId"],["impl<'a, T: PartialEq, A: PartialEq> PartialEq for CanonicalTx<'a, T, A>"],["impl<'a, T: PartialEq, A: PartialEq> PartialEq for TxNode<'a, T, A>"],["impl<A: PartialEq> PartialEq for ChainPosition<A>"],["impl<A: PartialEq> PartialEq for FullTxOut<A>"],["impl<A: PartialEq> PartialEq for ChangeSet<A>"],["impl<A: PartialEq> PartialEq for TxGraph<A>"],["impl<A: PartialEq, IA: PartialEq> PartialEq for ChangeSet<A, IA>"],["impl<K: PartialEq> PartialEq for InsertDescriptorError<K>"],["impl<K: PartialEq> PartialEq for ChangeSet<K>"],["impl<K: PartialEq> PartialEq for NoSuchKeychain<K>"]], "bdk_coin_select":[["impl PartialEq for ExcessStrategyKind"],["impl PartialEq for SelectionConstraint"]], "bdk_persist":[["impl<K: PartialEq, A: PartialEq> PartialEq for CombinedChangeSet<K, A>"]], "bdk_wallet":[["impl PartialEq for PkOrF"],["impl PartialEq for PolicyError"],["impl PartialEq for Satisfaction"],["impl PartialEq for SatisfiableItem"],["impl PartialEq for KeychainKind"],["impl PartialEq for Utxo"],["impl PartialEq for ScriptContextEnum"],["impl PartialEq for SignerContext"],["impl PartialEq for SignerId"],["impl PartialEq for TapLeavesOptions"],["impl PartialEq for ChangeSpendPolicy"],["impl PartialEq for TxOrdering"],["impl PartialEq for Condition"],["impl PartialEq for Policy"],["impl PartialEq for LocalOutput"],["impl PartialEq for WeightedUtxo"],["impl PartialEq for SignerOrdering"],["impl PartialEq for AddressInfo"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js index 74f23a71da..dbd166d78e 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.AsRef.js @@ -1,4 +1,4 @@ (function() {var implementors = { "bdk_chain":[["impl AsRef<[u8; 32]> for DescriptorId"],["impl AsRef<[u8]> for DescriptorId"],["impl<A> AsRef<TxGraph<A>> for TxGraph<A>"],["impl<A, I> AsRef<TxGraph<A>> for IndexedTxGraph<A, I>"]], -"bdk_wallet":[["impl AsRef<TxGraph<ConfirmationTimeHeightAnchor>> for Wallet"],["impl AsRef<[u8]> for KeychainKind"]] +"bdk_wallet":[["impl AsRef<TxGraph<ConfirmationTimeHeightAnchor>> for Wallet"],["impl AsRef<[u8]> for KeychainKind"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js b/docs-rs/bdk/nightly/latest/trait.impl/core/convert/trait.From.js index 53151dcc28..ffa9a2c80c 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 @@ -2,8 +2,8 @@ "bdk_chain":[["impl From<(&u32, &BlockHash)> for BlockId"],["impl From<(u32, BlockHash)> for BlockId"],["impl From<ChainPosition<ConfirmationTimeHeightAnchor>> for ConfirmationTime"],["impl From<BlockId> for (u32, BlockHash)"],["impl From<DescriptorId> for Hash"],["impl From<Hash> for DescriptorId"],["impl<A, IA: Default> From<ChangeSet<A>> for ChangeSet<A, IA>"],["impl<A, K> From<ChangeSet<K>> for ChangeSet<A, ChangeSet<K>>"]], "bdk_coin_select":[["impl From<usize> for BnbLimit"],["impl From<Duration> for BnbLimit"]], "bdk_file_store":[["impl From<Error> for 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_persist":[["impl<K, A> From<ChangeSet<A, ChangeSet<K>>> for CombinedChangeSet<K, A>"],["impl<K, A> From<BTreeMap<u32, Option<BlockHash>>> for CombinedChangeSet<K, A>"]], "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>"]], +"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<FullScanResult<KeychainKind>> for Update"],["impl From<SyncResult> for Update"],["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<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<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/trait.impl/core/error/trait.Error.js b/docs-rs/bdk/nightly/latest/trait.impl/core/error/trait.Error.js index 3767f03388..b4b077aba8 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/error/trait.Error.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/error/trait.Error.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk_chain":[["impl Error for ApplyHeaderError"],["impl Error for CalculateFeeError"],["impl Error for AlterCheckPointError"],["impl Error for CannotConnectError"],["impl Error for MissingGenesisError"]], +"bdk_chain":[["impl Error for ApplyHeaderError"],["impl Error for CalculateFeeError"],["impl Error for AlterCheckPointError"],["impl Error for CannotConnectError"],["impl Error for MissingGenesisError"],["impl<K: Debug> Error for InsertDescriptorError<K>"]], "bdk_coin_select":[["impl Error for SelectionError"]], "bdk_file_store":[["impl Error for FileError"],["impl Error for IterError"],["impl<C: Debug> Error for AggregateChangesetsError<C>"]], "bdk_sqlite":[["impl Error for Error"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js b/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js index 4b3d2287c1..4e2755905a 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Debug.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<B: Debug> Debug for BlockEvent<B>"]], -"bdk_chain":[["impl Debug for ConfirmationTime"],["impl Debug for ApplyHeaderError"],["impl Debug for CalculateFeeError"],["impl Debug for Balance"],["impl Debug for AlterCheckPointError"],["impl Debug for CannotConnectError"],["impl Debug for CheckPoint"],["impl Debug for LocalChain"],["impl Debug for MissingGenesisError"],["impl Debug for BlockId"],["impl Debug for ConfirmationHeightAnchor"],["impl Debug for ConfirmationTimeHeightAnchor"],["impl Debug for DescriptorId"],["impl<'a, T: Debug, A: Debug> Debug for CanonicalTx<'a, T, A>"],["impl<'a, T: Debug, A: Debug> Debug for TxNode<'a, T, A>"],["impl<A: Debug> Debug for ChainPosition<A>"],["impl<A: Debug> Debug for FullTxOut<A>"],["impl<A: Debug> Debug for ChangeSet<A>"],["impl<A: Debug> Debug for TxGraph<A>"],["impl<A: Debug, I: Debug> Debug for IndexedTxGraph<A, I>"],["impl<A: Debug, IA: Debug> Debug for ChangeSet<A, IA>"],["impl<I: Debug> Debug for SpkTxOutIndex<I>"],["impl<K: Debug> Debug for ChangeSet<K>"],["impl<K: Debug> Debug for KeychainTxOutIndex<K>"]], +"bdk_chain":[["impl Debug for ConfirmationTime"],["impl Debug for ApplyHeaderError"],["impl Debug for CalculateFeeError"],["impl Debug for Balance"],["impl Debug for AlterCheckPointError"],["impl Debug for CannotConnectError"],["impl Debug for CheckPoint"],["impl Debug for LocalChain"],["impl Debug for MissingGenesisError"],["impl Debug for BlockId"],["impl Debug for ConfirmationHeightAnchor"],["impl Debug for ConfirmationTimeHeightAnchor"],["impl Debug for DescriptorId"],["impl<'a, T: Debug, A: Debug> Debug for CanonicalTx<'a, T, A>"],["impl<'a, T: Debug, A: Debug> Debug for TxNode<'a, T, A>"],["impl<A: Debug> Debug for ChainPosition<A>"],["impl<A: Debug> Debug for FullTxOut<A>"],["impl<A: Debug> Debug for ChangeSet<A>"],["impl<A: Debug> Debug for TxGraph<A>"],["impl<A: Debug, I: Debug> Debug for IndexedTxGraph<A, I>"],["impl<A: Debug, IA: Debug> Debug for ChangeSet<A, IA>"],["impl<I: Debug> Debug for SpkTxOutIndex<I>"],["impl<K: Debug> Debug for InsertDescriptorError<K>"],["impl<K: Debug> Debug for ChangeSet<K>"],["impl<K: Debug> Debug for KeychainTxOutIndex<K>"],["impl<K: Debug> Debug for NoSuchKeychain<K>"]], "bdk_coin_select":[["impl Debug for ExcessStrategyKind"],["impl Debug for SelectionConstraint"],["impl Debug for CoinSelectorOpt"],["impl Debug for ExcessStrategy"],["impl Debug for Selection"],["impl Debug for SelectionError"],["impl Debug for WeightedValue"],["impl<'a> Debug for CoinSelector<'a>"]], "bdk_electrum":[["impl<E: Debug> Debug for BdkElectrumClient<E>"]], "bdk_file_store":[["impl Debug for FileError"],["impl Debug for IterError"],["impl<C> Debug for Store<C>
    where\n C: Sync + Send + Debug,
    "],["impl<C: Debug> Debug for AggregateChangesetsError<C>"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Display.js b/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Display.js index 82aafac8c4..edae6eed43 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Display.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/fmt/trait.Display.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk_chain":[["impl Display for ApplyHeaderError"],["impl Display for CalculateFeeError"],["impl Display for Balance"],["impl Display for AlterCheckPointError"],["impl Display for CannotConnectError"],["impl Display for MissingGenesisError"],["impl Display for DescriptorId"]], +"bdk_chain":[["impl Display for ApplyHeaderError"],["impl Display for CalculateFeeError"],["impl Display for Balance"],["impl Display for AlterCheckPointError"],["impl Display for CannotConnectError"],["impl Display for MissingGenesisError"],["impl Display for DescriptorId"],["impl<K: Debug> Display for InsertDescriptorError<K>"],["impl<K: Debug> Display for NoSuchKeychain<K>"]], "bdk_coin_select":[["impl Display for ExcessStrategyKind"],["impl Display for SelectionConstraint"],["impl Display for SelectionError"]], "bdk_file_store":[["impl Display for FileError"],["impl Display for IterError"],["impl<C> Display for AggregateChangesetsError<C>"]], "bdk_sqlite":[["impl Display for Error"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js index 1e469f9a03..0056774fbb 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Freeze.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<'c, C> Freeze for Emitter<'c, C>",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Freeze for BlockEvent<B>
    where\n B: Freeze,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl Freeze for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Freeze for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Freeze for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Freeze for Balance",1,["bdk_chain::keychain::Balance"]],["impl Freeze for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Freeze for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Freeze for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Freeze for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Freeze for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Freeze for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Freeze for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Freeze for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Freeze for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Freeze for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Freeze for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Freeze for CanonicalTx<'a, T, A>
    where\n T: Freeze,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Freeze for TxNode<'a, T, A>
    where\n T: Freeze,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Freeze for TxAncestors<'g, A, F>
    where\n F: Freeze,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Freeze for TxDescendants<'g, A, F>
    where\n F: Freeze,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Freeze for ChainPosition<A>
    where\n A: Freeze,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Freeze for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Freeze for FullTxOut<A>
    where\n A: Freeze,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Freeze for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Freeze for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Freeze for IndexedTxGraph<A, I>
    where\n I: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Freeze for ChangeSet<A, IA>
    where\n IA: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Freeze for SpkIterator<D>
    where\n D: Freeze,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Freeze for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Freeze for ChangeSet<K>",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Freeze for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Freeze for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Freeze for FullScanResult<K, A>",1,["bdk_chain::spk_client::FullScanResult"]]], +"bdk_chain":[["impl Freeze for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Freeze for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Freeze for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Freeze for Balance",1,["bdk_chain::keychain::Balance"]],["impl Freeze for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Freeze for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Freeze for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Freeze for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Freeze for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Freeze for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Freeze for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Freeze for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Freeze for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Freeze for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Freeze for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Freeze for CanonicalTx<'a, T, A>
    where\n T: Freeze,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Freeze for TxNode<'a, T, A>
    where\n T: Freeze,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Freeze for TxAncestors<'g, A, F>
    where\n F: Freeze,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Freeze for TxDescendants<'g, A, F>
    where\n F: Freeze,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Freeze for ChainPosition<A>
    where\n A: Freeze,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Freeze for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Freeze for FullTxOut<A>
    where\n A: Freeze,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Freeze for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Freeze for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Freeze for IndexedTxGraph<A, I>
    where\n I: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Freeze for ChangeSet<A, IA>
    where\n IA: Freeze,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Freeze for SpkIterator<D>
    where\n D: Freeze,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Freeze for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !Freeze for InsertDescriptorError<K>",1,["bdk_chain::keychain::txout_index::InsertDescriptorError"]],["impl<K> Freeze for ChangeSet<K>",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Freeze for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Freeze for NoSuchKeychain<K>
    where\n K: Freeze,
    ",1,["bdk_chain::keychain::txout_index::NoSuchKeychain"]],["impl<K> Freeze for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Freeze for FullScanResult<K, A>",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Freeze for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Freeze for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Freeze for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Freeze for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Freeze for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Freeze for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Freeze for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Freeze for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Freeze for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Freeze for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> Freeze for BnbIter<'c, 'f, S>
    where\n S: Freeze,
    ",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Freeze for Bnb<'c, S>
    where\n S: Freeze,
    ",1,["bdk_coin_select::bnb::Bnb"]]], "bdk_electrum":[["impl Freeze for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> !Freeze for BdkElectrumClient<E>",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Freeze for ElectrumFullScanResult<K>",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Freeze for FileError",1,["bdk_file_store::FileError"]],["impl Freeze for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Freeze for EntryIter<'t, T>",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Freeze for AggregateChangesetsError<C>
    where\n C: Freeze,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Freeze for Store<C>",1,["bdk_file_store::store::Store"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js index 8ce2dc9c7c..4d03041d57 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Send.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<'c, C> Send for Emitter<'c, C>
    where\n C: Sync,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Send for BlockEvent<B>
    where\n B: Send,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl Send for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Send for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Send for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Send for Balance",1,["bdk_chain::keychain::Balance"]],["impl Send for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Send for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Send for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Send for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Send for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Send for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Send for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Send for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Send for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Send for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Send for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Send for CanonicalTx<'a, T, A>
    where\n T: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Send for TxNode<'a, T, A>
    where\n T: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Send for TxAncestors<'g, A, F>
    where\n F: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Send for TxDescendants<'g, A, F>
    where\n F: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Send for ChainPosition<A>
    where\n A: Send,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Send for SyncResult<A>
    where\n A: Send,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Send for FullTxOut<A>
    where\n A: Send,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Send for ChangeSet<A>
    where\n A: Send,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Send for TxGraph<A>
    where\n A: Send,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Send for IndexedTxGraph<A, I>
    where\n I: Send,\n A: Send,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Send for ChangeSet<A, IA>
    where\n IA: Send,\n A: Send,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Send for SpkIterator<D>
    where\n D: Send,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Send for SpkTxOutIndex<I>
    where\n I: Send,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Send for ChangeSet<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Send for KeychainTxOutIndex<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Send for FullScanRequest<K>
    where\n K: Send,
    ",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Send for FullScanResult<K, A>
    where\n K: Send,\n A: Send,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], +"bdk_chain":[["impl Send for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Send for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Send for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Send for Balance",1,["bdk_chain::keychain::Balance"]],["impl Send for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Send for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Send for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Send for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Send for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Send for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Send for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Send for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Send for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Send for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Send for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Send for CanonicalTx<'a, T, A>
    where\n T: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Send for TxNode<'a, T, A>
    where\n T: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Send for TxAncestors<'g, A, F>
    where\n F: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Send for TxDescendants<'g, A, F>
    where\n F: Send,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Send for ChainPosition<A>
    where\n A: Send,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Send for SyncResult<A>
    where\n A: Send,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Send for FullTxOut<A>
    where\n A: Send,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Send for ChangeSet<A>
    where\n A: Send,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Send for TxGraph<A>
    where\n A: Send,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Send for IndexedTxGraph<A, I>
    where\n I: Send,\n A: Send,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Send for ChangeSet<A, IA>
    where\n IA: Send,\n A: Send,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Send for SpkIterator<D>
    where\n D: Send,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Send for SpkTxOutIndex<I>
    where\n I: Send,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Send for InsertDescriptorError<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::InsertDescriptorError"]],["impl<K> Send for ChangeSet<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Send for KeychainTxOutIndex<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Send for NoSuchKeychain<K>
    where\n K: Send,
    ",1,["bdk_chain::keychain::txout_index::NoSuchKeychain"]],["impl<K> Send for FullScanRequest<K>
    where\n K: Send,
    ",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Send for FullScanResult<K, A>
    where\n K: Send,\n A: Send,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Send for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Send for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Send for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Send for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Send for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Send for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Send for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Send for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Send for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Send for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !Send for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Send for Bnb<'c, S>
    where\n S: Send,
    ",1,["bdk_coin_select::bnb::Bnb"]]], "bdk_electrum":[["impl Send for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> Send for BdkElectrumClient<E>
    where\n E: Send,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Send for ElectrumFullScanResult<K>
    where\n K: Send,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Send for FileError",1,["bdk_file_store::FileError"]],["impl Send for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Send for EntryIter<'t, T>
    where\n T: Send,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Send for AggregateChangesetsError<C>
    where\n C: Send,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Send for Store<C>",1,["bdk_file_store::store::Store"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.StructuralPartialEq.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.StructuralPartialEq.js index 61e7b5c59d..0a9ed01375 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.StructuralPartialEq.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -1,5 +1,5 @@ (function() {var implementors = { -"bdk_chain":[["impl StructuralPartialEq for ConfirmationTime"],["impl StructuralPartialEq for ApplyHeaderError"],["impl StructuralPartialEq for CalculateFeeError"],["impl StructuralPartialEq for Balance"],["impl StructuralPartialEq for AlterCheckPointError"],["impl StructuralPartialEq for CannotConnectError"],["impl StructuralPartialEq for LocalChain"],["impl StructuralPartialEq for MissingGenesisError"],["impl StructuralPartialEq for BlockId"],["impl StructuralPartialEq for ConfirmationHeightAnchor"],["impl StructuralPartialEq for ConfirmationTimeHeightAnchor"],["impl StructuralPartialEq for DescriptorId"],["impl<'a, T, A> StructuralPartialEq for CanonicalTx<'a, T, A>"],["impl<'a, T, A> StructuralPartialEq for TxNode<'a, T, A>"],["impl<A> StructuralPartialEq for ChainPosition<A>"],["impl<A> StructuralPartialEq for FullTxOut<A>"],["impl<A> StructuralPartialEq for ChangeSet<A>"],["impl<A> StructuralPartialEq for TxGraph<A>"],["impl<A, IA> StructuralPartialEq for ChangeSet<A, IA>"],["impl<K> StructuralPartialEq for ChangeSet<K>"]], +"bdk_chain":[["impl StructuralPartialEq for ConfirmationTime"],["impl StructuralPartialEq for ApplyHeaderError"],["impl StructuralPartialEq for CalculateFeeError"],["impl StructuralPartialEq for Balance"],["impl StructuralPartialEq for AlterCheckPointError"],["impl StructuralPartialEq for CannotConnectError"],["impl StructuralPartialEq for LocalChain"],["impl StructuralPartialEq for MissingGenesisError"],["impl StructuralPartialEq for BlockId"],["impl StructuralPartialEq for ConfirmationHeightAnchor"],["impl StructuralPartialEq for ConfirmationTimeHeightAnchor"],["impl StructuralPartialEq for DescriptorId"],["impl<'a, T, A> StructuralPartialEq for CanonicalTx<'a, T, A>"],["impl<'a, T, A> StructuralPartialEq for TxNode<'a, T, A>"],["impl<A> StructuralPartialEq for ChainPosition<A>"],["impl<A> StructuralPartialEq for FullTxOut<A>"],["impl<A> StructuralPartialEq for ChangeSet<A>"],["impl<A> StructuralPartialEq for TxGraph<A>"],["impl<A, IA> StructuralPartialEq for ChangeSet<A, IA>"],["impl<K> StructuralPartialEq for InsertDescriptorError<K>"],["impl<K> StructuralPartialEq for ChangeSet<K>"],["impl<K> StructuralPartialEq for NoSuchKeychain<K>"]], "bdk_coin_select":[["impl StructuralPartialEq for ExcessStrategyKind"],["impl StructuralPartialEq for SelectionConstraint"]], "bdk_persist":[["impl<K, A> StructuralPartialEq for CombinedChangeSet<K, A>"]], "bdk_wallet":[["impl StructuralPartialEq for PkOrF"],["impl StructuralPartialEq for PolicyError"],["impl StructuralPartialEq for Satisfaction"],["impl StructuralPartialEq for SatisfiableItem"],["impl StructuralPartialEq for KeychainKind"],["impl StructuralPartialEq for Utxo"],["impl StructuralPartialEq for ScriptContextEnum"],["impl StructuralPartialEq for SignerContext"],["impl StructuralPartialEq for SignerId"],["impl StructuralPartialEq for TapLeavesOptions"],["impl StructuralPartialEq for ChangeSpendPolicy"],["impl StructuralPartialEq for TxOrdering"],["impl StructuralPartialEq for Condition"],["impl StructuralPartialEq for Policy"],["impl StructuralPartialEq for LocalOutput"],["impl StructuralPartialEq for WeightedUtxo"],["impl StructuralPartialEq for SignerOrdering"],["impl StructuralPartialEq for AddressInfo"]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js index c9f6219943..521a4ded86 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Sync.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<'c, C> Sync for Emitter<'c, C>
    where\n C: Sync,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Sync for BlockEvent<B>
    where\n B: Sync,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl !Sync for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Sync for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Sync for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Sync for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Sync for Balance",1,["bdk_chain::keychain::Balance"]],["impl Sync for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Sync for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Sync for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Sync for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Sync for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Sync for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Sync for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Sync for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Sync for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Sync for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Sync for CanonicalTx<'a, T, A>
    where\n T: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Sync for TxNode<'a, T, A>
    where\n T: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Sync for TxAncestors<'g, A, F>
    where\n F: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Sync for TxDescendants<'g, A, F>
    where\n F: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Sync for ChainPosition<A>
    where\n A: Sync,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Sync for SyncResult<A>
    where\n A: Sync,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Sync for FullTxOut<A>
    where\n A: Sync,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Sync for ChangeSet<A>
    where\n A: Sync,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Sync for TxGraph<A>
    where\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Sync for IndexedTxGraph<A, I>
    where\n I: Sync,\n A: Sync,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Sync for ChangeSet<A, IA>
    where\n IA: Sync,\n A: Sync,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Sync for SpkIterator<D>
    where\n D: Sync,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Sync for SpkTxOutIndex<I>
    where\n I: Sync,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !Sync for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Sync for ChangeSet<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Sync for KeychainTxOutIndex<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K, A> Sync for FullScanResult<K, A>
    where\n K: Sync,\n A: Sync,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], +"bdk_chain":[["impl !Sync for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Sync for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Sync for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Sync for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Sync for Balance",1,["bdk_chain::keychain::Balance"]],["impl Sync for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Sync for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Sync for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Sync for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Sync for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Sync for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Sync for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Sync for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Sync for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Sync for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Sync for CanonicalTx<'a, T, A>
    where\n T: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Sync for TxNode<'a, T, A>
    where\n T: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Sync for TxAncestors<'g, A, F>
    where\n F: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Sync for TxDescendants<'g, A, F>
    where\n F: Sync,\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Sync for ChainPosition<A>
    where\n A: Sync,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Sync for SyncResult<A>
    where\n A: Sync,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Sync for FullTxOut<A>
    where\n A: Sync,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Sync for ChangeSet<A>
    where\n A: Sync,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Sync for TxGraph<A>
    where\n A: Sync,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Sync for IndexedTxGraph<A, I>
    where\n I: Sync,\n A: Sync,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Sync for ChangeSet<A, IA>
    where\n IA: Sync,\n A: Sync,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Sync for SpkIterator<D>
    where\n D: Sync,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Sync for SpkTxOutIndex<I>
    where\n I: Sync,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !Sync for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> Sync for InsertDescriptorError<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::InsertDescriptorError"]],["impl<K> Sync for ChangeSet<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Sync for KeychainTxOutIndex<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Sync for NoSuchKeychain<K>
    where\n K: Sync,
    ",1,["bdk_chain::keychain::txout_index::NoSuchKeychain"]],["impl<K, A> Sync for FullScanResult<K, A>
    where\n K: Sync,\n A: Sync,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Sync for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Sync for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Sync for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Sync for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Sync for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Sync for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Sync for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Sync for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Sync for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Sync for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !Sync for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Sync for Bnb<'c, S>
    where\n S: Sync,
    ",1,["bdk_coin_select::bnb::Bnb"]]], "bdk_electrum":[["impl Sync for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> Sync for BdkElectrumClient<E>
    where\n E: Sync,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Sync for ElectrumFullScanResult<K>
    where\n K: Sync,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Sync for FileError",1,["bdk_file_store::FileError"]],["impl Sync for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Sync for EntryIter<'t, T>
    where\n T: Sync,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Sync for AggregateChangesetsError<C>
    where\n C: Sync,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Sync for Store<C>",1,["bdk_file_store::store::Store"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js index a8fd731794..82027a823d 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/marker/trait.Unpin.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<'c, C> Unpin for Emitter<'c, C>",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> Unpin for BlockEvent<B>
    where\n B: Unpin,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl Unpin for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Unpin for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Unpin for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Unpin for Balance",1,["bdk_chain::keychain::Balance"]],["impl Unpin for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Unpin for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Unpin for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Unpin for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Unpin for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Unpin for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Unpin for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Unpin for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Unpin for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Unpin for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Unpin for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Unpin for CanonicalTx<'a, T, A>
    where\n T: Unpin,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Unpin for TxNode<'a, T, A>
    where\n T: Unpin,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Unpin for TxAncestors<'g, A, F>
    where\n F: Unpin,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Unpin for TxDescendants<'g, A, F>
    where\n F: Unpin,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Unpin for ChainPosition<A>
    where\n A: Unpin,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Unpin for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Unpin for FullTxOut<A>
    where\n A: Unpin,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Unpin for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Unpin for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Unpin for IndexedTxGraph<A, I>
    where\n I: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Unpin for ChangeSet<A, IA>
    where\n IA: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Unpin for SpkIterator<D>
    where\n D: Unpin,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Unpin for SpkTxOutIndex<I>
    where\n I: Unpin,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Unpin for ChangeSet<K>",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Unpin for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Unpin for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Unpin for FullScanResult<K, A>",1,["bdk_chain::spk_client::FullScanResult"]]], +"bdk_chain":[["impl Unpin for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl Unpin for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl Unpin for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl Unpin for Balance",1,["bdk_chain::keychain::Balance"]],["impl Unpin for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl Unpin for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl Unpin for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl Unpin for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl Unpin for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl Unpin for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl Unpin for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl Unpin for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl Unpin for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl Unpin for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl Unpin for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> Unpin for CanonicalTx<'a, T, A>
    where\n T: Unpin,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> Unpin for TxNode<'a, T, A>
    where\n T: Unpin,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> Unpin for TxAncestors<'g, A, F>
    where\n F: Unpin,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> Unpin for TxDescendants<'g, A, F>
    where\n F: Unpin,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> Unpin for ChainPosition<A>
    where\n A: Unpin,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> Unpin for SyncResult<A>",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> Unpin for FullTxOut<A>
    where\n A: Unpin,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> Unpin for ChangeSet<A>",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> Unpin for TxGraph<A>",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> Unpin for IndexedTxGraph<A, I>
    where\n I: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> Unpin for ChangeSet<A, IA>
    where\n IA: Unpin,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> Unpin for SpkIterator<D>
    where\n D: Unpin,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> Unpin for SpkTxOutIndex<I>
    where\n I: Unpin,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> Unpin for InsertDescriptorError<K>
    where\n K: Unpin,
    ",1,["bdk_chain::keychain::txout_index::InsertDescriptorError"]],["impl<K> Unpin for ChangeSet<K>",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> Unpin for KeychainTxOutIndex<K>
    where\n K: Unpin,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> Unpin for NoSuchKeychain<K>
    where\n K: Unpin,
    ",1,["bdk_chain::keychain::txout_index::NoSuchKeychain"]],["impl<K> Unpin for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K, A> Unpin for FullScanResult<K, A>",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl Unpin for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl Unpin for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl Unpin for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl Unpin for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl Unpin for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl Unpin for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl Unpin for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl Unpin for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl Unpin for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> Unpin for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> Unpin for BnbIter<'c, 'f, S>
    where\n S: Unpin,
    ",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> Unpin for Bnb<'c, S>
    where\n S: Unpin,
    ",1,["bdk_coin_select::bnb::Bnb"]]], "bdk_electrum":[["impl Unpin for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> Unpin for BdkElectrumClient<E>
    where\n E: Unpin,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> Unpin for ElectrumFullScanResult<K>",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl Unpin for FileError",1,["bdk_file_store::FileError"]],["impl Unpin for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> Unpin for EntryIter<'t, T>
    where\n T: Unpin,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> Unpin for AggregateChangesetsError<C>
    where\n C: Unpin,
    ",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> Unpin for Store<C>
    where\n C: Unpin,
    ",1,["bdk_file_store::store::Store"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js index 4587f9ffa8..ce12b1e2e5 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<'c, C> RefUnwindSafe for Emitter<'c, C>
    where\n C: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> RefUnwindSafe for BlockEvent<B>
    where\n B: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl !RefUnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl RefUnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl RefUnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl RefUnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl RefUnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl RefUnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl RefUnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl RefUnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl RefUnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl RefUnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl RefUnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl RefUnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl RefUnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl RefUnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl RefUnwindSafe for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> RefUnwindSafe for CanonicalTx<'a, T, A>
    where\n T: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> RefUnwindSafe for TxNode<'a, T, A>
    where\n T: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> RefUnwindSafe for TxAncestors<'g, A, F>
    where\n F: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> RefUnwindSafe for TxDescendants<'g, A, F>
    where\n F: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> RefUnwindSafe for ChainPosition<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> RefUnwindSafe for SyncResult<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> RefUnwindSafe for FullTxOut<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> RefUnwindSafe for ChangeSet<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> RefUnwindSafe for TxGraph<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> RefUnwindSafe for IndexedTxGraph<A, I>
    where\n I: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> RefUnwindSafe for ChangeSet<A, IA>
    where\n IA: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> RefUnwindSafe for SpkIterator<D>
    where\n D: RefUnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> RefUnwindSafe for SpkTxOutIndex<I>
    where\n I: RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !RefUnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> RefUnwindSafe for ChangeSet<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> RefUnwindSafe for KeychainTxOutIndex<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K, A> RefUnwindSafe for FullScanResult<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], +"bdk_chain":[["impl !RefUnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl RefUnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl RefUnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl RefUnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl RefUnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl RefUnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl RefUnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl RefUnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl RefUnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl RefUnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl RefUnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl RefUnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl RefUnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl RefUnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl RefUnwindSafe for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> RefUnwindSafe for CanonicalTx<'a, T, A>
    where\n T: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> RefUnwindSafe for TxNode<'a, T, A>
    where\n T: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> RefUnwindSafe for TxAncestors<'g, A, F>
    where\n F: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> RefUnwindSafe for TxDescendants<'g, A, F>
    where\n F: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> RefUnwindSafe for ChainPosition<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> RefUnwindSafe for SyncResult<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> RefUnwindSafe for FullTxOut<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> RefUnwindSafe for ChangeSet<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> RefUnwindSafe for TxGraph<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> RefUnwindSafe for IndexedTxGraph<A, I>
    where\n I: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> RefUnwindSafe for ChangeSet<A, IA>
    where\n IA: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> RefUnwindSafe for SpkIterator<D>
    where\n D: RefUnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> RefUnwindSafe for SpkTxOutIndex<I>
    where\n I: RefUnwindSafe,
    ",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !RefUnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> RefUnwindSafe for InsertDescriptorError<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::InsertDescriptorError"]],["impl<K> RefUnwindSafe for ChangeSet<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> RefUnwindSafe for KeychainTxOutIndex<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> RefUnwindSafe for NoSuchKeychain<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::NoSuchKeychain"]],["impl<K, A> RefUnwindSafe for FullScanResult<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl RefUnwindSafe for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl RefUnwindSafe for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl RefUnwindSafe for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl RefUnwindSafe for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl RefUnwindSafe for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl RefUnwindSafe for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl RefUnwindSafe for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl RefUnwindSafe for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl RefUnwindSafe for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> RefUnwindSafe for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !RefUnwindSafe for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> RefUnwindSafe for Bnb<'c, S>
    where\n S: RefUnwindSafe,
    ",1,["bdk_coin_select::bnb::Bnb"]]], "bdk_electrum":[["impl RefUnwindSafe for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> RefUnwindSafe for BdkElectrumClient<E>
    where\n E: RefUnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> RefUnwindSafe for ElectrumFullScanResult<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl !RefUnwindSafe for FileError",1,["bdk_file_store::FileError"]],["impl !RefUnwindSafe for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> RefUnwindSafe for EntryIter<'t, T>
    where\n T: RefUnwindSafe,
    ",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> !RefUnwindSafe for AggregateChangesetsError<C>",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> RefUnwindSafe for Store<C>
    where\n C: RefUnwindSafe,
    ",1,["bdk_file_store::store::Store"]]], diff --git a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js index 44202e5958..3b5f4dbc53 100644 --- a/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/docs-rs/bdk/nightly/latest/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,6 +1,6 @@ (function() {var implementors = { "bdk_bitcoind_rpc":[["impl<'c, C> UnwindSafe for Emitter<'c, C>
    where\n C: RefUnwindSafe,
    ",1,["bdk_bitcoind_rpc::Emitter"]],["impl<B> UnwindSafe for BlockEvent<B>
    where\n B: UnwindSafe,
    ",1,["bdk_bitcoind_rpc::BlockEvent"]]], -"bdk_chain":[["impl !UnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl UnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl UnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl UnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl UnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl UnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl UnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl UnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl UnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl UnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl UnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl UnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl UnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl UnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl UnwindSafe for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> UnwindSafe for CanonicalTx<'a, T, A>
    where\n T: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> UnwindSafe for TxNode<'a, T, A>
    where\n T: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> UnwindSafe for TxAncestors<'g, A, F>
    where\n F: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> UnwindSafe for TxDescendants<'g, A, F>
    where\n F: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> UnwindSafe for ChainPosition<A>
    where\n A: UnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> UnwindSafe for SyncResult<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> UnwindSafe for FullTxOut<A>
    where\n A: UnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> UnwindSafe for ChangeSet<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> UnwindSafe for TxGraph<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> UnwindSafe for IndexedTxGraph<A, I>
    where\n I: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> UnwindSafe for ChangeSet<A, IA>
    where\n IA: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> UnwindSafe for SpkIterator<D>
    where\n D: UnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> UnwindSafe for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !UnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> UnwindSafe for ChangeSet<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> UnwindSafe for KeychainTxOutIndex<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K, A> UnwindSafe for FullScanResult<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], +"bdk_chain":[["impl !UnwindSafe for SyncRequest",1,["bdk_chain::spk_client::SyncRequest"]],["impl UnwindSafe for ConfirmationTime",1,["bdk_chain::chain_data::ConfirmationTime"]],["impl UnwindSafe for ApplyHeaderError",1,["bdk_chain::local_chain::ApplyHeaderError"]],["impl UnwindSafe for CalculateFeeError",1,["bdk_chain::tx_graph::CalculateFeeError"]],["impl UnwindSafe for Balance",1,["bdk_chain::keychain::Balance"]],["impl UnwindSafe for AlterCheckPointError",1,["bdk_chain::local_chain::AlterCheckPointError"]],["impl UnwindSafe for CannotConnectError",1,["bdk_chain::local_chain::CannotConnectError"]],["impl UnwindSafe for CheckPoint",1,["bdk_chain::local_chain::CheckPoint"]],["impl UnwindSafe for CheckPointIter",1,["bdk_chain::local_chain::CheckPointIter"]],["impl UnwindSafe for LocalChain",1,["bdk_chain::local_chain::LocalChain"]],["impl UnwindSafe for MissingGenesisError",1,["bdk_chain::local_chain::MissingGenesisError"]],["impl UnwindSafe for BlockId",1,["bdk_chain::chain_data::BlockId"]],["impl UnwindSafe for ConfirmationHeightAnchor",1,["bdk_chain::chain_data::ConfirmationHeightAnchor"]],["impl UnwindSafe for ConfirmationTimeHeightAnchor",1,["bdk_chain::chain_data::ConfirmationTimeHeightAnchor"]],["impl UnwindSafe for DescriptorId",1,["bdk_chain::descriptor_ext::DescriptorId"]],["impl<'a, T, A> UnwindSafe for CanonicalTx<'a, T, A>
    where\n T: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::CanonicalTx"]],["impl<'a, T, A> UnwindSafe for TxNode<'a, T, A>
    where\n T: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxNode"]],["impl<'g, A, F> UnwindSafe for TxAncestors<'g, A, F>
    where\n F: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxAncestors"]],["impl<'g, A, F> UnwindSafe for TxDescendants<'g, A, F>
    where\n F: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxDescendants"]],["impl<A> UnwindSafe for ChainPosition<A>
    where\n A: UnwindSafe,
    ",1,["bdk_chain::chain_data::ChainPosition"]],["impl<A> UnwindSafe for SyncResult<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::SyncResult"]],["impl<A> UnwindSafe for FullTxOut<A>
    where\n A: UnwindSafe,
    ",1,["bdk_chain::chain_data::FullTxOut"]],["impl<A> UnwindSafe for ChangeSet<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::ChangeSet"]],["impl<A> UnwindSafe for TxGraph<A>
    where\n A: RefUnwindSafe,
    ",1,["bdk_chain::tx_graph::TxGraph"]],["impl<A, I> UnwindSafe for IndexedTxGraph<A, I>
    where\n I: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::IndexedTxGraph"]],["impl<A, IA> UnwindSafe for ChangeSet<A, IA>
    where\n IA: UnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::indexed_tx_graph::ChangeSet"]],["impl<D> UnwindSafe for SpkIterator<D>
    where\n D: UnwindSafe,
    ",1,["bdk_chain::spk_iter::SpkIterator"]],["impl<I> UnwindSafe for SpkTxOutIndex<I>",1,["bdk_chain::spk_txout_index::SpkTxOutIndex"]],["impl<K> !UnwindSafe for FullScanRequest<K>",1,["bdk_chain::spk_client::FullScanRequest"]],["impl<K> UnwindSafe for InsertDescriptorError<K>
    where\n K: UnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::InsertDescriptorError"]],["impl<K> UnwindSafe for ChangeSet<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::ChangeSet"]],["impl<K> UnwindSafe for KeychainTxOutIndex<K>",1,["bdk_chain::keychain::txout_index::KeychainTxOutIndex"]],["impl<K> UnwindSafe for NoSuchKeychain<K>
    where\n K: UnwindSafe,
    ",1,["bdk_chain::keychain::txout_index::NoSuchKeychain"]],["impl<K, A> UnwindSafe for FullScanResult<K, A>
    where\n K: RefUnwindSafe,\n A: RefUnwindSafe,
    ",1,["bdk_chain::spk_client::FullScanResult"]]], "bdk_coin_select":[["impl UnwindSafe for BnbLimit",1,["bdk_coin_select::bnb::BnbLimit"]],["impl UnwindSafe for BranchStrategy",1,["bdk_coin_select::bnb::BranchStrategy"]],["impl UnwindSafe for ExcessStrategyKind",1,["bdk_coin_select::coin_selector::ExcessStrategyKind"]],["impl UnwindSafe for SelectionConstraint",1,["bdk_coin_select::coin_selector::SelectionConstraint"]],["impl UnwindSafe for CoinSelectorOpt",1,["bdk_coin_select::coin_selector::CoinSelectorOpt"]],["impl UnwindSafe for ExcessStrategy",1,["bdk_coin_select::coin_selector::ExcessStrategy"]],["impl UnwindSafe for Selection",1,["bdk_coin_select::coin_selector::Selection"]],["impl UnwindSafe for SelectionError",1,["bdk_coin_select::coin_selector::SelectionError"]],["impl UnwindSafe for WeightedValue",1,["bdk_coin_select::coin_selector::WeightedValue"]],["impl<'a> UnwindSafe for CoinSelector<'a>",1,["bdk_coin_select::coin_selector::CoinSelector"]],["impl<'c, 'f, S> !UnwindSafe for BnbIter<'c, 'f, S>",1,["bdk_coin_select::bnb::BnbIter"]],["impl<'c, S> UnwindSafe for Bnb<'c, S>
    where\n S: UnwindSafe,
    ",1,["bdk_coin_select::bnb::Bnb"]]], "bdk_electrum":[["impl UnwindSafe for ElectrumSyncResult",1,["bdk_electrum::bdk_electrum_client::ElectrumSyncResult"]],["impl<E> UnwindSafe for BdkElectrumClient<E>
    where\n E: UnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::BdkElectrumClient"]],["impl<K> UnwindSafe for ElectrumFullScanResult<K>
    where\n K: RefUnwindSafe,
    ",1,["bdk_electrum::bdk_electrum_client::ElectrumFullScanResult"]]], "bdk_file_store":[["impl !UnwindSafe for FileError",1,["bdk_file_store::FileError"]],["impl !UnwindSafe for IterError",1,["bdk_file_store::entry_iter::IterError"]],["impl<'t, T> !UnwindSafe for EntryIter<'t, T>",1,["bdk_file_store::entry_iter::EntryIter"]],["impl<C> !UnwindSafe for AggregateChangesetsError<C>",1,["bdk_file_store::store::AggregateChangesetsError"]],["impl<C> UnwindSafe for Store<C>
    where\n C: UnwindSafe,
    ",1,["bdk_file_store::store::Store"]]], diff --git a/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js b/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js index 744de6a43b..a357d1a064 100644 --- a/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js +++ b/docs-rs/bdk/nightly/latest/type.impl/alloc/collections/btree/map/struct.BTreeMap.js @@ -1,4 +1,4 @@ (function() {var type_impls = { "bdk_chain":[["
    source§

    impl<K: Ord, V> Append for BTreeMap<K, V>

    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.
    ","Append","bdk_chain::local_chain::ChangeSet"],["
    source§

    impl<K, V> BTreeMap<K, V>

    1.0.0 (const: 1.66.0) · source

    pub const fn new() -> BTreeMap<K, V>

    Makes a new, empty BTreeMap.

    \n

    Does not allocate anything on its own.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
    \n
    ",0,"bdk_chain::local_chain::ChangeSet"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

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

    Gets an iterator over the entries of the map, sorted by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"c\");\nmap.insert(2, \"b\");\nmap.insert(1, \"a\");\n\nfor (key, value) in map.iter() {\n    println!(\"{key}: {value}\");\n}\n\nlet (first_key, first_value) = map.iter().next().unwrap();\nassert_eq!((*first_key, *first_value), (1, \"a\"));
    \n
    1.0.0 · source

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

    Gets a mutable iterator over the entries of the map, sorted by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::from([\n   (\"a\", 1),\n   (\"b\", 2),\n   (\"c\", 3),\n]);\n\n// add 10 to the value if the key isn't \"a\"\nfor (key, value) in map.iter_mut() {\n    if key != &\"a\" {\n        *value += 10;\n    }\n}
    \n
    1.0.0 · source

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

    Gets an iterator over the keys of the map, in sorted order.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<_> = a.keys().cloned().collect();\nassert_eq!(keys, [1, 2]);
    \n
    1.0.0 · source

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

    Gets an iterator over the values of the map, in order by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.values().cloned().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
    \n
    1.10.0 · source

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

    Gets a mutable iterator over the values of the map, in order by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, String::from(\"hello\"));\na.insert(2, String::from(\"goodbye\"));\n\nfor value in a.values_mut() {\n    value.push_str(\"!\");\n}\n\nlet values: Vec<String> = a.values().cloned().collect();\nassert_eq!(values, [String::from(\"hello!\"),\n                    String::from(\"goodbye!\")]);
    \n
    1.0.0 (const: unstable) · source

    pub fn len(&self) -> usize

    Returns the number of elements in the map.

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

    pub fn is_empty(&self) -> bool

    Returns true if the map contains no elements.

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

    pub fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a Cursor pointing at the gap before the smallest key\ngreater than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.lower_bound(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &\"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &\"b\")));\n\nlet cursor = map.lower_bound(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.lower_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &\"a\")));
    \n
    source

    pub fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a CursorMut pointing at the gap before the smallest key\ngreater than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.lower_bound_mut(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &mut \"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &mut \"b\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &mut \"a\")));
    \n
    source

    pub fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a Cursor pointing at the gap after the greatest key\nsmaller than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.upper_bound(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &\"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &\"d\")));\n\nlet cursor = map.upper_bound(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.upper_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &\"d\")));\nassert_eq!(cursor.peek_next(), None);
    \n
    source

    pub fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a CursorMut pointing at the gap after the greatest key\nsmaller than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.upper_bound_mut(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &mut \"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &mut \"d\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &mut \"d\")));\nassert_eq!(cursor.peek_next(), None);
    \n
    ",0,"bdk_chain::local_chain::ChangeSet"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

    pub fn clear(&mut self)

    Clears the map, removing all elements.

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

    pub const fn new_in(alloc: A) -> BTreeMap<K, V, A>

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

    Makes a new empty BTreeMap with a reasonable choice for B.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\nuse std::alloc::Global;\n\nlet mut map = BTreeMap::new_in(Global);\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
    \n
    ",0,"bdk_chain::local_chain::ChangeSet"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

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

    Returns a reference to the value corresponding to the key.

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The supplied key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

    pub fn first_key_value(&self) -> Option<(&K, &V)>
    where\n K: Ord,

    Returns the first key-value pair in the map.\nThe key in this pair is the minimum key in the map.

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

    pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
    where\n K: Ord,

    Returns the first entry in the map for in-place manipulation.\nThe key of this entry is the minimum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.first_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"first\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"first\");\nassert_eq!(*map.get(&2).unwrap(), \"b\");
    \n
    1.66.0 · source

    pub fn pop_first(&mut self) -> Option<(K, V)>
    where\n K: Ord,

    Removes and returns the first element in the map.\nThe key of this element is the minimum key that was in the map.

    \n
    §Examples
    \n

    Draining elements in ascending order, while keeping a usable map each iteration.

    \n\n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_first() {\n    assert!(map.iter().all(|(k, _v)| *k > key));\n}\nassert!(map.is_empty());
    \n
    1.66.0 · source

    pub fn last_key_value(&self) -> Option<(&K, &V)>
    where\n K: Ord,

    Returns the last key-value pair in the map.\nThe key in this pair is the maximum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.last_key_value(), Some((&2, &\"a\")));
    \n
    1.66.0 · source

    pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
    where\n K: Ord,

    Returns the last entry in the map for in-place manipulation.\nThe key of this entry is the maximum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.last_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"last\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"a\");\nassert_eq!(*map.get(&2).unwrap(), \"last\");
    \n
    1.66.0 · source

    pub fn pop_last(&mut self) -> Option<(K, V)>
    where\n K: Ord,

    Removes and returns the last element in the map.\nThe key of this element is the maximum key that was in the map.

    \n
    §Examples
    \n

    Draining elements in descending order, while keeping a usable map each iteration.

    \n\n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_last() {\n    assert!(map.iter().all(|(k, _v)| *k < key));\n}\nassert!(map.is_empty());
    \n
    1.0.0 · source

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

    pub fn insert(&mut self, key: K, value: V) -> Option<V>
    where\n K: Ord,

    Inserts a key-value pair into the map.

    \n

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

    \n

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

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

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

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

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

    \n

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

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

    Retains only the elements specified by the predicate.

    \n

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\n// Keep only the elements with even-numbered keys.\nmap.retain(|&k, _| k % 2 == 0);\nassert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
    \n
    1.11.0 · source

    pub fn append(&mut self, other: &mut BTreeMap<K, V, A>)
    where\n K: Ord,\n A: Clone,

    Moves all elements from other into self, leaving other empty.

    \n

    If a key from other is already present in self, the respective\nvalue from self will be overwritten with the respective value from other.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\"); // Note: Key (3) also present in b.\n\nlet mut b = BTreeMap::new();\nb.insert(3, \"d\"); // Note: Key (3) also present in a.\nb.insert(4, \"e\");\nb.insert(5, \"f\");\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\nassert_eq!(a[&3], \"d\"); // Note: \"c\" has been overwritten.\nassert_eq!(a[&4], \"e\");\nassert_eq!(a[&5], \"f\");
    \n
    1.17.0 · source

    pub fn range<T, R>(&self, range: R) -> Range<'_, K, V>
    where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

    Constructs a double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

    \n
    §Panics
    \n

    Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\nuse std::ops::Bound::Included;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"a\");\nmap.insert(5, \"b\");\nmap.insert(8, \"c\");\nfor (&key, &value) in map.range((Included(&4), Included(&8))) {\n    println!(\"{key}: {value}\");\n}\nassert_eq!(Some((&5, &\"b\")), map.range(4..).next());
    \n
    1.17.0 · source

    pub fn range_mut<T, R>(&mut self, range: R) -> RangeMut<'_, K, V>
    where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

    Constructs a mutable double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

    \n
    §Panics
    \n

    Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<&str, i32> =\n    [(\"Alice\", 0), (\"Bob\", 0), (\"Carol\", 0), (\"Cheryl\", 0)].into();\nfor (_, balance) in map.range_mut(\"B\"..\"Cheryl\") {\n    *balance += 100;\n}\nfor (name, balance) in &map {\n    println!(\"{name} => {balance}\");\n}
    \n
    1.0.0 · source

    pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A>
    where\n K: Ord,

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut count: BTreeMap<&str, usize> = BTreeMap::new();\n\n// count the number of occurrences of letters in the vec\nfor x in [\"a\", \"b\", \"a\", \"c\", \"a\", \"b\"] {\n    count.entry(x).and_modify(|curr| *curr += 1).or_insert(1);\n}\n\nassert_eq!(count[\"a\"], 3);\nassert_eq!(count[\"b\"], 2);\nassert_eq!(count[\"c\"], 1);
    \n
    1.11.0 · source

    pub fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V, A>
    where\n Q: Ord + ?Sized,\n K: Borrow<Q> + Ord,\n A: Clone,

    Splits the collection into two at the given key. Returns everything after the given key,\nincluding the key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\");\na.insert(17, \"d\");\na.insert(41, \"e\");\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\n\nassert_eq!(b[&3], \"c\");\nassert_eq!(b[&17], \"d\");\nassert_eq!(b[&41], \"e\");
    \n
    source

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

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

    Creates an iterator that visits all elements (key-value pairs) in\nascending key order and uses a closure to determine if an element should\nbe removed. If the closure returns true, the element is removed from\nthe map and yielded. If the closure returns false, or panics, the\nelement remains in the map and will not be yielded.

    \n

    The iterator also lets you mutate the value of each element in the\nclosure, regardless of whether you choose to keep or remove it.

    \n

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

    \n
    §Examples
    \n

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

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

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

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<i32> = a.into_keys().collect();\nassert_eq!(keys, [1, 2]);
    \n
    1.54.0 · source

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

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.into_values().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
    \n
    ",0,"bdk_chain::local_chain::ChangeSet"],["
    1.0.0 · source§

    impl<K, V, A> Clone for BTreeMap<K, V, A>
    where\n K: Clone,\n V: Clone,\n A: Allocator + Clone,

    source§

    fn clone(&self) -> BTreeMap<K, V, 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
    ","Clone","bdk_chain::local_chain::ChangeSet"],["
    1.0.0 · source§

    impl<K, V, A> Debug for BTreeMap<K, V, A>
    where\n K: Debug,\n V: Debug,\n A: Allocator + Clone,

    source§

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

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

    impl<K, V> Default for BTreeMap<K, V>

    source§

    fn default() -> BTreeMap<K, V>

    Creates an empty BTreeMap.

    \n
    ","Default","bdk_chain::local_chain::ChangeSet"],["
    source§

    impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V>
    where\n K: Deserialize<'de> + Ord,\n V: Deserialize<'de>,

    source§

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

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

    impl<K, V, A> Drop for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    source§

    fn drop(&mut self)

    Executes the destructor for this type. Read more
    ","Drop","bdk_chain::local_chain::ChangeSet"],["
    1.2.0 · source§

    impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>
    where\n K: Ord + Copy,\n V: Copy,\n A: Allocator + Clone,

    source§

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

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

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

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

    fn extend_reserve(&mut self, additional: usize)

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

    impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>
    where\n K: Ord,\n A: Allocator + Clone,

    source§

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

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

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

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

    fn extend_reserve(&mut self, additional: usize)

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

    impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>
    where\n K: Ord,

    source§

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

    Converts a [(K, V); N] into a BTreeMap<(K, V)>.

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

    impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V>
    where\n K: Ord,

    source§

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

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

    impl<K, V, A> Hash for BTreeMap<K, V, A>
    where\n K: Hash,\n V: Hash,\n A: Allocator + Clone,

    source§

    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_chain::local_chain::ChangeSet"],["
    1.0.0 · source§

    impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

    source§

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

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

    \n
    §Panics
    \n

    Panics if the key is not present in the BTreeMap.

    \n
    §

    type Output = V

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

    impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
    where\n K: IntoDeserializer<'de, E> + Eq + Ord,\n V: IntoDeserializer<'de, E>,\n E: Error,

    §

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

    The type of the deserializer being converted into.
    source§

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

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

    impl<K, V, A> IntoIterator for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    source§

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

    Gets an owning iterator over the entries of the map, sorted by key.

    \n
    §

    type Item = (K, V)

    The type of the elements being iterated over.
    §

    type IntoIter = IntoIter<K, V, A>

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

    impl<K, V, A> Ord for BTreeMap<K, V, A>
    where\n K: Ord,\n V: Ord,\n A: Allocator + Clone,

    source§

    fn cmp(&self, other: &BTreeMap<K, V, A>) -> 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_chain::local_chain::ChangeSet"],["
    1.0.0 · source§

    impl<K, V, A> PartialEq for BTreeMap<K, V, A>
    where\n K: PartialEq,\n V: PartialEq,\n A: Allocator + Clone,

    source§

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

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

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

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

    impl<K, V, A> PartialOrd for BTreeMap<K, V, A>
    where\n K: PartialOrd,\n V: PartialOrd,\n A: Allocator + Clone,

    source§

    fn partial_cmp(&self, other: &BTreeMap<K, V, A>) -> 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_chain::local_chain::ChangeSet"],["
    source§

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

    source§

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

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

    impl<K, V, A> Eq for BTreeMap<K, V, A>
    where\n K: Eq,\n V: Eq,\n A: Allocator + Clone,

    ","Eq","bdk_chain::local_chain::ChangeSet"],["
    1.64.0 · source§

    impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>

    ","UnwindSafe","bdk_chain::local_chain::ChangeSet"]], -"bdk_wallet":[["
    §

    impl<K, V> Append for BTreeMap<K, V>
    where\n K: Ord,

    §

    fn append(&mut self, other: BTreeMap<K, V>)

    Append another object of the same type onto self.
    §

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    ","Append","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V> BTreeMap<K, V>

    1.0.0 (const: 1.66.0) · source

    pub const fn new() -> BTreeMap<K, V>

    Makes a new, empty BTreeMap.

    \n

    Does not allocate anything on its own.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

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

    Gets an iterator over the entries of the map, sorted by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"c\");\nmap.insert(2, \"b\");\nmap.insert(1, \"a\");\n\nfor (key, value) in map.iter() {\n    println!(\"{key}: {value}\");\n}\n\nlet (first_key, first_value) = map.iter().next().unwrap();\nassert_eq!((*first_key, *first_value), (1, \"a\"));
    \n
    1.0.0 · source

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

    Gets a mutable iterator over the entries of the map, sorted by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::from([\n   (\"a\", 1),\n   (\"b\", 2),\n   (\"c\", 3),\n]);\n\n// add 10 to the value if the key isn't \"a\"\nfor (key, value) in map.iter_mut() {\n    if key != &\"a\" {\n        *value += 10;\n    }\n}
    \n
    1.0.0 · source

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

    Gets an iterator over the keys of the map, in sorted order.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<_> = a.keys().cloned().collect();\nassert_eq!(keys, [1, 2]);
    \n
    1.0.0 · source

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

    Gets an iterator over the values of the map, in order by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.values().cloned().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
    \n
    1.10.0 · source

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

    Gets a mutable iterator over the values of the map, in order by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, String::from(\"hello\"));\na.insert(2, String::from(\"goodbye\"));\n\nfor value in a.values_mut() {\n    value.push_str(\"!\");\n}\n\nlet values: Vec<String> = a.values().cloned().collect();\nassert_eq!(values, [String::from(\"hello!\"),\n                    String::from(\"goodbye!\")]);
    \n
    1.0.0 (const: unstable) · source

    pub fn len(&self) -> usize

    Returns the number of elements in the map.

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

    pub fn is_empty(&self) -> bool

    Returns true if the map contains no elements.

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

    pub fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a Cursor pointing at the gap before the smallest key\ngreater than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.lower_bound(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &\"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &\"b\")));\n\nlet cursor = map.lower_bound(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.lower_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &\"a\")));
    \n
    source

    pub fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a CursorMut pointing at the gap before the smallest key\ngreater than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.lower_bound_mut(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &mut \"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &mut \"b\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &mut \"a\")));
    \n
    source

    pub fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a Cursor pointing at the gap after the greatest key\nsmaller than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.upper_bound(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &\"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &\"d\")));\n\nlet cursor = map.upper_bound(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.upper_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &\"d\")));\nassert_eq!(cursor.peek_next(), None);
    \n
    source

    pub fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a CursorMut pointing at the gap after the greatest key\nsmaller than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.upper_bound_mut(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &mut \"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &mut \"d\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &mut \"d\")));\nassert_eq!(cursor.peek_next(), None);
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

    pub fn clear(&mut self)

    Clears the map, removing all elements.

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

    pub const fn new_in(alloc: A) -> BTreeMap<K, V, A>

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

    Makes a new empty BTreeMap with a reasonable choice for B.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\nuse std::alloc::Global;\n\nlet mut map = BTreeMap::new_in(Global);\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

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

    Returns a reference to the value corresponding to the key.

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The supplied key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

    pub fn first_key_value(&self) -> Option<(&K, &V)>
    where\n K: Ord,

    Returns the first key-value pair in the map.\nThe key in this pair is the minimum key in the map.

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

    pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
    where\n K: Ord,

    Returns the first entry in the map for in-place manipulation.\nThe key of this entry is the minimum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.first_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"first\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"first\");\nassert_eq!(*map.get(&2).unwrap(), \"b\");
    \n
    1.66.0 · source

    pub fn pop_first(&mut self) -> Option<(K, V)>
    where\n K: Ord,

    Removes and returns the first element in the map.\nThe key of this element is the minimum key that was in the map.

    \n
    §Examples
    \n

    Draining elements in ascending order, while keeping a usable map each iteration.

    \n\n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_first() {\n    assert!(map.iter().all(|(k, _v)| *k > key));\n}\nassert!(map.is_empty());
    \n
    1.66.0 · source

    pub fn last_key_value(&self) -> Option<(&K, &V)>
    where\n K: Ord,

    Returns the last key-value pair in the map.\nThe key in this pair is the maximum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.last_key_value(), Some((&2, &\"a\")));
    \n
    1.66.0 · source

    pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
    where\n K: Ord,

    Returns the last entry in the map for in-place manipulation.\nThe key of this entry is the maximum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.last_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"last\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"a\");\nassert_eq!(*map.get(&2).unwrap(), \"last\");
    \n
    1.66.0 · source

    pub fn pop_last(&mut self) -> Option<(K, V)>
    where\n K: Ord,

    Removes and returns the last element in the map.\nThe key of this element is the maximum key that was in the map.

    \n
    §Examples
    \n

    Draining elements in descending order, while keeping a usable map each iteration.

    \n\n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_last() {\n    assert!(map.iter().all(|(k, _v)| *k < key));\n}\nassert!(map.is_empty());
    \n
    1.0.0 · source

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

    pub fn insert(&mut self, key: K, value: V) -> Option<V>
    where\n K: Ord,

    Inserts a key-value pair into the map.

    \n

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

    \n

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

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

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

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

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

    \n

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

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

    Retains only the elements specified by the predicate.

    \n

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\n// Keep only the elements with even-numbered keys.\nmap.retain(|&k, _| k % 2 == 0);\nassert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
    \n
    1.11.0 · source

    pub fn append(&mut self, other: &mut BTreeMap<K, V, A>)
    where\n K: Ord,\n A: Clone,

    Moves all elements from other into self, leaving other empty.

    \n

    If a key from other is already present in self, the respective\nvalue from self will be overwritten with the respective value from other.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\"); // Note: Key (3) also present in b.\n\nlet mut b = BTreeMap::new();\nb.insert(3, \"d\"); // Note: Key (3) also present in a.\nb.insert(4, \"e\");\nb.insert(5, \"f\");\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\nassert_eq!(a[&3], \"d\"); // Note: \"c\" has been overwritten.\nassert_eq!(a[&4], \"e\");\nassert_eq!(a[&5], \"f\");
    \n
    1.17.0 · source

    pub fn range<T, R>(&self, range: R) -> Range<'_, K, V>
    where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

    Constructs a double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

    \n
    §Panics
    \n

    Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\nuse std::ops::Bound::Included;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"a\");\nmap.insert(5, \"b\");\nmap.insert(8, \"c\");\nfor (&key, &value) in map.range((Included(&4), Included(&8))) {\n    println!(\"{key}: {value}\");\n}\nassert_eq!(Some((&5, &\"b\")), map.range(4..).next());
    \n
    1.17.0 · source

    pub fn range_mut<T, R>(&mut self, range: R) -> RangeMut<'_, K, V>
    where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

    Constructs a mutable double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

    \n
    §Panics
    \n

    Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<&str, i32> =\n    [(\"Alice\", 0), (\"Bob\", 0), (\"Carol\", 0), (\"Cheryl\", 0)].into();\nfor (_, balance) in map.range_mut(\"B\"..\"Cheryl\") {\n    *balance += 100;\n}\nfor (name, balance) in &map {\n    println!(\"{name} => {balance}\");\n}
    \n
    1.0.0 · source

    pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A>
    where\n K: Ord,

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut count: BTreeMap<&str, usize> = BTreeMap::new();\n\n// count the number of occurrences of letters in the vec\nfor x in [\"a\", \"b\", \"a\", \"c\", \"a\", \"b\"] {\n    count.entry(x).and_modify(|curr| *curr += 1).or_insert(1);\n}\n\nassert_eq!(count[\"a\"], 3);\nassert_eq!(count[\"b\"], 2);\nassert_eq!(count[\"c\"], 1);
    \n
    1.11.0 · source

    pub fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V, A>
    where\n Q: Ord + ?Sized,\n K: Borrow<Q> + Ord,\n A: Clone,

    Splits the collection into two at the given key. Returns everything after the given key,\nincluding the key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\");\na.insert(17, \"d\");\na.insert(41, \"e\");\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\n\nassert_eq!(b[&3], \"c\");\nassert_eq!(b[&17], \"d\");\nassert_eq!(b[&41], \"e\");
    \n
    source

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

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

    Creates an iterator that visits all elements (key-value pairs) in\nascending key order and uses a closure to determine if an element should\nbe removed. If the closure returns true, the element is removed from\nthe map and yielded. If the closure returns false, or panics, the\nelement remains in the map and will not be yielded.

    \n

    The iterator also lets you mutate the value of each element in the\nclosure, regardless of whether you choose to keep or remove it.

    \n

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

    \n
    §Examples
    \n

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

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

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

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<i32> = a.into_keys().collect();\nassert_eq!(keys, [1, 2]);
    \n
    1.54.0 · source

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

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.into_values().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Clone for BTreeMap<K, V, A>
    where\n K: Clone,\n V: Clone,\n A: Allocator + Clone,

    source§

    fn clone(&self) -> BTreeMap<K, V, 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
    ","Clone","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Debug for BTreeMap<K, V, A>
    where\n K: Debug,\n V: Debug,\n A: Allocator + Clone,

    source§

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

    Formats the value using the given formatter. Read more
    ","Debug","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V> Default for BTreeMap<K, V>

    source§

    fn default() -> BTreeMap<K, V>

    Creates an empty BTreeMap.

    \n
    ","Default","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V>
    where\n K: Deserialize<'de> + Ord,\n V: Deserialize<'de>,

    source§

    fn deserialize<D>(\n deserializer: D\n) -> Result<BTreeMap<K, V>, <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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.7.0 · source§

    impl<K, V, A> Drop for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    source§

    fn drop(&mut self)

    Executes the destructor for this type. Read more
    ","Drop","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.2.0 · source§

    impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>
    where\n K: Ord + Copy,\n V: Copy,\n A: Allocator + Clone,

    source§

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

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

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

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

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    ","Extend<(&'a K, &'a V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>
    where\n K: Ord,\n A: Allocator + Clone,

    source§

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

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

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

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

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    ","Extend<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.56.0 · source§

    impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>
    where\n K: Ord,

    source§

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

    Converts a [(K, V); N] into a BTreeMap<(K, V)>.

    \n\n
    use std::collections::BTreeMap;\n\nlet map1 = BTreeMap::from([(1, 2), (3, 4)]);\nlet map2: BTreeMap<_, _> = [(1, 2), (3, 4)].into();\nassert_eq!(map1, map2);
    \n
    ","From<[(K, V); N]>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V>
    where\n K: Ord,

    source§

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

    Creates a value from an iterator. Read more
    ","FromIterator<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Hash for BTreeMap<K, V, A>
    where\n K: Hash,\n V: Hash,\n A: Allocator + Clone,

    source§

    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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

    source§

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

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

    \n
    §Panics
    \n

    Panics if the key is not present in the BTreeMap.

    \n
    §

    type Output = V

    The returned type after indexing.
    ","Index<&Q>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    §

    impl IntoAssets for BTreeMap<DescriptorPublicKey, DescriptorSecretKey>

    §

    fn into_assets(self) -> Assets

    Convert self into a Assets struct
    ","IntoAssets","bdk_wallet::keys::KeyMap"],["
    source§

    impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
    where\n K: IntoDeserializer<'de, E> + Eq + Ord,\n V: IntoDeserializer<'de, E>,\n E: Error,

    §

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

    The type of the deserializer being converted into.
    source§

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

    Convert this value into a deserializer.
    ","IntoDeserializer<'de, E>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> IntoIterator for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    source§

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

    Gets an owning iterator over the entries of the map, sorted by key.

    \n
    §

    type Item = (K, V)

    The type of the elements being iterated over.
    §

    type IntoIter = IntoIter<K, V, A>

    Which kind of iterator are we turning this into?
    ","IntoIterator","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Ord for BTreeMap<K, V, A>
    where\n K: Ord,\n V: Ord,\n A: Allocator + Clone,

    source§

    fn cmp(&self, other: &BTreeMap<K, V, A>) -> 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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> PartialEq for BTreeMap<K, V, A>
    where\n K: PartialEq,\n V: PartialEq,\n A: Allocator + Clone,

    source§

    fn eq(&self, other: &BTreeMap<K, V, A>) -> 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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> PartialOrd for BTreeMap<K, V, A>
    where\n K: PartialOrd,\n V: PartialOrd,\n A: Allocator + Clone,

    source§

    fn partial_cmp(&self, other: &BTreeMap<K, V, A>) -> 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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

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

    source§

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

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Eq for BTreeMap<K, V, A>
    where\n K: Eq,\n V: Eq,\n A: Allocator + Clone,

    ","Eq","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.64.0 · source§

    impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>

    ","UnwindSafe","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"]] +"bdk_wallet":[["
    source§

    impl<K, V> Append for BTreeMap<K, V>
    where\n K: Ord,

    source§

    fn append(&mut self, other: BTreeMap<K, V>)

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

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    ","Append","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V> BTreeMap<K, V>

    1.0.0 (const: 1.66.0) · source

    pub const fn new() -> BTreeMap<K, V>

    Makes a new, empty BTreeMap.

    \n

    Does not allocate anything on its own.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

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

    Gets an iterator over the entries of the map, sorted by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"c\");\nmap.insert(2, \"b\");\nmap.insert(1, \"a\");\n\nfor (key, value) in map.iter() {\n    println!(\"{key}: {value}\");\n}\n\nlet (first_key, first_value) = map.iter().next().unwrap();\nassert_eq!((*first_key, *first_value), (1, \"a\"));
    \n
    1.0.0 · source

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

    Gets a mutable iterator over the entries of the map, sorted by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::from([\n   (\"a\", 1),\n   (\"b\", 2),\n   (\"c\", 3),\n]);\n\n// add 10 to the value if the key isn't \"a\"\nfor (key, value) in map.iter_mut() {\n    if key != &\"a\" {\n        *value += 10;\n    }\n}
    \n
    1.0.0 · source

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

    Gets an iterator over the keys of the map, in sorted order.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<_> = a.keys().cloned().collect();\nassert_eq!(keys, [1, 2]);
    \n
    1.0.0 · source

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

    Gets an iterator over the values of the map, in order by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.values().cloned().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
    \n
    1.10.0 · source

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

    Gets a mutable iterator over the values of the map, in order by key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, String::from(\"hello\"));\na.insert(2, String::from(\"goodbye\"));\n\nfor value in a.values_mut() {\n    value.push_str(\"!\");\n}\n\nlet values: Vec<String> = a.values().cloned().collect();\nassert_eq!(values, [String::from(\"hello!\"),\n                    String::from(\"goodbye!\")]);
    \n
    1.0.0 (const: unstable) · source

    pub fn len(&self) -> usize

    Returns the number of elements in the map.

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

    pub fn is_empty(&self) -> bool

    Returns true if the map contains no elements.

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

    pub fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a Cursor pointing at the gap before the smallest key\ngreater than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.lower_bound(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &\"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &\"b\")));\n\nlet cursor = map.lower_bound(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.lower_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &\"a\")));
    \n
    source

    pub fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a CursorMut pointing at the gap before the smallest key\ngreater than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.lower_bound_mut(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &mut \"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &mut \"b\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &mut \"a\")));
    \n
    source

    pub fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a Cursor pointing at the gap after the greatest key\nsmaller than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.upper_bound(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &\"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &\"d\")));\n\nlet cursor = map.upper_bound(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.upper_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &\"d\")));\nassert_eq!(cursor.peek_next(), None);
    \n
    source

    pub fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
    where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

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

    Returns a CursorMut pointing at the gap after the greatest key\nsmaller than the given bound.

    \n

    Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

    \n

    Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

    \n

    Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

    \n
    §Examples
    \n
    #![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.upper_bound_mut(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &mut \"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &mut \"d\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &mut \"d\")));\nassert_eq!(cursor.peek_next(), None);
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

    pub fn clear(&mut self)

    Clears the map, removing all elements.

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

    pub const fn new_in(alloc: A) -> BTreeMap<K, V, A>

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

    Makes a new empty BTreeMap with a reasonable choice for B.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\nuse std::alloc::Global;\n\nlet mut map = BTreeMap::new_in(Global);\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<K, V, A> BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    1.0.0 · source

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

    Returns a reference to the value corresponding to the key.

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The supplied key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

    pub fn first_key_value(&self) -> Option<(&K, &V)>
    where\n K: Ord,

    Returns the first key-value pair in the map.\nThe key in this pair is the minimum key in the map.

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

    pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
    where\n K: Ord,

    Returns the first entry in the map for in-place manipulation.\nThe key of this entry is the minimum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.first_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"first\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"first\");\nassert_eq!(*map.get(&2).unwrap(), \"b\");
    \n
    1.66.0 · source

    pub fn pop_first(&mut self) -> Option<(K, V)>
    where\n K: Ord,

    Removes and returns the first element in the map.\nThe key of this element is the minimum key that was in the map.

    \n
    §Examples
    \n

    Draining elements in ascending order, while keeping a usable map each iteration.

    \n\n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_first() {\n    assert!(map.iter().all(|(k, _v)| *k > key));\n}\nassert!(map.is_empty());
    \n
    1.66.0 · source

    pub fn last_key_value(&self) -> Option<(&K, &V)>
    where\n K: Ord,

    Returns the last key-value pair in the map.\nThe key in this pair is the maximum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.last_key_value(), Some((&2, &\"a\")));
    \n
    1.66.0 · source

    pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
    where\n K: Ord,

    Returns the last entry in the map for in-place manipulation.\nThe key of this entry is the maximum key in the map.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.last_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"last\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"a\");\nassert_eq!(*map.get(&2).unwrap(), \"last\");
    \n
    1.66.0 · source

    pub fn pop_last(&mut self) -> Option<(K, V)>
    where\n K: Ord,

    Removes and returns the last element in the map.\nThe key of this element is the maximum key that was in the map.

    \n
    §Examples
    \n

    Draining elements in descending order, while keeping a usable map each iteration.

    \n\n
    use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_last() {\n    assert!(map.iter().all(|(k, _v)| *k < key));\n}\nassert!(map.is_empty());
    \n
    1.0.0 · source

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

    pub fn insert(&mut self, key: K, value: V) -> Option<V>
    where\n K: Ord,

    Inserts a key-value pair into the map.

    \n

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

    \n

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

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

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

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

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

    \n

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

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

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

    \n

    The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

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

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

    Retains only the elements specified by the predicate.

    \n

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\n// Keep only the elements with even-numbered keys.\nmap.retain(|&k, _| k % 2 == 0);\nassert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
    \n
    1.11.0 · source

    pub fn append(&mut self, other: &mut BTreeMap<K, V, A>)
    where\n K: Ord,\n A: Clone,

    Moves all elements from other into self, leaving other empty.

    \n

    If a key from other is already present in self, the respective\nvalue from self will be overwritten with the respective value from other.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\"); // Note: Key (3) also present in b.\n\nlet mut b = BTreeMap::new();\nb.insert(3, \"d\"); // Note: Key (3) also present in a.\nb.insert(4, \"e\");\nb.insert(5, \"f\");\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\nassert_eq!(a[&3], \"d\"); // Note: \"c\" has been overwritten.\nassert_eq!(a[&4], \"e\");\nassert_eq!(a[&5], \"f\");
    \n
    1.17.0 · source

    pub fn range<T, R>(&self, range: R) -> Range<'_, K, V>
    where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

    Constructs a double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

    \n
    §Panics
    \n

    Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\nuse std::ops::Bound::Included;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"a\");\nmap.insert(5, \"b\");\nmap.insert(8, \"c\");\nfor (&key, &value) in map.range((Included(&4), Included(&8))) {\n    println!(\"{key}: {value}\");\n}\nassert_eq!(Some((&5, &\"b\")), map.range(4..).next());
    \n
    1.17.0 · source

    pub fn range_mut<T, R>(&mut self, range: R) -> RangeMut<'_, K, V>
    where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

    Constructs a mutable double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

    \n
    §Panics
    \n

    Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<&str, i32> =\n    [(\"Alice\", 0), (\"Bob\", 0), (\"Carol\", 0), (\"Cheryl\", 0)].into();\nfor (_, balance) in map.range_mut(\"B\"..\"Cheryl\") {\n    *balance += 100;\n}\nfor (name, balance) in &map {\n    println!(\"{name} => {balance}\");\n}
    \n
    1.0.0 · source

    pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A>
    where\n K: Ord,

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut count: BTreeMap<&str, usize> = BTreeMap::new();\n\n// count the number of occurrences of letters in the vec\nfor x in [\"a\", \"b\", \"a\", \"c\", \"a\", \"b\"] {\n    count.entry(x).and_modify(|curr| *curr += 1).or_insert(1);\n}\n\nassert_eq!(count[\"a\"], 3);\nassert_eq!(count[\"b\"], 2);\nassert_eq!(count[\"c\"], 1);
    \n
    1.11.0 · source

    pub fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V, A>
    where\n Q: Ord + ?Sized,\n K: Borrow<Q> + Ord,\n A: Clone,

    Splits the collection into two at the given key. Returns everything after the given key,\nincluding the key.

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\");\na.insert(17, \"d\");\na.insert(41, \"e\");\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\n\nassert_eq!(b[&3], \"c\");\nassert_eq!(b[&17], \"d\");\nassert_eq!(b[&41], \"e\");
    \n
    source

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

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

    Creates an iterator that visits all elements (key-value pairs) in\nascending key order and uses a closure to determine if an element should\nbe removed. If the closure returns true, the element is removed from\nthe map and yielded. If the closure returns false, or panics, the\nelement remains in the map and will not be yielded.

    \n

    The iterator also lets you mutate the value of each element in the\nclosure, regardless of whether you choose to keep or remove it.

    \n

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

    \n
    §Examples
    \n

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

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

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

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<i32> = a.into_keys().collect();\nassert_eq!(keys, [1, 2]);
    \n
    1.54.0 · source

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

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

    \n
    §Examples
    \n
    use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.into_values().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
    \n
    ",0,"bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Clone for BTreeMap<K, V, A>
    where\n K: Clone,\n V: Clone,\n A: Allocator + Clone,

    source§

    fn clone(&self) -> BTreeMap<K, V, 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
    ","Clone","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Debug for BTreeMap<K, V, A>
    where\n K: Debug,\n V: Debug,\n A: Allocator + Clone,

    source§

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

    Formats the value using the given formatter. Read more
    ","Debug","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V> Default for BTreeMap<K, V>

    source§

    fn default() -> BTreeMap<K, V>

    Creates an empty BTreeMap.

    \n
    ","Default","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

    impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V>
    where\n K: Deserialize<'de> + Ord,\n V: Deserialize<'de>,

    source§

    fn deserialize<D>(\n deserializer: D\n) -> Result<BTreeMap<K, V>, <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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.7.0 · source§

    impl<K, V, A> Drop for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    source§

    fn drop(&mut self)

    Executes the destructor for this type. Read more
    ","Drop","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.2.0 · source§

    impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>
    where\n K: Ord + Copy,\n V: Copy,\n A: Allocator + Clone,

    source§

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

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

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

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

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    ","Extend<(&'a K, &'a V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>
    where\n K: Ord,\n A: Allocator + Clone,

    source§

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

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

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

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

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    ","Extend<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.56.0 · source§

    impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>
    where\n K: Ord,

    source§

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

    Converts a [(K, V); N] into a BTreeMap<(K, V)>.

    \n\n
    use std::collections::BTreeMap;\n\nlet map1 = BTreeMap::from([(1, 2), (3, 4)]);\nlet map2: BTreeMap<_, _> = [(1, 2), (3, 4)].into();\nassert_eq!(map1, map2);
    \n
    ","From<[(K, V); N]>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V>
    where\n K: Ord,

    source§

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

    Creates a value from an iterator. Read more
    ","FromIterator<(K, V)>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Hash for BTreeMap<K, V, A>
    where\n K: Hash,\n V: Hash,\n A: Allocator + Clone,

    source§

    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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

    source§

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

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

    \n
    §Panics
    \n

    Panics if the key is not present in the BTreeMap.

    \n
    §

    type Output = V

    The returned type after indexing.
    ","Index<&Q>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    §

    impl IntoAssets for BTreeMap<DescriptorPublicKey, DescriptorSecretKey>

    §

    fn into_assets(self) -> Assets

    Convert self into a Assets struct
    ","IntoAssets","bdk_wallet::keys::KeyMap"],["
    source§

    impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
    where\n K: IntoDeserializer<'de, E> + Eq + Ord,\n V: IntoDeserializer<'de, E>,\n E: Error,

    §

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

    The type of the deserializer being converted into.
    source§

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

    Convert this value into a deserializer.
    ","IntoDeserializer<'de, E>","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> IntoIterator for BTreeMap<K, V, A>
    where\n A: Allocator + Clone,

    source§

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

    Gets an owning iterator over the entries of the map, sorted by key.

    \n
    §

    type Item = (K, V)

    The type of the elements being iterated over.
    §

    type IntoIter = IntoIter<K, V, A>

    Which kind of iterator are we turning this into?
    ","IntoIterator","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Ord for BTreeMap<K, V, A>
    where\n K: Ord,\n V: Ord,\n A: Allocator + Clone,

    source§

    fn cmp(&self, other: &BTreeMap<K, V, A>) -> 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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> PartialEq for BTreeMap<K, V, A>
    where\n K: PartialEq,\n V: PartialEq,\n A: Allocator + Clone,

    source§

    fn eq(&self, other: &BTreeMap<K, V, A>) -> 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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> PartialOrd for BTreeMap<K, V, A>
    where\n K: PartialOrd,\n V: PartialOrd,\n A: Allocator + Clone,

    source§

    fn partial_cmp(&self, other: &BTreeMap<K, V, A>) -> 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::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    source§

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

    source§

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

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.0.0 · source§

    impl<K, V, A> Eq for BTreeMap<K, V, A>
    where\n K: Eq,\n V: Eq,\n A: Allocator + Clone,

    ","Eq","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"],["
    1.64.0 · source§

    impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>

    ","UnwindSafe","bdk_wallet::descriptor::policy::ConditionMap","bdk_wallet::descriptor::policy::FoldedConditionMap","bdk_wallet::descriptor::HdKeyPaths","bdk_wallet::descriptor::TapKeyOrigins","bdk_wallet::keys::KeyMap"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js b/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js index 206b3dc046..1f89605c1b 100644 --- a/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js +++ b/docs-rs/bdk/nightly/latest/type.impl/bdk_chain/indexed_tx_graph/struct.IndexedTxGraph.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"example_cli":[["
    §

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

    §

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

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

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

    §

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

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

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

    §

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

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

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

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

    Construct a new [IndexedTxGraph] with a given index.

    \n

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

    Get a reference of the internal transaction graph.

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

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

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

    \n

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

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

    \n

    Each inserted transaction’s anchor will be constructed from\n[AnchorFromBlockPosition::from_block_position].

    \n

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

    \n

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

    Batch insert all transactions of the given block of height.

    \n

    Each inserted transaction’s anchor will be constructed from\n[AnchorFromBlockPosition::from_block_position].

    \n

    To only insert relevant transactions, use apply_block_relevant instead.

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

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

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

    Applies the [ChangeSet] to the [IndexedTxGraph].

    \n

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

    Determines the [ChangeSet] between self and an empty [IndexedTxGraph].

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

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

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

    Apply an update directly.

    \n

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

    \n

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

    Insert a floating txout of given outpoint.

    \n

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

    Insert and index a transaction into the graph.

    \n

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

    Insert an anchor for a given transaction.

    \n

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

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

    \n

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

    \n

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

    Batch insert transactions, filtering out those that are irrelevant.

    \n

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

    \n

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

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

    \n

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

    \n

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

    \n

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

    Batch insert unconfirmed transactions.

    \n

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

    \n

    To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

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

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

    source§

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

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

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

    source§

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

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

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

    source§

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

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

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

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

    \n
    source

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

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

    \n

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

    \n

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

    \n
    source

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

    Batch insert all transactions of the given block of height.

    \n

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

    \n

    To only insert relevant transactions, use apply_block_relevant instead.

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

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

    source

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

    Construct a new IndexedTxGraph with a given index.

    \n
    source

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

    Get a reference of the internal transaction graph.

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

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

    source

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

    Applies the ChangeSet to the IndexedTxGraph.

    \n
    source

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

    Determines the ChangeSet between self and an empty IndexedTxGraph.

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

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

    source

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

    Apply an update directly.

    \n

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

    \n
    source

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

    Insert a floating txout of given outpoint.

    \n
    source

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

    Insert and index a transaction into the graph.

    \n
    source

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

    Insert an anchor for a given transaction.

    \n
    source

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

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

    \n

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

    \n
    source

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

    Batch insert transactions, filtering out those that are irrelevant.

    \n

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

    \n
    source

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

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

    \n

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

    \n

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

    \n
    source

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

    Batch insert unconfirmed transactions.

    \n

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

    \n

    To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

    \n
    ",0,"example_cli::KeychainTxGraph"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/type.impl/bdk_persist/changeset/struct.CombinedChangeSet.js b/docs-rs/bdk/nightly/latest/type.impl/bdk_persist/changeset/struct.CombinedChangeSet.js index e222d60526..78a4f46972 100644 --- a/docs-rs/bdk/nightly/latest/type.impl/bdk_persist/changeset/struct.CombinedChangeSet.js +++ b/docs-rs/bdk/nightly/latest/type.impl/bdk_persist/changeset/struct.CombinedChangeSet.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"bdk_wallet":[["
    §

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

    §

    fn append(&mut self, other: CombinedChangeSet<K, A>)

    Append another object of the same type onto self.
    §

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    ","Append","bdk_wallet::wallet::ChangeSet"],["
    §

    impl<K, A> Clone for CombinedChangeSet<K, A>
    where\n K: Clone,\n A: Clone,

    §

    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
    ","Clone","bdk_wallet::wallet::ChangeSet"],["
    §

    impl<K, A> Debug for CombinedChangeSet<K, A>
    where\n K: Debug,\n A: Debug,

    §

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

    Formats the value using the given formatter. Read more
    ","Debug","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

    fn default() -> CombinedChangeSet<K, A>

    Returns the “default value” for a type. Read more
    ","Default","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

    fn deserialize<__D>(\n __deserializer: __D\n) -> Result<CombinedChangeSet<K, A>, <__D as Deserializer<'de>>::Error>
    where\n __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

    fn from(chain: BTreeMap<u32, Option<BlockHash>>) -> CombinedChangeSet<K, A>

    Converts to this type from the input type.
    ","From>>","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

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

    Converts to this type from the input type.
    ","From>>","bdk_wallet::wallet::ChangeSet"],["
    §

    impl<K, A> PartialEq for CombinedChangeSet<K, A>
    where\n K: PartialEq,\n A: PartialEq,

    §

    fn eq(&self, other: &CombinedChangeSet<K, A>) -> 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::wallet::ChangeSet"],["
    §

    impl<K, A> Serialize for CombinedChangeSet<K, A>
    where\n A: Ord + Serialize,\n K: Ord + Serialize,

    §

    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::wallet::ChangeSet"],["
    §

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

    ","StructuralPartialEq","bdk_wallet::wallet::ChangeSet"]] +"bdk_wallet":[["
    §

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

    §

    fn append(&mut self, other: CombinedChangeSet<K, A>)

    Append another object of the same type onto self.
    §

    fn is_empty(&self) -> bool

    Returns whether the structure is considered empty.
    ","Append","bdk_wallet::wallet::ChangeSet"],["
    §

    impl<K, A> Clone for CombinedChangeSet<K, A>
    where\n K: Clone,\n A: Clone,

    §

    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
    ","Clone","bdk_wallet::wallet::ChangeSet"],["
    §

    impl<K, A> Debug for CombinedChangeSet<K, A>
    where\n K: Debug,\n A: Debug,

    §

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

    Formats the value using the given formatter. Read more
    ","Debug","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

    fn default() -> CombinedChangeSet<K, A>

    Returns the “default value” for a type. Read more
    ","Default","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

    fn deserialize<__D>(\n __deserializer: __D\n) -> Result<CombinedChangeSet<K, A>, <__D as Deserializer<'de>>::Error>
    where\n __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

    fn from(chain: BTreeMap<u32, Option<BlockHash>>) -> CombinedChangeSet<K, A>

    Converts to this type from the input type.
    ","From>>","bdk_wallet::wallet::ChangeSet"],["
    §

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

    §

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

    Converts to this type from the input type.
    ","From>>","bdk_wallet::wallet::ChangeSet"],["
    §

    impl<K, A> PartialEq for CombinedChangeSet<K, A>
    where\n K: PartialEq,\n A: PartialEq,

    §

    fn eq(&self, other: &CombinedChangeSet<K, A>) -> 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::wallet::ChangeSet"],["
    §

    impl<K, A> Serialize for CombinedChangeSet<K, A>
    where\n A: Ord + Serialize,\n K: Ord + Serialize,

    §

    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::wallet::ChangeSet"],["
    §

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

    ","StructuralPartialEq","bdk_wallet::wallet::ChangeSet"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js b/docs-rs/bdk/nightly/latest/type.impl/bdk_wallet/descriptor/enum.Descriptor.js index a405cef60f..b21ee66a3e 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<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"]] +"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"],["
    source§

    impl DescriptorExt for Descriptor<DescriptorPublicKey>

    source§

    fn dust_value(&self) -> u64

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

    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/docs-rs/bdk/nightly/latest/type.impl/std/primitive.tuple.js b/docs-rs/bdk/nightly/latest/type.impl/std/primitive.tuple.js index 4e383dc59d..fc0cdb936a 100644 --- a/docs-rs/bdk/nightly/latest/type.impl/std/primitive.tuple.js +++ b/docs-rs/bdk/nightly/latest/type.impl/std/primitive.tuple.js @@ -1,4 +1,5 @@ (function() {var type_impls = { +"bdk_chain":[["
    source§

    impl<T0, T1> Append for (T0, T1)
    where\n T0: Append,\n T1: Append,

    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.
    ","Append","bdk_chain::keychain::Indexed","bdk_chain::keychain::KeychainIndexed"],["
    source§

    impl From<BlockId> for (u32, BlockHash)

    source§

    fn from(block_id: BlockId) -> Self

    Converts to this type from the input type.
    ","From","bdk_chain::keychain::Indexed"]], "bdk_wallet":[], "example_bitcoind_rpc_polling":[], "example_cli":[], diff --git a/examples/index.html b/examples/index.html index cea8c493d7..411691cee4 100644 --- a/examples/index.html +++ b/examples/index.html @@ -29,7 +29,7 @@ - + @@ -53,7 +53,7 @@ Blog GitHub - (opens new window)

    # Examples

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

    # BDK-CLI (opens new window)

    A command line interface to experiment with the bitcoindevkit.

    # DevkitWallet (opens new window)

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

    # Padawan Wallet (opens new window)

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

    # BDKSwiftExampleWallet (opens new window)

    An example iOS app using bdk-swift.

    # Tatooine (opens new window)

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

    # SEBA Bank Proof of reserves (opens new window)

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

    # Stackmate (opens new window)

    A multi-purpose Bitcoin Wallet.

    # Spotbit (opens new window)

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

    - + diff --git a/foundation/about/index.html b/foundation/about/index.html index bbdcb280ce..5d982751cf 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 4752a45174..5c9b00b3ea 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 2897ee6b3d..198e90c1ce 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 c1328535a1..d3581f7207 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 934169fedc..e981e00458 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 3f4f4f9665..a1b4fd3e28 100644 --- a/getting-started/index.html +++ b/getting-started/index.html @@ -31,7 +31,7 @@ - + @@ -105,7 +105,7 @@ wallet.get_descriptor_for_keychain(KeychainKind::External).to_string(), wallet.get_descriptor_for_keychain(KeychainKind::Internal).to_string()); } -

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

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

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