Commit graph

9 commits

Author SHA1 Message Date
josibake
5676aec1e1
refactor: Model the bech32 charlimit as an Enum
Bech32(m) was defined with a 90 character limit so that certain
guarantees for error detection could be made for segwit addresses.
However, there is nothing about the encoding scheme itself that requires
a limit and in practice bech32(m) has been used without the 90 char
limit (e.g. lightning invoices).

Further, increasing the character limit doesn't do away with error
detection, it simply lessons the guarantees.

Model charlimit as an Enum, so that if a different address scheme is
using bech32(m), the character limit for that address scheme can be
used, rather than always using the 90 charlimit defined for segwit
addresses.

upate comment
2024-05-13 12:07:47 +02:00
Samuel Dobson
a4fe70171b Make Bech32 LocateErrors return error list rather than using out-arg 2021-12-06 14:17:41 +13:00
Samuel Dobson
88cc481092 Modify copyright header on Bech32 code 2021-10-12 12:03:14 +13:00
Samuel Dobson
b62b67e06c Add Bech32 error location function 2021-10-12 12:03:14 +13:00
Fabian Jahr
03346022d6 naming nits 2021-03-17 17:59:22 -07:00
Pieter Wuille
da2bb6976d Implement Bech32m encoding/decoding 2021-03-15 17:26:35 -07:00
Samuel Dobson
2457aea83c Assert that the HRP is lowercase in Bech32::Encode 2019-09-05 13:25:11 +12:00
practicalswift
8fd6af89a0 Fix missing or inconsistent include guards 2018-03-22 16:23:04 +01:00
Pieter Wuille
8fd2267053 Import Bech32 C++ reference code & tests
This includes a reformatted version of the Bech32 reference code
(see https://github.com/sipa/bech32/tree/master/ref/c%2B%2B), with
extra documentation.
2017-09-28 16:02:16 -07:00