dcdpr / libbech32-java

BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

Updates bech32 checksum constant to "M" #6

Closed danpape closed 3 years ago

danpape commented 3 years ago

This PR contains all changes needed to update the bech32 algorithm's exponential constant from the original value of "1", then the intermediate value of "0x3FFFFFFF", to the now final value of "0x2bc830a3". This final value, also known as "M", was decided upon following the recent research by Pieter Wuille, currently seen here: https://github.com/sipa/bips/blob/bip-bech32m/bip-bech32m.mediawiki

Some items to consider (similar to the c++ library): HrpAndDp is a crappy struct name for the decoded "human readable" and "data" parts. Can you suggest something better? I'm also not terribly fond of the function name "encodeUsingOriginalConstant()" which goes along with the default of "encode()".