Key Management
Thexyz keys commands manage cryptographic keypairs for signing transactions on XYZ Chain.
Commands
| Command | Description |
|---|---|
xyz keys generate | Create a new keypair |
xyz keys list | List all stored keys |
xyz keys import | Import from mnemonic |
xyz keys export | Export a keypair |
Generate a New Key
Create a new keypair with a 24-word mnemonic:Example
Output
Output
Options
| Flag | Description |
|---|---|
--keyring-backend | Override keyring backend |
--home | Override home directory |
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
Output
Output
Key Derivation
XYZ Chain uses the following HD path:| Component | Value | Meaning |
|---|---|---|
| Purpose | 44’ | BIP44 |
| Coin Type | 118’ | XYZ Chain |
| Account | 0’ | First account |
| Change | 0 | External chain |
| Index | 0 | First address |
- Keplr wallet
- Ledger
- Other compatible wallets
Address Format
Generated addresses use thexyz prefix with Bech32 encoding:
Keyring Security
OS Backend (Default)
| Platform | Storage | Security |
|---|---|---|
| macOS | Keychain | High |
| Windows | Credential Manager | High |
| Linux | Secret Service | High |
File Backend
- Encrypted with passphrase
- Portable across machines
- Requires passphrase for each operation
Test Backend
Best Practices
Backup Strategy
Backup Strategy
- Write mnemonic on paper immediately
- Store in multiple secure locations
- Consider metal backup (fire/water resistant)
- Never store digitally (no photos, no cloud)
Multiple Keys
Multiple Keys
Use separate keys for different purposes:
hot-wallet- Daily transactions (small balance)cold-wallet- Long-term storage (large balance)dev-wallet- Development/testing only
Hardware Wallets
Hardware Wallets
For significant holdings, use a Ledger device:
Key Rotation
Key Rotation
Periodically move funds to new keys:
- Generate new key
- Transfer funds
- Archive old key (don’t delete - may have pending rewards)
Using Keys with Commands
Most commands accept key references via--from or --key:
Troubleshooting
Key not found
Key not found
Ensure the key exists:Check keyring backend matches:
Wrong keyring backend
Wrong keyring backend
Keys are stored per-backend. If you created a key with
test backend but are using os:macOS Keychain permission
macOS Keychain permission
On first use, macOS asks for permission. Click “Always Allow” to avoid repeated prompts.
Linux Secret Service
Linux Secret Service
Ensure a secret service is running: