Formalisation et vérification des systèmes blockchain - TEL - Thèses en ligne Accéder directement au contenu
Thèse Année : 2022

Formalisation and verification of blockchain systems

Formalisation et vérification des systèmes blockchain

Zeinab Nehaï
  • Fonction : Auteur
  • PersonId : 1281240
  • IdRef : 271778423

Résumé

A blockchain is a distributed system for storing data that cannot be changed or deleted. Blockchain applications are very complex, as they consist of several programs, often all linked to each other. One feature that has attracted much interest in blockchains is the ability to write smart contracts. These are programs where transaction rules can be defined, thus revolutionising the use of the blockchain. However, the increasing use of blockchain has brought to light the limits of this technology. Indeed, the increase in the number of blockchains has given rise to the desire of users to exchange with other users who are not on the same blockchain as them. To meet this use case, applications called Cross-Chain Swap have been developed. Their purpose is to ensure the exchange of assets between different users located on different blockchains. These applications are often based on smart contracts to establish transfer rules. Although blockchain is a rapidly growing technology, it suffers from a lack of formalism in its systems. For example, Solidity is the most widely used language for writing smart contracts. Solidity is a language with non-formal semantics, making smart contracts written in this language vulnerable to attacks. In addition, blockchain suffers from the presence of malicious participants, commonly known as Byzantine participants. These participants have random behaviour and are likely not to follow the system's rules. Thus, systems, such as the Cross-Chain Swap, need to employ means to ensure their proper functioning despite the presence of Byzantines. One way of doing this is through the use of formal methods. These are techniques for rigorously reasoning, using mathematical logic, about a computer program to demonstrate its validity against a specific specification. In this thesis, we propose to apply these verification methods to the systems we have mentioned, namely smart contracts and Cross-Chain Swap applications. First, we propose the WhyML language, dedicated to formal program verification, as a smart contract writing language. The language is based on mathematical logic to prove the correctness of the program. The approach is to define a smart contract in the form of mathematical formulas and then apply tools that prove that the formulas are true. Applying this approach ensures that the contracts are correct before they are stored in the blockchain. The results obtained from this first study showed that WhyML was suitable as a language for writing smart contracts, thus allowing for programs correct by construction. In a second step, we apply formalism methods to Cross-Chain Swap applications. The first step of this formalisation is to define a formal specification of the Cross-Chain Swap problem. The approach consists in defining the properties that characterise the specification of the problem; for example, the specification must be resilient to Byzantine participants. The second step is constructing an algorithm that must satisfy the specification of the Cross-Chain Swap. Once these two steps are completed, we apply formal methods to the algorithm to prove its correctness. For this approach, we modelled our algorithm using TLA+, which is a specific language for modelling distributed and concurrent systems. We then checked whether the resulting model satisfies the properties of the problem under study. The results obtained showed that the Cross-Chain Swap algorithm we constructed satisfies the properties of the Cross-Chain Swap specification in the presence of Byzantine participants.
Une blockchain est un système distribué qui permet de stocker des données ne pouvant être ni modifiées ni supprimées. Les applications blockchain sont très complexes, car elles se constituent de plusieurs programmes, souvent tous liés les uns aux autres. Une caractéristique qui a suscité un fort intérêt pour les blockchains est la possibilité d'écrire des smart contracts. Ces derniers sont des programmes dans lesquels des règles de transaction peuvent être définies, révolutionnant ainsi l'utilisation de la blockchain. Cependant, l'utilisation croissante de la blockchain a fait émerger les limites de cette technologie. En effet, l'augmentation du nombre de blockchains, a fait naître auprès des utilisateurs l'envie d'échanger avec d'autres utilisateurs n'étant pas sur la même blockchain qu'eux. Pour répondre à ce cas d'utilisation, les applications appelées Cross-Chain Swap ont été développées. Leur but est d'échanger des biens entre différents utilisateurs se trouvant sur différentes blockchains. Ces applications sont souvent basées sur l'utilisation des smart contracts pour établir les règles de transfert. Bien qu'étant une technologie qui se popularise, la blockchain souffre d'un manque de formalisme de ses systèmes tels que les langages de smart contract. Par exemple, le langage Solidity possède une sémantique non-formelle, rendant les smart contracts rédigés dans ce langage vulnérable aux attaques. De plus, la blockchain souffre également de la présence de participants malveillants, appelés Byzantins. Ces participants ont un comportement aléatoire, et sont susceptibles de ne pas suivre les règles du système. Ainsi, les systèmes, comme les Cross-Chain Swap, ont nécessairement besoin d'employer des moyens pour assurer leur bon fonctionnement malgré la présence de Byzantins. Un moyen d'y parvenir est l'utilisation des méthodes formelles. Ces techniques permettant de raisonner rigoureusement, à l'aide de logique mathématique, sur un programme informatique, afin de démontrer leur validité par rapport à une certaine spécification. Dans cette thèse, nous proposons d'appliquer ces méthodes de vérification aux systèmes que nous avons cités, à savoir les smart contracts et les applications Cross-Chain Swap. Dans un premier temps, nous proposons le langage WhyML, dédié à la vérification formelle de programme, comme langage d'écriture de smart contract. Le langage WhyML, se base sur de la logique mathématique pour prouver l'exactitude du programme. L'approche est de définir un smart contract sous forme de formules mathématiques et ensuite d'appliquer des outils qui permettent de prouver que les formules sont vraies. En appliquant cette approche, on s'assure de la correction des contracts avant leur stockage dans la blockchain. Les résultats obtenus à l'issue de cette première étude ont montré que WhyML convenait comme langage d'écriture de smart contracts, permettant ainsi d'avoir des programmes correct par construction. Dans un second temps, nous appliquons des méthodes de formalisme à des applications Cross-Chain Swap. La première étape de cette formalisation est de définir une spécification formelle du problème des Cross-Chain Swap. L'approche consiste à définir les propriétés qui caractérisent la spécification du problème, par exemple, la spécification se doit d'être résiliente aux participants Byzantins. La seconde étape est la construction d'un algorithme qui satisfait la spécification du Cross-Chain Swap. Une fois ces deux étapes accomplies, nous appliquons des méthodes formelles à l'algorithme pour prouver sa correction. Pour cette approche, nous avons modélisé notre algorithme en TLA+ qui est un langage spécifique pour modéliser des systèmes distribués. Nous avons ensuite vérifié si le modèle obtenu satisfait bien les propriétés du problème étudié. Les résultats obtenus ont montré que l'algorithme que nous avons construit satisfaisait bien les propriétés de la spécification du Cross-Chain Swap.
Fichier principal
Vignette du fichier
va_Nehai_Zeinab.pdf (1.68 Mo) Télécharger le fichier
Origine : Version validée par le jury (STAR)

Dates et versions

tel-04198469 , version 1 (07-09-2023)

Identifiants

  • HAL Id : tel-04198469 , version 1

Citer

Zeinab Nehaï. Formalisation et vérification des systèmes blockchain. Informatique et langage [cs.CL]. Université Paris Cité, 2022. Français. ⟨NNT : 2022UNIP7046⟩. ⟨tel-04198469⟩
53 Consultations
104 Téléchargements

Partager

Gmail Facebook X LinkedIn More