btcsuite / btcutil

Provides bitcoin-specific convenience functions and types
475 stars 408 forks source link

Add support for the bech32m encoding defined in BIP-350 #195

Closed federicobond closed 2 years ago

federicobond commented 3 years ago

Taproot is just around the corner with a new encoding format for addresses. I already have a working version of btcutil with Bech32m, but it breaks the signature of bech32.Encode and bech32.EncodeFromBase256 with an additional encoding parameter and also returns an additional encoding value in the bech32.Decode and bech32.DecodeFromBase256, which is used to make sure that addresses use the correct encoding depending on the witness version.

If we can't break the current API, then we need to find a new name for these functions or create a new bech32m package. Any comments or suggestions welcome.

gcsfred2 commented 3 years ago

@federicobond I suggest new names for these functions.

benma commented 3 years ago

@federicobond would you mind opening a PR?

I agree that a new package is preferable.

benma commented 3 years ago

https://github.com/btcsuite/btcutil/pull/202