0% found this document useful (0 votes)
15 views49 pages

CST 428 Blockchain Module 2

The document provides an overview of blockchain technology, detailing its fundamental concepts, benefits, limitations, and various types. It explains the decentralized nature of blockchain, consensus mechanisms, and the process of mining, while also discussing smart contracts and the implications of decentralization in various sectors. Additionally, it highlights the challenges of scalability, regulation, and privacy in the adoption of blockchain technology.

Uploaded by

devilspidey030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views49 pages

CST 428 Blockchain Module 2

The document provides an overview of blockchain technology, detailing its fundamental concepts, benefits, limitations, and various types. It explains the decentralized nature of blockchain, consensus mechanisms, and the process of mining, while also discussing smart contracts and the implications of decentralization in various sectors. Additionally, it highlights the challenges of scalability, regulation, and privacy in the adoption of blockchain technology.

Uploaded by

devilspidey030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CST 428 BLOCK CHAIN TECHNOLOGIES

S8 CSE – ELECTIVE
MODULE – 2

Fundamentals of Blockchain
Technology
Blockchain Definition

P2P - there is no central controller in the network, and all participants (nodes)
talk to each other directly
allows transactions to be conducted directly among the peers without third-
party involvement, such as by a bank
Blockchain Definition
Distributed Ledger - ledger is spread across
the network among all peers in the network, and
each peer holds a copy of the complete Ledger
Append-only
data can only be added to the blockchain in time
sequential order
almost impossible to change data in block
(immutable)
Blockchain Definition
■ updateable only via consensus - mutual
agreement
contains all sorts of various user
level agents and programs that
operate on the blockchain

provides executions services on the


blockchain and performs operations such
as value transfer, smart contract
execution, and block generation

Ensures agreement
among different
participants
Ensures security of block
chain

Information propagation
layer

Basic communication layer


Blockchain - Generic Elements

● First block in the blockchain that is


hardcoded at the time the blockchain was
first started
● Dependent on the type and design of a
blockchain
Blockchain - Generic Elements

a number that is generated and used only once

creation time of the block

hash of all of the nodes of a Merkle tree

record of an event, for example, the


event of transferring cash from a
sender's account to a beneficiary's
account
Blockchain - Generic Elements
Address - unique identifiers used in a blockchain transaction to denote senders and recipients
usually a public key or derived from a public key

Transaction: fundamental unit of a blockchain 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: network topology wherein all peers can communicate with each
other and send and receive messages

Virtual machine: allows Turing complete code to be run on a blockchain as smart contracts.
Ethereum Virtual Machine (EVM) and
Chain Virtual Machine (CVM)
Blockchain - Generic Elements
State machine: A blockchain can be viewed as a state transition mechanism whereby a state is
modified from its initial form to the next one by nodes on the blockchain network as a result of
transaction execution

Smart contracts: 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

Node: Defined as an individual player in a distributed system. All nodes are capable of sending and
receiving messages to and from each other.
How blockchain works?
How blockchain works?
[Link] is initiated
• A node starts a transaction by first creating it and then digitally signing it with its private key.
• A transaction can represent various actions in a blockchain.

[Link] is validated and broadcast:


• A transaction is propagated (broadcast) usually by using data-dissemination protocols,
• Such as Gossip protocol, to other peers that validate the transaction based on preset validity
criteria

[Link] new block:


• When the transaction is received and validated by special participants called miners on the
blockchain network
• it is included in a block, and the process of mining starts
How blockchain works?
[Link] block found
• Once a miner solves a mathematical puzzle (or fulfills the requirements of the
consensus mechanism implemented in a blockchain)
• The block is considered "found" and finalized
Add new block to the blockchain
• The newly created block is validated transactions or smart contracts within it are
executed, and it is propagated to other peers
Benefits and features of blockchain
Decentralization: There is no need for a trusted third party or intermediary to validate
transactions; instead, a consensus mechanism is used to agree on the validity of transactions

Transparency and trust: As blockchains are shared, this allows the system to be transparent

Immutability: Once the data has been written to the blockchain, it is extremely difficult to change it
back

High availability: As the system is based on thousands of nodes in a peer-to-peer network, and
the data is replicated and updated on every node, the system becomes highly available

Highly secure: All transactions on a blockchain are cryptographically secured and thus provide
network integrity. Any transactions posted from the nodes on the blockchain are verified based on a
predetermined set of rules. Only valid transactions are selected for inclusion in a block
Benefits and features of blockchain
Simplification of current paradigms: blockchain can serve as a single shared ledger among
many interested parties, this can result in simplifying the model by reducing the complexity of
managing the separate systems maintained by each entity

Faster dealings: Blockchain does not require a lengthy process of verification, reconciliation, and
clearance because a single version of agreed-upon data is already available on a shared ledger
between financial organizations

Cost-saving: As no trusted third party or clearing house is required in the blockchain model, this
can massively eliminate overhead costs in the form of the fees, which are paid to such parties

Platform for smart contracts: A blockchain is a platform on which programs can run that execute
business logic on behalf of the users. It is available on newer blockchain platforms such as
Ethereum and MultiChain, but not on Bitcoin
Benefits and features of blockchain
Smart property: It is possible to link a digital or physical asset to the blockchain in such a secure
and precise manner that it cannot be claimed by anyone else. You are in full control of your asset,
and it cannot be double-spent or double-owned. Compare this with a digital music file, for example,
which can be copied many times without any controls. While it is true that many Digital Rights
Management (DRM) schemes are being used currently along with copyright laws, none of them are
enforceable in the way a blockchain-based DRM can be
Limitations of blockchain
Scalability: Currently, blockchain networks are not as scalable

Adoption: there is still a long way to go before the mass adoption of this technology

Regulation: Due to its decentralized nature, regulation is almost impossible on blockchain.


Traditionally, due to the existence of regulatory authorities, consumers have a certain level of
confidence that if something goes wrong they can hold someone accountable

Relatively immature technology: blockchain is still a new technology and requires a lot of
research to achieve maturity

Privacy and confidentiality: Privacy is a concern on public blockchains such as Bitcoin where
everyone can see every single transaction. This transparency is not desirable in many industries
such as the financial, law, or medical sectors
Types of blockchain
Tokenized blockchains: standard blockchains that generate
cryptocurrency as a result of a consensus process via mining or
initial distribution. Bitcoin and Ethereum are prime examples

Tokenless blockchains : do not have the basic unit for the


transfer of value. However, they are still valuable in situations
where there is no need to transfer value between nodes and only
the sharing of data among various trusted parties is required.
Consensus

● Backbone of a blockchain
● Provides the decentralization of control through an optional
process known as mining
● Choice of the consensus algorithm is governed by the type of
blockchain in use
● Process of achieving agreement between distrusting nodes on
the final state of data
Mining
• Suppose Alice wants to transfer 10 BTC to Bob.
• Now the transaction data of A is shared with the miners from
the memory pool.
• A memory pool is a place where an unconfirmed or unverified
transaction waits for its confirmation.
• Miners start competing with themselves to solve the
mathematical riddle in order to validate and verify the
transaction using proof of work.
Mining
• The miner who solves the problem first shares his result with
other nodes(miners).
• Once maximum nodes agree with the solution, the transaction
block is verified and is then added to the blockchain.
• At the same time, the miner who solved the puzzle gets a
reward of 6.25 bitcoins.
• Now, after the addition of the transaction block, the 10 BTC
associated with the transaction data is transferred to Bob from
Alice.
Consensus

● a set of steps that are taken by most or all nodes in a


blockchain to agree on a proposed state or value
● Requirements:
○ Agreement: All honest nodes decide on the same value
○ Integrity: no node can make the decision more than once
in a single consensus cycle
Consensus

● Requirements:
○ Validity: The value agreed upon by all honest nodes must
be the same as the initial value proposed by at least one
honest node
○ Fault tolerant: The consensus algorithm should be able to
run correctly in the presence of faulty or malicious nodes
○ Termination: All honest nodes terminate the execution of
the consensus process and eventually reach a decision
Types of consensus

● Traditional fault tolerance-based:


○ Two types of faults
■ Fail-stop faults: node merely crashed
● Paxos and RAFT protocol are used to deal
● Byzantine faults: faulty node exhibits malicious or
inconsistent behavior arbitrarily
○ Difficult to handle
○ Byzantine Fault Tolerance (PBFT) is used
Consensus in Blockchain

● Used in blockchain in order to provide a means of agreeing to


a single version of the truth by all peers on the blockchain
network
● 1) Proof-based, leader-election lottery-based, or the
Nakamoto consensus whereby a leader is elected at random
(using an algorithm) and proposes a final value
Consensus in Blockchain

● Also referred to as the fully decentralized or permissionless


type of consensus mechanism
● used in the Bitcoin and Ethereum blockchain in the form of a
PoW mechanism
● 2) Byzantine fault tolerance (BFT)-based is a more traditional
approach based on rounds of votes
○ known as the consortium or permissioned type of
consensus mechanism
Consensus in Blockchain

● BFT-based consensus mechanisms perform well when there


are a limited number of nodes, but they do not scale well
● Leader election lottery-based (PoW) consensus mechanisms
scale very well but perform very slowly
Consensus in Blockchain

● Available algorithms for consensus in context of blockchain


○ Proof of Work (PoW): relies on proof that adequate
computational resources have been spent before
proposing a value for acceptance by the network
■ Used in Bitcoin, Litecoin, and other cryptocurrency
blockchains
■ Successful against any collusion attacks on a
blockchain network, such as the Sybil attack
Consensus in Blockchain
● proof that adequate computational resources
have been spent
01 Proof of Work (PoW) ● Used in Bitcoin, Litecoin and other
cryptocurrency
● Successful against Sybil Attack

● node or user has an adequate stake


(invest) in the system.
● Act as validators and validate transactions
02 Proof of Stake (PoS) ● first introduced by Peercoin
● used in the Ethereum blockchain version
Serenity
Consensus in Blockchain
● innovation over standard PoS
Delegated Proof of ● each node that has a stake in the system can
03 Stake (DPoS)
delegate the validation of a transaction to
other nodes by voting
● used in the BitShares blockchain

● uses a Trusted Execution Environment


Proof of Elapsed Time (TEE) to provide randomness and safety in
04 (PoET) the leader-election process via a
guaranteed wait time

● nodes that wish to participate in


the network have to make a security
05 Proof of Deposit (PoD) deposit before they can mine and
propose blocks
● used in the Tendermint blockchain
Consensus in Blockchain

Proof of Importance ● monitors the usage and movement of tokens


06 (PoI)
by the user in order to establish a level of trust
and importance

● used in the stellar consensus protocol


Federated consensus ● Nodes retain a group of publicly-trusted
07 or federated Byzantine peers and propagate only those
transactions that have been validated by
consensus the majority of trusted nodes

Reputation-based ● a leader is elected by the reputation it has


08 mechanisms
built over time on the network
● based on the votes of other members
Consensus in Blockchain
Practical Byzantine ● provides tolerance against Byzantine nodes
09 Fault Tolerance ● used in many different implementations of
distributed systems and blockchains
(PBFT)
● combination of PoS and PoW
● ensures that a stakeholder is selected in a
10 Proof of Activity (PoA) pseudorandom but uniform fashion
● more energy-efficient mechanism

● uses hard disk space as a resource to mine


the blocks
11 Proof of Capacity (PoC) ● also known as hard drive mining
● First introduced in the BurstCoin
cryptocurrency
Decentralization

● Core benefit and service provided by blockchain technology


● allows anyone to compete to become the decision-making
authority
● consensus mechanism governs this competition, and the most
famous method is known as Proof of Work (PoW)
● Semi-decentralized model to a fully decentralized one
depending on the requirements and circumstances
Not dependent on a
single master node
Decentralization control is distributed
among many nodes

computation may not


happen in parallel and
data is replicated across
multiple nodes that users
view as a single, coherent
System

still a central authority


that governs the entire
system

majority of online service


providers, including
Google, Amazon, eBay,
and Apple's App Store,
use this model to deliver
services
Decentralization
Decentralization
Decentralization
Feature Centralized Decentralized

Ownership Service provider All users

Architecture Client/server Distributed, different


topologies

Security Basic More secure

High availability No Yes

Fault tolerance Basic, single point of failure Highly tolerant, as service is


replicated

Collusion resistance Basic, because it's under the Highly resistant, as


control of a group or even consensus algorithms ensure
single individual defense against adversaries
Decentralization
Feature Centralized Decentralized

Application architecture Single application Application replicated across


all nodes

Trust Consumers have to trust the No mutual trust required


service provider

Cost for consumer Higher Lower


Methods of decentralization

● Two methods - disintermediation and competition


● Disintermediation - the intermediary (that is, the bank) is no
longer required
○ used not only in finance but in many other industries as
well, such as health, law, and the public sector
Methods of decentralization

● Contest-driven decentralization - different service providers


compete with each other in order to be selected for the
provision of services by the system
○ ensures that an intermediary or service provider is not
monopolizing the service
○ Smart contracts to make a free choice based on the
criteria just mentioned
Routes to decentralization
Case of a Money transfer system 1. Money transfer system
1. What is being decentralized? 2. Disintermediation
2. What level of decentralization is required? 3. Bitcoin
3. What blockchain is used? 4. Atomicity (ensure that transactions
4. What security mechanism is used? execute successfully in full or do not
execute at all)
Blockchain and full ecosystem decentralization

● Storage
○ Stored directly in a blockchain which achieves
decentralization but is not suitable for large data
○ better alternative for storing data is to use Distributed
hash tables (DHTs)
○ BitTorrent is the most scalable and fastest network
Blockchain and full ecosystem decentralization
• Two primary requirements here are high availability and link
stability.
• Which means that data should be available when required and
network links also should always be accessible.
• Inter-Planetary File system posess both the properties.
• Its vision is to provide decentralised world wide web by replacing
http protocol
• IPFS uses DHT and merkle directed acrylic graph to provide
storage and searching functionality

Juan Benet possesses both of these properties, and its vision is to provide a decentralized World Wide Web by replacing the HTTP protocol. IPFS uses Kademlia DHT and Merkle
Directed Acyclic Graphs (DAGs) to provide storage and searching functionality, respectively.
Blockchain and full ecosystem decentralization

● There are other alternatives for data storage, such as


Ethereum Swarm, Storj, and MaidSafe
● Ethereum has its own decentralized and distributed
ecosystem that uses Swarm for storage and the Whisper
protocol for communication
● BigChainDB is another storage layer decentralization project
aimed at providing a scalable, fast, and linearly scalable
decentralized database
Blockchain and full ecosystem decentralization

● Communication
○ The internet the communication layer in blockchain is
considered to be decentralised.
○ Services such as email and online storage are based on
service provider in control
○ on the unconditional trust of a central authority (the service
provider) where users are not in control of their data
○ Even user passwords are stored on trusted third-party
Blockchain and full ecosystem decentralization

● Communication
○ Alternative to ISP is to use mesh networks
○ Provides a decentralized alternative where nodes can talk
directly to each other without a central hub such as an ISP
● Computing power and decentralization
○ Achieved by a blockchain technology such as Ethereum,
where smart contracts with embedded business logic can run
on the blockchain network
Blockchain and full ecosystem decentralization
Questions

1. Illustrate the blockchain based decentralized system.


2. Explain how Proof of Stake can achieve consensus among peers.
3. Illustrate and explain how blockchain works using a neat diagram.
4. Explain the benefits, features and limitations of blockchain.
5. Explain consensus mechanisms used in blockchain. List out any six
consensus algorithms used in the context of blockchain.
6. Define blockchain. Explain how decentralization of computing or
processing power is achieved by a blockchain.
7. Explain the fundamental concepts of blockchain technology
Link to additional resources
Bitcoin Script: An Introduction For Beginners ([Link])
Ethereum Transactions Information | Etherscan
Ethereum Blocks #0 | Etherscan
[Link] Explorer | BCH | ETH | BCH

You might also like