Setting up gasless transactions on Base
Turnkey provides native gas sponsorship for Base (EIP-155:8453) and Base Sepolia (EIP-155:84532). Unlike traditional paymaster setups, Turnkey handles transaction construction, signing, gas estimation, and broadcast in a single API call. You toggle sponsorship with a single parameter.To access gas sponsorship, ensure it is enabled within your Turnkey dashboard. Then use the corresponding chain ID in the
caip2 parameter.How it works
Turnkey’sethSendTransaction endpoint handles the full transaction lifecycle:
- Transaction construction: You provide the minimal payload (recipient, value, calldata). Turnkey fills in nonce, gas estimates, and tip fees.
- Signing: The transaction is signed within Turnkey’s secure enclave using the sender’s private key.
- Broadcast and monitoring: Turnkey submits the signed transaction to Base and monitors it until inclusion or failure.
sponsor: true, Turnkey covers the gas fees. Your users never need to hold ETH on Base.
Getting started
Set up your Turnkey organization and account by following the Quickstart guide. You should have:- A root user with a public/private API key pair within the Turnkey parent organization
- An organization ID
- A wallet with an Ethereum account created within this organization
Install dependencies
Option 1: Using @turnkey/sdk-server
For backend services and Node.js applications.
Step 1: Create a client
Step 2: Submit a sponsored transaction
sponsor: false (or omit the field) to send a standard EIP-1559 transaction where the sender pays gas.
Step 3: Poll for inclusion
Transaction statuses
| Status | Description |
|---|---|
| INITIALIZED | Transaction constructed and signed, not yet broadcast |
| BROADCASTING | Actively broadcasting to the network, awaiting inclusion |
| INCLUDED | Transaction included in a block |
| FAILED | Transaction could not be included and will not be retried |
Option 2: Using @turnkey/react-wallet-kit
For React applications, handleSendTransaction provides a complete UI experience with modals, loading states, and explorer links.
Checking gas usage
You can configure gas limits at both the sub-org and organization level. Monitor usage to handle edge cases when approaching your limit:Smart contract interactions
Sponsored transactions support arbitrary EVM operations, not just simple sends. You can interact with smart contracts by passing calldata:Security
Turnkey’s gas sponsorship is designed to prevent replay attacks. Transaction construction happens inside secure enclaves, and as long as the request includes the relevant nonce, only one transaction can be created from it. The user’s authenticator signs requests and the enclave verifies signatures, so a malicious actor cannot modify or replay the request.Resources
- Transaction Management: Full conceptual overview of gas sponsorship, broadcast, and monitoring
- Gas Station SDK: EIP-7702 based gasless transactions with your own paymaster
- Turnkey policy engine: Write policies against both sponsored and non-sponsored transactions
- Base network support: Turnkey’s Ethereum and Base ecosystem support