Skip to content

Commit b501de4

Browse files
authored
Merge pull request bitcoin#582 from sipa/up173
Add extra test cases & implementations to BIP173
2 parents 41e0684 + 199404e commit b501de4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

bip-0173.mediawiki

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ P2PKH addresses can be used.
247247

248248
* Reference encoder and decoder:
249249
** [https://github.com/sipa/bech32/tree/master/ref/c For C]
250+
** [https://github.com/sipa/bech32/tree/master/ref/c++ For C++]
250251
** [https://github.com/sipa/bech32/tree/master/ref/javascript For JavaScript]
251252
** [https://github.com/sipa/bech32/tree/master/ref/go For Go]
252253
** [https://github.com/sipa/bech32/tree/master/ref/python For Python]
@@ -268,6 +269,16 @@ The following strings have a valid Bech32 checksum.
268269
* <tt>11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc8247j</tt>
269270
* <tt>split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w</tt>
270271
272+
The following strings have an invalid Bech32 checksum (with reason for invalidity):
273+
* 0x20 + <tt>1nwldj5</tt>: HRP character out of range
274+
* 0x7F + <tt>1axkwrx</tt>: HRP character out of range
275+
* <tt>an84characterslonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1569pvx</tt>: overall max length exceeded
276+
* <tt>pzry9x0s0muk</tt>: No separator character
277+
* <tt>1pzry9x0s0muk</tt>: Empty HRP
278+
* <tt>x1b4n0q5v</tt>: Invalid data character
279+
* <tt>li1dgmt3</tt>: Too short checksum
280+
* <tt>de1lg7wt</tt> + 0xFF: Invalid character in checksum
281+
271282
The following list gives valid segwit addresses and the scriptPubKey that they
272283
translate to in hex.
273284
* <tt>BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4</tt>: <tt>0014751e76e8199196d454941c45d1b3a323f1433bd6</tt>
@@ -286,8 +297,9 @@ their invalidity.
286297
* <tt>bc10w508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7kw5rljs90</tt>: Invalid program length
287298
* <tt>BC1QR508D6QEJXTDG4Y5R3ZARVARYV98GJ9P</tt>: Invalid program length for witness version 0 (per BIP141)
288299
* <tt>tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sL5k7</tt>: Mixed case
289-
* <tt>tb1pw508d6qejxtdg4y5r3zarqfsj6c3</tt>: zero padding of more than 4 bits
300+
* <tt>bc1zw508d6qejxtdg4y5r3zarvaryvqyzf3du</tt>: zero padding of more than 4 bits
290301
* <tt>tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3pjxtptv</tt>: Non-zero padding in 8-to-5 conversion
302+
* <tt>bc1gmk9yu</tt>: Empty data section
291303
292304
===Checksum design===
293305

0 commit comments

Comments
 (0)