Lazy Contracts: Alleviating High Gas Costs by Secure and Trustless Off-chain Execution of Smart Contracts
- URL: http://arxiv.org/abs/2309.11317v1
- Date: Wed, 20 Sep 2023 13:41:45 GMT
- Title: Lazy Contracts: Alleviating High Gas Costs by Secure and Trustless Off-chain Execution of Smart Contracts
- Authors: Soroush Farokhnia,
- Abstract summary: In most programmable blockchains, the notion of gas is introduced to prevent DoS attacks.
A fixed cost to each atomic operation, and the initiator of a function call pays the total gas cost as a transaction fee.
This thesis proposes "lazy contracts" as a solution to alleviate these costs.
- Score: 0.0
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Smart contracts are programs that are executed on the blockchain and can hold, manage and transfer assets in the form of cryptocurrencies. The contract's execution is then performed on-chain and is subject to consensus, i.e. every node on the blockchain network has to run the function calls and keep track of their side-effects. In most programmable blockchains, such as Ethereum, the notion of gas is introduced to prevent DoS attacks by malicious parties who might try to slow down the network by performing heavy computations. A fixed cost to each atomic operation, and the initiator of a function call pays the total gas cost as a transaction fee. This helps prevent DoS attacks, but the resulting fees are extremely high. For example, in 2022, on Ethereum alone, there has been a total gas usage of 1.77 Million ETH ~ 4.3 Billion USD. This thesis proposes "lazy contracts" as a solution to alleviate these costs. Our solution moves most of the computation off-chain, ensuring that each function call incurs only a tiny amount of gas usage, while preserving enough data on-chain to guarantee an implicit consensus about the state of the contract variables and ownership of funds. A complete on-chain execution of the functions will only be triggered in case two parties to the contract are in disagreement about the current state, which in turn can only happen if at least one party is dishonest. In such cases, our protocol can identify the dishonest party and penalize them by having them pay for the entire gas usage. Hence, no rational party has an incentive to act dishonestly. Finally, we perform extensive experiments over 160,735 real-world Solidity contracts that were involved in 9,055,492 transactions in January 2022--January 2023 on Ethereum and show that our approach reduces the overall gas usage by 55.4%, which amounts to an astounding saving of 109.9 Million USD in gas fees.
Related papers
- Demystification and Near-perfect Estimation of Minimum Gas Limit and Gas Used for Ethereum Smart Contracts [0.3277163122167433]
Two central concepts of this system are the emphgas limit assigned by the issuer of a transaction and the emphgas used by a transaction.
Despite its practical relevance, this concept has not been properly addressed.
This paper proposes a precise notion of minimum gas limit and how it can differ from gas used by a transaction.
arXiv Detail & Related papers (2025-01-08T13:07:34Z) - Privacy-Preserving Smart Contracts for Permissioned Blockchains: A zk-SNARK-Based Recipe Part-1 [1.7265013728931]
This work proposes a solution utilizing zk-SNARKs to provide privacy in smart contracts and blockchains.
The proposal includes a new type of transactions, called delegated transactions, which enable use cases like Delivery vs Payment (DvP)
arXiv Detail & Related papers (2025-01-06T21:16:33Z) - How To Save Fees in Bitcoin Smart Contracts: a Simple Optimistic Off-chain Protocol [0.40964539027092906]
We consider the execution of smart contracts on Bitcoin.
We introduce a protocol that moves most of the execution of a Bitcoin contract off-chain.
arXiv Detail & Related papers (2024-03-14T21:20:36Z) - CRPWarner: Warning the Risk of Contract-related Rug Pull in DeFi Smart
Contracts [30.68899693638844]
Rug Pull is one of the most notorious examples of the Rug Pull" scam.
Rug Pull events have already caused significant financial losses.
Based on the analysis of rug pull events, we propose CRPWarner to identify malicious functions in smart contracts.
arXiv Detail & Related papers (2024-03-03T07:48:38Z) - TxAllo: Dynamic Transaction Allocation in Sharded Blockchain Systems [37.22526235663589]
This paper focuses on the transaction allocation problem to reduce the number of cross-shard transactions.
A deterministic and fast allocation scheme TxAllo is proposed to dynamically infer the allocation of accounts.
For a blockchain with 60 shards, TxAllo reduces the cross-shard transaction ratio from 98% to about 12%.
arXiv Detail & Related papers (2022-12-22T10:22:31Z) - Refined Bitcoin Security-Latency Under Network Delay [35.16231062731263]
We study how secure a block is after it becomes $k$-deep in the chain.
We analyze the race between adversarial and honest chains in three different phases.
We find the probability distribution of the growth of the adversarial chains under models similar to those in [Guo, Ren; AFT 2022] when a target block becomes $k$-deep in the chain.
arXiv Detail & Related papers (2022-12-02T18:54:30Z) - Bitcoin-Enhanced Proof-of-Stake Security: Possibilities and Impossibilities [45.90740335615872]
Bitcoin is the most secure blockchain in the world, supported by the immense hash power of its Proof-of-Work miners.
Proof-of-Stake chains are energy-efficient, have fast finality but face several security issues.
We show that these security issues are inherent in any PoS chain without an external trusted source.
We propose a new protocol, Babylon, where an off-the-shelf PoS protocol checkpoints onto Bitcoin to resolve these issues.
arXiv Detail & Related papers (2022-07-18T06:01:25Z) - Token Spammers, Rug Pulls, and SniperBots: An Analysis of the Ecosystem of Tokens in Ethereum and in the Binance Smart Chain (BNB) [50.888293380932616]
We study the ecosystem of the tokens and liquidity pools.
We find that about 60% of tokens are active for less than one day.
We estimate that 1-day rug pulls generated $240 million in profits.
arXiv Detail & Related papers (2022-06-16T14:20:19Z) - Quantum Multi-Solution Bernoulli Search with Applications to Bitcoin's
Post-Quantum Security [67.06003361150228]
A proof of work (PoW) is an important cryptographic construct enabling a party to convince others that they invested some effort in solving a computational task.
In this work, we examine the hardness of finding such chain of PoWs against quantum strategies.
We prove that the chain of PoWs problem reduces to a problem we call multi-solution Bernoulli search, for which we establish its quantum query complexity.
arXiv Detail & Related papers (2020-12-30T18:03:56Z) - Profiling Gas Consumption in Solidity Smart Contracts [3.0378875015087567]
We propose GasMet, a suite of metrics for statically evaluating the code quality of a smart contract from the gas consumption perspective.
An experiment involving 2,186 smart contracts demonstrates that the proposed metrics have direct associations with deployment costs.
arXiv Detail & Related papers (2020-08-12T17:26:55Z) - BatPay: a gas efficient protocol for the recurrent micropayment of ERC20
tokens [0.35132824436572674]
BatPay is a proxy scaling solution for the transfer of ERC20 tokens.
It is suitable for micropayments in one-to-many and few-to-many scenarios.
arXiv Detail & Related papers (2020-02-06T15:43:52Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.