Titre : |
Application of Blockchain Technology in the Development of DeFi Applications |
Type de document : |
texte imprimé |
Auteurs : |
Ines Selma Redjechta, Auteur ; Lakhdar Goudjil, Directeur de thèse |
Editeur : |
Setif:UFA |
Année de publication : |
2024 |
Importance : |
1 vol (106 f .) |
Format : |
29 cm |
Langues : |
Anglais (eng) |
Catégories : |
Thèses & Mémoires:Informatique
|
Mots-clés : |
Blockchain
Ethereum
Decentralized Finance
DeFi
Decentralized Exchange
DEX
Smart Contracts
Cybersecurity
Software Engineering |
Index. décimale : |
004 - Informatique |
Résumé : |
This thesis explores the application of blockchain technology in the development of Decentralized
Finance (DeFi) applications, with a particular emphasis on the creation of a
Decentralized Exchange (DEX). The study begins by examining the fundamental aspects
of blockchain technology, including its architecture, security features, and historical evolution,
with a specific focus on Ethereum as a platform for decentralized applications. It
then delves into the principles, evolution, and core components of the DeFi ecosystem,
contrasting it with traditional financial systems.
A significant portion of the research is dedicated to the secure software engineering
methodology employed in the development of the DEX. This includes the selection of an
appropriate trading model, the design and implementation of smart contracts, and the
application of continuous integration and continuous deployment (CI/CD) techniques.
The thesis also addresses the unique security challenges associated with DeFi, such as
blockchain vulnerabilities and DeFi-specific risks, proposing strategies and tools to mitigate
these issues.
The findings demonstrate the potential of blockchain technology to revolutionize financial
systems by providing a secure, transparent, and decentralized foundation for financial
applications. The research underscores the critical importance of robust security practices
in the development and deployment of DeFi applications to ensure their reliability and
trustworthiness. |
Note de contenu : |
Sommaire
General Introduction 4
1 Blockchain Technology and Ethereum: A Foundation for Decentralized
Finance 5
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Blockchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.2 Why is Blockchain secure? . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3 Overview of Blockchain History . . . . . . . . . . . . . . . . . . . . 7
1.2.4 Types of Blockchains . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.5 Blockchain Architecture . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Ethereum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.1 Ethereum Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.2 Ethereum Main Architectural Concepts . . . . . . . . . . . . . . . . 15
1.4 Decentralized Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5 Decentralized Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5.1 Decentralized Autonomous Organization (DAO) . . . . . . . . . . . 18
1.5.2 Decentralized Applications (DApps) . . . . . . . . . . . . . . . . . . 19
1.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2 Unveiling the DeFi Ecosystem: Building Blocks and Core Components 20
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2 Decentralized Finance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.1 Definition and Core Principles . . . . . . . . . . . . . . . . . . . . . 20
2.2.2 Contrast with Traditional Finance . . . . . . . . . . . . . . . . . . . 21
2.2.3 Origins and Evolution . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.4 Hybrid Models: CeDeFi . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3 DeFi Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.1 Smart Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.2 DeFi Crypto-Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.4 DeFi Main Modules and Subsystems . . . . . . . . . . . . . . . . . . . . . 25
2.4.1 Crypto Wallets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.4.2 Oracles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.4.3 Financial Decentralized Applications (Financial DApps) . . . . . . 28
2.4.4 Decentralized Financial Services . . . . . . . . . . . . . . . . . . . . 28
2.4.5 Decentralized Physical Infrastructure Networks (DePIN) . . . . . . 28
2.4.6 Security and Regulation . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5 DeFi Liquidity Management . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5.1 Liquidity Pools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5.2 Automated Market Making (AMM) . . . . . . . . . . . . . . . . . . 29
2.5.3 Order Books: A Bridge Between CeFi and DeFi . . . . . . . . . . . 30
2.6 DeFi Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.6.1 Settlement Layer (Layer 1) . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.2 Asset Layer (Layer 2) . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.3 Protocol Layer (Layer 3) . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.4 Application Layer (Layer 4) . . . . . . . . . . . . . . . . . . . . . . 31
2.6.5 Aggregation Layer (Layer 5) . . . . . . . . . . . . . . . . . . . . . . 31
2.7 DeFi Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7.1 Basic DeFi Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.2 Complex DeFi Protocols . . . . . . . . . . . . . . . . . . . . . . . . 33
2.8 DeFi Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.8.1 Blockchain Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . . 34
2.8.2 DeFi-Specific Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . 36
2.8.3 DeFi Security Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3 Development of a Decentralized Exchange (DEX): Secure Software Engineering
Methodology 43
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2 Theoretical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2.1 Decentralized Exchange (DEX) . . . . . . . . . . . . . . . . . . . . 43
3.2.2 Trading Exchange Protocols in a Nutshell . . . . . . . . . . . . . . 44
3.2.3 Popular DEX Platforms . . . . . . . . . . . . . . . . . . . . . . . . 46
3.3 This Project’s Trading Model . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.3.1 Order Matching Model Selection . . . . . . . . . . . . . . . . . . . . 47
3.3.2 Reason for Order Book Model Selection . . . . . . . . . . . . . . . . 48
3.4 Defining a Software Engineering Methodology to Develop The DEX App . 49
3.4.1 ABCDE Methodology . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5 CI/CD Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6 Testing the DEX App: Local Nets, Testnets and Mainnets . . . . . . . . . 55
3.6.1 Local Blockchain Simulation . . . . . . . . . . . . . . . . . . . . . . 55
3.6.2 Functional Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.3 Automation and Integration Testing . . . . . . . . . . . . . . . . . 55
3.6.4 Deployment on a Testnet . . . . . . . . . . . . . . . . . . . . . . . . 55
3.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4 The full design and implementation of our Orderbook DEX 57
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.3 Proposal for a Customized SDLC for DEX Development . . . . . . . . . . 58
4.3.1 Overview of the SDLC Process . . . . . . . . . . . . . . . . . . . . 58
4.4 DEX’s Development Steps (ABCDE Adapted) . . . . . . . . . . . . . . . 60
4.4.1 Defining Goals of the System . . . . . . . . . . . . . . . . . . . . . 60
4.4.2 The Actors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.4.3 User Stories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.4.4 Dividing the Systems into Two Subsystems . . . . . . . . . . . . . . 62
4.4.5 Design of the Smart Contract Subsystem . . . . . . . . . . . . . . . 67
4.4.6 Coding the Core Component : The Matching Engine . . . . . . . . 70
4.4.7 Testing The Smart Contract Subsystem . . . . . . . . . . . . . . . . 72
4.4.8 Design of the App Subsystem (UI) . . . . . . . . . . . . . . . . . . 73
4.4.9 Deployment and Test . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.5 CI/CD Automation Functionality . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.1 Installing and configuring the initial development environment . . . 84
4.5.2 Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.3 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.4 Security Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.5 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 |
Côte titre : |
MAI/0857 |
Application of Blockchain Technology in the Development of DeFi Applications [texte imprimé] / Ines Selma Redjechta, Auteur ; Lakhdar Goudjil, Directeur de thèse . - [S.l.] : Setif:UFA, 2024 . - 1 vol (106 f .) ; 29 cm. Langues : Anglais ( eng)
Catégories : |
Thèses & Mémoires:Informatique
|
Mots-clés : |
Blockchain
Ethereum
Decentralized Finance
DeFi
Decentralized Exchange
DEX
Smart Contracts
Cybersecurity
Software Engineering |
Index. décimale : |
004 - Informatique |
Résumé : |
This thesis explores the application of blockchain technology in the development of Decentralized
Finance (DeFi) applications, with a particular emphasis on the creation of a
Decentralized Exchange (DEX). The study begins by examining the fundamental aspects
of blockchain technology, including its architecture, security features, and historical evolution,
with a specific focus on Ethereum as a platform for decentralized applications. It
then delves into the principles, evolution, and core components of the DeFi ecosystem,
contrasting it with traditional financial systems.
A significant portion of the research is dedicated to the secure software engineering
methodology employed in the development of the DEX. This includes the selection of an
appropriate trading model, the design and implementation of smart contracts, and the
application of continuous integration and continuous deployment (CI/CD) techniques.
The thesis also addresses the unique security challenges associated with DeFi, such as
blockchain vulnerabilities and DeFi-specific risks, proposing strategies and tools to mitigate
these issues.
The findings demonstrate the potential of blockchain technology to revolutionize financial
systems by providing a secure, transparent, and decentralized foundation for financial
applications. The research underscores the critical importance of robust security practices
in the development and deployment of DeFi applications to ensure their reliability and
trustworthiness. |
Note de contenu : |
Sommaire
General Introduction 4
1 Blockchain Technology and Ethereum: A Foundation for Decentralized
Finance 5
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Blockchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.2 Why is Blockchain secure? . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3 Overview of Blockchain History . . . . . . . . . . . . . . . . . . . . 7
1.2.4 Types of Blockchains . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.5 Blockchain Architecture . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Ethereum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.1 Ethereum Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.2 Ethereum Main Architectural Concepts . . . . . . . . . . . . . . . . 15
1.4 Decentralized Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5 Decentralized Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5.1 Decentralized Autonomous Organization (DAO) . . . . . . . . . . . 18
1.5.2 Decentralized Applications (DApps) . . . . . . . . . . . . . . . . . . 19
1.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2 Unveiling the DeFi Ecosystem: Building Blocks and Core Components 20
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2 Decentralized Finance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.1 Definition and Core Principles . . . . . . . . . . . . . . . . . . . . . 20
2.2.2 Contrast with Traditional Finance . . . . . . . . . . . . . . . . . . . 21
2.2.3 Origins and Evolution . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.4 Hybrid Models: CeDeFi . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3 DeFi Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.1 Smart Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.2 DeFi Crypto-Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.4 DeFi Main Modules and Subsystems . . . . . . . . . . . . . . . . . . . . . 25
2.4.1 Crypto Wallets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.4.2 Oracles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.4.3 Financial Decentralized Applications (Financial DApps) . . . . . . 28
2.4.4 Decentralized Financial Services . . . . . . . . . . . . . . . . . . . . 28
2.4.5 Decentralized Physical Infrastructure Networks (DePIN) . . . . . . 28
2.4.6 Security and Regulation . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5 DeFi Liquidity Management . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5.1 Liquidity Pools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5.2 Automated Market Making (AMM) . . . . . . . . . . . . . . . . . . 29
2.5.3 Order Books: A Bridge Between CeFi and DeFi . . . . . . . . . . . 30
2.6 DeFi Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.6.1 Settlement Layer (Layer 1) . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.2 Asset Layer (Layer 2) . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.3 Protocol Layer (Layer 3) . . . . . . . . . . . . . . . . . . . . . . . . 31
2.6.4 Application Layer (Layer 4) . . . . . . . . . . . . . . . . . . . . . . 31
2.6.5 Aggregation Layer (Layer 5) . . . . . . . . . . . . . . . . . . . . . . 31
2.7 DeFi Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7.1 Basic DeFi Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.7.2 Complex DeFi Protocols . . . . . . . . . . . . . . . . . . . . . . . . 33
2.8 DeFi Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.8.1 Blockchain Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . . 34
2.8.2 DeFi-Specific Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . 36
2.8.3 DeFi Security Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3 Development of a Decentralized Exchange (DEX): Secure Software Engineering
Methodology 43
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2 Theoretical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2.1 Decentralized Exchange (DEX) . . . . . . . . . . . . . . . . . . . . 43
3.2.2 Trading Exchange Protocols in a Nutshell . . . . . . . . . . . . . . 44
3.2.3 Popular DEX Platforms . . . . . . . . . . . . . . . . . . . . . . . . 46
3.3 This Project’s Trading Model . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.3.1 Order Matching Model Selection . . . . . . . . . . . . . . . . . . . . 47
3.3.2 Reason for Order Book Model Selection . . . . . . . . . . . . . . . . 48
3.4 Defining a Software Engineering Methodology to Develop The DEX App . 49
3.4.1 ABCDE Methodology . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5 CI/CD Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.6 Testing the DEX App: Local Nets, Testnets and Mainnets . . . . . . . . . 55
3.6.1 Local Blockchain Simulation . . . . . . . . . . . . . . . . . . . . . . 55
3.6.2 Functional Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6.3 Automation and Integration Testing . . . . . . . . . . . . . . . . . 55
3.6.4 Deployment on a Testnet . . . . . . . . . . . . . . . . . . . . . . . . 55
3.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4 The full design and implementation of our Orderbook DEX 57
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.3 Proposal for a Customized SDLC for DEX Development . . . . . . . . . . 58
4.3.1 Overview of the SDLC Process . . . . . . . . . . . . . . . . . . . . 58
4.4 DEX’s Development Steps (ABCDE Adapted) . . . . . . . . . . . . . . . 60
4.4.1 Defining Goals of the System . . . . . . . . . . . . . . . . . . . . . 60
4.4.2 The Actors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.4.3 User Stories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.4.4 Dividing the Systems into Two Subsystems . . . . . . . . . . . . . . 62
4.4.5 Design of the Smart Contract Subsystem . . . . . . . . . . . . . . . 67
4.4.6 Coding the Core Component : The Matching Engine . . . . . . . . 70
4.4.7 Testing The Smart Contract Subsystem . . . . . . . . . . . . . . . . 72
4.4.8 Design of the App Subsystem (UI) . . . . . . . . . . . . . . . . . . 73
4.4.9 Deployment and Test . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.5 CI/CD Automation Functionality . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.1 Installing and configuring the initial development environment . . . 84
4.5.2 Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.3 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.4 Security Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5.5 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 |
Côte titre : |
MAI/0857 |
|