Expand description
§alloy-signer-tempo
Read-only Tempo wallet keystore reader
for alloy. Parses the file that tempo wallet login writes and exposes the
materialized signer plus optional Keychain-mode metadata. No network I/O.
§On-disk path
$TEMPO_HOME/wallet/keys.toml, falling back to ~/.tempo/wallet/keys.toml
(matches the Tempo CLI). The CLI normally creates this file with Unix mode
0600; this crate reads the file without inspecting or enforcing its permissions.
If the file is valid TOML but individual [[keys]] entries do not match the
expected schema, those entries are skipped and a warning is emitted through
tracing.
§Example
use alloy_primitives::address;
use alloy_signer_tempo::{TempoKeystore, TempoLookup};
let store = TempoKeystore::load()?;
match store.find_by_from(address!("0x70997970c51812dc3a010c7d01b50e0d17dc79c8"))? {
TempoLookup::Direct(signer) => {
// EOA: the on-disk key IS the wallet account.
let _ = signer;
}
TempoLookup::Keychain(signer, access_key) => {
// Smart wallet: ephemeral access key signs on behalf of the root wallet.
let _ = (signer, access_key);
}
_ => unreachable!("TempoLookup is `#[non_exhaustive]`"),
}§Scope
In: read keys.toml, materialize PrivateKeySigner, expose Keychain
metadata, foundry-compatible env vars (TEMPO_PRIVATE_KEY,
TEMPO_ACCESS_KEY, TEMPO_ROOT_ACCOUNT).
Out: writing/rotating keys, decoding key_authorization to a typed value
(the RLP bytes are exposed opaquely), any network I/O.
Lookup is metadata extraction, not authorization enforcement. It filters for available secp256k1 key material and checks expiry at lookup time. In Keychain mode, a recorded key address must match the private key’s derived address. It does not enforce the recorded chain ID, spending limits, authorization, or expiry when the signer is later used. Returned signers have no chain ID configured; configure transaction chain IDs separately.
Structs§
- Entry
Summary - Redacted summary of a single keystore entry. Contains no secret material.
- Tempo
Access Key - Side-channel metadata for Keychain-mode signing.
- Tempo
Keystore - Parsed Tempo keystore, ready to be looked up.
- Token
Limit - Per-token spending limit attached to an access key.
Enums§
- KeyType
- Cryptographic key type recorded for an entry.
- Tempo
Lookup - Result of a successful Tempo keystore lookup.
- Tempo
Signer Error - Errors that can occur while reading or interpreting a Tempo keystore.
- Wallet
Type - On-chain wallet type recorded for an entry.
Constants§
- ENV_
ACCESS_ KEY - Hex-encoded access key for Keychain-mode signing.
- ENV_
PRIVATE_ KEY - Hex-encoded private key for Direct-mode signing.
- ENV_
ROOT_ ACCOUNT - Smart-wallet/root address authorizing
TEMPO_ACCESS_KEY. When absent (or equal to the access-key address), the access key is treated as Direct.
Functions§
- default_
keys_ path - Default keystore path:
$TEMPO_HOME/wallet/keys.toml, falling back to~/.tempo/wallet/keys.toml. Mirrors the Tempo CLI exactly. - tempo_
signer_ from_ env - Resolve a Tempo signer from environment variables.