Gas Budgeting for dApp Devs

Our goal at Biconomy is to continually find ways to streamline Biconomy SDK integrations so that Devs can put gasless transactions in the hands of as many new web3 users as possible. We believe one big pain point for Devs is the inability to budget gas costs. One solution is to simply offer Devs the ability to purchase gas at a known upfront fixed price. If you missed our first piece on fixed price transactions, see what we are building.

In this post, we take a closer look at how Biconomy’s Gasless product can leverage fixed price transactions to provide a better UX for dApp developers today.

Biconomy SDK and the Gasless UX

The example cited in our previous post describes a user having the ability to wake up on a Saturday morning and purchase a bundle of transactions at that day’s Gwei price. In theory, a protocol specialized in financial risk management can harness gas forward markets to fully accept any and all gas price risk from normal web3 users on any given day, and immediately construct a perfect hedge so as to completely offset the risk taken. This financial risk manager could develop a user facing wallet plug-in that offers users the ability to purchase a fixed gas budget at a fixed price (”fixed price transactions subscriptions”) that they would then be free to spend over the subscription window.

This kind of solution would require an end-user interface with Biconomy’s gas tanks, which is not currently something we offer. However, similar to offering end users fixed price transaction subscriptions directly, we could instead allow dApps to purchase gas budgets for their end-users (or their own DevOps) at a fixed price.

Gasless ELI5

If you are not familiar with Biconomy’s Gasless Product, here is a quick explainer. Decentralized applications load gas tokens into a non-custodial gas tank and then relay user transactions through Biconomy’s relay infrastructure, which is capable of reimbursing itself through the dApp’s gas tanks. This setup allows the dApp’s users to interact with the dApp gas free.

Gasless UX Tradeoff

In the current gasless integration, dApps make a tradeoff between controlling the cost of subsidizing user gas fees and guaranteeing a number of gasless transactions for their users. Gas price volatility forces the dApp to choose how they optimize. If a dApp were to control for cost, then user experience may suffer as the number of gasless transactions possible might be less than communicated to their users as gas prices rise. Alternatively, if a dApp were to control for the number of transactions, the cost may become burdensome as gas prices rise.

Gasless UX Improvement

To help solve the Gasless UX tradeoff, Biconomy is proposing a transaction subscription agreement. Here, a dApp would be able purchase a 30-day subscription for a specified number of gas units at a fixed (gwei) price. This allows the dApp to know their monthly gas fee subsidy expenses in advance, while guaranteeing their users a certain number of transactions.

By offering dApps the ability to lock in user subsidies at a known upfront cost, Biconomy can make gas subsidy costs predictable for dApps. We think this is a nice UX improvement.

Example - Alice

Alice wants to onboard users to her shopping adventure game, and her target market is non crypto-native. By integrating Gasless, Alice can abstract away her user’s interaction with the network, which allows her users to focus on building out their digital wardrobe instead of having to constantly source gas tokens.

Alice wants to know in advance how much she will spend on gas subsidies each month. For this, she works with Biconomy to purchase a transaction subscription agreement.

Biconomy works with Alice to study her expected user base and the smart contract methods her shopping game will call. Biconomy and Alice estimate her smart contracts burn ~70k gas units/method call, and her users will make ~10.3k method calls per month. Thus, Alice will need to subsidize approximately 721MM gas units over the course of the first month. Using the previous 6500 blocks average gas price of 24 gwei, Alice would need approximately 17.3 ETH to cover her user’s gas costs for the next month. Alice signs up for a transaction subscription with Biconomy for 721MM gas units over the thirty days at a cost of 17.3 ETH. Biconomy guarantees Alice 721MM gas over the thirty days ensuring an optimal user experience, and Alice is satisfied knowing she will spend no more than 17.3 ETH for the next thirty days on subsidizing user gas, at an average cost of about 0.002 ETH per user transaction.

Example - Bob

Bob recently launched a new rollup chain to Ethereum. Bob’s optimistic fraud proof architecture allows users to cheaply transact off-chain with the guarantee that their assets are properly accounted for. In Bob’s set up, the off-chain transaction call data is compressed and sent in batches to a smart contract on Ethereum that represents the canonical state of the rollup. Bob employs an Ethereum relayer node that pays gas fees and submits changes to the smart contract to the Ethereum network. Bob’s rollup collects an estimated Ethereum gas fee from each rollup transactions and uses the collective funds to reimburse the relayer node. Bob recognizes overtime that estimating Ethereum gas fees, even a few minutes out, can be a difficult task.

Bob would like to know ahead of time how much he’s going to pay in Ethereum gas fees so that he can more accurately price his rollup transactions.

Bob works with Biconomy to estimate the monthly Ethereum gas spent writing off-chain call data to the network. Although a rough estimate, they determine that Bob will need to spend roughly 1.3MM gas per batch or roughly 6.2B gas per month writing call data to Ethereum. Using the previous 6500 blocks average gas price of 24 Gwei, Bob would need approximately 149 ETH to cover Ethereum gas costs for the next month. Bob signs up for a transaction subscription with Biconomy for 6.2B gas units over the thirty days at a cost of 149 ETH. Biconomy guarantees Bob 6.2B gas over the thirty days ensuring rollup transactions are priced in a predictable manner, and Bob is satisfied knowing his rollup users will spend no more than 149 ETH for the next thirty days, regardless of how volatile the Ethereum gas market is.

Subscribe to Trevor Jacka
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.