cratefield-signer
Signs a payload by key reference: a venture asks for an EVM transaction, an ERC-4337 UserOperation, EIP-712 data or a Solana message to be signed, names the key, and never touches raw key material. Keys are created here and referenced everywhere else; no API exports a private key.
Every sign call runs the same gauntlet, in order: the payload's intent is decoded, the guardrails are asked, the decision and the outcome are written to an append-only audit chain, and only on allow does the underlying provider see the payload. A deny, a decode failure, a tripped kill switch or a failed audit record means the provider is never called.
use ;
let guardrails = new.allow_evm?;
let signer = new;
let subject = new?;
let key = block_on?;
let tx = EvmTransaction ;
let signature = block_on?;
assert!;
# Ok::
The default composition is SecretsSigner: a secp256k1 or ed25519 key held
in the Secrets port, decrypted inside sign and never before, wrapped in a
GuardedSigner. It mints session keys only — there is no import API, by
design; owner keys belong in a hardware wallet or a KMS, not in a tenant
database. Wrap the audit trail in MemorySignAudit (or your own
SignAudit) and the chain's verify will name the first tampered entry.
The signing hashes are computed here, not trusted from the caller: RLP +
keccak256 for an EIP-1559 transaction, userOpHash for a v0.7 packed
UserOperation, 0x1901 || domain separator || struct hash for EIP-712.
Known-answer tests pin all of them to published vectors.
Pure Rust, no network, nothing key-specific leaves the process; builds for
wasm32-unknown-unknown. fakes and conformance ship in the crate so a
provider can be built against the same suite the reference implementations
pass.