Skip to main content

Crate alloy_signer_tempo

Crate alloy_signer_tempo 

Source
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§

EntrySummary
Redacted summary of a single keystore entry. Contains no secret material.
TempoAccessKey
Side-channel metadata for Keychain-mode signing.
TempoKeystore
Parsed Tempo keystore, ready to be looked up.
TokenLimit
Per-token spending limit attached to an access key.

Enums§

KeyType
Cryptographic key type recorded for an entry.
TempoLookup
Result of a successful Tempo keystore lookup.
TempoSignerError
Errors that can occur while reading or interpreting a Tempo keystore.
WalletType
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.