Update 16_7_Integrating_Libwally_and_Bitcoin-CLI.md

This commit is contained in:
Shannon Appelcline 2020-08-25 11:30:25 -10:00 committed by GitHub
parent fcfcf975a6
commit 83bbeee061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,13 +2,13 @@
> **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning.
Libwally is ultimately limited. It's about creating and accessing wallets, with some additional functions related to transactions and PSBTs that might be useful for services that are not connected to full nodes on the internet. Ultimately, however, you're going to need full node services to take advantage of Libwally.
Libwally is limited. It's about creating and accessing wallets, with some additional functions related to transactions and PSBTs that might be useful for services that are not connected to full nodes on the internet. Ultimately, however, you're going to need full node services to take advantage of Libwally.
This final section will offer some examples of using Libwally programs to complement a `bitcoin-cli` environment. Though we will suggest that these services are all on the same machine, they may become even more powerful if the `bitcoin-cli` service is directly connected to the internet and the Libwally service is not.
This final section will offer some examples of using Libwally programs to complement a `bitcoin-cli` environment. Though these examples imply that these services are all on the same machine, they may become even more powerful if the `bitcoin-cli` service is directly connected to the internet and the Libwally service is not.
## Creating Recovery Words
One of the big limitations of Bitcoin Core is that it creates a BIP32 HD wallet, but it doesn't provide any way to back that up with BIP39 mnemonic words. You can now do that yourself.
One of the big limitations of Bitcoin Core is that it creates a BIP32 HD wallet, but it doesn't provide any way to back that up with BIP39 mnemonic words. With Libwally, you can now do that yourself.
You can dump your wallet with the `dumpwallet` RPC command:
```
@ -17,20 +17,15 @@ $ bitcoin-cli dumpwallet seed
"filename": "/home/standup/.bitcoin/seed"
}
```
If you read the file you created, you should see your seed toward the start:
If you read the file you created, you should see your seed with the line `hdseed=1`
```
# Wallet dump created by Bitcoin v0.20.0
# * Created on 2020-08-19T01:26:20Z
# * Best block at time of backup was 1807738 (00000000bf0ec16a551727230a56ba5c37aae9158114e6f906c1df9655bf97ed),
# mined on 2020-08-19T01:18:26Z
# extended private masterkey: tprv8ZgxMBicQKsPf1YVXBNApPnJZSt7hYkvBvkzKygbKSF7Bbnvha1ZwRnzJRCXyXkzSkJpggPcvPBroUmhFKYM8F4cxJCjFnmE2MTqrH8ywYf
standup@btctest:~/.bitcoin$ more seed | grep hdseed
cV2ofwMK2EWH7PduPGTU3mKkKsQRhAddWNzMLHqVgnvD8RgkHE97 2020-08-04T19:04:02Z hdseed=1 # addr=tb1qtuk0khv6qmwq6xl0llk9r8ht35z3kkk6qsaazw
```
(Under that will be keys for all of your addresses.)
The following command will currently work to extract that seed, though this type of command depending on file formatting is always prone to breaking as file formats change:
```
$ seed=$(more ~/.bitcoin/seed | grep "extended" | awk -F': ' '{print $2}')
seed=$(cat seed | grep hdseed=1 | awk '{print $1}')
```
Now, you just need to import that into a simple Libwally program.