In order to build the website locally, you'll need [Node.js](https://nodejs.org/) >= 14.16 (or basically the latest LTS version).
-The setup is straight forward:
+The setup is straightforward:
```bash
# Install dependencies
### Embedding YouTube videos
-To add a YouTube video with a preview, you can so so by linking to it like this:
+To add a YouTube video with a preview, you can do so by linking to it like this:
```md
[](https://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE)
```
-Note that the link item need to be a preview image (either from YouTube or a custom one) to result in an embedded video.
+Note that the link item needs to be a preview image (either from YouTube or a custom one) to result in an embedded video.
### Check for broken links
```
We disabled the default BDK feature (which specifies blockchain backend as an electrum server) and we requested the following features:
- **all-keys**: Adds BIP39 key derivation capabilities
- - **key-value-db**: Adds a persistance storage capability
+ - **key-value-db**: Adds a persistence storage capability
- **rpc**: Adds the RPC blockchain backend capability.
-Now that we have the dependcies added, we can import them in the `main.rs` file to use in our code.
+Now that we have the dependencies added, we can import them in the `main.rs` file to use in our code.
Add the following imports at the start of `main.rs`
```rust
...
}
```
-Running the binary should produces the following result
+Running the binary should produce the following result
```shell
$ cargo run
recv: "wpkh([89df6a67/84'/1'/0'/0]tprv8iSRXyLtTKJN9qt1jyPVqwhDMEaYztXunPaRQznaH1z8gj8e2g7RnF2ZoHP56VEXwMn76AiV1Je6nJmZbFistwAQCrRGmSrsoKfdqfTDNA1/*)",
- We used the rpc configuration to create a `RpcBlockchain` structure.
- Finally we used the Descriptors, Database, and Blockchain to create our final BDK `wallet` structure.
-Now that we have a our wallet cooked, in the end, we instructed it to sync with the bitcoin core backend, and fetch us a new address.
+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.
If all goes well, you should see an address printed in the terminal.
}
```
-The above code segment is mostly straight forward. The only new thing added is `wallet.build_tx()` which returns a `TxBuilder`. 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 `TxBuilder` supports scour its implementation [here](https://github.com/bitcoindevkit/bdk/blob/38d1d0b0e29d38cd370c740d798d96a3c9fcaa1f/src/wallet/tx_builder.rs#L123-L153).
+The above code segment is mostly straightforward. The only new thing added is `wallet.build_tx()` which returns a `TxBuilder`. 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 `TxBuilder` supports scour its implementation [here](https://github.com/bitcoindevkit/bdk/blob/38d1d0b0e29d38cd370c740d798d96a3c9fcaa1f/src/wallet/tx_builder.rs#L123-L153).
Finally to step through what we did above:
- We asked core wallet to send 10 BTC to bdk wallet address.
let xkey: ExtendedKey = (mnemonic, password).into_extended_key().unwrap();
let xprv = xkey.into_xprv(Network::Regtest).unwrap();
- // Derive our dewscriptors to use
+ // Derive our descriptors to use
// We use the following paths for recieve and change descriptor
// recieve: "m/84h/1h/0h/0"
// change: "m/84h/1h/0h/1"
## Step 1: Seed Generate
-### 1a: Mnemonic word-list + XPRV (Exteneded Private Key) :key:
+### 1a: Mnemonic word-list + XPRV (Extended Private Key) :key:
Linux/Terminal:
:arrow_forward: `bdk-cli key generate | tee key.json`
}
```
-- Verify transcation in the memory pool on testnet [Mempool-testnet!](https://mempool.space/testnet)
+- Verify transaction in the memory pool on testnet [Mempool-testnet!](https://mempool.space/testnet)
:::tip
Run sync one more time and see that the balance has decreased.
- [BIP: 174 - Partially Signed Bitcoin Transaction Format](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki)
- [What are Descriptors and miniscript?](https://blog.summerofbitcoin.org/miniscript-policy-descriptors-hidden-powers-of-bitcoin/)
- [Master Private Key and Extended Private Key](https://bitcoin.stackexchange.com/questions/97242/bip39-tool-bip32-extended-private-key-vs-bip32-root-key)
-- [Minsc A Miniscript-based scripting language for Bitcoin contracts](https://min.sc)
\ No newline at end of file
+- [Minsc A Miniscript-based scripting language for Bitcoin contracts](https://min.sc)
There are two notable differences though. First, we call `build_async()` to
create an asynchronous Esplora client. Second the SOCKS5 URL scheme is
“socks5h”. It’s not a typo. The async client supports two SOCKS5 schemes
-“socks5” and “socks5h”. The difference between them that the former
+“socks5” and “socks5h”. The difference between them is that the former
makes the client to resolve domain names, and the latter does not, so the
client passes them to the proxy as is. A regular DNS resolver cannot
resolve Tor onion addresses, so we should use “socks5h” here.