r14 keygen
Generate a new Root14 keypair and create the wallet file.
Usage
r14 keygen
What It Does
- Checks if
~/.r14/wallet.jsonalready exists. If so, exits with an error to prevent accidental overwrite. - Generates a random
SecretKey(BLS12-381 field element). - Derives
owner_hash = Poseidon(secret_key). - Creates the wallet file with default config values.
- Prints the
owner_hashto share with others.
Output
With --json:
{
"wallet_path": "/home/user/.r14/wallet.json",
"owner_hash": "0x1a2b3c4d5e6f..."
}
Directory Creation
Creates ~/.r14/ if it doesn't exist. The wallet file is always stored at ~/.r14/wallet.json.
Default Config Values
The newly created wallet has placeholder values that need to be configured before on-chain operations:
| Key | Default Value |
|---|---|
stellar_secret | PLACEHOLDER |
indexer_url | http://localhost:3000 |
rpc_url | https://soroban-testnet.stellar.org:443 |
core_contract_id | PLACEHOLDER |
transfer_contract_id | PLACEHOLDER |
Use r14 config set <key> <value> to configure these before depositing or transferring.
Re-generating
To regenerate a wallet, delete the existing file first:
rm ~/.r14/wallet.json
r14 keygen
This creates a completely new keypair. Any notes from the previous wallet will be lost.