-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for bech32 in genesis file #362
Comments
When importing a @webmaster128 created a bug report for the |
@husio I think they don't care much about code they inherit from https://github.com/btcsuite/btcutil and don't use. Maybe it is worth fixing the btcsuite/btcutil implementation and use it. |
Blocked by btcsuite/btcutil#137 unless we will use different bech32 decoder implementation. Initial work done in https://github.com/iov-one/weave/tree/bech32_support_issue_362 |
Looks like that library is a no-go for now. I was digging in to see if the bech32 c utility was reliable (or maybe that one had errors). Seems this uses code pulled from the reference implementation. Digging for test vectors to validate one over the other, I found a list of reference implementations in many languages, including go. And this version includes a complete test suite with test vectors. Digging in, I found no license file, but as one github user pointed out, there is a BSD license in the source itself. Given this code has not changed in around 2 years and is a reference implementation, I would suggest copying these files (including the original copyright notice) into our repo and using that. |
Copy https://github.com/sipa/bech32/tree/master/ref/go/src/bech32 as is into |
// ...
payloadDec, err := bech32.ConvertBits(payload, 5, 8, false)
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(want, payloadDec) {
// ... |
Thanks @matheusd I was really wondering how this implementation could differ from the standard. I guess we have two approaches that work now. |
Allow to specify a JSON serialized condition using bech32 encoding. resolve #362
Builds on #347
Also allow the
bech32:
prefix to be parsed:We can use tendermint bech32 implementation as an example and use the implementation from https://github.com/btcsuite/btcutil/tree/master/bech32
We should also verify the library matches the values we have with iov-core (use some standard encode/decode test vectors)
The text was updated successfully, but these errors were encountered: