Specification Mining for Smart Contracts with Trace Slicing and Predicate Abstraction

📅 2024-03-20
🏛️ arXiv.org
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Smart contracts suffer from a lack of formal specifications, severely hindering their comprehension, testing, and formal verification. To address this, we propose the first automated specification mining framework that jointly leverages trace slicing and predicate abstraction to infer high-level behavioral specifications—namely, function-call finite-state machines—and statistical program invariants from historical transaction traces. Our method integrates symbolic execution enhancement with state-machine modeling to achieve precise behavioral abstraction and invariant discovery. Evaluated on 17 real-world Ethereum smart contracts, our approach significantly improves symbolic analysis code coverage—by up to 56%—and enables automated documentation generation and maintainable test-suite construction. This work bridges a critical gap in the smart contract domain: the absence of automated specification inference and formal documentation generation.

Technology Category

Application Category

📝 Abstract
Smart contracts are computer programs running on blockchains to implement Decentralized Applications. The absence of contract specifications hinders routine tasks, such as contract understanding and testing. In this work, we propose a specification mining approach to infer contract specifications from past transaction histories. Our approach derives high-level behavioral automata of function invocations, accompanied by program invariants statistically inferred from the transaction histories. We implemented our approach as tool SMCON and evaluated it on eleven well-studied Azure benchmark smart contracts and six popular real-world DApp smart contracts. The experiments show that SMCON mines reasonably accurate specifications that can be used to enhance symbolic analysis of smart contracts achieving higher code coverage and up to 56% speedup, and facilitate DApp developers in maintaining high-quality documentation and test suites.
Problem

Research questions and friction points this paper is trying to address.

Mining smart contract specifications from transaction histories
Enhancing symbolic analysis for higher code coverage
Facilitating DApp developers in maintaining documentation
Innovation

Methods, ideas, or system contributions that make the work stand out.

Trace slicing for smart contract analysis
Predicate abstraction for invariant inference
Behavioral automata from transaction histories
🔎 Similar Papers