Skip to main content

keygen

Usage: chr keygen [<options>]

Generates public/private key pair

File format:
-f, --file=<path> Set file to save keypair to explicitly
--get-pubkey[=<value>]
╭───────────────────────────────────────────────────╮
│ Print the active public key. If│
│no key-id is specified, the key is determined from │
│your configuration; │
│ otherwise, retrieves the public│
│key for the given key-id. │
╰───────────────────────────────────────────────────╯
--dry Perform dry run, prints keys in terminal and does not
save keys to disk
--key-id=<value> Name the generated key with an id

Options:
-m, --mnemonic=<text> Mnemonic word list, words separated by space, e.g:
"lift employ roast rotate liar holiday sun fever
output magnet...""
-h, --help Show this message and exit

The keygen command (chr keygen) generates a public and private key pair. By default, the keys are generated with default key id chromia_key and saved in the .chromia folder as chromia_key.pubkey and chromia_key.

  • To use a key pair by its key ID, set the property key.id = <key_id> in your configuration file (.chromia/config).

    If your TEXT string is myKey then the public key is stored as myKey.pubkey and private key as myKey. To use a key pair by its key ID, set the property key.id = <key_id> in your Chromia configuration (.chromia/config) file. If the config file does not exist, then you can create one in the .chromia folder.

    • Windows: C:\Users\<YourUsername>\.chromia\config
    • macOS and Linux: /Users/<YourUsername>/.chromia/config or /home/<YourUsername>/.chromia/config
  • To recover a key pair from a mnemonic, pass in the mnemonic with --mnemonic "march aspect pizza treat ...".