What EIP-712 defines
EIP-712 hashes a typed struct together with a domain separator that names the app, the chain ID, and the verifying contract. Wallets display the fields, and a contract recovers the signer with ecrecover. It underlies permits, order books, and gasless flows. ERC1271 extends verification to contract wallets through isValidSignature.
Message signing on Solana
Solana wallets sign messages in two ways. Use offchain messages where the wallet supports them, and fall back to raw messages where it does not.
solana:signOffchainMessagesolana:signMessage| Piece | EIP-712 | Solana |
|---|---|---|
| Signature scheme | secp256k1 | Ed25519 |
| Message format | Typed structs hashed with a domain separator | An offchain message envelope around your text |
| Domain binding | Chain ID and verifying contract in the domain | Fields you include in the message, such as your domain and program ID |
| Onchain verification | ecrecover in the contract | An Ed25519 verification instruction that your program inspects |
| Contract wallets | ERC1271 isValidSignature | PDAs sign onchain through CPIs |
Verify a signature on your server
For sign-in and other offchain actions, your backend verifies the signature. No transaction or fee is involved.
Verify a signature in a program
Verifying an Ed25519 signature inside a program costs too much compute, and the verification program cannot be called through a CPI. Instead, the transaction includes an instruction for the Ed25519 signature verification program, and your program uses instruction introspection to confirm that the instruction checked the expected signer and message. With an offchain message, the signed bytes include the signing domain, the version, and the signer list before your text, so pass the full signed message to the verification instruction and parse it in your program.
Design the message
EIP-712's domain separator prevents a signature from being replayed on another app or chain. On Solana, put the same protections in the message itself.
Signatures from programs
ERC1271 exists because a contract wallet has no private key. A Solana program has none either, and it does not need an offchain signature: it authorizes actions onchain by signing for its PDAs in a cross-program invocation. If a multisig or smart wallet must approve an offchain message, have its members sign and verify their signatures against the wallet's stored owners.