You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0173.mediawiki
+24-9Lines changed: 24 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ increase, but that does not matter when copy-pasting addresses.</ref> format cal
76
76
77
77
A Bech32<ref>'''Why call it Bech32?''' "Bech" contains the characters BCH (the error
78
78
detection algorithm used) and sounds a bit like "base".</ref> string is at most 90 characters long and consists of:
79
-
* The '''human-readable part''', which is intended to convey the type of data or anything else that is relevant for the reader. Its validity (including the used set of characters) is application specific, but restricted to ASCII characters with values in the range 33-126.
79
+
* The '''human-readable part''', which is intended to convey the type of data, or anything else that is relevant to the reader. This part MUST contain 1 to 83 US-ASCII characters, with each character having a value in the range [33-126]. HRP validity may be further restricted by specific applications.
80
80
* The '''separator''', which is always "1". In case "1" is allowed inside the human-readable part, the last one in the string is the separator<ref>'''Why include a separator in addresses?''' That way the human-readable
81
81
part is unambiguously separated from the data part, avoiding potential
82
82
collisions with other human-readable parts that share a prefix. It also
@@ -153,7 +153,7 @@ guarantees detection of '''any error affecting at most 4 characters'''
153
153
and has less than a 1 in 10<sup>9</sup> chance of failing to detect more
154
154
errors. More details about the properties can be found in the
155
155
Checksum Design appendix. The human-readable part is processed by first
156
-
feeding the higher bits of each character's ASCII value into the
156
+
feeding the higher bits of each character's US-ASCII value into the
157
157
checksum calculation followed by a zero and then the lower bits of each<ref>'''Why are the high bits of the human-readable part processed first?'''
158
158
This results in the actually checksummed data being ''[high hrp] 0 [low hrp] [data]''. This means that under the assumption that errors to the
159
159
human readable part only change the low 5 bits (like changing an alphabetical character into another), errors are restricted to the ''[low hrp] [data]''
@@ -182,11 +182,15 @@ to make.
182
182
183
183
'''Uppercase/lowercase'''
184
184
185
-
Decoders MUST accept both uppercase and lowercase strings, but
186
-
not mixed case. The lowercase form is used when determining a character's
187
-
value for checksum purposes. For presentation, lowercase is usually
188
-
preferable, but inside QR codes uppercase SHOULD be used, as those permit
189
-
the use of
185
+
The lowercase form is used when determining a character's value for checksum purposes.
186
+
187
+
Encoders MUST always output an all lowercase Bech32 string.
188
+
If an uppercase version of the encoding result is desired, (e.g.- for presentation purposes, or QR code use),
189
+
then an uppercasing procedure can be performed external to the encoding process.
190
+
191
+
Decoders MUST NOT accept strings where some characters are uppercase and some are lowercase (such strings are referred to as mixed case strings).
192
+
193
+
For presentation, lowercase is usually preferable, but inside QR codes uppercase SHOULD be used, as those permit the use of
190
194
''[http://www.thonky.com/qr-code-tutorial/alphanumeric-mode-encoding alphanumeric mode]'', which is 45% more compact than the normal
* <tt>?1ezyfcl</tt> WARNING: During conversion to US-ASCII some encoders may set unmappable characters to a valid US-ASCII character, such as '?'. For example:
0 commit comments