SlideShare a Scribd company logo
UNIT V
BLOCKCHAIN APPLICATIONS
Smart contracts, Truffle Design and issue- DApps- NFT. Blockchain
Applications in Supply Chain Management, Logistics, Smart Cities,
Finance and Banking, Insurance,etc- Case Study.
Applications of Blockchain Technology in Various
Industries
Financial Services
Healthcare
Government
CPG and Retail
Travel and Hospitality
SMART CONTRACTS
 Smart contracts are digital contracts stored on a blockchain that
are automatically executed when predetermined terms and
conditions are met.
 A smart contract works in the same way as a traditional contract
while also automatically enforcing the contract.
 Smart contracts are programs that execute exactly as they are
set up (coded, programmed) by their creators.
FEATURES OF SMART CONTRACTS
 Distributed
 Deterministic
 Immutable
 Autonomy
 Customizable
 Transparent
 Trustless
 Self-verifying
 Self-enforcing
CAPABILITIES OF SMART CONTRACTS
 Accuracy
 Automation
 Speed
 Backup
 Security
 Savings
 Manages information
 Multi-signature accounts
HOW DO SMART CONTRACTS WORK?
 A smart contract is just a digital contract with the security coding of the blockchain.
 It has details and permissions written in code that require an exact sequence of events to
take place to trigger the agreement of the terms mentioned in the smart contract.
 It can also include the time constraints that can introduce deadlines in the contract.
 Every smart contract has its address in the blockchain. The contract can be interacted
with by using its address presuming the contract has been broadcasted on the network.
 The idea behind smart contracts is pretty simple. They are executed on a basis of simple
logic, IF-THEN for example:
 IF you send object A, THEN the sum (of money, in cryptocurrency) will be transferred to
you.
 IF you transfer a certain amount of digital assets (cryptocurrency, for example, ether,
bitcoin), THEN the A object will be transferred to you.
 IF I finish the work, THEN the digital assets mentioned in the contract will be transferred to
me.
Smart Contract Working
 Identify Agreement: Multiple parties identify the cooperative opportunity and desired
outcomes and agreements could include business processes, asset swaps, etc.
 Set conditions: Smart contracts could be initiated by parties themselves or when certain
conditions are met like financial market indices, events like GPS locations, etc.
 Code business logic: A computer program is written that will be executed automatically
when the conditional parameters are met.
 Encryption and blockchain technology: Encryption provides secure authentication and
transfer of messages between parties relating to smart contracts.
 Execution and processing: In blockchain iteration, whenever consensus is reached
between the parties regarding authentication and verification then the code is
executed and the outcomes are memorialized for compliance and verification.
 Network updates: After smart contracts are executed, all the nodes on the network
update their ledger to reflect the new state. Once the record is posted and verified on
the blockchain network, it cannot be modified, it is in append mode only.
ADVANTAGES OF SMART CONTRACTS
 Recordkeeping
 Autonomy
 Reduce fraud
 Fault-tolerance
 Enhanced trust
 Cost-efficiency
CHALLENGES OF SMART CONTRACTS
 No regulations
 Difficult to implement
 Immutable
 Alignment
TRUFFLE IN BLOCKCHAIN
 Truffle is a development environment, testing framework, and asset
pipeline for building decentralized applications (dapps) on the
Ethereum blockchain.
 Truffle has various advantages
 Automated Contract Testing
 Scriptable Migration and Deployment
TRUFFLE SUITE
 Truffle is a leading development framework that simplifies the process of
building and deploying enterprise blockchain applications.
 With its powerful suite of tools, Truffle enables businesses to create
robust, scalable solutions tailored to their unique needs.
 Truffle Suite offers a comprehensive answer to all dApp developers with
a collection of powerful tools to facilitate smart contract development
on the Ethereum blockchain.
BASIC ROLES OF EACH COMPONENT OF TRUFFLE SUITE
 Truffle is the smart contract development framework.
 Ganache helps you in setting up a personal Ethereum blockchain for
development and testing on a local network.
 Drizzle serves as a repository of ready-to-use components and an integral
tool in the development of dApp user interfaces.
GANACHE
 Ganache is a personal blockchain for rapid Ethereum and Filecoin distributed
application development. It can be used across the entire development cycle;
enabling to develop, deploy, and test
 dApps in a safe and deterministic environment.
DRIZZLE
Drizzle is a collection of front-end libraries that make writing
dapp front-ends easier and more predictable.
The core of Drizzle is based on a Redux store, so you have
access to the spectacular development tools around
Redux.
Drizzle is the fundamental package that handles contract
and account creation. This means the standard bundle
includes extra contract features.
SOME KEY PROPERTIES OF DRIZZLE
Stores: Drizzle maintains a library of React components
often used in dApps.
Reactive Datastore – Drizzle is built around a Redux store.
Drizzle also synchronizes transactions, contracts, etc.
Drizzle is a suite of libraries built on the Redux store. Its
modular design makes dApp UI creation more
accessible and customizable
USE OF TRUFFLE FOR BLOCKCHAIN
Truffle is a popular development framework for building
decentralized applications (dApps) on the Ethereum
blockchain.
It simplifies the process of deploying smart contracts,
managing interactions with the blockchain, and building
full-stack decentralized applications.
KEY REASONS TO CHOOSE TRUFFLE
1. Comprehensive Development Framework
2. Easy Smart Contract Deployment
3. Test and Debugging Tools
4. Integration with Ganache
5. Interactive Console
6. Support for Multiple Networks
7. Truffle Suite Ecosystem
8. Ease of Use
9. Active Community and Documentation
10. Security
CREATING DAPPS USING THE TRUFFLE FRAMEWORK:
dApps (Decentralized Applications) are applications
that do not rely on traditional servers. Instead, dApps
make use of Blockchain to host the data traditionally
stored on the servers.
 The data is stored across the network of nodes connected to the
Blockchain. Various tools and frameworks are used to write full-
stack, decentralized applications.
 One such popular framework for writing dApps using the Solidity
programming language is Truffle.
CREATING DAPPS USING THE TRUFFLE FRAMEWORK:
Step 1: Setting up the Development Environment:
The requirements before starting a Truffle project are as
follows:
Node.js
Ganache — For simulating a Bl ockchain locally.
Metamask — For handling Blockchain transactions via the
browser.
To set up the Truffle framework, run the following command:
npm install -g truffle
Step 2: Use a Truffle Box to generate boilerplate code:
To simplify the process of creating a dApp in Truffle,
instead of manually creating the files and including the
dependencies, you can use a Truffle Box.
A Truffle Box provides useful boilerplate code with which
you can directly start designing your dApp. These “boxes”
also contain other useful components, such as commonly
used Solidity Contracts, libraries, front-end views, etc.
truffle unbox pet-shop
truffle unbox react
truffle unbox pet-shoptruffle unbox react
Step 3: Writing the Solidity Smart Contracts:
Once a truffle box is downloaded and unpacked, it creates
a Truffle specific directory structure. The general structure of a
Truffle project is shown in the figure below:
 The contracts directory, all the Solidity smart contracts are written and
stored as .sol files.
 The migrations directory contains code to migrate and deploy the
designed contracts.
 node_modules directory stores all the required node dependencies
to run the project.
 src directory is used to store the front-end components of the project,
such as HTML and CSS files.
 test directory stores the unit tests written by the developer.
truffle unbox pet-shoptruffle unbox react
Step 4: Compile and Migrate the Contracts:
Once the contracts have been written, we can compile and then
migrate them to store them on our blockchain. To compile a Solidity
contract in Truffle, run the command
truffle compile
Once successfully compiled, the contracts are converted into
bytecode which is executed by the Ethereum Virtual Machine (EVM).
After successful compilation, the contracts need to be saved on the
Blockchain such that users may access the functions provided by the
contract.
Once migrated to the Blockchain, each deployed contract is
assigned a unique address to reference its location on the
Blockchain
truffle unbox pet-shoptruffle unbox react
Step 5: Writing Unit Tests:
Test-Driven Development is a highly recommended approach in
all scopes of software development. It is of paramount
importance in the case of dApps.
By design of the blockchain, changes once made to the
blockchain are stored permanently and immutably on the chain.
. Unit Testing in Truffle can be done with the help of the Chai and
Mocha libraries, which provide a range of assertions and other
tools to perform testing. Once written the test are run by
executing,
truffle test
truffle unbox pet-shoptruffle unbox react
Step 6, 7: Creating a UI and integrating with the contracts:
 The UI design of the dApp is done as usual using tools and languages like
HTML, CSS, Bootstrap, JavaScript, etc.
 To interface the front end with the deployed contracts, we rely on the web3
JavaScript library.
 Using web3js, we can instantiate the deployed Ethereum contracts inside a
front-end JS file and subsequently call functions and exchange data with
the blockchain
 Step 6, 7: Creating a UI and integrating with the contracts:
 The UI design of the dApp is done as usual using tools and languages like
HTML, CSS, Bootstrap, JavaScript, etc. To interface the front end with the
deployed contracts, we rely on the web3 JavaScript library. Using web3js,
we can instantiate the deployed Ethereum contracts inside a front-end JS
file and subsequently call functions and exchange data with the
blockchain
truffle unbox pet-shoptruffle unbox react

More Related Content

PPTX
Blockchain Development Kit
PPTX
How to design, code, deploy and execute a smart contract
PPTX
Hyperledger
PPTX
Introduction to Solidity and Smart Contract Development (9).pptx
PDF
The Decentralized Developer Toolbox by Petros Ring
PDF
solulab.com-Develop Aptos Smart Contract Using Move Language.pdf
PDF
Blockchain and decentralized applications.pdf
ODP
Hyperledger Fabric and Tools
Blockchain Development Kit
How to design, code, deploy and execute a smart contract
Hyperledger
Introduction to Solidity and Smart Contract Development (9).pptx
The Decentralized Developer Toolbox by Petros Ring
solulab.com-Develop Aptos Smart Contract Using Move Language.pdf
Blockchain and decentralized applications.pdf
Hyperledger Fabric and Tools

Similar to CCS339 Unit V BLOCKCHAIN APPLICATIONS .pptx (20)

PDF
Web3 Application Development
PPTX
Ton blockchain development complete guide.pptx
PPTX
Ethereum Devcon1 Report (summary writing)
PPTX
The Foundation of Smart Contract Development on Ethereum
PDF
Blockchain development 101
PPTX
Fluence.sh
PPTX
Defrag X Keynote: Deploying and managing Global Blockchain Network
PPTX
Defrag x blockchain keynote
PPTX
Hyperledger Project Overview - January 2018.pptx
PDF
BlockchainLAB Hackathon
PDF
Encode Educate session 2 - Learn to code using Concordium
PPTX
Blockchain Experiments 1-11.pptx
PDF
BEST BLOCKCHAIN DEVELOPMENT PLATFORMS TO WATCH OUT FOR IN 2023
PPTX
Block chain technology
PPTX
Block chain technology
PDF
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
PDF
10 most used blockchain tools in 2021 for blockchain development
PDF
Introduction of Hyperledger Fabric & Composer
PDF
IRJET- Proof of Document using Multichain and Ethereum
PDF
Hyperledger Fabric & Composer
Web3 Application Development
Ton blockchain development complete guide.pptx
Ethereum Devcon1 Report (summary writing)
The Foundation of Smart Contract Development on Ethereum
Blockchain development 101
Fluence.sh
Defrag X Keynote: Deploying and managing Global Blockchain Network
Defrag x blockchain keynote
Hyperledger Project Overview - January 2018.pptx
BlockchainLAB Hackathon
Encode Educate session 2 - Learn to code using Concordium
Blockchain Experiments 1-11.pptx
BEST BLOCKCHAIN DEVELOPMENT PLATFORMS TO WATCH OUT FOR IN 2023
Block chain technology
Block chain technology
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
10 most used blockchain tools in 2021 for blockchain development
Introduction of Hyperledger Fabric & Composer
IRJET- Proof of Document using Multichain and Ethereum
Hyperledger Fabric & Composer
Ad

Recently uploaded (20)

PPTX
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
DOCX
Factor Analysis Word Document Presentation
PPTX
Managing Community Partner Relationships
PPTX
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
PPT
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
PPT
Predictive modeling basics in data cleaning process
PPTX
modul_python (1).pptx for professional and student
PPTX
Introduction to Inferential Statistics.pptx
PDF
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
PDF
Microsoft Core Cloud Services powerpoint
PPTX
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
PDF
Global Data and Analytics Market Outlook Report
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
importance of Data-Visualization-in-Data-Science. for mba studnts
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
PDF
[EN] Industrial Machine Downtime Prediction
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
New ISO 27001_2022 standard and the changes
PPTX
Pilar Kemerdekaan dan Identi Bangsa.pptx
QUANTUM_COMPUTING_AND_ITS_POTENTIAL_APPLICATIONS[2].pptx
Factor Analysis Word Document Presentation
Managing Community Partner Relationships
sac 451hinhgsgshssjsjsjheegdggeegegdggddgeg.pptx
lectureusjsjdhdsjjshdshshddhdhddhhd1.ppt
Predictive modeling basics in data cleaning process
modul_python (1).pptx for professional and student
Introduction to Inferential Statistics.pptx
REAL ILLUMINATI AGENT IN KAMPALA UGANDA CALL ON+256765750853/0705037305
Microsoft Core Cloud Services powerpoint
(Ali Hamza) Roll No: (F24-BSCS-1103).pptx
Global Data and Analytics Market Outlook Report
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
importance of Data-Visualization-in-Data-Science. for mba studnts
Qualitative Qantitative and Mixed Methods.pptx
Jean-Georges Perrin - Spark in Action, Second Edition (2020, Manning Publicat...
[EN] Industrial Machine Downtime Prediction
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
New ISO 27001_2022 standard and the changes
Pilar Kemerdekaan dan Identi Bangsa.pptx
Ad

CCS339 Unit V BLOCKCHAIN APPLICATIONS .pptx

  • 1. UNIT V BLOCKCHAIN APPLICATIONS Smart contracts, Truffle Design and issue- DApps- NFT. Blockchain Applications in Supply Chain Management, Logistics, Smart Cities, Finance and Banking, Insurance,etc- Case Study.
  • 2. Applications of Blockchain Technology in Various Industries Financial Services Healthcare Government CPG and Retail Travel and Hospitality
  • 3. SMART CONTRACTS  Smart contracts are digital contracts stored on a blockchain that are automatically executed when predetermined terms and conditions are met.  A smart contract works in the same way as a traditional contract while also automatically enforcing the contract.  Smart contracts are programs that execute exactly as they are set up (coded, programmed) by their creators.
  • 4. FEATURES OF SMART CONTRACTS  Distributed  Deterministic  Immutable  Autonomy  Customizable  Transparent  Trustless  Self-verifying  Self-enforcing
  • 5. CAPABILITIES OF SMART CONTRACTS  Accuracy  Automation  Speed  Backup  Security  Savings  Manages information  Multi-signature accounts
  • 6. HOW DO SMART CONTRACTS WORK?  A smart contract is just a digital contract with the security coding of the blockchain.  It has details and permissions written in code that require an exact sequence of events to take place to trigger the agreement of the terms mentioned in the smart contract.  It can also include the time constraints that can introduce deadlines in the contract.  Every smart contract has its address in the blockchain. The contract can be interacted with by using its address presuming the contract has been broadcasted on the network.  The idea behind smart contracts is pretty simple. They are executed on a basis of simple logic, IF-THEN for example:  IF you send object A, THEN the sum (of money, in cryptocurrency) will be transferred to you.  IF you transfer a certain amount of digital assets (cryptocurrency, for example, ether, bitcoin), THEN the A object will be transferred to you.  IF I finish the work, THEN the digital assets mentioned in the contract will be transferred to me.
  • 7. Smart Contract Working  Identify Agreement: Multiple parties identify the cooperative opportunity and desired outcomes and agreements could include business processes, asset swaps, etc.  Set conditions: Smart contracts could be initiated by parties themselves or when certain conditions are met like financial market indices, events like GPS locations, etc.  Code business logic: A computer program is written that will be executed automatically when the conditional parameters are met.  Encryption and blockchain technology: Encryption provides secure authentication and transfer of messages between parties relating to smart contracts.  Execution and processing: In blockchain iteration, whenever consensus is reached between the parties regarding authentication and verification then the code is executed and the outcomes are memorialized for compliance and verification.  Network updates: After smart contracts are executed, all the nodes on the network update their ledger to reflect the new state. Once the record is posted and verified on the blockchain network, it cannot be modified, it is in append mode only.
  • 8. ADVANTAGES OF SMART CONTRACTS  Recordkeeping  Autonomy  Reduce fraud  Fault-tolerance  Enhanced trust  Cost-efficiency
  • 9. CHALLENGES OF SMART CONTRACTS  No regulations  Difficult to implement  Immutable  Alignment
  • 10. TRUFFLE IN BLOCKCHAIN  Truffle is a development environment, testing framework, and asset pipeline for building decentralized applications (dapps) on the Ethereum blockchain.  Truffle has various advantages  Automated Contract Testing  Scriptable Migration and Deployment
  • 11. TRUFFLE SUITE  Truffle is a leading development framework that simplifies the process of building and deploying enterprise blockchain applications.  With its powerful suite of tools, Truffle enables businesses to create robust, scalable solutions tailored to their unique needs.  Truffle Suite offers a comprehensive answer to all dApp developers with a collection of powerful tools to facilitate smart contract development on the Ethereum blockchain.
  • 12. BASIC ROLES OF EACH COMPONENT OF TRUFFLE SUITE  Truffle is the smart contract development framework.  Ganache helps you in setting up a personal Ethereum blockchain for development and testing on a local network.  Drizzle serves as a repository of ready-to-use components and an integral tool in the development of dApp user interfaces.
  • 13. GANACHE  Ganache is a personal blockchain for rapid Ethereum and Filecoin distributed application development. It can be used across the entire development cycle; enabling to develop, deploy, and test  dApps in a safe and deterministic environment.
  • 14. DRIZZLE Drizzle is a collection of front-end libraries that make writing dapp front-ends easier and more predictable. The core of Drizzle is based on a Redux store, so you have access to the spectacular development tools around Redux. Drizzle is the fundamental package that handles contract and account creation. This means the standard bundle includes extra contract features.
  • 15. SOME KEY PROPERTIES OF DRIZZLE Stores: Drizzle maintains a library of React components often used in dApps. Reactive Datastore – Drizzle is built around a Redux store. Drizzle also synchronizes transactions, contracts, etc. Drizzle is a suite of libraries built on the Redux store. Its modular design makes dApp UI creation more accessible and customizable
  • 16. USE OF TRUFFLE FOR BLOCKCHAIN Truffle is a popular development framework for building decentralized applications (dApps) on the Ethereum blockchain. It simplifies the process of deploying smart contracts, managing interactions with the blockchain, and building full-stack decentralized applications.
  • 17. KEY REASONS TO CHOOSE TRUFFLE 1. Comprehensive Development Framework 2. Easy Smart Contract Deployment 3. Test and Debugging Tools 4. Integration with Ganache 5. Interactive Console 6. Support for Multiple Networks 7. Truffle Suite Ecosystem 8. Ease of Use 9. Active Community and Documentation 10. Security
  • 18. CREATING DAPPS USING THE TRUFFLE FRAMEWORK: dApps (Decentralized Applications) are applications that do not rely on traditional servers. Instead, dApps make use of Blockchain to host the data traditionally stored on the servers.  The data is stored across the network of nodes connected to the Blockchain. Various tools and frameworks are used to write full- stack, decentralized applications.  One such popular framework for writing dApps using the Solidity programming language is Truffle.
  • 19. CREATING DAPPS USING THE TRUFFLE FRAMEWORK:
  • 20. Step 1: Setting up the Development Environment: The requirements before starting a Truffle project are as follows: Node.js Ganache — For simulating a Bl ockchain locally. Metamask — For handling Blockchain transactions via the browser. To set up the Truffle framework, run the following command: npm install -g truffle
  • 21. Step 2: Use a Truffle Box to generate boilerplate code: To simplify the process of creating a dApp in Truffle, instead of manually creating the files and including the dependencies, you can use a Truffle Box. A Truffle Box provides useful boilerplate code with which you can directly start designing your dApp. These “boxes” also contain other useful components, such as commonly used Solidity Contracts, libraries, front-end views, etc. truffle unbox pet-shop truffle unbox react truffle unbox pet-shoptruffle unbox react
  • 22. Step 3: Writing the Solidity Smart Contracts: Once a truffle box is downloaded and unpacked, it creates a Truffle specific directory structure. The general structure of a Truffle project is shown in the figure below:  The contracts directory, all the Solidity smart contracts are written and stored as .sol files.  The migrations directory contains code to migrate and deploy the designed contracts.  node_modules directory stores all the required node dependencies to run the project.  src directory is used to store the front-end components of the project, such as HTML and CSS files.  test directory stores the unit tests written by the developer. truffle unbox pet-shoptruffle unbox react
  • 23. Step 4: Compile and Migrate the Contracts: Once the contracts have been written, we can compile and then migrate them to store them on our blockchain. To compile a Solidity contract in Truffle, run the command truffle compile Once successfully compiled, the contracts are converted into bytecode which is executed by the Ethereum Virtual Machine (EVM). After successful compilation, the contracts need to be saved on the Blockchain such that users may access the functions provided by the contract. Once migrated to the Blockchain, each deployed contract is assigned a unique address to reference its location on the Blockchain truffle unbox pet-shoptruffle unbox react
  • 24. Step 5: Writing Unit Tests: Test-Driven Development is a highly recommended approach in all scopes of software development. It is of paramount importance in the case of dApps. By design of the blockchain, changes once made to the blockchain are stored permanently and immutably on the chain. . Unit Testing in Truffle can be done with the help of the Chai and Mocha libraries, which provide a range of assertions and other tools to perform testing. Once written the test are run by executing, truffle test truffle unbox pet-shoptruffle unbox react
  • 25. Step 6, 7: Creating a UI and integrating with the contracts:  The UI design of the dApp is done as usual using tools and languages like HTML, CSS, Bootstrap, JavaScript, etc.  To interface the front end with the deployed contracts, we rely on the web3 JavaScript library.  Using web3js, we can instantiate the deployed Ethereum contracts inside a front-end JS file and subsequently call functions and exchange data with the blockchain  Step 6, 7: Creating a UI and integrating with the contracts:  The UI design of the dApp is done as usual using tools and languages like HTML, CSS, Bootstrap, JavaScript, etc. To interface the front end with the deployed contracts, we rely on the web3 JavaScript library. Using web3js, we can instantiate the deployed Ethereum contracts inside a front-end JS file and subsequently call functions and exchange data with the blockchain truffle unbox pet-shoptruffle unbox react