Skip to main content

Key Management

The xyz keys commands manage cryptographic keypairs for signing transactions on XYZ Chain.

Commands

Generate a New Key

Create a new keypair with a 24-word mnemonic:

Example

Save your mnemonic phrase immediately! It is only displayed once and cannot be recovered.

Options

List Keys

View all stored keypairs:

Example Output

Import a Key

Import an existing key from a mnemonic phrase:

Interactive Mode

With Flag

Validation

The CLI validates:
  • Mnemonic must be 12 or 24 words
  • Words must be valid BIP39 words
  • Checksum must be valid

Export a Key

Export a keypair as armored ASCII:

Example

The exported key is encrypted with the passphrase you provide. Import it on another machine with:

Key Derivation

XYZ Chain uses the following HD path:
This ensures compatibility with:
  • Keplr wallet
  • Ledger
  • Other compatible wallets

Address Format

Generated addresses use the xyz prefix with Bech32 encoding:

Keyring Security

OS Backend (Default)

Uses platform-specific secure storage:

File Backend

  • Encrypted with passphrase
  • Portable across machines
  • Requires passphrase for each operation

Test Backend

Development only! Keys stored unencrypted at ~/.xyz/keyring-test/

Best Practices

  1. Write mnemonic on paper immediately
  2. Store in multiple secure locations
  3. Consider metal backup (fire/water resistant)
  4. Never store digitally (no photos, no cloud)
Use separate keys for different purposes:
  • hot-wallet - Daily transactions (small balance)
  • cold-wallet - Long-term storage (large balance)
  • dev-wallet - Development/testing only
For significant holdings, use a Ledger device:
Periodically move funds to new keys:
  1. Generate new key
  2. Transfer funds
  3. Archive old key (don’t delete - may have pending rewards)

Using Keys with Commands

Most commands accept key references via --from or --key:

Troubleshooting

Ensure the key exists:
Check keyring backend matches:
Keys are stored per-backend. If you created a key with test backend but are using os:
On first use, macOS asks for permission. Click “Always Allow” to avoid repeated prompts.
Ensure a secret service is running: