Overview
EIP-712 (Ethereum Improvement Proposal 712) provides a standard for signing typed structured data. In Crossmint Agentic Finance, EIP-712 signatures enable human-readable payment confirmations where users can verify exactly what they’re signing before authorizing a payment. Unlike raw message signing (which shows cryptic hex strings), EIP-712 presents structured data in a readable format, improving security and user trust.Why EIP-712 for Payments?
Human Readable
Users see clear payment details: amount, recipient, currency, and chain ID
Type Safety
Structured schemas prevent malformed payment data
Replay Protection
Domain separators and nonces prevent signature reuse
Wallet Compatible
Supported by MetaMask, WalletConnect, and Crossmint wallets
EIP-712 Signature Structure
An EIP-712 signature consists of four components:Domain Separator
The domain prevents signature replay attacks across:- Different chains:
chainIdensures signatures are chain-specific - Different protocols:
nameandversionidentify the protocol - Different contracts:
verifyingContractties signature to a specific contract
Type Definitions
Defines the schema for the payment message:amount(uint256): Payment amount in smallest unit (e.g., 50000 = 0.05 USDC)currency(address): Token contract addressto(address): Recipient wallet addressnonce(uint256): Unique value to prevent replay attacks
Signing with Crossmint Wallets
The x402 adapter bridges Crossmint wallets to the viem Account interface expected by x402:x402Adapter.ts
- Crossmint wallets support both ERC-6492 (pre-deployed) and EIP-1271 (deployed) signatures
- The adapter logs payment details for transparency
- Signature processing handles different formats (see ERC-6492 Validation)
Payment Signature Flow
Example: Guest Agent Signing
Fromsrc/agents/guest.ts:279-285:
- Extracts payment requirements from the 402 response
- Constructs the EIP-712 payload
- Calls
x402Signer.signTypedData(payload) - Sends signature to the facilitator for verification
Signature Format Output
After signing, signatures are processed based on wallet deployment status:Pre-Deployed Wallets (ERC-6492)
- The actual signature bytes
- Wallet factory address
- Deployment bytecode
- Constructor arguments
- Magic suffix:
0x6492...6492(32 bytes)
Deployed Wallets (EIP-1271)
isValidSignature() function.
Security Considerations
Nonce Usage
Nonce Usage
Use unique nonces (timestamps or UUIDs) to prevent replay attacks:Never reuse nonces - each payment must have a unique identifier.
Domain Separation
Domain Separation
Always verify the domain matches your application:
Amount Validation
Amount Validation
Verify payment amounts match tool requirements:
Implementation Checklist
Create x402 Signer
Wrap your Crossmint wallet with
createX402Signer() to provide EIP-712 signing capability.Define Payment Schema
Use the standard x402 Payment type with amount, currency, to, and nonce fields.
Related Topics
ERC-6492 Validation
Pre-deployment signature verification
x402 Facilitator
Payment settlement and verification
References
- EIP-712 Specification
- x402 Protocol Documentation
- Source:
events-concierge/src/x402Adapter.ts:30-67