Chain ID, Address Format and Signatures
Chain ID
Cronos POS Chain has different Chain ID to distinguish between devnet, testnet and mainnet. When running the Cronos POS Chain in your local environment, you will also need to decide your own Chain ID.
For example, our testnet Chain ID is testnet-croeseid-4
.
Address prefix
BIP-0173 defines a new format for segregated witness output addresses that contains a human-readable part that identifies the coin type. Cronos POS Chain has different address prefixes for its corresponding network types, these prefixes are:
cro
tcro
dcro
Cronos POS Chain uses the Bech32 address format wherever users must handle binary data. Bech32 encoding provides robust integrity checks on data and the human readable part(HRP) that provides contextual hints that can assist UI developers with providing informative error messages. Specifically, we have the following HRP prefix for different addresses types in the mainnet:
Account
cro
Validator Operator
crocncl
Consensus Nodes
crocnclcons
We can use the keys show
command of chain-maind
with the flag --bech <type> (acc|val|cons)
to obtain the addresses and keys as mentioned above: for example,
Signatures
Digital signature has been the main way to authenticate users, by allowing users to sign transactions using their own private key. The public key and other data that are required for proper transaction validation are stored in an Account
object.
Since the chain-maind
v3.0.0, the new types of public keys and signing algorithms are supported, including secp256r1/NIST P-256. Secp256r1 is commonly applied in HSMs, macOS/iOS/watchOS Secure Enclave and Android hardware-backed Keystore, which allows the devices to function as hardware wallets. Based on secp256r1, the chosen parameters are supposed to be random numbers, while secp256k1 has had its parameters chosen relatively rigidly. Also, the address length (in bytes) in secp256k1 is 20 versus secp256r1 of 32.
At this stage, the following three digital key schemes for creating digital signatures are supported in Cosmos SDK. You can learn more at the Cosmos SDK website.
secp256k1
, as implemented in the SDK's crypto/keys/secp256k1 packagesecp256r1
, as implemented in the SDK's crypto/keys/secp256r1 packagetm-ed25519
, as implemented in the SDK crypto/keys/ed25519 package (supported only for the consensus validation)
secp256k1
20
33
yes
no
secp256r1
32
33
yes
no
tm-ed25519
not used
32
no
yes
Last updated