Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Setting up the wallet

The wallet is the command-line client for LEZ: it holds your keys, builds and signs transactions, proves private ones, and reads state back.

Before you start

Clone the repository and work from its root:

git clone https://github.com/logos-blockchain/logos-execution-zone
cd logos-execution-zone

Install Rust, the RISC Zero toolchain and the system packages listed in the quickstart’s What you need; Docker is needed to build programs and to run the L1 node of the full stack, not for the standalone sequencer.

The transcripts in this part come from a local devnet. The standalone sequencer in Start a node is enough to follow them; Running a node has the full stack with the L1 node and indexer.

Your first tokens come from:

  • on a local devnet, its genesis (lez/sequencer/service/networks/local.json), which funds two public accounts whose secrets the wallet-import-test-accounts recipe in the Justfile imports (Making accounts);
  • on the public testnet, the L1: mint tokens on the L1 with the blockchain wallet in Logos Basecamp, then bridge them to LEZ with that wallet’s channel deposit into the LEZ testnet channel. The deposit’s metadata names the public LEZ account to credit, as the base58 of a Borsh-encoded DepositMetadata carrying the account’s initial key (lez/programs/bridge/core/src/deposit.rs), and the bridge credits it once the deposit is final on the L1. Check the metadata before sending: a deposit whose metadata does not decode is never credited, and with withdrawals disabled those tokens cannot be recovered. The LEZ wallet has no deposit command, and the repository has no faucet. Someone who already holds LEZ tokens can also send you some: give them the initial key wallet account new public printed, which they pass as --to-initial-key (Sending), or the public keys show-keys prints for your private account.

Installing and first run

cargo install --path lez/wallet --force --locked

The wallet keeps its configuration (wallet_config.json) and keys (storage.json) in the directory LEE_WALLET_HOME_DIR names, or in ~/.lee/wallet when it is unset. Give each network its own home:

export LEE_WALLET_HOME_DIR=~/lez-wallets/devnet

Make pointing it at a node the first wallet command you run. With no configuration it writes one pointing at https://testnet.lez.logos.co, right for the public testnet and wrong for a local devnet:

wallet change-network local

local is http://127.0.0.1:3040, testnet is the public one, and anything else is taken as a sequencer URL. just run-wallet <args> instead sets LEE_WALLET_HOME_DIR to the repository’s debug configuration in lez/wallet/configs/debug, which already points at the local node. A new wallet starts its private sync at the tip of the network it is set up against. When change-network is the first command, it is applied before that setup, so the cursor starts at the tip of the node you named. On an existing wallet change-network does not move that cursor, which stays at the old network’s height; Reading the chain says how to scan again. Then check it can reach the node:

wallet check-health

The first command you run, change-network included, sets the wallet up: it asks for a password twice (or takes LEE_WALLET_PASSWORD when that is set, even to an empty value) and prints a recovery phrase, the only way to restore the accounts generated from it (not imported keys, groups or labels): write it down. A shared account’s keys come from a random group secret instead, so keep each group secret too (What the owner must keep). An empty password leaves the store unencrypted, fine for a local devnet; a non-empty one is required by every later command, or read from LEE_WALLET_PASSWORD.

The commands

CommandWhat it does
wallet accountcreate, import, label, list, read and sync accounts, resolve a label to its id, and show an account’s keys
wallet auth-transfersend native tokens, at any public/private combination
wallet chain-infocurrent-block-id, block, transaction
wallet pendinglist and receive messages waiting in a mailbox
wallet program-loaderdeploy and update programs
wallet programsend one public transaction to any program, naming the actors it touches and which of them the signature authorizes. There is no command for a private call to an arbitrary program: that needs code (Sending a message)
wallet bridgewithdraw to L1. Withdrawals are disabled in this version: the bridge program panics with Withdraws are disabled in the current version of LEZ
wallet groupgroup keys: new, list, remove, invite, join, new-sealing-key
wallet keycardKeycard signing, not in the default build and not usable in this version: a Keycard holds one fixed key, while the wallet signs each nonce of a public account with a new one (Keys, nonces and rotation)
wallet configget, set and description of configuration fields
wallet change-networkpoint the wallet at a different node
wallet set-passwordset, change or remove the storage password
wallet restore-keysrestore keys from a mnemonic at a given depth
wallet check-healthconfirm the wallet reaches the node and its privacy circuit id matches the node’s

Eight flags are global and work on any subcommand. The fee flags act on the fee model in How fees are priced:

FlagWhat it does
--dry-runsimulate the transaction the command would send and report its cost instead of sending it (what it checks)
--gas-limit GASdeclare this execution gas limit on a public transaction, instead of the cycles a simulation measures plus the configured margin
--max-fee AMOUNTcap a public transaction’s fee, instead of its reserve at the headroom’s base fees. The sequencer rejects a cap below what a dry run reports
--tip AMOUNTtip on top of the base fees, declared on a public transaction or paid inside a proof
--fee-headroom BLOCKSprice the fee for base fees that rise as fast as allowed for this many blocks after the current ones, instead of the configured headroom (5 by default)
--fee-payer ACCOUNT_ID_WITH_PRIVACYpay a private transaction’s fee from this account: Private/<id> for an owned private account, whether or not the transaction mentions it, or Public/<id> for a public account the transaction already signs with
--refund-to ACCOUNT_IDrefund a private transaction’s fee surplus to this public account instead of privately to the payer (Private fees)
--allow-revertsend a public transaction even though its simulation reverts; it still pays its fee. The simulation misses validity windows

--fee-payer needs the privacy prefix (Public/ or Private/), while --refund-to takes a bare base58 public id without one. --refund-to is meant for a transaction that already credits that account publicly, such as a deshield (shield and deshield): any other target links the transaction to it, which the wallet logs as a warning (shown only with RUST_LOG=warn or a more verbose level, since the wallet logs errors alone by default).

On a public transaction, pinning both --gas-limit and --max-fee (without --dry-run) skips the simulation, so the wallet checks neither the fee nor whether the action reverts.

wallet help, and --help on any subcommand, prints the authoritative arguments. Shell completions are in the repository’s completions/ directory.

Where to go next

Accounts and transfers creates accounts and moves tokens between them, Reading the chain gets state back out, and Pending messages collects a message someone sent you while you were offline.

To write programs rather than use them, skip to the Quickstart.