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

PDF Unit I

Uploaded by

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

PDF Unit I

Uploaded by

sgg866425
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 60

Blockchain Fundamentals

7IT05
UNIT 1: Introduction to Blockchain: History of Blockchain –
Types of Blockchain – Consensus – Decentralization using
Blockchain – Blockchain and Full Ecosystem Decentralization –
Platforms for Decentralization.
UNIT 2: Introduction to Crypto currency:
Bitcoin – Digital Keys and Addresses – Transactions – Mining–
Bitcoin Networks and Payments – Wallets
UNIT 3: Alternative Coins & Smart Contract:
Alternative Coins – Theoretical foundations – Bitcoin limitations
–Smart Contracts – Ricardian Contracts.
UNIT 4: Ethereum:
The Ethereum Network – Components of Ethereum Ecosystem
– Ethereum Programming Languages: Runtime Byte Code, Blocks
and Blockchain, Fee Schedule – Supporting Protocols – Solidity
UNIT 5: Web3 & Hyperledger:
Introduction to Web3 – Contract Deployment – POST Requests – Development Frameworks
Hyperledger as a Protocol – The Reference Architecture – Hyperledger Fabric – Distributed
Ledger – Corda.

UNIT 6: : Alternative Blockchains And Next Emerging Trends:


Kadena – Ripple – Rootstock – Quorum – Tendermint – Scalability – Privacy – Other Challenges.
Course Prerequisites:

1. Knowledge of Computer Network

2. Cryptography & Network Security.

Course Learning Objectives:


Throughout the course, students will be expected to demonstrate their understanding of
Blockchain Technology by being able to do each of the following:
3. To understand Blockchain’s fundamental components, and examine decentralization using blockchain.
4. To explain how cryptocurrency works, from when a transaction is created to when it is considered part of the
Blockchain.
5. To explain the components of Ethereum and Programming Languages for Ethereum.
6. To study the basics of Hyperledger and Web3.
7. To know about alternative Blockchains and Blockchain projects in different domains.
Course Outcomes:
On completion of the course, the students will be able to:
1. Understand the technology components of Blockchain and how it
works behind the scenes.
2. Identify different approaches to developing decentralized applications.
3. Understand Bitcoin and its limitations by comparing with other
alternative coins.
4. Devise solution using the Ethereum model.
5. Understand and use Hyperledger and its development framework.
6. Track alternative Blockchains and emerging trends in Blockchain.
The history of blockchain and Bitcoin
• In 2008, A Peer-to-Peer Electronic Cash System was written
on the topic of peer-to-peer electronic cash under the
pseudonym Satoshi Nakamoto.
• It introduced the term chain of blocks.
• No one knows the actual identity of Satoshi Nakamoto.
• After introducing Bitcoin in 2009, he remained active in
the Bitcoin developer community until 2011.
• He then handed over Bitcoin development to its core
developers and simply disappeared.
• Since then, there has been no communication from him
whatsoever, and his existence and identity are shrouded in
mystery.
• The term chain of blocks evolved over the years into the word
blockchain.
Block

Figure 1.1.All blocks are cryptographically link


together

1.Data :“hello everyone”


2.Prev Hash:23432FRT123
3.Hash :123FFRE342
Blockchain
• Blockchain is simply a data structure where each block is linked to
another block in a time- stamped chronological order
• It is a distributed digitalledger of an
immutable public record of digital transactions.
• Every new record is validated across the distributed network before it
is stored in a block.
• All information once stored on the ledger is
verifiable and auditable but not
editable.
• Each block is identified by its cryptographic signature.
• The first block of the blockchain is known as Genesis block
Figure:- blockchain Features
Problems with the current system
Ledger
• Banks and other third parties take
A ledger is a record-keeping book fees for transferring money
that stores all the transactions of an • Mediating costs increases
organization. transaction costs
• Minimum practical transaction size is
limited;
• Financial exchanges are slow. Checking
and low cost wire services take days to
complete
• System is opaque and lacks transparency
• Also, central authority in control can
overuse the power and can create money
Figure:- Ledger as per their own will
We need a system
which:
• Eliminates the need of
middlemen or Third
parties thereby making
transaction costs nil or
negligible.
• Enhance transaction
execution speeds and can
facilitate instant
reconciliation.
• Is transparent and
tamper resistant in
order to avoid
manipulation or
misuse.
• Currency creation is not in
control of any central
authority.
• Is regulated to maintain
The network view of a
blockchain
Generic elements of a blockchain

Generic structure of a blockchain


The
• A block is merely generic
a selection structure
of transactions of a block.
bundled together and organized logically.
• A transaction is a record of an event
• A genesis block is the first block in the
blockchain that is hardcoded at the time the
blockchain was first started.
• A nonce is a number that is generated and used
only
once.
• A nonce is used extensively in many
cryptographic operations to provide replay
protection, authentication, and encryption.
• Time Stamp is recording of date and time taken
by transactions.
• Merkle root is a hash of all of the nodes of a
Merkle
• tree.
Merkle trees are widely used to validate the
The generic structure of a block.
large data structures securely and efficiently.
Elements of a generic blockchain are described
here one by one.

Address:
• Addresses are unique identifiers used in a blockchain
transaction to denote senders and recipients.
• An address is usually a public key or derived from a
public key.
• A single user may not use the same address again and
generate a new one for each transaction.
• Bitcoin is, in fact, a pseudonymous system.
• End users are usually not directly identifiable
Elements of a generic blockchain are described
here one by one.

Transaction:
• A transaction is the fundamental unit of a blockchain.
• A transaction represents a transfer of value from one address
to another.
Block:

• A block is composed of multiple transactions and other


elements, such as the previous block hash (hash pointer),
timestamp, and nonce.
Peer-to-peer network:

• As the name implies, a peer-to-peer network is a network


Elements of a generic blockchain are described
here one by one.

Scripting or programming language:


• In Bitcoin, transaction scripts are predefined in a language called
Script, which consist of sets of commands that allow nodes to
transfer tokens from one address to another.
• Script is a limited language, it only allows essential operations that
are necessary for executing transactions,
• Think of it as a calculator that only supports standard pre-
programmed arithmetic operations.
• As such, Bitcoin script language cannot be called Turing complete.
• Turing complete languages need loops and branching capability to
perform complex computations.
Elements of a generic blockchain are described
here one by one.

Virtual machine:
• A virtual machine allows Turing complete code to be run on a blockchain (as smart contracts);
whereas a transaction script is limited in its operation.
• virtual machines are not available on all blockchains.
• Various blockchains use virtual machines to run programs such as Ethereum Virtual
Machine
(EVM) and Chain Virtual Machine (CVM).
• EVM is used in Ethereum blockchain
• CVM is a virtual machine developed for and used in an enterprise-grade blockchain called
Chain
Core.
State machine:
• A blockchain can be viewed as a state transition mechanism
• a state is modified from its initial form to the next one and eventually to a final form by nodes on
the blockchain network as a result of a transaction execution, validation, and finalization process.
Elements of a generic blockchain are described
here one by one.
Node:

• A node in a blockchain network performs various


functions depending on the role that it takes on.
• A node can propose and validate transactions and
perform mining to facilitate consensus and secure the
blockchain.
• This goal is achieved by following a consensus
protocol (most commonly PoW).
• Nodes can also perform other functions such as
simple payment verification , validation, and many
other functions depending on the type of the
Elements of a generic blockchain are described
here one by one.
Smart contract:
•These programs run on top of the blockchain and encapsulate the
business logic to be executed when certain conditions are met.
•These programs are enforceable and automatically executable.
•The smart contract feature is not available on all blockchain
platforms, but it is now becoming a very desirable feature due to
the flexibility and power that it provides to the blockchain
applications.
•Smart contracts have many use cases, including but not limited to
identity management, capital markets, trade finance, record
Features of
Blockchain
Features of blockchain

• Distribution: Blockchain participants are located physically apart


from each other and each node copy of a ledger that updates with new
transactions as they occur.

• Encryption: Blockchain uses technologies such as public and private


keys to record the data in the blocks securely.

• Immutability: Completed transactions are cryptographically signed,


time-stamped and sequentially added to the ledger.
Features of blockchain

• Tokenization: Transactions and other interactions in a blockchain


involve the secure exchange of value.

•Decentralization: Both network information and the rules for how


the network operates are maintained by nodes due to consensus
mechanism.
Benefits of Blockchains
Benefits of Blockchains
• Trust less: The blockchain is immutable and automates trusted transactions between
counterparties who do not need to know each other.

• Transactions are only executed when programmed conditions are met by both parties.

• Unstoppable: Once the conditions programmed into a blockchain protocol are met, an
initiated transaction cannot be undone, changed, or stopped.
• Immutable: Records on a blockchain cannot be changed or tampered.

• Decentralized: No single entity maintains the network. Decisions on the blockchain are
made via consensus. Decentralization is essential because it ensures people can easily
access and build on the platform.
Benefits of Blockchains
• Lower Cost: In the traditional finance system, you pay third parties like
banks to process transactions. The blockchain eliminates these intermediaries
and reduces fees.
• Peer-to-Peer: Cryptocurrencies like Bitcoin, let you send money directly to
anyone, anywhere in the world, without an intermediary like a bank charging
transaction or handling fees.
• Transparent: Public blockchains are open-source software, so anyone can access
them to view transactions and their source code.
• They can even use the code to build new applications and suggest improvements
to the code. Suggestions are accepted or rejected via consensus.
Benefits of Blockchains
• Universal Banking: anyone can access the blockchain to store money, it’s a great
way to protect against theft that can happen due to holding cash in physical
locations.
• Use cases
•Dubai has been able to integrate blockchain into eight
industry sectors
• Real estate
• Tourism
• Security
• Transportation
• Finance
• Health
• Education.

• The end result is to become the world’s first blockchain city.


Features of Distributed Ledger
Benefits of Distributed Ledgers

• Highly transparent, secure, tamper-proof, and immutable.


• After records are written into distributed ledgers, they cannot be
altered by any other party.
• The need for a third party is eliminated
• Inherently decentralized
• Highly transparent
Types of
blockchain
• Public Blockchains
• Private Blockchains
• Consortiums Blockchains
• Hybrid Blockchains
Public Blockchains
• Open, decentralized networks of
computers accessible to anyone
wanting to request or validate a
transaction (check for accuracy).
• Those (miners) who validate
transactions receive rewards.
• Public blockchains use proof-of-work or
proof-of-stake consensus.
• Permission-less distributed
ledger system.
• Anyone who has access to the internet
can sign in on a blockchain platform to
become an authorized node and be a
part of the blockchain network. Figure:- Public Blockchain
• Example : Bitcoin and Ethereum
(ETH) blockchains.
A public blockchain has some
characteristic features:
• Write-only, immutable, transparent data storage.
• It brings trust among the whole community of users
• Decentralized, no need for intermediaries.
• Consistent state across all participants.
• Resistant against malicious participants.
• Anyone can join the public blockchain.
Disadvantages
• They suffer from a lack of transaction speed.
Private Blockchains
• A Private Blockchain is just
like a relational database i.e.
fully centralized and owned
by a single organization.
• Private blockchains are
not open, they have
access restrictions.
• People who want to join
require permission from
the system administrator.
• They are typically governed
by one entity, meaning they’re
centralized.
• For example, Hyperledger is Figure:- Private Blockchain
a private, permissioned
blockchain.
Consortiums blockchain
• Validation is conducted by known and identified members of the limited
network of nodes
• Greater privacy since the information from verified blocks is not exposed to
the public.
• There are no transaction fees
• Consensus is reached by a relatively small number of nodes in accordance to
the governance scheme.
• A consortium platform is more flexible.
• Voting-based system, it ensures low latency and superb speed.
• Examples are Corda, Quram
Hybrid Blockchain
• Hybrid blockchain is best defined as a combination of a private and public blockchain.
• It has use-cases in an organization that neither wants to deploy a private blockchain nor
public blockchain and simply wants to deploy both worlds’ best.

Advantages

• Works in a closed ecosystem without the need to make everything


public.
• Rules can be changed according to the needs.
• Hybrid networks are also immune to 51% attacks.
• It offers privacy while still connected with a public network.
• It offers good scalability compared to the public network.
Hybrid Blockchain

Dis-Advantages

• Not completely transparent.

• Upgrading to the hybrid blockchain can be a challenge.

• There is no incentive for participating and contributing to the network.


Consensus
• Ensures that the next block in a blockchain is the one and only version
of the truth.
• consensus algorithm is a process in computer science used to achieve
agreement on some information among the distributed systems.
• The consensus algorithm was designed for the blockchain technology
to achieve reliability in a blockchain network having multiple nodes.
• A consensus mechanism is a protocol that brings all
nodes of a distributed blockchain network into
agreement on a single data set.
• They act as the verification standards through which
each blockchain transaction gets approved.
Consensus
Algorithm
• The consensus algorithm is probably the most important part of
any implementation of blockchain.
• The Bitcoin uses one consensus algorithm called Proof Of Work.
• Try to get the right nonce number by checking the hash created for the block
until the result hash have the same number of zero's in it's prefix.
• This execution to try to get the right nonce number takes a lot of energy cost
and computational work, and that's why the miners get the fees from the
transaction.
Figure:- Consensus mechanism
Proof of Work consensus algorithm
• This type of consensus mechanism relies on proof that
adequate computational resources have been spent
before proposing a value for acceptance by the
network.
• This scheme is used in Bitcoin, Litecoin,
and other cryptocurrency blockchains.
• Currently, it is the only algorithm that has proven
to be astonishingly successful against any
collusion attacks on a blockchain network, such
as the Sybil attack.
Proof of Stake
(PoS):
• This algorithm works on the idea that a node or user has an adequate stake in
the system;
• So that any malicious attempt by that user would outweigh the benefits of
performing such an attack on the network.
• This idea was first introduced by Peercoin, and it is going to be used in
the Ethereum blockchain version called Serenity.
• Another important concept in PoS is coin age, which is a criterion derived
from the amount of time and number of coins that have not been spent.
• In this model, the chances of proposing and signing the next block increase
with the coin age.
Proof of Work Vs Proof of Stake
• Participating nodes are called • Participating nodes are
miners called validators or forgers
• Validating capacity depends on the
• Mining capacity depends stake in the network
on computational power • No new coins are formed
• Mining produces new coins • Validators receive transaction fees
• Miners receive block • Low to moderate energy
rewards consumption
• Massive energy • 51% attacks are virtually
consumption impossible
• Significantly prone to 51%
attacks
Delegated Proof of Stake
(DPoS):
• This is an innovation over standard PoS,
• whereby each node that has a stake in the system can delegate the
validation of a
transaction to other nodes by
voting.
• It is used in the BitShares
blockchain.
Proof of Elapsed Time
(PoET):
• Introduced by Intel in 2016,
PoET uses a Trusted
Execution Environment
(TEE) to
provide randomness and safety
in the leader
Proof of Deposit (PoD):
• In this case, nodes that wish to participate in the network
have to make a security deposit before they can mine and
propose blocks.
• This mechanism is used in the Tendermint blockchain

Proof of Burn (PoB)


In the Proof of Burn (PoB) algorithm, miners reach a
consensus by burning the coins.
It’s a process in which crypto coins get permanently
eliminated from regular circulation.
In such cases, the burning of coins mechanism is used to
validate transactions.
Hence, the more coins a miner burns, the higher the chances
of adding the block to the network.
Different types of networks/systems
Centralized Network Advantages Disadvantages

In Centralized network , Command Chain Not 100% Trustable


there is central authority
that governs and handle Reduced Costs Single Point Failure
the network
Consistent Output Scalability
Limitations

Decentralized Network

In Decentralized network , Full Control Costly


there is no authority that
governs and handle the Immutable Data Misuse of authority
network
High Security High Security
A decentralized network:
•Multiple Nodes:
In a decentralized network, there isn’t a single
central authority. Instead, multiple nodes or
participants in the network have equal status.
•Peer-to-Peer Communication:
Nodes communicate directly with each other
without the need for a central server. Each node
can send and receive information independently.
•Data Distribution: Data is distributed across
multiple nodes. Instead of being stored in one
central location, it’s spread out, often using a
technology called distributed ledger or
•Redundancy and Resilience: Since data is stored across
many nodes, the network is more resilient. If one node fails,
the data can still be retrieved from other nodes, enhancing
reliability.

•Decision-Making: Decisions are often made through a


consensus mechanism involving multiple nodes. This
ensures that no single entity has complete control, promoting
fairness.

•Example: Cryptocurrencies like Bitcoin operate on a


decentralized network. Each user’s computer, known as a
node, contributes to the overall functioning of the network by
validating and recording transactions.


A centralized network:
•Single Control Point: In a centralized network, there
is one central point, often a server or mainframe, that
governs the entire network.

•Communication Flow: All communication between


devices, like computers or users, goes through this
central point. It acts as a mediator, receiving requests
and sending back responses.

•Data Storage: The central authority stores data and


information. When users or devices need data, they
request it from the central point, and it provides the
•Decision-Making: Decisions, such as access
permissions or resource allocation, are made
centrally. The central authority has the ultimate say
in how resources are used or shared.

•Dependency: The entire network relies on the


central authority. If it fails or experiences issues, the
entire network may be affected.

•Example: In a typical office setup, a centralized


network might have a main server storing files and
managing user access.
•All computers connect to this server for file sharing
Decentralization using blockchain
• Decentralization is a core benefit and service provided by
blockchain technology.
• By design, blockchain is a perfect vehicle for providing a
platform that
does not need any intermediaries
• It can function with many different leaders chosen via
consensus mechanisms.
• This model allows anyone to compete to become the
decision-making
authority.
• This competition is governed by a consensus mechanism, and
the most commonly used method is known as Proof of Work
(PoW).
Decentralized
Applications
• Decentralized means no node is instructing any other node as to
what to do.

• The code runs on a peer-to-peer network of nodes and no single


node has control over the dApp.

• Depending on the functionality of the dApp, different data structures


can be used to store the application data.

• Bitcoin uses a blockchain decentralized ledger of transactions.


Distributed
Applications
• Applications in which computation is distributed
across components, communicate and coordinate
their actions by passing messages.
• The components interact with each other in order to
achieve a common goal.
Some distributed applications examples are:
• CDN
• AWS
Distributed applications
• Cloud Instances
• Google, Facebook, Netflix, etc
Platforms for decentralization
• Blockchain network such as Bitcoin, Ethereum,
Hyperledger Fabric, or Quorum can be used to provide
decentralization service.
• Many organizations around the world have introduced
platforms to make distributed application development easy,
accessible, and secure.
Ethereum
• Ethereum tops the list as being the first blockchain to introduce a
Turing-complete language and the concept of a virtual machine.
• With the availability of its Turing-complete language called Solidity,
endless possibilities have opened for the development of decentralized
applications.
• This blockchain was first proposed in 2013 by Vitalik Buterin,
• and it provides a public blockchain to develop smart contracts and
decentralized applications.
• Currency tokens on Ethereum are called Ethers.
MaidSafe
• MaidSafe provides a Secure Access For Everyone (SAFE) network
• It is made up of unused computing resources, such as storage, processing power,
and the data connections of its users.
• The files on the network are divided into small chunks of data, which are
encrypted and distributed randomly throughout the network.
• This data can only be retrieved by its respective owner.
• One key innovation of MaidSafe is that duplicate files are automatically rejected
on the network, which helps reduce the need for additional computing resources
needed to manage the load.
• It uses Safecoin as a token to incentivize its contributors.
Lisk
• Lisk is a blockchain application development and cryptocurrency platform.
• It allows developers to use JavaScript to build decentralized applications and host
them in their respective sidechains.
• Lisk uses the Delegated Proof of Stake (DPOS) mechanism for consensus whereby 101 nodes
can be elected to secure the network and propose blocks.
• It uses the Node.js and JavaScript backend, while the frontend allows the use of
standard technologies, such as CSS3, HTML5, and JavaScript.
• Lisk uses LSK coin as a currency on the blockchain.
• Another derivative of Lisk is Rise, which is a Lisk-based decentralized application and
digital currency platform.
• It offers a greater focus on the security of the system.

You might also like