Stack Exploder: Unblocking Web3 Products With Costless Transactions
Blockchains traditionally use gas tokens: 1) to pay for infrastructure providers like validators and miners and 2) as a mechanism for spam prevention and transaction ordering. The need for gas tokens often creates awkward user experience issues where end users need to acquire arbitrary tokens from exchanges or other methods prior to interacting with a Web3 product. While a nuisance for DeFi use cases, this awkward user experience is existential for gaming and entertainment where user experience is king. Imagine a non-Web3 gamer valiantly defeating the Sith Lord, only to be interrupted with a message requesting to connect their Metamask and pay gas to mint an NFT achievement. Fortunately, there are some workarounds.
Account abstraction (ERC-4337) is a popular solution to allow “gasless” transactions on behalf of the end user. In this blog post, we will discuss how Account Abstraction works, explain why it is not a comprehensive solution for the developer and propose a new Saga-native solution — the recycled gas token.
Account Abstraction
With a traditional transaction mechanism, a user submits a transaction to a validator with the necessary gas fees. The validator takes the gas as payment and includes the transaction in the blockchain.
Account Abstraction (ERC-4337) separates the verification mechanism from the transaction inclusion mechanism on Ethereum, enabling a separate paymaster to be used for the necessary gas fees.
For the end user, Account Abstraction looks and feels like gasless transactions. However, it is incorrect to call this “gasless” as it is more akin to “sponsored gas,” where someone pays the gas on behalf of the users. While Account Abstraction is a fantastic tool for developers, using it for a “gasless experience” creates other potential user experience problems.
Issues with Sponsored Gas
Sponsored gas only punts the gas issue for another party to resolve on behalf of the user. Generally speaking, the developer of the application ends up footing the gas bill. This poses two general issues in user experience for the developer.
First, the gas payment required by the validator to include transactions into the blockchain becomes an economic sink for the developer. Unfortunately, most developers do not have infinite resources to continuously pay gas fees on behalf of all their users. In one form or another, sponsored gas transactions need to be economically profitable for the developer. This means that developers need to be very selective about whose transactions they will and won’t sponsor. Any users that the selection criteria deems not economical will need to pay for their own gas and have a degraded product experience. A miscalculation will quickly deplete the paymaster wallet and cause errors for the users.
Second, even if the developer correctly filters the correct balance of user transactions, the transaction cost for including a transaction in the blockchain is completely out of the developer’s control. The cost per transaction is variable based on the demand of the blockchain, and (again) miscalculation will quickly deplete the paymaster wallet and cause errors for their users. Ethereum gas costs can vary by more than 10x quite frequently depending on meme coin and other DeFi activity. A developer who normally sponsors $1,000 in monthly gas may suddenly require $10,000 worth of $ETH.
The crux of the user experience issue is that transaction fees are an economic drain from users to the validators.
Saga Revolutionizes Token Flows
In Saga’s Token Mechanism and Incentives Paper, we outlined how we re-architected economic flows in the Saga protocol. With Saga Chainlets, validators are compensated directly by developers for providing infrastructure. Therefore, validators do not collect transaction fees from Chainlets. Instead, all transaction fees are returned back to the developer’s account.
The developer can choose to keep all transaction fees as revenue. Alternatively, we can use this clever economic flow to create a truly sustainable costless blockchain experience.
Introducing Recycled Gas Tokens
When the user interacts with the application, the developer can faucet an appropriate amount of tokens into the user’s wallet. For example, this can be done when a user opens an account to start playing a game or just-in-time (JIT) as they sign transactions.
For the JIT example, the gas tokens’ faucet transactions and the user’s transaction can be atomically batched into the blockchain at the same time. Using Saga’s token flow, the entire balance of the gas tokens are then returned back to the developer’s wallet to be fauceted to future users and transactions. No economic value is funneled out through gas fees.
Using the recycled gas token mechanism, the developer can use their gas token similar to web API tokens, granting access to any subset of users dynamically. For example, a developer can create a faucet that gives 3 free transactions to any users. Then, for a subscription fee, give access to 100 transactions a day. With recycled gas tokens, possibilities are endless and it is always always zero-cost to the developer.
The benefits also extend to the developers’ backend services. In other blockchain systems, a developer is no different from users. When the developer needs to update their own application state, the developer needs to pay the blockchain validators gas fees to update those states. In traditional web applications, database migrations are quite common and necessary to improve the product. However, in Web3, changes in state cost so much that developers will simply avoid making substantive changes to the blockchain state once deployed.
With Saga, because the gas token is always recycled back to the developer, the developer’s server-to-chain infrastructure costs nothing to the developer. The developer’s backend can access and modify the chain all day without costs or restrictions.
Conclusion
Unblocking economics flows for developers is required for mass adoption of blockchain. Recycled gas tokens is only one method Saga uses to unblock developers. By supporting truly costless transactions, we can lift economic barriers from builders and unlock Saga scale applications. For more details around how you can Unblock your application, follow us on X, join our Discord and Telegram and subscribe to our Medium.