LNP-BP / rust-lnpbp

Library implementing LNPBP standards related to client-side-validation paradigm
https://lnp-bp.org
MIT License
79 stars 38 forks source link

Deprecate lnpbp_bech32 in favor of baid58 #226

Closed dr-orlovsky closed 1 year ago

dr-orlovsky commented 1 year ago

It become apparent that the use of Bech32m encoding was a mistake. You can read more about this in here: https://github.com/UBIDECO/rust-baid58/blob/0d9f2b2af90212212b0e9ca5723788bf07b5607b/README.md?plain=1#L72-L94 Additionally to what is said there, Bech32(m) simply doesn't work for anything longer than 90 encoded characters: it is a clearly stated in the BIP-173:

A Bech32[2] string is at most 90 characters long

The reason for the length limit is the fact that the error correction can't handle longer strings; and 6 character checksum appended to the end of the Bech32(m) string is just a waste of space in this case - plus "safety" guarantees of the Bech32 are broken.

Instead, recommend Base58 encoding using additional optional checksums and human-readable identifiers: Baid58.

cryptoquick commented 1 year ago

ACK, it looks good, I'd prefer this over Base64.