Create and back up a wallet
Create a wallet, protect it with a passphrase, and make the backups that let you recover it.
On this page
Create#
xlh wallet create --name mainThe passphrase must have at least 12 characters. It is read in the terminal without echo, or from the first line of a file named in LATHEN_WALLET_PASSPHRASE_FILE. It is never a command-line argument and the wallet page never asks for it.
The keys are stored encrypted (a passphrase-derived key with scrypt, then AES-256-GCM). A wrong passphrase, a modified file or weak key-derivation settings fail with a fixed message and open nothing.
What the wallet holds#
| Value | Purpose | Leaves the wallet? |
|---|---|---|
Spend key (ask) | Authorises spending | Never |
Nullifier key (nk) | Detects when your notes are spent; cannot spend | Never |
| Decryption key (ML-KEM-1024) | Opens the envelopes addressed to you | Never |
| State-file key | Encrypts the wallet's saved state | Never |
| Owner value | What a payer puts in a note for you | In your receiving card and payment requests |
| Encryption public key | What a payer encrypts to | In your receiving card |
There is one key pair per wallet, so one owner value. It is not visible on chain, because each note hides it behind a fresh random salt.
Back up#
Everything lives in the data folder; xlh version prints where. Make a backup right after creating the wallet and again after creating an asset:
xlh wallet backup --name main --out <file>The backup is one file encrypted under its own passphrase. It contains your keys and the records that cannot be rebuilt from the chain: issuance secrets and salts, asset labels, contacts, payment requests and launch records. It does not contain notes, witnesses or proofs in progress.
| What | If you lose it | If someone else gets it |
|---|---|---|
| Wallet backup file | The wallet's funds are gone | They also need the backup passphrase; with both they can spend |
| Wallet passphrase | The wallet cannot be opened | |
Genesis file (chain/genesis.json, public) | A wallet backup is useless without it | Nothing; it is public |
Store the passphrase and the backup in different places. Keep backups off the computer that runs the node. Do not keep the data folder in a synchronised folder such as OneDrive, iCloud or Dropbox.
Restore#
restore writes a new wallet store. The first synchronisation rescans the chain from block 1 and finds every note again, including notes the ledger created for pool trades. Two things are not restored:
- An exchange that was open when the backup was made. Its inputs become spendable again when it expires.
- Notes in flight. A transaction being proved when a wallet is stopped is lost, and the wallet shows its notes as reserved until they expire.