docs/02_cleos/03_command-reference/create/key.md
cleos create key [OPTIONS]
Where
--file or --to-consoleNote: The arguments and options enclosed in square brackets are optional.
Creates a new keypair and either prints the public and private keys to the screen or to a file.
The following information shows the different positionals and options you can use with the cleos create key command:
-h,--help - Print this help message and exit--r1 - Generate a key using the R1 curve (iPhone), instead of the K1 curve (Bitcoin)
-f,--file TEXT - Name of file to write private/public key output to. (Must be set, unless "--to-console" is passed
--to-console - Print private/public keys to console.cleos.
[[info | Note]]
| The cleos tool is bundled with the EOSIO software. Installing EOSIO will install the cleos and keosd command line tools.cleos create key --to-console
Where
--to-console = Tells the cleos create key command to print the private/public keys to the console.
Example Output
Private key: 5KDNWQvY2seBPVUz7MiiaEDGTwACfuXu78bwZu7w2UDM9A3u3Fs
Public key: EOS5zG7PsdtzQ9achTdRtXwHieL7yyigBFiJDRAQonqBsfKyL3XhC
cleos create key --file my_keys.txt
Where
--file keys.txt = Tells the cleos create key command to output the private/public keys to afile called my_keys.txt.
Example Output
saving keys to my_keys.txt
cat my_keys.txt
Example Output
Private key: 5KWcfnGao5K6WV65Zgjd1xvpugRUeKwb6oxzmwaS1tPE2Ef4qzo
Public key: EOS7oDiBtzSHtShprGFmXm9JLnwxhcPeDyhww3tXDvVATDYtciLGG