Mechanisms for Modeling and Validation of Smart Contracts - Afonso, João Miguel de Almeida (2023)
The characterization of a Smart Contract consists of describing agreements between multiple parties involved, which can be autonomously upheld without the need of a trusted intermediary. SCs are stored and executed on the Blockchain, a decentralized, digital ledger designed to log transactions in a secure and transparent manner. It operates across a network of computers, where each node retains a copy of the ledger and transactions are validated through consensus protocols. One of the key features of SCs and blockchains is their immutability: once they have been deployed, the contracts and blocks of the blockchain can not be changed (although it is technically possible, it necessitates extreme measures such as hard forking or obtaining cooperation of a substantial portion of the network nodes in a blockchain). However, vulnerabilities can still exist in the code of SCs, potentially resulting in exploitable bugs that may lead to the loss of valuable assets. To address these issues domain-specific languages (DSLs) are under development to offer safety assurances to programmers. However, none of these languages can offer absolute proof of contract correctness, leaving room for improvement in the development of SCs. This thesis aims to contribute to the process of elaborating SCs by introducing a language designed to capture their behavior. In addition to this language, suitable tool mechanisms were also developed to perform static validations on the behavior of existing Daml SCs, ensuring alignment with the intended outcomes of the contracts and ultimately bolstering the auditability of SCs.