Introducing Smart Gas: Pay Network Fees with Stablecoins in Tangem Wallet
Smart gas transactions are now available in Tangem Wallet across Ethereum, BNB Smart Chain, Polygon, Arbitrum One, and Base.
AI summary
Users migrating from centralized exchanges to self-custody wallets consistently hit the same obstacle: they withdraw tokens to their new wallet, attempt to make a transaction, and discover they can't. The transaction requires gas fees paid in the network's native currency, ETH on Ethereum, BNB on BNB Smart Chain, MATIC on Polygon, and they have none.
This isn't a minor inconvenience. The user now needs to acquire a small amount of native tokens just to move their own assets. That means finding an exchange that supports small purchases, paying withdrawal fees that may exceed the amount needed, or finding a faucet or friend who can send them enough to get started. For many users, especially those new to self-custody, this is where they give up.
We’re integrating smart gas transactions to eliminate this barrier entirely.
What is a smart gas transaction?
Smart gas transactions allow users to pay network fees using popular stablecoins instead of native tokens. When you have USDC or USDT in a supported network, you can use it to cover transaction fees directly.
Example: Alice withdraws 100 USDT from Coinbase to her Tangem Wallet on the Ethereum network. She wants to send 50 USDT to Bob, but she has no ETH on Tangem to pay the gas fee. With Smart gas transactions, the app detects her USDT balance and offers to pay the fee in USDT. Alice confirms and signs the transaction, and 50 USDT is sent to Bob, with ~$0.80 in USDT deducted as the network fee. She never needed to acquire ETH.
Supported Networks and Tokens
Smart gas transactions are available on major EVM networks that have implemented EIP-7702 (Pectra upgrade). We've selected fee tokens based on liquidity, predictable transfer gas costs, and widespread adoption; primarily USD-pegged stablecoins that users are most likely to hold after withdrawing from exchanges.
Network | Supported Fee Tokens |
|---|---|
Ethereum | USDC, USDT |
BNB Smart Chain | USDC, BSC-USD |
Polygon | USDC, USDT0 |
Arbitrum One | USDC, USDT0 |
Base | USDC |
How does a smart gas transaction work behind the scenes
This feature is enabled by EIP-7702 ("Set Code for EOA"), introduced with the Pectra upgrade in May 2025. This standard represents a significant evolution in how Ethereum accounts can function.
How EIP-7702 Works
Traditionally, Ethereum has two account types: Externally Owned Accounts (EOAs), controlled by private keys, and Contract Accounts, which contain executable code. EOAs are simple—they can hold assets and sign transactions—but they can't execute custom logic. Contract accounts can execute arbitrary code but require deployment and have different security properties.
EIP-7702 bridges this gap. It allows an EOA to temporarily delegate to a smart contract's code by signing an authorization message. Critically, this authorization doesn't require an on-chain transaction. The user signs a message, and that signature can be included in a transaction submitted by someone else.
This is what makes smart gas transactions possible: users can authorize the attachment of our contract logic to their account without paying any gas fee for that authorization itself.
Why this matters
Before EIP-7702, achieving similar functionality required either:
- Account abstraction (ERC-4337): Requires users to migrate to a new smart contract wallet address, breaking compatibility with their existing EOA.
- Meta-transactions: Requires token contracts to support permit functions or specific relay infrastructure.
- Centralized relayers: Introduces trust assumptions and potential censorship points
EIP-7702 lets users keep their existing address while gaining smart contract capabilities on demand.
Tangem’s smart contract implementation
We developed a custom smart contract rather than adopting existing solutions. Off-the-shelf implementations we evaluated were either more expensive for users (due to unnecessary overhead) or included functionality that expanded the attack surface without providing benefit for our use case.
Our implementation uses two contracts:
Tangem7702Smart gasExecutor
This is the contract delegated by the user's EOA. It handles:
- Signature verification — Validates that the smart gas transaction parameters were signed by the account owner using EIP-712 typed data signing
- Transaction execution — Executes the user's intended transaction (e.g., token transfer)
- Fee compensation — Calculates actual gas consumed and transfers the appropriate fee token amount to the fee recipient
The contract maintains minimal storage—just a nonce for replay protection. Storage layout is offset using Solidity's custom storage layout feature to prevent collisions if the contract is ever upgraded.
// Core data structures
struct Transaction {
address to;
uint value; // Currently must be 0
bytes data;
}
struct Fee {
address feeToken; // Token used for fee payment
uint maxTokenFee; // Maximum fee in token units
uint coinPriceInToken; // Native currency price in token
uint feeTransferGasLimit; // Gas limit for fee transfer
uint baseGas; // Fixed overhead (signature verification, nonce update)
address feeReceiver; // Fee collection address
}
struct Smart gasTransaction {
Transaction transaction;
Fee fee;
uint nonce; // From user's contract storage
}Key constants:
- BASE_GAS = 60,000 — Fixed gas overhead for signature verification, nonce updates, and execution scaffolding
Tangem7702EntryPoint: The Entry Point Contract
We also deployed an Entry Point contract that serves as our relay's interface for executing smart gas transactions. Its role is simple and essential: it verifies that the contract code attached to the user's address matches exactly what we expect before forwarding the transaction for execution.
function executeTransaction(
Smart gasTransaction calldata gasslessTx,
bytes calldata signature,
bool forced,
address executor
) externalThe forced parameter controls behavior when the fee transfer gas exceeds feeTransferGasLimit:
- false — Revert the transaction (used during gas estimation)
- true — Emit an event and continue (used during actual execution, since gas is already spent)
This protects our relay infrastructure. Since we're paying the actual gas costs upfront and receiving compensation from the user's fee token balance, we need assurance that the attached contract will correctly calculate and transfer that compensation. The Entry Point ensures we interact only with accounts running our audited contract code.
Fee parameters
When you approve a smart gas transaction, you sign a message containing:
- Fee token: Which stablecoin will be used for payment (e.g., USDC)
- Token price: The exchange rate between the fee token and the native currency, used to calculate the equivalent cost
- Maximum fee: The upper bound the user is willing to pay, this is what's displayed in the Tangem app
- Additional parameters for replay protection and transaction specifics
The maximum fee provides users with cost certainty. The actual fee charged is based on real gas consumption and will typically be lower than this maximum.
Security model
We evaluated existing solutions (ERC-4337 account abstraction, third-party smart gas providers), but building our own contract was a deliberate security decision. Generic smart gas transaction solutions often include:
- Support for arbitrary contract calls (expanding what a compromised signature could authorize)
- Batch transaction capabilities (increasing complexity and potential for unexpected interactions)
- Upgradability mechanisms (introducing admin key risks)
Our contract is purpose-built for token transfers with fee payment. It does one thing, which makes it easier to audit and reason about.
Factor | ERC-4337 | Tangem’s implementation |
|---|---|---|
Gas overhead | Higher (bundler infrastructure) | Lower (direct execution) |
Attack surface | Larger (more functionality) | Minimal (single purpose) |
Storage collision risk | Varies by implementation | Mitigated via custom storage layout |
Upgradeability | Often included (admin key risk) | Not upgradeable |
Audit
The contract was audited by Pessimistic, a blockchain security firm specializing in smart contract analysis. The full audit report is available on GitHub.
User experience
Despite the technical complexity underneath, the user-facing experience is simple:
- You initiate a transaction (send, swap, send via swap) in a supported network
- If you have a balance in a supported stablecoin, the app offers the option to pay fees in that token
- You see the maximum fee in the stablecoin denomination and confirm the transaction
- Behind the scenes: you sign both the EIP-7702 authorization (attaching Tangem’s smart contract to your account) and the smart gas transaction parameters
- This signed bundle is sent to our backend, which submits the transaction to the network
- The transaction executes, and the fee is deducted from your stablecoin balance
From your perspective, it's just a normal transaction, except you didn't need native coins to make it happen.
Limitations and considerations
Smart gas transactions currently work with the stablecoins listed earlier in this article. We selected these based on liquidity, adoption, and technical compatibility. Other limitations include:
- Fee premium: Smart gas transactions may cost slightly more than native gas payments due to the additional contract execution overhead and the need to convert token prices. We've optimized our contract to minimize this premium.
- Network support: EIP-7702 is only available on networks that have implemented the Pectra upgrade. We've enabled the feature on the networks where both EIP-7702 support and stablecoin liquidity make it practical.
Conclusion
Smart gas transactions remove one of the most persistent friction points in self-custody. By leveraging EIP-7702, we've enabled users to transact with only the tokens they already hold.
For users coming from exchanges, this means their withdrawn tokens are immediately usable. For the broader ecosystem, it's a step toward crypto infrastructure that meets users where they are rather than demanding they understand gas mechanics before they can move their own money.