Freshman here to run full node.
There is one thing I am very confused: what is the difference among so many kinds of addressed?
- node id like
- cosmosaddr like
- cosmosaccpub like
- cosmosvalpub like
value field in
- the address format in seeds setting in
There are in different formats. I wonder if they are encoded from just the same binary public key? Why Cosmos specifies some many types of addresses?
@fjchen Here is a document describing the account key format: https://github.com/cosmos/cosmos-sdk/blob/master/docs/spec/other/bech32.md
The address format in the
seeds setting is
<node_id>@<ip>:<port> fo those are the same.
I’m also not seeing a value field in
~/.gaiad/config/config.toml. Are you talking about the
value fields in
Sorry for my mistake.
value field is in
public_key field. It looks like a kind of expression for binary public key.
And what is the relationship between
node id and public key? Go-amino or something?
Just read the spec in https://github.com/cosmos/cosmos-sdk/blob/master/docs/spec/other/bech32.md. Why they differentiate
cosmosaccpub for the same account? Is the
cosmosaccpub can be decoded into binary public key but
@jack Is it possible to remove these prefixes or have custom prefixes for our projects when using cosmos-sdk?
Also, can I generate the usual cosmos address with cosmosaccaddr prefix for my wallet and later change the address to my own prefix? Is it just a matter of changing the prefix?
It is not possible at the moment. I just commented here: https://github.com/cosmos/cosmos-sdk/issues/1336 with a proposal for how to go about doing the change, feel free to take a stab at implementation.
You can’t just change the prefix, as the prefix is part of how the rest of it is encoded. Bech32 has error correction, which is a really nice property, and it makes use of the prefix as a part of that.
@valardragon thanks a lot for your response. I will checkout the other link. Is it possible to extract Public Key from just the Bech32 address? I notice a function (GetAccPubKeyBech32) in types/account.go which seems to indicate that it is possible. Just wanted to double check.
Bech32 is just an encoding. If your Bech32 a pubkey, then you can recover the pubkey from it. If you bech32 an address, then you can only recover the address. The name of the prefix is intended to indicate which it is.