Key Management
A mnemonic, also known as a mnemonic, is a set of words used to recover or recover a cryptocurrency wallet. It serves as a backup to access your digital assets if you lose access to the original wallet. This phrase is usually a series of 12-24 words generated when you created your wallet and should be kept safe and private.
The importance of the seed phrase is that cryptocurrencies are stored in a decentralized manner, meaning that there is no central authority or institution that holds or controls your funds. This means that if you lose access to your wallet (e.g. forget your password, lose your device), you will not be able to get your funds back without your seed phrase. Therefore, it is crucial to store your seed phrase in a safe and secure place, such as physical paper or a secure digital file.
Also, it is recommended to make multiple copies and store them in different locations so that you have access to your funds in case of any emergency.
Mnemonic Phrase and Private Key
A seed phrase, also known as a recovery phrase or backup phrase, is a series of words used to generate a private key. It is usually a set of 12 or 24 words used to recover or restore access to a cryptocurrency wallet if the original private key is lost or damaged. The seed phrase can be used to generate multiple private keys that can be used to access multiple cryptocurrency addresses and balances.
A private key, on the other hand, is a long string of characters that is used to sign transactions and provide access to your cryptocurrency funds. Private keys are generated from a seed phrase and are unique to each cryptocurrency address. It is used to create a digital signature for a transaction to ensure that the transaction is legitimate and has been authorized by the rightful owner of the funds.
In conclusion, the security of your private key and seed phrase is paramount. If your private key is compromised, it could put all linked accounts at risk. However, losing the mnemonic phrase can have more serious consequences because it is used to generate multiple private keys. Therefore, it is crucial to take proper steps to protect your private key and seed phrase to avoid any catastrophic loss.
Mnemonics in Daodst CLI
Before proceeding with the CLI, make sure you have stcd
installed. Installation instructions are located.
When you create a new key, you receive a seed phrase that you can use to recover that key. Backup mnemonic:
stcd keys add dev0
{
"name": "dev0",
"type": "local",
"address": "dst1n253dl2tgyhxjm592p580c38r4dn8023ctv28d",
"pubkey": '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"ArJhve4v5HkLm+F7ViASU/rAGx7YrwU4+XKV2MNJt+Cq"}',
"mnemonic": ""
}
**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.
# <24 word mnemonic phrase>
To restore keys:
$ stcd keys add dev0-restored --recover
> Enter your bip39 mnemonic
banner genuine height east ghost oak toward reflect asset marble else explain foster car nest make van divide twice culture announce shuffle net peanut
{
"name": "dev0-restored",
"type": "local",
"address": "dst1n253dl2tgyhxjm592p580c38r4dn8023ctv28d",
"pubkey": '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"ArJhve4v5HkLm+F7ViASU/rAGx7YrwU4+XKV2MNJt+Cq"}'
}
Key export
Tendermint-Private Key Format
To back up such a key without a mnemonic:
stcd keys export dev0
Enter passphrase to decrypt your key:
Enter passphrase to encrypt the exported key:
-----BEGIN TENDERMINT PRIVATE KEY-----
kdf: bcrypt
salt: 14559BB13D881A86E0F4D3872B8B2C82
type: secp256k1
# <Tendermint private key>
-----END TENDERMINT PRIVATE KEY-----
$ echo "\
-----BEGIN TENDERMINT PRIVATE KEY-----
kdf: bcrypt
salt: 14559BB13D881A86E0F4D3872B8B2C82
type: secp256k1
# <Tendermint private key>
-----END TENDERMINT PRIVATE KEY-----" > dev0.export
Ethereum-Private Key Format
NOTE: These types of keys are compatible with MetaMask
To back up such a key without a mnemonic:
stcd keys unsafe-export-eth-key dev0 > dev0.export
**WARNING** this is an unsafe way to export your unencrypted private key, are you sure? [y/N]: y
Enter keyring passphrase:
key import
Tendermint-Private Key Format
$ stcd keys import dev0-imported ./dev0.export
Enter passphrase to decrypt your key:
Ethereum-Private Key Format
$ stcd keys unsafe-import-eth-key dev0-imported ./dev0.export
Enter passphrase to encrypt your key:
verify
Verify that your key has been restored using the following command:
$ stcd keys list
[
{
"name": "dev0-imported",
"type": "local",
"address": "dst1n253dl2tgyhxjm592p580c38r4dn8023ctv28d",
"pubkey": '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"ArJhve4v5HkLm+F7ViASU/rAGx7YrwU4+XKV2MNJt+Cq"}'
},
{
"name": "dev0-restored",
"type": "local",
"address": "dst1n253dl2tgyhxjm592p580c38r4dn8023ctv28d",
"pubkey": '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"ArJhve4v5HkLm+F7ViASU/rAGx7YrwU4+XKV2MNJt+Cq"}'
},
{
"name": "dev0",
"type": "local",
"address": "dst1n253dl2tgyhxjm592p580c38r4dn8023ctv28d",
"pubkey": '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"ArJhve4v5HkLm+F7ViASU/rAGx7YrwU4+XKV2MNJt+Cq"}'
}
]