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

  • Cointime's Evening Highlights for May 19th

    1.US spot Bitcoin ETFs saw net inflows of $948.3 million this week

  • Will this cycle skip Ethereum?

    Ryan Sean Adams is going to take the perspective of long-term Ethereum bulls, not the obviously wrong dyed in the wool Ethereum is dead haters.

  • This year, there have been more than 90 Bitcoin ecosystem-related financings

    There have been more than 90 financing transactions related to the Bitcoin ecosystem since 2024, setting a new record for the highest number of financing transactions in a single year in Bitcoin's history. Kyle Samani, Managing Partner at Multicoin Capital, pointed out that with the emergence of the Bitcoin Taproot upgrade and the Ordinals protocol, the Bitcoin ecosystem is experiencing a "developer renaissance". For some developers, building financial tools on Bitcoin is more attractive because it is the oldest and most secure blockchain. Multicoin Capital's investment trend is reportedly shifting from Solana to the Bitcoin ecosystem. The venture capital firm has invested in projects such as Solana Labs and StarkWare, but recently participated in the funding of the Bitcoin-native music platform Arch Network and the Bitcoin scaling network Mezo.

  • $1.911 billion worth of SOL transferred

    According to Whale Alert monitoring, 11,040,253 SOL (US $1,911,291,365) was transferred from an unknown wallet to another unknown wallet.

  • DeFi TVL exceeds $95 billion again

    According to defillama data, as of May 18, 2024, the total value locked (TVL) in DeFi has once again surpassed $95 billion. It is currently reported at $95.069 billion, an increase of nearly $12 billion from the low point of $83.04 billion 35 days ago. Among the top five protocols in terms of TVL, Eigenlayer has the highest 30-day increase, with TVL rising by 19.67% to a total of $15.455 billion.

  • Cointime's Evening Highlights for May 24th

    1. CryptoPunks Launches “Super Punk World” Digital Avatar Series

  • An address mistakenly transferred about $7,000 in BTC to Satoshi Nakamoto’s wallet

    According to Arkham monitoring, someone accidentally sent 90% of their BTC assets to Satoshi Nakamoto's wallet address last night. They were trying to swap Ordinal for PupsToken, but ended up sending almost their entire wallet balance - about $7,000 worth of BTC.

  • USDC circulation increased by 200 million in the past 7 days

    According to official data, within the 7 days ending on May 16th, Circle issued 1.8 billion USDC, redeemed 1.6 billion USDC, and the circulation increased by 200 million. The total circulation of USDC is 33.2 billion US dollars, and the reserve is 33.4 billion US dollars, of which 3.8 billion US dollars are in cash, and Circle Reserve Fund holds 29.6 billion US dollars.

  • Bitcoin mining company Phoenix Group released its Q1 financial report: net profit of US$66.2 million, a year-on-year increase of 166%

    Phoenix Group, a listed mining company and blockchain technology provider for Bitcoin, released its Q1 financial report, with the following main points:

  • Pudgy Penguins and Lotte strategically cooperate to expand into the Korean market, and the floor price rose by 3.1% on the 7th

    The NFT series "Pudgy Penguins" has recently announced a strategic partnership with South Korean retail and entertainment giant Lotte Group on the X platform to expand its market in South Korea and surrounding areas. More information will be announced in the future. According to CoinGecko data, the floor price of Pudgy Penguins is currently 11.8 ETH, with a 7-day increase of 3.1%.