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
To interact with the blockchain and carry out transactions
through a web browser, we require a browser extension capable
of handling such transactions.
For this, a popular choice is MetaMask
truffle unbox pet-shoptruffle unbox react
Share your assignment II presentation to prepare
blockchain application.
truffle unbox pet-shoptruffle unbox react

More Related Content

PPTX
CCS339 Unit V BLOCKCHAIN APPLICATIONS .pptx
PPTX
Webinar: Enterprise Blockchain Radically Simplified with Truffle and Kaleido
PPTX
Build your own Blockchain with the right tool for your application
PPTX
Blockchain Development Kit
PPTX
Creating Smart Contract
PPTX
Write Smart Contracts with Truffle Framework
PPTX
Getting started with blockchain dapp
PDF
Developing Blockchain Applications
CCS339 Unit V BLOCKCHAIN APPLICATIONS .pptx
Webinar: Enterprise Blockchain Radically Simplified with Truffle and Kaleido
Build your own Blockchain with the right tool for your application
Blockchain Development Kit
Creating Smart Contract
Write Smart Contracts with Truffle Framework
Getting started with blockchain dapp
Developing Blockchain Applications

Similar to Block chain application is explained in detail (20)

PDF
20221110 MetaCoin
ODP
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
PPTX
Explore how to build dapp
PDF
Handson Smart Contract Development With Solidity And Ethereum From Fundamenta...
PDF
Smart Contracts: From Zero to Dapp Hero | Hedera18
PPTX
Building decentralized applications (dapps) on Ethereum - Eva Shon, & Igor Li...
PDF
How to develop decentralized apps for the Ethereum blockchain.
PPTX
Ton blockchain development complete guide.pptx
PDF
Token platform based on sidechain
PDF
A Gentle introduction to Blockchain with Ethereum
PDF
Part 4: Understanding the working of Smart Contracts
PDF
Blockchain and smart contracts, what they are and why you should really care ...
PPTX
20180714 workshop - Ethereum decentralized application with truffle framework
PDF
Ethereum Blockchain and DApps - Workshop at Software University
PPTX
The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized A...
PDF
Introduction to Ethereum Smart Contracts
PDF
Blockchain In Action 1st Edition Bina Ramamurthy
PDF
SCAT-Final block chain detection .pdf
PDF
Keynote at the BRAINS conference -- Blockchain Application Design and Develo...
PPTX
Event Itnig - Smart Contracts by MarketPay, Juan Ignacio Pérez Sacristán
20221110 MetaCoin
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Explore how to build dapp
Handson Smart Contract Development With Solidity And Ethereum From Fundamenta...
Smart Contracts: From Zero to Dapp Hero | Hedera18
Building decentralized applications (dapps) on Ethereum - Eva Shon, & Igor Li...
How to develop decentralized apps for the Ethereum blockchain.
Ton blockchain development complete guide.pptx
Token platform based on sidechain
A Gentle introduction to Blockchain with Ethereum
Part 4: Understanding the working of Smart Contracts
Blockchain and smart contracts, what they are and why you should really care ...
20180714 workshop - Ethereum decentralized application with truffle framework
Ethereum Blockchain and DApps - Workshop at Software University
The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized A...
Introduction to Ethereum Smart Contracts
Blockchain In Action 1st Edition Bina Ramamurthy
SCAT-Final block chain detection .pdf
Keynote at the BRAINS conference -- Blockchain Application Design and Develo...
Event Itnig - Smart Contracts by MarketPay, Juan Ignacio Pérez Sacristán
Ad

Recently uploaded (20)

PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Rapid Prototyping: A lecture on prototyping techniques for interface design
Enhancing plagiarism detection using data pre-processing and machine learning...
MuleSoft-Compete-Deck for midddleware integrations
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Convolutional neural network based encoder-decoder for efficient real-time ob...
sbt 2.0: go big (Scala Days 2025 edition)
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Module 1 Introduction to Web Programming .pptx
Advancing precision in air quality forecasting through machine learning integ...
giants, standing on the shoulders of - by Daniel Stenberg
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
4 layer Arch & Reference Arch of IoT.pdf
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Ad

Block chain application is explained in detail

  • 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 To interact with the blockchain and carry out transactions through a web browser, we require a browser extension capable of handling such transactions. For this, a popular choice is MetaMask truffle unbox pet-shoptruffle unbox react
  • 26. Share your assignment II presentation to prepare blockchain application. truffle unbox pet-shoptruffle unbox react