Comment on page
Keys allows you to manage your local tendermint keystore (wallets) for StaFiHub.
Derive a new private key and encrypt to disk.
stafihubd keys add <key-name> [flags]
stafihubd keys add MyKey
Enter and repeat the password, at least 8 characters, then you will get a new key.
write the seed phrase in a safe place! It is the only way to recover your account if you ever forget your password. :::
If you forget your password or lose your key, or you wanna use your key in another place, you can recover your key by your seed phrase.
stafihubd keys add MyKey --recover
You'll be asked to enter and repeat the new password for your key, and enter the seed phrase. Then you get your key back.
Enter a passphrase for your key:
Repeat the passphrase:
Enter your recovery seed phrase:
The following example creates a multisig key with 3 sub-keys, and specify the minimum number of signatures as 2. The tx could be broadcast only when the number of signatures is greater than or equal to 2.
stafihubd keys add <multisig-keyname> --multisig-threshold=2 --multisig=<signer-keyname-1>,<signer-keyname-2>,<signer-keyname-3>
<signer-keyname>can be the type of "local/offline/ledger", but not "multi" type.
If you don't have all the permission of sub-keys, you can ask for the pubkeys to create the offline keys first, then you will be able to create the multisig key.
Offline key can be created by "stafihubd keys add --pubkey". :::
How to use multisig key to sign and broadcast a transaction, please refer to multisign
Delete a local key by the given name.
stafihubd keys delete <key-name> [flags]
stafihubd keys delete MyKey
Export the keystore of a key to a json file
stafihubd keys export <key-name> [flags]
stafihubd keys export Mykey --output-file=<path-to-keystore>
Import a ASCII armored private key into the local keybase.
stafihubd keys import <name> <keyfile> [flags]
List all the keys stored by this key manager along with their associated name, type, address and pubkey.
stafihubd keys list
Migrate key information from the legacy (db-based) Keybase to the new keyring-based Keybase.
stafihubd keys migrate [flags]
Create a bip39 mnemonic, sometimes called a seed phrase, by reading from the system entropy. To pass your own entropy, use
stafihubd keys mnemonic [flags]
stafihubd keys mnemonic
You'll get a bip39 mnemonic with 24 words, e.g.:
beauty entire blue tape ordinary fix rotate learn smart tiger dolphin cycle cigar dish alcohol slab bachelor vital design consider paper panther mad eternal
Convert and print to stdout key addresses and fingerprints from hexadecimal into bech32 cosmos prefixed format and vice versa.
stafihubd keys parse <hex-or-bech32-address> [flags]
Get details of a local key.
stafihubd keys show <key-name> [flags]
stafihubd keys show MyKey
The following infos will be shown:
- name: Mykey
If an address has been bonded to be a validator operator (which the address you used to create a validator), then you can use
--bech valto get the operator's address prefixed by
ivaand the pubkey prefixed by
stafihubd keys show MyKey --bech val
- name: Mykey