15,851 research outputs found
A Survey of Smart Contract Formal Specification and Verification
A smart contract is a computer program which allows users to define and
execute transactions automatically on top of the blockchain platform. Given the
significance of smart contracts in supporting important activities across
industry sectors including supply chain, finance, legal and medical services,
there is a strong demand for verification and validation techniques. Yet, the
vast majority of smart contracts lack any kind of formal specification, which
is essential for establishing their correctness. In this survey, we investigate
formal models and specifications of smart contracts presented in the literature
and present a systematic overview in order to understand the common trends. We
also discuss the current approaches used in verifying such property
specifications and identify gaps with the hope to recognize promising
directions for future work
Towards Safer Smart Contracts: A Survey of Languages and Verification Methods
With a market capitalisation of over USD 205 billion in just under ten years,
public distributed ledgers have experienced significant adoption. Apart from
novel consensus mechanisms, their success is also accountable to smart
contracts. These programs allow distrusting parties to enter agreements that
are executed autonomously. However, implementation issues in smart contracts
caused severe losses to the users of such contracts. Significant efforts are
taken to improve their security by introducing new programming languages and
advance verification methods. We provide a survey of those efforts in two
parts. First, we introduce several smart contract languages focussing on
security features. To that end, we present an overview concerning paradigm,
type, instruction set, semantics, and metering. Second, we examine verification
tools and methods for smart contract and distributed ledgers. Accordingly, we
introduce their verification approach, level of automation, coverage, and
supported languages. Last, we present future research directions including
formal semantics, verified compilers, and automated verification
Formal Specification and Verification of Solidity Contracts with Events
Events in the Solidity language provide a means of communication between the
on-chain services of decentralized applications and the users of those
services. Events are commonly used as an abstraction of contract execution that
is relevant from the users' perspective. Users must, therefore, be able to
understand the meaning and trust the validity of the emitted events. This paper
presents a source-level approach for the formal specification and verification
of Solidity contracts with the primary focus on events. Our approach allows
specification of events in terms of the on-chain data that they track, and
predicates that define the correspondence between the blockchain state and the
abstract view provided by the events. The approach is implemented in
solc-verify, a modular verifier for Solidity, and we demonstrate its
applicability with various examples
Bug Searching in Smart Contract
With the frantic development of smart contracts on the Ethereum platform, its
market value has also climbed. In 2016, people were shocked by the loss of
nearly $50 million in cryptocurrencies from the DAO reentrancy attack. Due to
the tremendous amount of money flowing in smart contracts, its security has
attracted much attention of researchers. In this paper, we investigated several
common smart contract vulnerabilities and analyzed their possible scenarios and
how they may be exploited. Furthermore, we survey the smart contract
vulnerability detection tools for the Ethereum platform in recent years. We
found that these tools have similar prototypes in software vulnerability
detection technology. Moreover, for the features of public distribution systems
such as Ethereum, we present the new challenges that these software
vulnerability detection technologies face.Comment: 8 pages, 9 figure
Debugging Smart Contract's Business Logic Using Symbolic Model-Checking
Smart contracts are a special type of programs running inside a blockchain.
Immutable and transparent, they provide means to implement fault-tolerant and
censorship-resistant services. Unfortunately, its immutability causes a serious
challenge of ensuring that a business logic and implementation is correct
upfront, before publishing in a blockchain. Several big accidents have indeed
shown that users of this technology need special tools to verify smart contract
correctness. Existing automated checkers are able to detect only well known
implementation bugs, leaving the question of business logic correctness far
aside. In this work, we present a symbolic model-checking technique along with
a formal specification method for a subset of Solidity programming language
that is able to express both state properties and trace properties; the latter
constitutes a weak analogy of temporal properties. We evaluate the proposed
technique on the MiniDAO smart contract, a young brother of notorious TheDAO.
Our Proof-of-Concept was able to detect a non-trivial error in the business
logic of this smart contract in a few seconds.Comment: 16 page
Executable Operational Semantics of Solidity
Bitcoin has attracted everyone's attention and interest recently. Ethereum
(ETH), a second generation cryptocurrency, extends Bitcoin's design by offering
a Turing-complete programming language called Solidity to develop smart
contracts. Smart contracts allow creditable execution of contracts on EVM
(Ethereum Virtual Machine) without third parties. Developing correct smart
contracts is challenging due to its decentralized computation nature. Buggy
smart contracts may lead to huge financial loss. Furthermore, smart contracts
are very hard, if not impossible, to patch once they are deployed. Thus, there
is a recent surge of interest on analyzing/verifying smart contracts. While
existing work focuses on EVM opcode, we argue that it is equally important to
understand and define the semantics of Solidity since programmers program and
reason about smart contracts at the level of source code. In this work, we
develop the structural operational semantics for Solidity, which allows us to
identify multiple design issues which underlines many problematic smart
contracts. Furthermore, our semantics is executable in the K framework, which
allows us to verify/falsify contracts automatically
Violable Contracts and Governance for Blockchain Applications
We examine blockchain technologies, especially smart contracts, as a platform
for decentralized applications. By providing a basis for consensus, blockchain
promises to upend business models that presuppose a central authority. However,
blockchain suffers from major shortcomings arising from an over-regimented way
of organizing computation that limits its prospects. We propose a
sociotechnical, yet computational, perspective that avoids those shortcomings.
A centerpiece of our vision is the notion of a declarative, violable contract
in contradistinction to smart contracts. This new way of thinking enables
flexible governance, by formalizing organizational structures; verification of
correctness without obstructing autonomy; and a meaningful basis for trust
Understanding the Motivations, Challenges and Needs of Blockchain Software Developers: A Survey
The blockchain technology has potential applications in various areas such as
smart-contracts, Internet of Things (IoT), land registry, supply chain
management, storing medical data, and identity management. Although the Github
currently hosts more than six thousand active Blockchain software (BCS)
projects, few software engineering research has investigated these projects and
its' contributors. Although the number of BCS projects is growing rapidly, the
motivations, challenges, and needs of BCS developers remain a puzzle.
Therefore, the primary objective of this study is to understand the
motivations, challenges, and needs of BCS developers and analyze the
differences between BCS and non-BCS development. On this goal, we sent an
online survey to 1,604 active BCS developers identified via mining the Github
repositories of 145 popular BCS projects. The survey received 156 responses
that met our criteria for analysis.
The results suggest that the majority of the BCS developers are experienced
in non-BCS development and are primarily motivated by the ideology of creating
a decentralized financial system. Although most of the BCS projects are Open
Source Software (OSS) projects by nature, more than 93% of our respondents
found BCS development somewhat different from a non-BCS development as BCS
projects have higher emphasis on security and reliability than most of the
non-BCS projects. Other differences include: higher costs of defects,
decentralized and hostile environment, technological complexity, and difficulty
in upgrading the software after release. Software development tools that are
tuned for non-BCS development are inadequate for BCS and the ecosystem needs an
array of new or improved tools, such as: customized IDE for BCS development
tasks, debuggers for smart-contracts, testing support, easily deployable
simulators, and BCS domain specific design notations
Engaging Millennials into Learning Formal Methods
This paper summarizes our experience in teaching courses on formal methods
(FM) to Computer Science (CS) and Software Engineering (SE) students at various
universities around the world, including University of Madeira (UMa) in
Portugal, Pontificia Universidad Javeriana (PUJ) and University of Los Andes
(Uniandes) in Colombia, Carnegie Mellon University (CMU) in the USA, and at
Innopolis University (INNO) in the Russian Federation. We report challenges
faced during the past 10 to 15 years to teach FM to millennials undergradu- ate
and graduate students and describe how we have coped with those challenges. We
formulate a characterization of millennials, based on our experience, and show
how this characterization has shaped our decisions in terms of course structure
and content. We show how these decisions are reflected on the current structure
of the MSS (Models of Software Systems) course that currently runs as part of
the MSIT-SE (Master of Science in Information Technology - Software
Engineering) programme offered at INNO. We have conducted two surveys among
students, the first one at CMU and the second one at INNO that we have used to
document and justify our decisions. The first survey is about the choice of
Event-B as mathematical formalism and the second one is about the organization
of teams of students within the classroom to work on software projects based on
Event-B.Comment: 24 page
Vandal: A Scalable Security Analysis Framework for Smart Contracts
The rise of modern blockchains has facilitated the emergence of smart
contracts: autonomous programs that live and run on the blockchain. Smart
contracts have seen a rapid climb to prominence, with applications predicted in
law, business, commerce, and governance.
Smart contracts are commonly written in a high-level language such as
Ethereum's Solidity, and translated to compact low-level bytecode for
deployment on the blockchain. Once deployed, the bytecode is autonomously
executed, usually by a %Turing-complete virtual machine. As with all programs,
smart contracts can be highly vulnerable to malicious attacks due to deficient
programming methodologies, languages, and toolchains, including buggy
compilers. At the same time, smart contracts are also high-value targets, often
commanding large amounts of cryptocurrency. Hence, developers and auditors need
security frameworks capable of analysing low-level bytecode to detect potential
security vulnerabilities.
In this paper, we present Vandal: a security analysis framework for Ethereum
smart contracts. Vandal consists of an analysis pipeline that converts
low-level Ethereum Virtual Machine (EVM) bytecode to semantic logic relations.
Users of the framework can express security analyses in a declarative fashion:
a security analysis is expressed in a logic specification written in the
\souffle language. We conduct a large-scale empirical study for a set of common
smart contract security vulnerabilities, and show the effectiveness and
efficiency of Vandal. Vandal is both fast and robust, successfully analysing
over 95\% of all 141k unique contracts with an average runtime of 4.15 seconds;
outperforming the current state of the art tools---Oyente, EthIR, Mythril, and
Rattle---under equivalent conditions.Comment: 28 pages, 11 figure
- …