Skip to main content

ERC-1271 Signing

ERC-1271 allows smart contracts to verify off-chain signatures, enabling gasless order creation from contracts like vaults, DAOs, and protocol treasuries.

ERC-1271 vs PreSign

Use ERC-1271 when your contract needs to place orders frequently (trading vaults, automated strategies). Use PreSign when you need a simpler approach or can’t modify the contract code.

Implementing isValidSignature

Your contract must implement the EIP-1271 interface:
The function must:
  • Be a view function (no state changes)
  • Return 0x1626ba7e (the magic value) for valid signatures
  • Return any other value for invalid signatures

Example: Single-owner vault

Example: Multi-sig / threshold

Submitting ERC-1271 orders via SDK

The from field must be set to the smart contract address, not the EOA signing the order. The API cannot infer the owner from an ERC-1271 signature.

Submitting via raw API

If not using the SDK, submit to POST /api/v1/orders with:
The signature field contains whatever bytes your contract’s isValidSignature expects. The protocol will call isValidSignature(orderDigest, signature) on your contract to verify.

EIP-712 domain separator

Your off-chain signer must produce the signature over the correct order digest. The EIP-712 domain is the same across all chains:
See the signing schemes reference for the full EIP-712 type definition and order struct.

Common errors

Token approvals

Your smart contract must approve the VaultRelayer (0xC92E8bdf79f0507f65a392b0ab4667716BFE0110) to spend the sell token. This approval must come from the contract itself (the order owner), not from an EOA.
Last modified on March 12, 2026