Cointime

Download App
iOS & Android

How to purchase Ethereum GAS in advance

From Ethresearch by web3skeptic

Abstract

This topic introduces a method for purchasing gas on Ethereum. Technically it is a fully on-chain Ethereum gas futures market. The volatility of gas prices, primarily driven by network demand fluctuations, significantly obstructs user experience on Ethereum due to unpredictable costs. This solution aims to mitigate that issue.

Protocol Description

General

The protocol users might be divided into to parties, gas purchasers (Purchaser) and gas providers (Executors)

The general protocol workflow has these stages:

  1. Purchaser: Listing order
  2. Executor: Accepting order
  3. Purchaser: Requesting transaction execution
  4. Executor: Executing transaction
  5. Anyone: Liquidating executor

Listing order

It is required to place order conditions onchain regarding the execution timeframe, gas price, and the expected security from the Executor, also the Purchaser locks the reward tokens responsible of paying the gas: gasCost * gasAmount.

The GasOrder should include such fields:

struct GasOrder { uint256 gasAmount; // The amount of Gas to book for future executions uint256 executionPeriodStart; // Start timestamp when it is possible to use the gas within the order uint256 executionPeriodDeadline; // End timestamp when it is possible to use the gas within the order uint256 executionWindow; // This variable defines a window, measured in blocks, within which a // transaction must be executed. This constraint is designed to optimize timing and prevent delays, while // also safeguarding against the exploitation of gas price fluctuations by malicious actors. TokenTransfer gasCost; // The cost of one Gas unit TokenTransfer guarantee; // The guarantee security required from the Executor }

Accepting order

Some Executor accept the conditions of the GasOrder, and locks the guarantee. The guarantee security is execpected to be proportional to the purchased amount of Gas.

Requesting transaction execution

When the GasOrder execution timeframe comes, the user might request transaction execution by signing the data structure with the transaction details.

Message { address from; uint256 nonce; uint256 gasOrder; // number of the employed order uint256 deadline; // deadline of the msg execution, should be within the range of order execution address to; // the contract which is being called uint256 gas; // gas limit to spend uint256 tips; // tips to the party which pushes the tx request onchain bytes data; // execution request details bytes signature; // the signature by the sender }

After the transaction is signed the hash of it should be published onchain. It might be done by transaction requester itself, or by anyone else. To incentives the posting the transaction request onchain the signer specifies the tips. The tips represents the Gas within the GasOrder which will be burned and the respective share of reward will be directed to the transaction request submitter.

Executor takes the signed data and calls the to contract from function within the protocol which executes the call with the data from the Message. Consecuently the call unlocks the share of the reward and the guarantee for the Executor.

If the transaction is not Executed because it is not profitable for the Executor than the Executor might be liquidated, it might be implemented in few ways, centralized and decentralized, lets review the decentralized version.

Decentralized liquidation logic

During the transaction request, the transaction hash is posted on-chain, also the signature and remaining Message data posted as a calldata to be publicly available.

If the Executor fails to execute the transaction before the Message.deadline, anyone can do so by providing the necessary data from the Message before the deadline + CONSTANT_LIQUIDATION_TIME. In return, the executor’s guarantee is partially forfeited, and the Liquidator requester receives a reward.

Bottlenecks

Executor incentive

Executor incentives rely on adjusting GasCost to accommodate risk. As gas prices are unpredictable, Executors mitigate risks by charging extra. This flexible pricing model, determined by Executors, may evolve from sporadic agreements to a more standardized market, resulting in better price averages over time.

Gas consumption

The protocol’s viability hinges on surpassing a certain threshold, as it necessitates gas for order publication, acceptance, signature verification, and transaction execution.

Split of liquidity

Tokenizing each Gas order is straightforward, yet trading shares between orders poses a challenge due to their differing parameters. While securitization of long-term orders seems a plausible solution, preventing liquidity fragmentation remains elusive at present.

Lock of guarantee

Executors must lock guarantees to deter liquidation risks, yet this restricts their flexibility. The locked guarantee could otherwise be utilized for liquidity elsewhere to generate yield. One potential solution is to lock tokens which represent shares in farming pools, enabling yield generation while locked. However, this introduces additional risks for gas Purchasers parties, as farming protocols entail additional security assumptions and associated risks.

P.S. I’m really interested to get the feedback on the proposed mechanism

Comments

All Comments

Recommended for you

  • BTC breaks through $97,000

    the market shows BTC breaking through $97,000, now trading at $97,011.43, with a 24-hour increase of 0.85%. The market is volatile, please manage risks.

  • The JuCoin ecological project JuChain has been launched on the main network, and the public chain co construction summit will be held. The ecological debut protocol is Butterfly

    Cointime News:JuCoin's self-developed public chain JuChain has been launched on the main network. The JuChain Public Chain Co construction Summit initiated by JuCoin will be held on May 15, 2025 in Bangkok, Thailand. The conference will release the first ecological agreement--

  • BTC breaks through $96,000

    the market shows that BTC has broken through $96,000 and is now trading at $96,014.98, with a 24-hour increase of 1.15%. The market fluctuates greatly, so please manage your risks well.

  • Martin Young ·

    North Carolina House passes state crypto investment bill

    North Carolina’s House passed a bill to allow the state treasurer to invest government funds in approved cryptocurrencies with a 71 to 44 vote.

  • Ciaran Lyons ·

    Galaxy Digital plans Nasdaq listing as crypto stocks post strong rebound

    Galaxy Digital’s Mike Novogratz says the Nasdaq listing will provide an easier gateway for exposure to the crypto and AI ecosystem.

  • Martin Young ·

    US crypto groups urge SEC for clarity on staking

    A group of nearly 30 crypto advocate groups has asked the SEC to provide legal clarity on crypto staking, arguing that it's not an investment activity.

  • JuCoin CEO: UX design in the encryption industry needs to pay attention to user emotional details to enhance user experience

    Cointime News: JuCoin CEO Sammi Li delivered a keynote speech at the TOKEN2049 conference, analyzing the current challenges in user experience (UX) design in the cryptocurrency industry. Sammi Li believes that the existing encryption product experience fails to effectively empathize with users, often leading to usage anxiety, which hinders the large-scale adoption of Web3. Combining her rich experience in the luxury goods industry, she emphasizes that building trust relies on paying attention to user emotions and critical moments of interaction, and constructing it through details rather than simply technical presentations. JuCoin is applying these user centered design principles to its Web3 ecosystem construction, aiming to lower user barriers and enhance user experience by optimizing JuChain and related product designs. It calls on the encryption industry to think together and place user experience at a more core position.

  • Xiongan New Area: Combining blockchain with digital RMB to launch "Digital Currency Loan" product, with payment amount of nearly 100 million yuan

    On January 11th, according to the Xiong'an Public Account, the digital RMB pilot in Xiong'an New Area has achieved new results. The first digital RMB tax payment transaction in the financial field has been completed, and self-service tax terminals have been developed. The "blockchain + digital RMB" technology is applied to government procurement management, increasing the proportion of advance payment and landing multiple applications to solve corporate problems. In 2024, the People's Bank of China Xiong'an New Area Branch, together with the Xiong'an New Area Reform and Development Bureau, will launch the "Implementation Plan for the Deepening of the Pilot Work of Digital RMB in the Rongdong Area", to enhance public awareness. By combining blockchain with digital RMB, the "digital currency loan" product will be launched, with a payment amount of nearly 100 million yuan.

  • Fardi Wang, Chairman of NEXUS 2140: AI•Web3•Ecom Global Expo, Made Appearance at Meta Crypto Oasis 2025 in Dubai

    Fardi Wang, Chairman of NEXUS 2140: AI•Web3•Ecom Global Expo, recently appeared at the Meta Crypto Oasis 2025 in Dubai, joining global Web3 leaders such as Justin Sun (Founder of TRON) and Chris (Co-founder of Sonic) to discuss the future of the industry. As the first cross-industry event integrating AI, Web3, and E-commerce, NEXUS 2140 is accelerating its international expansion through Fardi Wang’s active participation. At the summit, Fardi Wang emphasized that the integration of virtual and real-world assets is the key breakthrough for the Web3 ecosystem. He mentioned: “NEXUS 2140 is leveraging Korea’s policies, technological strengths, and ecosystem advantages to build a global industrial hub.” His insights received strong recognition from attendees, and the Dubai visit further amplified the international influence of the event, injecting new momentum into global digital economy collaboration.

  • Binance Wallet’s New TGE B² Network is Now Available for Investment

    according to official page data, Binance Wallet's new TGE B² Network is now open for investment, with an end time of 18:00 (UTC+8). The participation threshold for this TGE is that Alpha points must reach 82 points.