Skip to content

Commit eb62f6e

Browse files
committed
bip93: make bech32 capitalization consistently lowercase
1 parent 838fd93 commit eb62f6e

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

bip-0093.mediawiki

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,20 @@ However, BIP-0039 has no error-correcting ability, cannot sensibly be extended t
6060

6161
===codex32===
6262

63-
A codex32 string is similar to a Bech32 string defined in [https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki BIP-0173].
63+
A codex32 string is similar to a bech32 string defined in [https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki BIP-0173].
6464
It reuses the base32 character set from BIP-0173, and consists of:
6565

6666
* A human-readable part, which is the string "ms" (or "MS").
6767
* A separator, which is always "1".
6868
* A data part which is in turn subdivided into:
6969
** A threshold parameter, which MUST be a single digit between "2" and "9", or the digit "0".
7070
*** If the threshold parameter is "0" then the share index, defined below, MUST have a value of "s" (or "S").
71-
** An identifier consisting of 4 Bech32 characters.
72-
** A share index, which is any Bech32 character. Note that a share index value of "s" (or "S") is special and denotes the unshared secret (see section "Unshared Secret").
73-
** A payload which is a sequence of up to 74 Bech32 characters. (However, see '''Long codex32 Strings''' below for an exception to this limit.)
74-
** A checksum which consists of 13 Bech32 characters as described below.
71+
** An identifier consisting of 4 bech32 characters.
72+
** A share index, which is any bech32 character. Note that a share index value of "s" (or "S") is special and denotes the unshared secret (see section "Unshared Secret").
73+
** A payload which is a sequence of up to 74 bech32 characters. (However, see '''Long codex32 Strings''' below for an exception to this limit.)
74+
** A checksum which consists of 13 bech32 characters as described below.
7575
76-
As with Bech32 strings, a codex32 string MUST be entirely uppercase or entirely lowercase.
76+
As with bech32 strings, a codex32 string MUST be entirely uppercase or entirely lowercase.
7777
For presentation, lowercase is usually preferable, but uppercase SHOULD be used for handwritten codex32 strings.
7878
If a codex32 string is encoded in a QR code, it SHOULD use the uppercase form, as this is encoded more compactly.
7979

@@ -131,7 +131,7 @@ We do not specify how an implementation should implement error correction. Howev
131131
* Implementations interpret "?" as an erasure.
132132
* Implementations optionally interpret other non-bech32 characters, or characters with incorrect case, as erasures.
133133
* If a string with 8 or fewer erasures can have those erasures filled in to make a valid codex32 string, then the implementation suggests such a string as a correction.
134-
* If a string consisting of valid Bech32 characters in the proper case can be made valid by substituting 4 or fewer characters, then the implementation suggests such a string as a correction.
134+
* If a string consisting of valid bech32 characters in the proper case can be made valid by substituting 4 or fewer characters, then the implementation suggests such a string as a correction.
135135
136136
===Unshared Secret===
137137

@@ -243,7 +243,7 @@ The conversion process consists of:
243243
# Choose a 4 bech32 character identifier
244244
#* We do not define how to choose the identifier, beyond noting that it SHOULD be distinct for every master seed the user may need to disambiguate.
245245
# Set the share index to <code>s</code>
246-
# Set the payload to a Bech32 encoding of the master seed, padded with arbitrary bits
246+
# Set the payload to a bech32 encoding of the master seed, padded with arbitrary bits
247247
# Generating a valid checksum in accordance with the Checksum section
248248
249249
Along with the codex32 secret, the user must generate ''t''-1 other codex32 shares, each with the same threshold value, the same identifier, and a distinct share index.
@@ -288,8 +288,8 @@ def ms32_create_long_checksum(data):
288288

289289
A long codex32 string follows the same specification as a regular codex32 string with the following changes.
290290

291-
* The payload is a sequence of between 75 and 103 Bech32 characters.
292-
* The checksum consists of 15 Bech32 characters as defined above.
291+
* The payload is a sequence of between 75 and 103 bech32 characters.
292+
* The checksum consists of 15 bech32 characters as defined above.
293293
294294
A codex32 string with a data part of 94 or 95 characters is never legal as a regular codex32 string is limited to 93 data characters and a long codex32 string is at least 96 characters.
295295

@@ -384,9 +384,9 @@ The inline code in this BIP text can be used as a Python reference.
384384
===Test vector 1===
385385

386386
This example shows the codex32 format, when used without splitting the secret into any shares.
387-
The payload contains 26 Bech32 characters, which corresponds to 130 bits. We truncate the last two bits in order to obtain a 128-bit master seed.
387+
The payload contains 26 bech32 characters, which corresponds to 130 bits. We truncate the last two bits in order to obtain a 128-bit master seed.
388388

389-
codex32 secret (Bech32): <code>ms10testsxxxxxxxxxxxxxxxxxxxxxxxxxx4nzvca9cmczlw</code>
389+
codex32 secret (bech32): <code>ms10testsxxxxxxxxxxxxxxxxxxxxxxxxxx4nzvca9cmczlw</code>
390390

391391
Master secret (hex): <code>318c6318c6318c6318c6318c6318c631</code>
392392

@@ -419,7 +419,7 @@ In particular, given an all uppercase codex32 string, we still use lowercase <co
419419
===Test vector 3===
420420

421421
This example shows splitting an existing 128-bit master seed into "random" codex32 shares, using ''k''=3 and an identifier of <code>cash</code>.
422-
We appended two zero bits in order to obtain 26 Bech32 characters (130 bits of data) from the 128-bit master seed.
422+
We appended two zero bits in order to obtain 26 bech32 characters (130 bits of data) from the 128-bit master seed.
423423

424424
Master secret (hex): <code>ffeeddccbbaa99887766554433221100</code>
425425

@@ -447,7 +447,7 @@ However, each choice would have resulted in a different set of derived shares.
447447
===Test vector 4===
448448

449449
This example shows converting a 256-bit secret into a codex32 secret, without splitting the secret into any shares.
450-
We appended four zero bits in order to obtain 52 Bech32 characters (260 bits of data) from the 256-bit secret.
450+
We appended four zero bits in order to obtain 52 bech32 characters (260 bits of data) from the 256-bit secret.
451451

452452
256-bit secret (hex): <code>ffeeddccbbaa99887766554433221100ffeeddccbbaa99887766554433221100</code>
453453

@@ -476,7 +476,7 @@ Note that the choice to append four zero bits was arbitrary, and any of the foll
476476
===Test vector 5===
477477

478478
This example shows generating a new 512-bit master seed using "random" codex32 characters and appending a checksum.
479-
The payload contains 103 Bech32 characters, which corresponds to 515 bits. The last three bits are discarded when converting to a 512-bit master seed.
479+
The payload contains 103 bech32 characters, which corresponds to 515 bits. The last three bits are discarded when converting to a 512-bit master seed.
480480

481481
This is an example of a '''Long codex32 String'''.
482482

@@ -576,8 +576,8 @@ These examples all incorrectly mix upper and lower case characters.
576576

577577
===Mathematical Companion===
578578

579-
Below we use the Bech32 character set to denote values in GF[32].
580-
In Bech32, the letter <code>Q</code> denotes zero and the letter <code>P</code> denotes one.
579+
Below we use the bech32 character set to denote values in GF[32].
580+
In bech32, the letter <code>Q</code> denotes zero and the letter <code>P</code> denotes one.
581581
The digits <code>0</code> and <code>2</code> through <code>9</code> do ''not'' denote their numeric values.
582582
They are simply elements of GF[32].
583583

0 commit comments

Comments
 (0)