Ethereum Paymaster: Who Pays Gas?

The paymaster pays the gas, and if you think that means free transactions, you are already bleeding money. Ethereum's account abstraction stack lets a smart contract settle the gas bill on behalf of a user, but someone funded that contract, and that someone is either you, your counterparty, or a sponsor with a hidden ledger. The Ethereum Paymaster is not charity infrastructure. It is a prepaid credit line with a validation function bolted on top.

The Prefunded Deposit Is the Whole Game

Every paymaster contract must hold a balance in the EntryPoint before it can sponsor a single UserOperation. When a bundler submits the bundle, the EntryPoint calls validatePaymasterUserOp, and the paymaster either approves the sponsorship or reverts. If it approves, the EntryPoint debits the paymaster's deposit immediately, before the user's calldata ever executes. This is the part most developers gloss over: the paymaster is on the hook the moment validation passes, regardless of whether the user's transaction later fails. 💸 You eat the gas on a failed execution unless your validation logic checks the target call and simulates it. A sloppy paymaster deposit strategy is just a subsidized denial-of-service waiting to happen.

Sponsorship Models and Where the Money Actually Sits

There are four real sponsorship patterns running in production. First, the gasless dApp model, where the protocol treasury tops up the paymaster deposit and the user pays nothing at the point of interaction. Second, the ERC-20 token model, where the user hands over stablecoins and the paymaster converts them to ETH via an oracle-priced swap inside the postOp call. Third, the allowlist model, where signed attestations gate who gets sponsored, and the sponsor is a marketing budget with a hard cap. Fourth, the cross-chain model, where a relayer on another chain reimburses the paymaster out of band. In every single case, the entity that funded the deposit is the entity that pays gas. The user's wallet is a pass-through. 😤 Anyone telling you otherwise is selling a bridge.

Validation Context Is Your Only Defense

The paymaster's validatePaymasterUserOp runs in a restricted context. You cannot read storage outside the paymaster's own slot namespace, you cannot call arbitrary external contracts without staking, and you have a strict gas limit on validation itself. This is where the account abstraction design forces discipline: your sponsorship policy must be provable inside a few thousand gas. If your validation logic needs an oracle read, you must pre-stake and accept the risk that the oracle is stale. The bundler will not wait for you to make up your mind. It simulates, it validates, and it debits. A paymaster that reverts during validation gets its UserOperation dropped and the reputation score tanks.

The postOp Reimbursement Trap

Here is the mechanism that separates professionals from tourists. The postOp call executes after the user's transaction and is where you collect ERC-20 payment, apply penalties, or record usage. If postOp reverts, the entire UserOperation reverts, and the paymaster still pays the validation gas. Worse, the EntryPoint enforces a postOp gas limit, and exceeding it triggers a revert with the same outcome. 🔥 I have watched teams build elaborate token-payment flows that blow the postOp budget by a few hundred gas, turning every sponsored transaction into a full loss. Measure your postOp path with a hard ceiling and leave a twenty percent buffer. No exceptions.

Reputation, Throttling, and the Bundler's Cut

Paymasters carry a reputation score in the EntryPoint. A paymaster with a poor record gets throttled, and throttled paymasters see their UserOperations deprioritized or rejected outright by bundlers. Bundlers are not public utilities; they take a margin, and they will drop your bundle if the paymaster looks risky. This means the true cost of sponsorship includes the bundler premium, not just the base fee. 🎯 The gas sponsorship budget must account for priority fees, bundler markup, and the occasional failed postOp. Anyone quoting you a flat per-transaction sponsorship cost is quoting the optimistic case.

Who Pays, Precisely

Follow the deposit. The paymaster contract holds ETH in the EntryPoint. The EntryPoint debits that deposit at validation time. The deposit was funded by whoever called depositFor, and that call is on-chain forever. If your paymaster uses a token swap in postOp, the user effectively pays through the swap spread plus the paymaster's margin. If your paymaster uses an allowlist, a sponsor's treasury pays and the user pays with their identity data. There is no free gas on Ethereum, only gas with a moved invoice. The invoice moves to the deposit, and the deposit moves to whoever signed the funding transaction.