Author: Ryan Grant 2020-12-08 17:39:23
Published on: 2020-12-08T17:39:23+00:00
A suggested strategy for a bech32 library external to Bitcoin Core is proposed, which includes defaulting to the new M, using an interface to explicitly use both M=1 and M=0x2bc830a3, throwing an error if decoding fails but informing whether the other M would have succeeded. An interface to peek at the witness version byte of the data part is also recommended, with return values such as "it's version zero, based on a clean decoding" or "too many errors to say anything more about decoding". While looking into the data that is supposed to be checksummed to determine which checksum to use may not be elegant, auto-correcting the witness version byte may be done, against BIP173's current version advice. Some of the libraries that will be contemplating these steps include those found in https://github.com/topics/bech32?o=desc&s=stars. Three existing uses of bech32 that are external to Bitcoin Core are provided in https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md, https://github.com/btcontract/lnurl-rfc, and https://github.com/bitcoin/bips/blob/master/bip-0136.mediawiki. Finally, BIP136 can be unconditionally moved to M=0x2bc830a3 due to having little legacy burden.
Updated on: 2023-06-14T16:07:32.106322+00:00