@@ -227,6 +227,12 @@ program is neither 20 nor 32 bytes, the script must fail.''
227
227
As a result of the previous rules, addresses are always between 14 and 74 characters long, and their length modulo 8 cannot be 0, 3, or 5.
228
228
Version 0 witness addresses are always 42 or 62 characters, but implementations MUST allow the use of any version.
229
229
230
+ Implementations should take special care when converting the address to a
231
+ scriptPubkey, where witness version ''n'' is stored as ''OP_n'' . OP_0 is
232
+ encoded as 0x00, but OP_1 through OP_16 are encoded as 0x51 though 0x60
233
+ (81 to 96 in decimal). If a bech32 address is converted to an incorrect
234
+ scriptPubKey the result will likely be either unspendable or insecure.
235
+
230
236
===Compatibility ===
231
237
232
238
Only new software will be able to use these addresses, and only for
@@ -242,8 +248,10 @@ P2PKH addresses can be used.
242
248
* Reference encoder and decoder:
243
249
** [https://github.com/sipa/bech32/tree/master/ref/c For C ]
244
250
** [https://github.com/sipa/bech32/tree/master/ref/javascript For JavaScript ]
251
+ ** [https://github.com/sipa/bech32/tree/master/ref/go For Go ]
245
252
** [https://github.com/sipa/bech32/tree/master/ref/python For Python ]
246
253
** [https://github.com/sipa/bech32/tree/master/ref/haskell For Haskell ]
254
+ ** [https://github.com/sipa/bech32/tree/master/ref/ruby For Ruby ]
247
255
** [https://github.com/sipa/bech32/tree/master/ref/rust For Rust ]
248
256
249
257
* Fancy decoder that localizes errors:
@@ -264,9 +272,9 @@ The following list gives valid segwit addresses and the scriptPubKey that they
264
272
translate to in hex.
265
273
* <tt>BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4 </tt>: <tt>0014751e76e8199196d454941c45d1b3a323f1433bd6 </tt>
266
274
* <tt>tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7 </tt>: <tt>00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262 </tt>
267
- * <tt>bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx </tt>: <tt>8128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6 </tt>
268
- * <tt>BC1SW50QA3JX3S </tt>: <tt>9002751e </tt>
269
- * <tt>bc1zw508d6qejxtdg4y5r3zarvaryvg6kdaj </tt>: <tt>8210751e76e8199196d454941c45d1b3a323 </tt>
275
+ * <tt>bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k7grplx </tt>: <tt>5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6 </tt>
276
+ * <tt>BC1SW50QA3JX3S </tt>: <tt>6002751e </tt>
277
+ * <tt>bc1zw508d6qejxtdg4y5r3zarvaryvg6kdaj </tt>: <tt>5210751e76e8199196d454941c45d1b3a323 </tt>
270
278
* <tt>tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy </tt>: <tt>0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433 </tt>
271
279
272
280
The following list gives invalid segwit addresses and the reason for
0 commit comments