Skip to content

Commit f59849d

Browse files
committed
Update chapter numbers
1 parent a87ec94 commit f59849d

6 files changed

+16
-16
lines changed

17_1_Setting_Up_Libwally.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ In both cases, the argument is for flags, but is currently set to `0`.
129129

130130
## Test a Test Libwally Program
131131

132-
The src directory contains [testwally.c](src/16_1_testwally.c), which just shows how the initialize and cleanup functions work.
132+
The src directory contains [testwally.c](src/17_1_testwally.c), which just shows how the initialize and cleanup functions work.
133133

134134
You can compile it as follows:
135135
```

17_3_Using_BIP32_in_Libwally.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ There is also a `wally_bip32_key_to_address` function, which can be used to gene
115115

116116
## Test HD Code
117117

118-
The code for these HD example can, as usual, be found in the [src directory](src/16_3_genhd.c).
118+
The code for these HD example can, as usual, be found in the [src directory](src/17_3_genhd.c).
119119

120120
You can compile and test it:
121121
```

17_4_Using_PSBTs_in_Libwally.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Obviously, there's a lot more you could look at in the PSBTs. In fact, looking i
116116
117117
### Test Your PSBT Reader
118118

119-
Again, the code for this (extremely rudimentary and specific) PSBT reader is in the [src directory](src/16_4_examinepsbt.c).
119+
Again, the code for this (extremely rudimentary and specific) PSBT reader is in the [src directory](src/17_4_examinepsbt.c).
120120

121121
You can compile it as normal:
122122
```
@@ -289,7 +289,7 @@ But what you have is not yet a legal PSBT, because of the lack of inputs. You ca
289289
```
290290
### Test Your PSBT Creation
291291

292-
At this point, you should have an empty, but working PSBT, which you can see by compiling and running [the program](src/16_4_createemptypsbt.c).
292+
At this point, you should have an empty, but working PSBT, which you can see by compiling and running [the program](src/17_4_createemptypsbt.c).
293293
```
294294
$ cc createemptypsbt.c -lwallycore -o createemptypsbt
295295
$ ./createemptypsbt

17_5_Using_Scripts_in_Libwally.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ As you might expect, you then add that input to your transaction:
9898
lw_response = wally_tx_add_input(tx,tx_input);
9999
```
100100

101-
> **NOTE** Obviously, you'll want to be able to create your own inputs if you're using Libwally for real applications, but this is intended as a first step. And, it can actually be useful for integrating with `bitcoin-cli`, as we'll see in [§16.7](16_7_Integrating_Libwally_and_Bitcoin-CLI.md).
101+
> **NOTE** Obviously, you'll want to be able to create your own inputs if you're using Libwally for real applications, but this is intended as a first step. And, it can actually be useful for integrating with `bitcoin-cli`, as we'll see in [§16.7](17_7_Integrating_Libwally_and_Bitcoin-CLI.md).
102102
103103
### Print a Transaction
104104

@@ -113,7 +113,7 @@ We'll show how to make use of that in §16.7.
113113

114114
## Test Your Replacement Script
115115

116-
You can grab the test code from the [src directory](src/16_5_replacewithscript.c) and compile it:
116+
You can grab the test code from the [src directory](src/17_5_replacewithscript.c) and compile it:
117117
```
118118
$ cc replacewithscript.c -lwallycore -o replacewithscript
119119
```

17_6_Using_Other_Functions_in_Libwally.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Some relate to the wallet import format (WIF):
4545

4646
## Use BIP32 Functions
4747

48-
There are additional BIP32 HD-wallet functions, beyond what was covered in [§16.3: Using BIP32 in Libwally](16_3_Using_BIP32_in_Libwally.md).
48+
There are additional BIP32 HD-wallet functions, beyond what was covered in [§17.3: Using BIP32 in Libwally](17_3_Using_BIP32_in_Libwally.md).
4949

5050
* `bip32_key_get_fingerprint` — Generate a BIP32 fingerprint for an extended key
5151
* `bip32_key_serialize` — Transform an extended key into serialized bytes
@@ -65,19 +65,19 @@ The main functions are:
6565

6666
## Use BIP39 Functions
6767

68-
A few BIP39 mnemonic-word functions were just overviewed in [§16.2: Using BIP39 in Libwally](16_2_Using_BIP39_in_Libwally.md):
68+
A few BIP39 mnemonic-word functions were just overviewed in [§17.2: Using BIP39 in Libwally](17_2_Using_BIP39_in_Libwally.md):
6969

7070
* `bip39_get_languages` — See a list of supported languages
7171
* `bit39_get_word` — Retrieve a specific word from a language's word list
7272
* `bip39_get_wordlist` — See a list of words for a language
7373

7474
## Use PSBT Functions
7575

76-
Listings of most PSBT functions can be found in [16.4: Using PSBTs in Libwally](16_4_Using_PSBTs_in_Libwally.md).
76+
Listings of most PSBT functions can be found in [17.4: Using PSBTs in Libwally](17_4_Using_PSBTs_in_Libwally.md).
7777

7878
## Use Script Functions
7979

80-
[§16.5: Using Scripts in Libwally](16_5_Using_Scripts_in_Libwally.md) just barely touched upon Libwally's Scripts functions.
80+
[§17.5: Using Scripts in Libwally](17_5_Using_Scripts_in_Libwally.md) just barely touched upon Libwally's Scripts functions.
8181

8282
There's another function that lets you determine the sort of script found in a transaction:
8383

@@ -102,7 +102,7 @@ Then there are a slew of functions that create `scriptPubKey` from bytes, `scrip
102102

103103
## Use Transaction Functions
104104

105-
We also just barely touched upon the functions that can be used to create and convert functions in [§16.5](16_5_Using_Scripts_in_Libwally.md).
105+
We also just barely touched upon the functions that can be used to create and convert functions in [§17.5](17_5_Using_Scripts_in_Libwally.md).
106106

107107
There are numerous informational functions, some of the more interesting of which are:
108108

17_7_Integrating_Libwally_and_Bitcoin-CLI.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This final section will offer some examples of using Libwally programs to comple
88

99
## Share a Transaction
1010

11-
[§16.5: Using Scripts in Libwally](16_5_Using_Scripts_in_Libwally.md) detailed how Libwally could be used to rewrite an existing transaction, to do something that `bitcoin-cli` can't: produce a transaction that contains a unique P2SH. Obviously, this is a building block; if you decide to dig further into Libwally you'll create entire transactions on your own. But, this abbreviated methodology also has its own usage: it shows how transactions can be passed back and forth between `bitcoin-cli` and Libwally, demonstrating a first example of using them in a complementary fashion.
11+
[§17.5: Using Scripts in Libwally](17_5_Using_Scripts_in_Libwally.md) detailed how Libwally could be used to rewrite an existing transaction, to do something that `bitcoin-cli` can't: produce a transaction that contains a unique P2SH. Obviously, this is a building block; if you decide to dig further into Libwally you'll create entire transactions on your own. But, this abbreviated methodology also has its own usage: it shows how transactions can be passed back and forth between `bitcoin-cli` and Libwally, demonstrating a first example of using them in a complementary fashion.
1212

1313
To fully demonstrate this methodology, you'll create a transaction with `bitcoin-cli`, using this UTXO:
1414
```
@@ -33,7 +33,7 @@ $ utxo_vout=$(bitcoin-cli listunspent | jq -r '.[0] | .vout')
3333
$ recipient=tb1qycsmq3jas5wkhf8xrfn8k7438cm5pc8h9ae2k0
3434
$ rawtxhex=$(bitcoin-cli -named createrawtransaction inputs='''[ { "txid": "'$utxo_txid'", "vout": '$utxo_vout' } ]''' outputs='''{ "'$recipient'": 0.0009 }''')
3535
```
36-
Though you placed a recipient and an amount in the output, it's irrelevent, because you'll be rewriting those. A fancier bit of code could read the existing `vout` info before rewriting, but we're keeping things very close to our [original code](src/16_5_replacewithscript.c).
36+
Though you placed a recipient and an amount in the output, it's irrelevent, because you'll be rewriting those. A fancier bit of code could read the existing `vout` info before rewriting, but we're keeping things very close to our [original code](src/17_5_replacewithscript.c).
3737

3838
Here's the one change necessary, to allow you to specify the satoshi `vout`, without having to hardcode it, as in the original:
3939
```
@@ -170,7 +170,7 @@ $ bitcoin-cli decoderawtransaction $signedtx
170170
```
171171
Voila! That's the power of Libwally with `bitcoin-cli`.
172172

173-
Obviously, you can also pass around a PSBT using the functions described in [§16.4](16_4_Using_PSBTs_in_Libwally.md) and that's a more up-to-date methodology for the modern-day usage of Bitcoin, but in either example, the concept of passing transactions from `bitcoin-cli` to Libwally code and back should be similar.
173+
Obviously, you can also pass around a PSBT using the functions described in [§17.4](17_4_Using_PSBTs_in_Libwally.md) and that's a more up-to-date methodology for the modern-day usage of Bitcoin, but in either example, the concept of passing transactions from `bitcoin-cli` to Libwally code and back should be similar.
174174

175175
## Import & Export BIP39 Seeds
176176

@@ -182,7 +182,7 @@ Unfortunately, not all interactions between Libwally and `bitcoin-cli` go as smo
182182
183183
## Import Private Keys
184184

185-
Fortunately, you can do much the same thing by importing a private key generated in Libwally. Take a look at [genhd-for-import.c](src/16_7_genhd_for_import.c), a simplified version of the `genhd` program from [§16.3](16_3_Using_BIP32_in_Libwally.md) that also uses the `jansson` library from [§15.1](15_1_Accessing_Bitcoind_with_C.md) for regularized output.
185+
Fortunately, you can do much the same thing by importing a private key generated in Libwally. Take a look at [genhd-for-import.c](src/17_7_genhd_for_import.c), a simplified version of the `genhd` program from [§17.3](17_3_Using_BIP32_in_Libwally.md) that also uses the `jansson` library from [§16.1](15_1_Accessing_Bitcoind_with_C.md) for regularized output.
186186

187187
The updated code also contains one change of note: it requests a fingerprint from Libwally so that it can properly create a derivation path:
188188
```
@@ -195,7 +195,7 @@ The updated code also contains one change of note: it requests a fingerprint fro
195195

196196
> :warning: **WARNING:** Remember that the fingerprint in derivation paths is arbitrary. Because Libwally provides one, we're using it, but if you didn't have one, you could add an arbitrary 4-byte hexcode as a fingerprint to your derivation path.
197197
198-
Be sure to compile the new code with the `jansson` library, after installing it (if necessary) per [§15.1](15_1_Accessing_Bitcoind_with_C.md).
198+
Be sure to compile the new code with the `jansson` library, after installing it (if necessary) per [§16.1](15_1_Accessing_Bitcoind_with_C.md).
199199
```
200200
$ cc genhd-for-import.c -lwallycore -lsodium -ljansson -o genhd-for-import
201201
```

0 commit comments

Comments
 (0)