Skip to content

Commit c228195

Browse files
hardingjnewbery
authored andcommitted
s/bech32/bech32m/ in text, when appropriate
1 parent ef10197 commit c228195

4 files changed

+16
-16
lines changed

2.0-taproot-introduction.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"\n",
2424
"In each chapter, we first introduce the case study scenario and give an overview of the technology. We then demonstrate its use as follows:\n",
2525
"\n",
26-
"1. We first construct a segwit v1 witness program that implements the desired spending policy and derive the bech32 address for that witness program;\n",
27-
"2. Then we start a Bitcoin Core full node, generate 101 blocks on the node (so that the node has a mature balance to spend), and spend coins from the Bitcoin Core wallet to the bech32 address from step (1);\n",
26+
"1. We first construct a segwit v1 witness program that implements the desired spending policy and derive the bech32m address for that witness program;\n",
27+
"2. Then we start a Bitcoin Core full node, generate 101 blocks on the node (so that the node has a mature balance to spend), and spend coins from the Bitcoin Core wallet to the bech32m address from step (1);\n",
2828
"3. Finally, we construct a transaction spending from the output created in step (2) back to the Bitcoin Core wallet. We sign the transaction and verify that the transaction is valid using the full node's `testmempoolaccept` RPC method.\n",
2929
"\n",
3030
"This sequence of steps is illustrated below:"

2.1-segwit-version-1.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"source": [
7070
"#### 2.1.1 Example: Constructing a segwit v1 output\n",
7171
"\n",
72-
"In this example, we construct segwit v1 output for spending along the key path. We generate a key pair, encode the public key using the BIP340 and BIP341 pubkey encoding rules, and then encode the witness version and witness program to a bech32 address."
72+
"In this example, we construct segwit v1 output for spending along the key path. We generate a key pair, encode the public key using the BIP340 and BIP341 pubkey encoding rules, and then encode the witness version and witness program to a bech32m address."
7373
]
7474
},
7575
{
@@ -86,10 +86,10 @@
8686
"program = pubkey.get_bytes()\n",
8787
"print(\"Witness program is {}\\n\".format(program.hex()))\n",
8888
"\n",
89-
"# Create (regtest) bech32 address\n",
89+
"# Create (regtest) bech32m address\n",
9090
"version = 0x01\n",
9191
"address = program_to_witness(version, program)\n",
92-
"print(\"bech32 address is {}\".format(address))"
92+
"print(\"bech32m address is {}\".format(address))"
9393
]
9494
},
9595
{
@@ -290,7 +290,7 @@
290290
"# Generate the address\n",
291291
"version = 0\n",
292292
"address = program_to_witness(version, script_hash)\n",
293-
"print(\"bech32 address is {}\".format(address))"
293+
"print(\"bech32m address is {}\".format(address))"
294294
]
295295
},
296296
{
@@ -545,7 +545,7 @@
545545
"source": [
546546
"**Congratulations!** In this chapter, you have:\n",
547547
"\n",
548-
"- Learned how to create a segwit v1 output and derive its bech32 address.\n",
548+
"- Learned how to create a segwit v1 output and derive its bech32m address.\n",
549549
"- Sent bitcoin to a segwit v1 address, and then constructed a transaction that spends the segwit v1 output back to the wallet using the key path.\n",
550550
"- Shown how using a segwit v1 MuSig output saves fees and improves privacy over using P2WSH multisig."
551551
]

2.3-tapscript.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@
576576
"source": [
577577
"#### Example 2.3.8: Generate a single tapscript segwit v1 address\n",
578578
"\n",
579-
"In this example, we construct segwit v1 output for spending along the single script path. We will reuse the previously generated segwit v1 witness program which has the `csa_hashlock_delay` tapscript committed to it, and encode it to a bech32 address."
579+
"In this example, we construct segwit v1 output for spending along the single script path. We will reuse the previously generated segwit v1 witness program which has the `csa_hashlock_delay` tapscript committed to it, and encode it to a bech32m address."
580580
]
581581
},
582582
{
@@ -592,10 +592,10 @@
592592
"program = taproot_pubkey_b\n",
593593
"print(\"Witness program is {}\\n\".format(program.hex()))\n",
594594
"\n",
595-
"# Create (regtest) bech32 address\n",
595+
"# Create (regtest) bech32m address\n",
596596
"version = 0x01\n",
597597
"address = program_to_witness(1, program)\n",
598-
"print(\"bech32 address is {}\".format(address))"
598+
"print(\"bech32m address is {}\".format(address))"
599599
]
600600
},
601601
{

2.4-taptree.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"1. Compute TapLeaves A, B and C.\n",
7272
"2. Compute Internal TapBranch AB.\n",
7373
"3. Compute TapTweak\n",
74-
"4. Derive the segwit output address."
74+
"4. Derive the bech32m address."
7575
]
7676
},
7777
{
@@ -116,10 +116,10 @@
116116
"taptweak = # TODO: implement\n",
117117
"print(\"TapTweak:\", taptweak.hex())\n",
118118
"\n",
119-
"# 4) Derive the segwit output address.\n",
119+
"# 4) Derive the bech32m address.\n",
120120
"taproot_pubkey_b = internal_pubkey.tweak_add(taptweak).get_bytes()\n",
121-
"segwit_address = program_to_witness(1, taproot_pubkey_b)\n",
122-
"print('Segwit address:', segwit_address)"
121+
"bech32m_address = program_to_witness(1, taproot_pubkey_b)\n",
122+
"print('Bech32m address:', bech32m_address)"
123123
]
124124
},
125125
{
@@ -343,7 +343,7 @@
343343
"source": [
344344
"#### _Programming Exercise 2.4.5_ - Constructing a taproot output from a taptree\n",
345345
"\n",
346-
"In the following exercise, please construct the output and segwit address for a taptree with 4 leaves using with the huffman taptree constructor, so that it results in a balanced tree. Please generate new keys for the internal key and pay-to-pubkey tapscripts."
346+
"In the following exercise, please construct the output and bech32m address for a taptree with 4 leaves using with the huffman taptree constructor, so that it results in a balanced tree. Please generate new keys for the internal key and pay-to-pubkey tapscripts."
347347
]
348348
},
349349
{
@@ -371,7 +371,7 @@
371371
"taptree = # TODO: implement\n",
372372
"taptree.huffman_constructor( # TODO: implement\n",
373373
"\n",
374-
"# Generate taproot tree with the `construct()` method, then use the taproot bytes to create a segwit address\n",
374+
"# Generate taproot tree with the `construct()` method, then use the taproot bytes to create a bech32m address\n",
375375
"taproot_script, tweak, control_map = taptree.construct()\n",
376376
"taproot_pubkey = pubkey_internal.tweak_add(tweak) \n",
377377
"program = taproot_pubkey.get_bytes()\n",

0 commit comments

Comments
 (0)