-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
bech32: Add a way to change the default prefixes #1336
Comments
Thanks for pointing this out! We currently don't have a way to do this, we should add one though. |
I think it should be fine to make these unexported global variables, with getter methods, and a register function. The register function would then have a corresponding "seal" method, a paradigm used in many places. Then we'd expect apps to set these and seal these in their main We're essentially then creating a constant, which can be initialized during runtime. |
Thanks @ValarDragon for linking me to this. I too feel it would be a very important feature as far as the SDK is concerned. I'll see how to implement this. Also, two things -
|
I like the idea @ValarDragon suggested. However, you may still actually use any bech32 prefixing you want, at least in a limited scope. The We should still do something akin to what @ValarDragon suggested.
No, they are not all derived from the same public key (if you're referring to the various bech32 prefixes. Users only need to maintain their key pairs for accounts. Validators/consensus operators have their own key pairs. |
Thanks @alexanderbez I was thinking about having the following function in types/address.go So users would just call: Also, would it make sense to just use the plain hex encoding of address for the time being in our project until this is ready? And then later switch to using the Bech32 addresses? |
This issue should be closed. @sherry13131 |
In Cosmos-sdk, all the public keys and addresses are using Bech32 prefix. Is it possible to change it to other prefix by myself for my own project? If yes, what kind of files do I need to override or rewrite, and how? I see the prefix constant is in the cosmos-sdk/types/account.go, which is the file that developers do not need.
Since this is an SDK, I think it should have this feature (change the prefix of keys and address) when developers creating their own project, in view of project design.
The text was updated successfully, but these errors were encountered: