Overview
CoW Protocol supports multiple signing schemes to accommodate different wallet types and use cases:- EIP-712 — Standard wallet signatures with structured data
- ETHSIGN — Legacy eth_sign RPC method
- EIP-1271 — Smart contract wallet signatures
- PRESIGN — On-chain pre-authorized orders
SigningScheme Enum
EIP-712 Signatures
EIP-712 is the recommended signing scheme for standard wallets (MetaMask, Ledger, etc.). It provides human-readable structured data in wallet prompts, type-safe signing with domain separation, and the best user experience and security.EcdsaSignature Structure
ETHSIGN Signatures
EIP-1271 Signatures
EIP-1271 enables smart contract wallets (Gnosis Safe, Argent, etc.) to sign orders.EIP-1271 Magic Value
PreSign Signatures
PRESIGN allows orders to be authorized on-chain before submission. Useful for smart contracts that need to place orders, pre-authorized trading strategies, and orders that don’t require immediate signing.Signing Order Cancellations
Signature Union Type
Choosing the Right Signing Scheme
EIP-712 -- Recommended for EOAs
EIP-712 -- Recommended for EOAs
Use for standard wallet accounts (MetaMask, Ledger, etc.). Provides the best UX and security.
EIP-1271 -- For Smart Contracts
EIP-1271 -- For Smart Contracts
Required for Gnosis Safe, Argent, and other smart contract wallets. The contract must implement
isValidSignature().PRESIGN -- For Automated Orders
PRESIGN -- For Automated Orders
Best for contracts that need to place orders automatically or for pre-authorizing orders before submission.
ETHSIGN -- Legacy Only
ETHSIGN -- Legacy Only
Avoid using ETHSIGN. Only include for backward compatibility with old systems.
Best Practices
- Always Use EIP-712: For standard wallets, consistently apply EIP-712 for enhanced security and UX
- Validate Signatures: Always verify signatures before submitting orders to the API
- Handle All Schemes: Support multiple schemes to work with different wallet types
- Test Thoroughly: Test signature creation and validation on testnets first
Related Resources
- Order Structure — Learn about order data structures
- Contract Interaction — Guide to creating and submitting orders
- Composable Orders — Build programmatic orders