Docs/How it works
Gasless messaging
How a message gets on-chain without you paying gas.
The flow#
- 1
You sign
Your wallet signs an EIP-712ForwardRequestdescribing the exact contract call. - 2
The app relays
The app posts the request and signature to its relayer at/api/relay. - 3
The Paymaster submits
The relayer callsPaymaster.relay(), which runs the request through the Forwarder. - 4
The Forwarder checks
It verifies your signature and nonce, then calls the Whispr contract with your address attached. - 5
Whispr records it
It reads you as the sender (ERC-2771), stores the message and emitsMessageSent.
The signed request#
| Field | Meaning |
|---|---|
from | Your address. |
to | The Whispr contract. |
value | Always 0: the relayer refuses requests that carry ETH. |
gas | Gas limit: an estimate plus 80,000. |
nonce | Your next Forwarder nonce. A request can only run once. |
data | The encoded call, such as sendMessage(…). |
Because the signature covers every field, a relayer can't change the message, the recipient or the amount, and can't replay it.
Who pays#
The relayer pays the gas, and the Paymaster refunds it a fixed amount per message from its own balance: RELAYER_REIMBURSEMENT_WEI (0.00005 ETH by default), capped by the Paymaster's maxReimbursementPerTx (0.01 ETH by default). Anyone can top up the Paymaster with deposit() or a plain transfer.