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

  • Grayscale transferred more than 1,000 BTC to Coinbase Prime address again last night

    According to Arkham data monitoring, the grayscale address transferred about 411 BTC to Coinbase Prime last night, and about 14 hours ago transferred 1003 BTC to Coinbase Prime address again, worth about $64.18 million.

  • Justin Sun has deposited 166 million USDT to Binance in the past 7 hours

    According to on-chain analyst @ai_9684xtpa, in the past 7 hours, Sun Yuchen has accumulated a total of 166 million USDT deposited into Binance.

  • An address transferred 8150 ETH to Galaxy Digital OTC address 8 hours ago

    According to on-chain analyst @ai_9684xtpa monitoring, 8 hours ago, address 0x4E8...fA555 transferred 8,150 ETH (valued at $25.64 million) to Galaxy Digital OTC address, suspected of commissioning sales.

  • Suspected Amber Group address withdraws 3 million SAFE from Gate.io

    Spot On Chain monitoring shows that wallet 0x011 (possibly Amber Group) withdrew 3 million SAFE tokens (worth $6.72 million) from Gate.io for the first time at a price of $2.25, six hours ago. It is worth noting that the price of SAFE has fallen by about 36% since April 23, 2024.

  • Franklin Ethereum ETF EZET listed on DTCC website

    COINOTAG has stated on the X platform that the Franklin Ethereum ETF EZET has been listed on the DTCC website.

  • Grayscale GBTC Bitcoin holdings fell below 300,000 BTC

    Official data from Grayscale shows that as of April 26th local time, GBTC's Bitcoin holdings have fallen below the 300,000 BTC mark to 298,445.4699 BTC, a decrease of approximately 2,167 BTC from the previous day. Additionally, GBTC's assets under management (non-GAAP) have decreased to $19,052,609,573.56, and its circulating shares have decreased to 335,190,100.

  • Hong Kong Investment Commission: Virtual asset spot ETFs can be bought and sold through banks

    Hong Kong investors and the Financial Education Committee have stated that the investment scope of spot virtual asset ETFs is limited to virtual assets (currently limited to Bitcoin and Ethereum) provided to the Hong Kong public for buying and selling on virtual asset trading platforms holding China Securities Regulatory Commission licenses. Trading counterparties must buy and sell virtual assets through licensed virtual asset trading platforms to reduce counterparty risks. Asset custody must be entrusted to designated institutions regulated in Hong Kong, such as licensed virtual asset trading platforms, banks, or their subsidiaries registered in Hong Kong, to reduce custody risks. Investors can buy and sell virtual asset spot ETFs through securities firms or banks. Some virtual asset spot ETFs also provide non-listed fund unit categories, which operate similarly to non-listed funds. Investors can apply for and redeem units through securities firms or banks.

  • Lido: SSV Simple DVT testnet has ended, selected participants will join the mainnet Simple DVT module

    Lido announced the end of the SSV Simple DVT testnet on the X platform and will soon launch the mainnet. In the next few weeks, selected participants will use SSV technology to join the Lido Simple DVT module on the mainnet.

  • Justin Sun redeemed 85.53 million USDT from JustLend 4 hours ago and immediately transferred it to Binance

    As monitored by on-chain analyst Yu Jin, 4 hours ago, Sun Yuchen's Tron address (TXN...752) redeemed 85.53 million USDT from JustLend and immediately transferred it to Binance.

  • ETH falls below $3,100

    According to market data, ETH has fallen below $3,100 and is now trading at $3,099.54, with a daily decline of 1.04%. The market is volatile, so please be prepared for risk control.