Skip to content

Setup Keyring

The keyring holds the private/public keypairs used to interact with a node. For instance, a validator key needs to be set up before running the blockchain node, so that blocks can be correctly signed.

Adding a Key to the Keyring

You'll need to add a key to the keyring before using your node for validation or sending transactions directly from berad.

The following command allows you to create or recover a key for your node to use (option details are explained below):

shell
berad keys add <YOUR_KEY_NAME> --keyring-backend test --algo eth_secp256k1
berad keys add <YOUR_KEY_NAME> --keyring-backend test --algo eth_secp256k1

Algo

The Berachain node uses the eth_secp256k1 algorithm to encrypt its keys instead of the default algorithm used by Cosmos. Please pass the --algo eth_secp256k1 flag to overwrite this.

Keyring Backend

The keyring-backend flag refers to the different types of storage you can use with the node, they are as follows:

os          Uses the operating system's default credentials store.
file        Uses encrypted file-based keystore within the app's configuration directory.
            This keyring will request a password each time it is accessed, which may occur
            multiple times in a single command resulting in repeated password prompts.
kwallet     Uses KDE Wallet Manager as a credentials management application.
pass        Uses the pass command line utility to store and retrieve keys.
test        Stores keys insecurely to disk. It does not prompt for a password to be unlocked
            and it should be use only for testing purposes.
os          Uses the operating system's default credentials store.
file        Uses encrypted file-based keystore within the app's configuration directory.
            This keyring will request a password each time it is accessed, which may occur
            multiple times in a single command resulting in repeated password prompts.
kwallet     Uses KDE Wallet Manager as a credentials management application.
pass        Uses the pass command line utility to store and retrieve keys.
test        Stores keys insecurely to disk. It does not prompt for a password to be unlocked
            and it should be use only for testing purposes.

For more details on each backend, please refer to the the Cosmos keyring docs

Additional Commands

The keyring management command keys supports additional commands other than add. They are as follows:

delete         Delete the given keys
export         Export private keys
import         Import private keys into the local keybase
list           List all keys
list-key-types List all key types
migrate        Migrate keys from amino to proto serialization format
mnemonic       Compute the bip39 mnemonic for some input entropy
parse          Parse address from hex to bech32 and vice versa
rename         Rename an existing key
show           Retrieve key information by name or address
delete         Delete the given keys
export         Export private keys
import         Import private keys into the local keybase
list           List all keys
list-key-types List all key types
migrate        Migrate keys from amino to proto serialization format
mnemonic       Compute the bip39 mnemonic for some input entropy
parse          Parse address from hex to bech32 and vice versa
rename         Rename an existing key
show           Retrieve key information by name or address

To read more about how to use this commands, please use the CLI help option like so:

shell
berad keys --help
berad keys --help