Skip to content
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

Fix bech32 encoding #690

Closed
greg-szabo opened this issue Nov 20, 2020 · 1 comment · Fixed by #704
Closed

Fix bech32 encoding #690

greg-szabo opened this issue Nov 20, 2020 · 1 comment · Fixed by #704
Milestone

Comments

@greg-szabo
Copy link
Member

PubKey::to_bech32() is not compatible with the Cosmos-SDK/Tendermint-Go implementation.

Go still uses Amino encoding before converting the public key into a bech32-encoded string.

This causes issues for KMS: iqlusioninc/tmkms#228

See the SDK code that implements the difference: https://github.com/cosmos/cosmos-sdk/blob/590358652cc1cbc13872ea1659187e073ea38e75/types/address.go#L634-L639

Cleanup effort here: cosmos/cosmos-sdk#7357

@greg-szabo greg-szabo added this to the v0.17.0 milestone Nov 20, 2020
@greg-szabo
Copy link
Member Author

The difference described on the above link in the SDK needs to be implemented here:

pub fn to_bech32(self, hrp: &str) -> String {
bech32::encode(hrp, self.as_bytes())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant