sipa / bech32

Code snippets and analysis of the Bech32 format
191 stars 107 forks source link

update rust reference code for bech32m #60

Open apoelstra opened 3 years ago

apoelstra commented 3 years ago

Also add support for "bcrt" HRP

sipa commented 3 years ago

Hmm, is it desirable to restrict the code to bc/bcrt/tb? I don't think the other reference code does that.

apoelstra commented 3 years ago

If not I'm happy to remove it. It seemed like an odd thing to do, but the existing Rust code did it.

sipa commented 3 years ago

Yeah, I think I'd prefer removing that requirement.

apoelstra commented 3 years ago

Removed. This did mean that we had to remove a couple test vectors (which are "invalid segwit addresses" according to BIP-173 and 350 but nonetheless valid bech32).