Skip to main content
sauce wallet manages the wallet directory: the encrypted keys that --wallet <name> signs with.

Synopsis

Description

A wallet is one key that the sauce command keeps in the wallet directory, ~/.sauce/wallets by default, encrypted under a password. Every command that signs takes --wallet <name> with the same password source, on EVM chains and on Solana. The local MCP server signs with these wallets too when it runs over stdio (MCP wallets).
  • Files. Each wallet is one file, <name>.json, written once with mode 0600 and never overwritten. The directory is created with mode 0700. An EVM wallet is a Web3 Secret Storage v3 keystore (scrypt, AES-128-CTR), so --keystore, cast wallet and geth read it. A Solana wallet is the same envelope around the 64-byte keypair, marked "kind": "solana". The file holds the address in the clear, so list and address need no password. Wallets, passwords and spending policy describes the format.
  • Names. A name is up to 64 characters of lowercase letters, digits, - and _, starting with a letter or a digit. A name already in the directory is refused.
  • Passwords. The password comes from exactly one source: --password-env <NAME>, --password-file <path> or --password-command <command>. With none of them, the command asks at the terminal, twice for a new wallet. A password is at least 8 characters. No option takes the password itself as its value.
  • Import. import reads the key from a file, or from stdin with -, never from the command line; an operand that looks like a key is refused. It takes an EVM private key (32 bytes of hex), a Web3 Secret Storage keystore (opened with the password, which the wallet then keeps), or a Solana keypair (the JSON array of 64 bytes that solana-keygen writes, or its base58).
  • Export. export writes the key to the terminal device itself, never to stdout. It asks you to type the wallet’s name first. With no controlling terminal it refuses; a pseudo-terminal counts as one. The MCP server has no tool for it.
  • Policy. A file <name>.policy.json beside a wallet limits what it sends through --wallet and the MCP server’s wallet tools, not through --keystore (spending policy). list marks each wallet that has one and prints a warning for a policy file that does not parse or that others can write.
These are hot wallets: whoever holds a wallet’s file and its password holds the key. Keep small balances in them. Agents, wallets and keys covers what an agent running as you can do with them.

Options

sauce wallet

sauce wallet new

sauce wallet list

sauce wallet address

sauce wallet import

sauce wallet export

Output

new and import print the wallet’s name, kind, address, file and policy on stdout, and notes on stderr: the password source to sign with, that --keystore and cast wallet read an EVM wallet’s file, and that it is a hot wallet. list prints one line per wallet. address prints the address alone: a 0x address, or a base58 public key for a Solana wallet. With --json, new, import and address print one wallet, and list prints the directory and its wallets:
policy is null for a wallet with no policy file. Exit codes: 0 on success; 1 when the command refuses, for example a name already taken, a password file others can read, or export with no terminal; 2 for a usage error, such as an invalid name, a password under 8 characters, or a key given on the command line.

Examples

The examples run in one directory in order. They keep their wallets in ./wallets with --wallets ./wallets, and read the password from pw.txt, a file with mode 0600, or from the variable SAUCE_WALLET_PASSWORD.

Create an EVM wallet

The first three lines are stderr.

Create a Solana wallet with the password from the environment

Import a private key from a file

key.txt holds 32 bytes of hex.

Import a Solana keypair from stdin

keypair.json holds the JSON array of 64 bytes that solana-keygen writes.

List the wallets

After wallets/agent.policy.json and wallets/trader-sol.policy.json are written (spending policy):
(policy) marks a wallet with a <name>.policy.json beside it.

Read the refusals

export with no controlling terminal, as in a script, exits 1. A program that runs it in a pseudo-terminal can answer the prompt and read the key, so this does not keep the key from an agent (Agents, wallets and keys):
A password file that others can read exits 1:
A key given as the operand exits 2:

Next steps