TRAC: a tool for data-aware coordination (with an application to smart contracts)

Joao Afonso,Elvis Konjoh Selabi,Maurizio Murgia,Antonio Ravara,Emilio Tuosto
2024-04-30
Abstract:We propose TRAC, a tool for the specification and verification of coordinated multiparty distributed systems. Relying on finite-state machines (FSMs) where transition labels look like Hoare triples, \thetool can specify the coordination of the participants of a distributed protocol for instance an execution model akin blockchain smart contracts (SCs). In fact, the transitions of our FSMs yield guards, and assignments over data variables, and with participants binders. The latter allow us to model scenarios with an unbounded number of participants which can vary at run-time. We introduce a notion of well-formedness to rule out meaningless or problematic specifications. This notion is verified with TRAC and demonstrated on several case studies borrowed from the smart contracts domain. Then, we evaluate the performance of TRAC using a set of randomised examples, studying the correlations between the features supported and the time taken to decide well-formedness.
Logic in Computer Science
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is the coordination problem of multiple participants in distributed systems, especially the coordination problem in the field of smart contracts (SCs). Specifically, the author proposes a tool named TRAC for specifying and verifying data - aware coordination protocols. The following are the specific problems that the paper attempts to solve: 1. **Formalizing Coordination Protocols**: - Existing coordination protocols (such as the finite - state machine FSM proposed by Azure) are usually informal sketches and cannot capture all the details and potential problems of the protocols. - The author hopes to use more precise formal methods to describe these protocols to ensure their correctness and consistency. 2. **Handling Dynamic Participants**: - In many application scenarios, the number of participants may change dynamically, and existing models have difficulty dealing with this situation. - TRAC allows modeling scenarios with an unbounded number of participants by introducing binders, and these participants can change at runtime. 3. **Verifying the Correctness of Protocols**: - The interaction between operations and conditions in the protocol may lead to unexpected behavior, especially when using informal specifications. - The author proposes the concept of "well - formedness" and develops the TRAC tool to automatically verify whether these protocols meet the well - formedness conditions, thereby avoiding errors and inconsistent behavior. 4. **Supporting Complex Coordination Features**: - Many smart contracts need to support complex features, such as cross - contract interaction, the addition of new participants, role revocation, etc. - TRAC aims to support these complex features and can handle the diverse requirements in practical applications. ### Main Contributions - **Data - Aware Finite - State Machine (DAFSM)**: Defines a new formal model that can express how operations affect the protocol state and explicitly declare the functions of participants. - **Well - Formedness Conditions**: Proposes a series of conditions to exclude meaningless or problematic specifications and implements the verification of these conditions in TRAC. - **TRAC Tool**: Develops a tool that can be used to specify and verify coordination protocols in smart contracts and demonstrates the application of this tool in multiple case studies. - **Performance Evaluation**: Studies the performance of TRAC and its support for different features through experimental evaluation of randomly generated examples. ### Conclusion TRAC provides a powerful tool for coordination protocols in distributed systems, especially in the field of smart contracts. It can not only formally describe these protocols but also automatically verify their correctness, thereby improving the reliability and security of the system.