Synopsis 1
Synopsis 1
Submitted by
Kshipra bora
Roll Number: 17MCE10011
Under Guidance of
Dr. Alok Singh Gahlot
Tittle: Making Smart Contract Smarter
Introduction-`A smart contract is a program that runs on the blockchain and has its correct
execution enforced by the consensus protocol. A contract can encode any set of rules
represented in its programming language—for instance, a contract can execute transfers when
certain events happen (e.g., payment of security deposits in an escrow system). Accordingly,
smart contracts can implement a wide range of applications, including financial instruments
(e.g., sub-currencies, financial derivatives, savings wallets, wills) and self-enforcing or
autonomous governance applications (e.g., outsourced computation, decentralized gambling).
A smart contract is identified by an address (a 160-bitidentifier) and its code resides on the
blockchain. Users invoke a smart contract in present cryptocurrencies by sending transactions
to the contract address. Specifically, if a new transaction is accepted by the blockchain and has
a contract address as the recipient, then all participants on the mining network execute the
contract code with the current state of the blockchain and the transaction payloads as inputs.
The network then agrees on the output and the next state of the contract by participating in a
consensus protocol. Ethereum, a more recent cryptocurrency, is a prominent Turing-complete
smart contract platform. Unlike Bitcoin, Ethereum supports stateful contracts in which values
can persist on the blockchain to be used in multiple invocations. In the last six months alone,
roughly 15, 000 smart contracts have been deployed in the Ethereum network, suggesting a
steady growth in the usage of the platform. As Ethereum receives more public exposure and
other similar projects like Rootstock and Counterparty emerge on top of the Bitcoin blockchain,
we expect the number of smart contracts to grow.
Motivation-
Unfortunately, the security of smart contracts has not received much attention, although
several anecdotal incidents of smart contracts malfunctioning have recently been reported,
including contracts that do not execute as expected and/or that have locked away thousands of
dollars’ worth of virtual coins. In contrast to classical distributed applications that can be
patched when bugs are detected, smart contracts are irreversible and immutable. There is no
way to patch a buggy smart contract, regardless of its popularity or how much money it has,
without reversing the blockchain (a formidable task). Therefore, reasoning about the
correctness of smart contracts before deployment is critical, as is designing a safe smart
contract system.
Ethereum’s smart contract system has seen steady adoption, supporting tens of thousands of
contracts, holding millions of dollars’ worth of virtual coins. In this paper, we investigate the
security of running smart contracts based on Ethereum in an open distributed network like
those of cryptocurrencies. We introduce several new security problems in which an adversary
can manipulate smart contract execution to gain profit. These bugs suggest subtle gaps in the
understanding of the distributed semantics of the underlying platform. As a refinement, we
propose ways to enhance the operational semantics of Ethereum to make contracts less
vulnerable. For developers writing contracts for the existing Ethereum system, we build a
symbolic execution tool called Oyente to find potential security bugs. Among19, 366 existing
Ethereum contracts, Oyente flags 8, 833 of them as vulnerable, including the TheDAO bug
which led to a 60 million US dollar loss in June 2016. We also discuss the severity of other
attacks for several case studies which have source code available and confirm the attacks
(which target only our accounts) in the main Ethereum network.
Conclusion-
This paper, documents several new classes of security bugs in Ethereum smart contract,
proposes solution for the documented bugs formalizes the semantics of Ethereum smart
contracts, this paper also provide OYENTE, a symbolic execution tool which analyses Ethereum
smart contracts to detect bugs. We run OYENTE on real Ethereum smart contracts and
confirmed the attacks in the real Ethereum network.
Tittle: Making Smart Contract Smarter
References-
[1] Chenguang Zhu, Ye Leu, Ye Li, Xiuheng Wu, “Identifying Solidity Smart Contract API
Documentation Errors”, 37th IEEE/ACM International Conference on Automated Software
Engineering, October 2022,
[2] Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, Aquinas Hobor, “Making Smart
Contracts Smarter”, National University of Singapore, October 2016, DOI:
http://dx.doi.org/10.1145/2976749.2978309
[3] Ethereum Foundation. The serpent contract-oriented programming language.
https://github.com/ethereum/serpent.
[4] Oyente project page. https://www.comp.nus.edu.sg/˜loiluu/oyente.html.
[5] TheDAO smart contract.
http://etherscan.io/address/0xbb9bc244d798123fde783fcc1c72d3bb8c189413#code.
[6] EtherEx: A fully decentralized cryptocurrency exchange. https://etherex.org/.
[7] EtherOpt: A decentralized options exchange. http://etheropt.github.io/.
[8] The Run smart contract.
https://etherscan.io/address/0xcac337492149bdb66b088bf5914bedfbf78ccc18.
[9] Ethereum Foundation. Block validation algorithm.
https://github.com/ethereum/wiki/wiki/BlockProtocol-2.0#block-validation-algorithm.
[10] Andrew Miller, Brian Warner, and Nathan Wilcox.Gas economics.
https://github.com/LeastAuthority/ethereum-analyses/blob/master/GasEcon.md.
[11] Protect The Castle Contract. Http://protect-the-castle.ether-contract.org/.
[12] GovernMental Smart Contract. Http://governmental.github.io/GovernMental/.
[1] TheDAO smart contract.
http://etherscan.io/address/0xbb9bc244d798123fde783fcc1c72d3bb8c189413#code.
[15] EtherEx: A fully decentralized cryptocurrency exchange. https://etherex.org/.
[16] EtherOpt: A decentralized options exchange. Http://etheropt.github.io/.
[17] Ethereum Foundation. Block validation algorithm.
https://github.com/ethereum/wiki/wiki/BlockProtocol-2.0#block-validation-algorithm.
[18] Andrew Miller, Brian Warner, and Nathan Wilcox.Gas economics.
https://github.com/LeastAuthority/ethereum-analyses/blob/master/GasEcon.md.