0% found this document useful (0 votes)
9 views

Unit 1

The document states that the training data is current up to October 2023. It implies that any information or developments beyond that date are not included. This sets a clear boundary for the relevance of the data.

Uploaded by

VIJAYA RAJA V
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Unit 1

The document states that the training data is current up to October 2023. It implies that any information or developments beyond that date are not included. This sets a clear boundary for the relevance of the data.

Uploaded by

VIJAYA RAJA V
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

RMK College of Engineering and Technology

21AI907 AI in BLOCK
CHAIN

VI semster III Year

Elective
OBJECTIVES:
 To acquire knowledge in Blockchain Technologies.

 To Understand how block chain and AI can be used


to innovate.

 To explain Cryptocurrencies and AI.

 To develop applications using blockchain.

 To understand the limitations and future scope of


AI in Blockchain.
OUTCOMES:
 CO1: Acquire knowledge in Blockchain Technologies.

 CO2: Understand how block chain and AI can be used


to innovate.

 CO3: Explain Cryptocurrencies and AI.

 CO4: Develop applications using blockchain.

 CO5: Understand the limitations and future scope of


AI in Blockchain.
UNIT I : INTRODUCTION TO BLOCKCHAIN

Overview – Blockchain vs Distributed


Ledger Technology vs Distributed
Databases – Public vs private vs
permissioned blockchains – Privacy in
blockchains – Bitcoins – Ethereum –
Hyperledger – Blockchain platforms –
Consensus Algorithms – Building
DApps with blockchain tools
UNIT II : BLOCKCHAIN AND ARTIFICIAL INTELLIGENCE

AI and BlockChain driven Databases –


Centralized vs Distributed data –
Blockchain data – Big data for AI analysis
– Global databases – Data Management
in a DAO.
Benefits of combining blockchain and AI
– Aicumen Technologies -Combining
blockchain and AI to humanize digital
interactions
UNIT III : CRYPTOCURRENCY AND AI

Role of AI in cryptocurrency
– cryptocurrency trading –
Making price predictions
with AI – Market making –
future of cryptocurrencies
UNIT IV : DEVELOPING BLOCKCHAIN PRODUCTS

Development Life Cycle of a


DIApp – Designing a DIApp
– Developing a DIApp –
Testing – Deploying –
Monitoring – Implementing
DIApps.
UNIT V : LIMITATIONS AND FUTURE OF AI WITH BLOCKCHAIN

Technical Challenges – Business


Model Challenges – Scandals and
Public perception – Government
Regulation – Privacy Challenges
for Personal Records –
Convergence of AI with
Blockchain – Future – Enterprise.
TEXT BOOKS:

1. Ganesh Prasad Kumble, Anantha


Krishnan, “Practical Artificial Intelligence
and Blockchain: A guide to converging
blockchain and AI to build smart
applications for new economies”, Packt
Publications, 2020. (unit 1-5)

2. Melanie Swan, “Block Chain: Blueprint


for a New Economy”, O’Reilly, 2015. (unit 5)
INTRODUCTION TO BLOCKCHAIN
INTRODUCTION TO BLOCKCHAIN
DISTRIBUTED DATABASE
DISTRIBUTED DATABASE
BLOCKCHAIN VERSUS DISTRIBUTED LEDGER TECHNOLOGY VERSUS
DISTRIBUTED DATABASES

Distributed
Feature Blockchain DLT
Database
Not updated by
Immutability new identifier Few exceptions Immutable
Logical User defined
Smart contracts User inputs
execution functions
Accessibility Middleware Stakeholders Client-server
Verify before
Verifiability No No
change
Economic self-
Incentivization models No
incentivized
TYPES OF BLOCKCHAIN
Public vs private vs permissioned blockchains

Attribute vs Public Private Permissioned


variant blockchains blockchains blockchains
Accessible to all Access by an IP or Access by verified
Network barrier users. a DNS participants
User can perform, Deploy DApps, use
such as develop a validators and DApps, validate
Restrictions smart contract DApps users. transactions, or all
and use it three
Entire user data in
Encryption is
blocks is not
Encryption May not be used widely to various
encrypted. Not a
stake holders
common goal
Bitcoin
• Bitcoin was created by Satoshi Nakamoto in 2008

• It is a digital money, peer to peer transactions on the internet

• Bitcoin is decentralized: any two people, in the world, can send bitcoin to
each other without the involvement of a bank

• Every transaction is tracked on the Blockchain, which is similar to a bank’s


ledger, or log of customers’

• It is distributed across the entire network

• There will only ever be 21 million bitcoin

• It isn’t necessary to buy an entire bitcoin: you can buy just a fraction of
one
Bitcoin mining
Ethereum
• Ethereum is a decentralized blockchain platform

• It executes and verifies application code, called smart contracts.

• Smart contracts allow participants to transact with each other


without a trusted central authority.

• Transactions are sent from and received by user-created


Ethereum accounts.

• A sender must sign transactions and spend Ether, Ethereum's


native cryptocurrency, as a cost of processing transactions on
the network.
Ethereum
Hyperledger
• Hyperledger is an open source project hosted by the Linux
Foundation

• It is in collaboration with various industry leaders in finance,


banking, supply chain, manufacturing, and other domains

• Hyperledger and some of the projects under the Hyperledger


umbrella.

• Hyperledger project including Accenture, IBM, DTCC, Intel, and


R3, among others.

• The project hosts a dozen code repositories of blockchain


frameworks and tools
Hyperledger
• Hyperledger is an open source project hosted by the Linux
Foundation

• It is in collaboration with various industry leaders in finance,


banking, supply chain, manufacturing, and other domains

• Hyperledger and some of the projects under the Hyperledger


umbrella.

• Hyperledger project including Accenture, IBM, DTCC, Intel, and


R3, among others.

• The project hosts a dozen code repositories of blockchain


frameworks and tools
Hyperledger Fabric
• Hyperledger Fabric is a blockchain framework initially
developed by the IBM and Digital Assets members.

• Fabric is a DLT that aims to provide a modular architecture for


developers to use only what is needed.

• The framework supports the execution of logic abstracted into


containers called chaincode.

• Using Fabric is easily enabled by the plethora of


documentation, tutorials, and tools available for deploying
business networks without much hassle.
Hyperledger Sawtooth
• Hyperledger Sawtooth is a blockchain framework that offers
enterprises a secure leadership election of nodes in the
network, with special modes for executing instructions.

• Sawtooth offers a powerful, developer-friendly Software


Development Kit (SDK) for a majority of languages to write
and deploy smart contracts.

• Notably, Sawtooth is one of the early live projects to


experiment with WebAssembly (WASM) as a virtual medium
for the execution of smart contracts.
Other Hyperledger frameworks and tools
• Hyperledger Indy: A blockchain platform to specially handle
decentralized identities from inside or external systems

• Hyperledger Grid: A WASM-based project for building supply


chain solutions

• Hyperledger Quilt: A blockchain tool to connect blockchain


realms of different protocols using the Interledger Protocol
(ILP) specifications

• Hyperledger Caliper: A blockchain benchmarking tool to


assess the performance of a specific blockchain with specific
parameters such as Transactions Per Second (TPS), transaction
latency, resource utilization, and so on
Other blockchain platforms – Hashgraph,
Corda, and IOTA
• Hashgraph is a DLT with a superior consensus mechanism
leveraging Directed Acyclic Graphs (DAGs). Corda is an open source
DLT maintained by the financial services consortium R3.

• Corda offers a smart contracts platform to allow businesses to


execute complex agreements, associating multiple variants of asset
classes across various business domains, including supply chain,
healthcare, and finance.

• IOTA is an open source DLT that offers payment automation and


secure communication between IoT devices.

• This project has delivered impressive wallets, a data marketplace


for sensor data, and payment channels for quicker transaction
settlements
Consensus algorithms
• A consensus algorithm is a process used to achieve agreement
on a single data value among distributed processes or systems.

• It is responsible for maintaining the integrity of the blockchain by


ensuring that no single node or group of nodes can manipulate
the network.

• They help achieve decentralization by ensuring all nodes come to


a consensus on transaction validity, preventing centralization

• They improve efficiency by allowing nodes to quickly agree on


transaction validity and add new blocks to the blockchain in a
timely manner.
Proof of work
• Proof of Work is a consensus algorithm used to validate
transactions and add new blocks to the chain

• It requires miners to solve complex mathematical problems,


known as hashes, in order to validate transactions and add new
blocks to the chain

• Merit: The PoW algorithm has been time tested in the Bitcoin
blockchain network and there is not a single hack/compromise
of the account states in the network leading to double spend.

• Demerit: As the PoW algorithm needs to find a solution to a


mathematical problem, significant CPU cycles are required to
generate hashes and so it is an energy-intensive technique
Proof of stake
• In a PoS network, validators are chosen to add new blocks to
the chain based on the amount of cryptocurrency they hold

• The larger the stake, the greater the chance of being selected
to add a block to the chain

• Merit: The PoS algorithm is energy-efficient as there are fewer


computational requirements.

• Demerit: criticisms relating to the algorithm's vulnerability to


capitalist attacks on the network of the node owner and tries
to compete with other candidates with a stupendous amount
of cryptocurrency at stake, higher than all the other
candidates
Proof of burn
• PoB requires participants to burn, or destroy, cryptocurrency
tokens to prove their commitment to the network

• Once the cryptocurrency is burned, the user is given the right


to add new blocks to the blockchain and receive rewards.

• Merit: The PoB algorithm is convenient during the transition


of cryptocurrencies and network upgrades if the system trusts
the participating entities.

• Demerit: The PoB algorithm is usually applicable in PoW-


based blockchains and so has a limitation of applicability..
Delegated Proof of Stake
• A smaller group of validators, known as delegates or witnesses, to validate transactions and add
new blocks

• Merit: Ready and scales easily in a public network environment.

• Demerit: Although dPOS is efficient, it is prone to capitalistic efforts to supersede other minor
token stakeholders
Proof of authority
• PoA relies on a group of trusted validators instead of a
decentralized network of nodes.

• Validators are typically selected based on their reputation and


expertise, and they are incentivized to act honestly

• Merit: If the node is observed to malfunction, its reputation is


severely affected and cannot proceed as a validator.

• Demerit: The PoA algorithm is partially centralized as the


authority of adding or rejecting transactions lies in the
purview of very few nodes in the network
Practical Byzantine fault tolerance
• PBFT works by breaking down the consensus process into a
series of steps that are repeated for each transaction.

• Each step involves a different node in the network, and each


node is responsible for verifying the validity of the transaction
before passing it on to the next node.

• Merit: The PBFT algorithm is efficient, with fast transaction


processing and scalable to hundreds of nodes in a private
network.

• Demerit: The algorithm is based on a gatekeeper technique


and is hence criticized for its centralized approaches. PBFT is
not suitable for public blockchains
Proof of elapsed time
• It is a consensus algorithm developed by Intel for use in
permissioned blockchain networks.

• Each participant in the network is assigned a random waiting


time, similar to a lottery.

• Merit: PoET allows anyone with eligible hardware to


participate as a validator node, allowing legitimate ways of
verifying the leader election.

• Demerit: Although PoET does not involve staking


cryptocurrencies to form a validatory node, the cost of
affording specialized hardware does not come cheap
RAFT
• RAFT ensures safe leader election, appending log entries in a
distributed manner.(Reliable, Replicated, Redundant, And
Fault-Tolerant)

• The main motivation to bring about a distributed consensus


algorithm that is much easier to understand.

• Merit: RAFT is one of the fastest algorithms in processing


complex transaction payloads with the security of leadership
and state machine consistency.

• Demerit: RAFT is suitable for permissioned or private


blockchains only
Ternary augmented RAFT architecture
• TARA introduces dynamic hierarchy to networks to ensure that
their authority is not concentrated among a few nodes

• It address heterogeneous transactions identifiable by their asset


classes by leveraging PBFT hardening and cryptographic message
exchanges.

• Merits: TARA offers service clusters to ensure high availability,


throughput, and scale. It has the hardware of all form factors
with the ability to compute and store transactions can
participate.

• Demerit: Leadership election is not inherently dependent on the


node's reputation, thereby allowing a potential attack on systems
Avalanche
• Uses leaderless Byzantine fault tolerance, using a metastable
mechanism achieving the same level of security and
consistency among the nodes

• Avalanche depends on the Snowball family to form a DAG,


which stores the user transactional data, instead of blocks.

• Merit: Avalanche guarantees liveness and is immune to race


conditions in the network.

• Demerit: Leadership consensus may not be applicable to all


blockchain environments as there is not a carefully analyzed
set of heuristics to ensure consistencyms
Building DApps with blockchain tools
• One of the main causes of the mainstream adoption of
blockchain is the developer-led wave of evangelism for the
technology.

• This has been observed in the form of frameworks and tools


at developer's disposal.

• we will go through the various tools and platforms that are


available for public consumption to build blockchain-based
software solutions.
Blockchain toolchains and frameworks
• Truffle: The Truffle framework was developed by ConsenSys as
an open source project, offering a pipeline for the development,
testing, and deployment of smart contracts targeted on the
EVM.

• Embark: The Embark framework was developed by Status as an


open source project, offering a debugging and integration
environment for Ethereum smart contract developers. Notably,
Embark offers tighter integration with IPFS for the decentralized
storage of contract data.

• Hyperledger Composer: This is an open source effort from the


LinuxFoundation, which offers tools to assist developers with
converting requirements into proof of concept for the DevOps
process, for spinning a new network as required.
Blockchain tools and frameworks
• MetaMask: This is a middleware that bridges an application running in
the browser with the Ethereum blockchain. It is an open source
initiative supported and consumed widely by all Ethereum developers.
Users can perform transactions in a web application through MetaMask.

• Ethers.js: This is a JavaScript-based library with full implementation of


the Ethereum wallet as per the specification. Developers use this open
source library to create user wallets, perform transactions, and much
more. This library is also well known for its recent support for Ethereum
Name Service (ENS).

• Nethereum: This is an open source library used to build Ethereum-


based blockchain solutions in .NET environments. Nethereum
offers .NET developers an SDK called NuGet, which is integrated into the
Visual Studio Integrated Development Environment (IDE) for using web3
functionalities across web and mobile applications.
Developing smart contracts using IDEs and plugins
• The Remix IDE
Remix has been the de facto IDE for smart contract development and
deployment. This open source IDE is used by developers who are interested in
developing, debugging, and deploying solidity smart contracts for Ethereum
network. Notably, this IDE works well with private networks and offers regular
updates.

• The EthFiddle IDE


EthFiddle is an open source initiative by Loom Network to facilitate code
experimentation online and provides the ability to share experimental code
snippets of solidity smart contracts among developers for easier collaboration.

• The YAKINDU plugin for Eclipse


Several enterprise developers have yearned for plugins for current IDEs, and this
plugin offers just that. YAKINDU offers basic syntax highlighting and other
common language package features for solidity smart contract development in
the Eclipse IDE
Developing smart contracts using IDEs and plugins
• The Solidity plugin for Visual Studio Code
This plugin can be installed on Visual Studio Code, one of the
most used IDEs. It boasts to be one of the leading plugins used
for solidity smart contract development.

• The Etheratom plugin for Visual Studio Code


Etheratom is a plugin available for GitHub's Atom editor, offering
IDE features such as syntax highlighting, including a deployment
interface to a local Ethereum node. It uses web3.js to interact
with a local Ethereum node.

You might also like