Skip to main content
Once you’ve received the payloads from the API, you need to sign them to approve execution.

Signature Formats by Mode and Version

MEE v2.2.1+ introduces EIP-712 typed data signing for smart-account mode, providing better security and user experience through structured, human-readable signing requests.
The API automatically returns the correct payloadToSign format based on your account version and mode. Your signing code should detect and handle both formats.

Quick Start: Copy-Paste Utilities

For TypeScript users: Copy the utilities below directly into your project.
Not using TypeScript? Implement your own version following the same logic shown in the code.
Using a single execution mode? The utility below handles all signature types, but each mode only uses a subset:If your application uses only one mode, you can create a lighter implementation that handles just the signature types you’ll encounter.

How It Works: Three Signature Types

  • The API returns an array of payloads to sign.
  • In most cases this array has just one item.
  • Each item in the payload is one of three signature types (simple, permit, onchain) depending on your execution mode and token support

Simple (Smart Account & EIP-7702)

What: Signs a message for smart account or EIP-7702 execution
When: smart-account mode or eoa-7702 mode
Result: Off-chain signature
By default, v2.2.1+ uses EIP-712 typed data for smart-account mode. Personal message signing only occurs in two cases: eoa-7702 mode, or when upgrading legacy v2.1.0 smart accounts.

EIP-712 Typed Data (Default for Smart Accounts)

For v2.2.1+ smart accounts (the default), the payload contains EIP-712 structured data:
How to sign EIP-712:

Personal Message (EIP-7702 & Legacy Upgrade Only)

For eoa-7702 mode and v2.1.0 accounts during upgrade, the payload contains a raw message:
How to sign personal message:

Detecting the Format

Use a type guard to automatically detect and sign the correct format:

The Magic: Supertx Hash Embedding

For EOA mode, the API cleverly embeds the supertransaction hash into your signatures. This creates a cryptographic link between funding and execution, enabling single-signature cross-chain operations. For Permit: The supertx hash replaces the deadline field
For Onchain: The supertx hash is appended to calldata

Usage by Execution Mode

Signature Requirements:
  • One signature per funding token
  • Type depends on token support (permit or onchain)

Summary

  1. Copy the utilities - They handle all signature types automatically
  2. Get a quote - The API returns the appropriate payload type
  3. Sign with utilities - signQuoteSignablePayload() routes to the right method
  4. Execute - Send signed payloads back to complete the supertransaction
The utilities abstract away the complexity while the API’s clever hash embedding enables powerful single-signature cross-chain operations.

Why EIP-712 Typed Data?

MEE v2.2.1+ uses EIP-712 typed data signing for smart-account mode for several benefits:
Wallets display structured data instead of opaque hex strings. Users can see transaction details like amounts, recipients, and deadlines before signing.
Users can verify transaction details in their wallet UI before signing, making it harder for malicious sites to trick users into signing harmful transactions.
Signatures are cryptographically bound to specific contracts and chains, preventing signature replay attacks across different applications or networks.
Structured types prevent signature malleability attacks and ensure data integrity throughout the signing process.

Migration Notes

When migrating from v2.1.0 to v2.2.1+ or supporting both versions:
  1. Update signing logic - Use the type guard to handle both payload formats
  2. Test with both formats - Ensure backward compatibility with legacy accounts
  3. No API changes needed - The API automatically returns the correct format based on account version
  4. Upgrade transactions use personal message - When upgrading a v2.1.0 account, the upgrade quote uses personal message signing (not EIP-712)