KEMBAR78
Fundamentals of Blockchain | PDF | Cryptocurrency | Computer Network
100% found this document useful (1 vote)
133 views57 pages

Fundamentals of Blockchain

Fundamentals of blockchain

Uploaded by

falep97691
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
100% found this document useful (1 vote)
133 views57 pages

Fundamentals of Blockchain

Fundamentals of blockchain

Uploaded by

falep97691
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
You are on page 1/ 57

MODULE 2

FUNDAMENTALS OF BLOCKCHAIN TECHNOLOGY

 Blockchain – Definition, architecture, elements of blockchain, benefits and

limitations, types of blockchain.

 Consensus – definition, types, consensus in blockchain.

 Decentralization – Decentralization using blockchain, Methods of decentralization,

Routes to decentralization, Blockchain and full ecosystem decentralization.


BLOCK CHAIN

 A blockchain is a constantly growing ledger which keeps a permanent record of all the transactions that have

taken place in a secure, chronological, and immutable way.

• Ledger: It is a file that is constantly growing.

• Permanent: It means once the transaction goes inside a blockchain, you can put up it permanently in the ledger.

• Secure: Blockchain placed information in a secure way. It uses very advanced cryptography to make sure that the

information is locked inside the blockchain.

• Chronological: Chronological means every transaction happens after the previous one.

• Immutable: It means as you build all the transaction onto the blockchain, this ledger can never be changed.
 A blockchain is a chain of blocks which contain information. Each block records all of

the recent transactions, and once completed goes into the blockchain as a permanent
database. Each time a block gets completed, a new block is generated.
NETWORK VIEW OF A BLOCKCHAIN
NETWORK VIEW OF A BLOCKCHAIN

 Internet : provides a basic communication layer for any network.

 A peer-to-peer network runs on top of the internet, which hosts another layer of

blockchain.

 That layer contains transactions, blocks, consensus mechanisms, state machines, and

blockchain smart contracts

 At the top, there are users or nodes that connect to the blockchain and perform various

operations such as consensus, transaction verification, and processing.


GENERIC STRUCTURE OF A
BLOCKCHAIN

 Block : a selection of transactions bundled together and organized

logically.

 A transaction is a record of an event, for example, the event of transferring

cash from a sender's account to a beneficiary's account.


GENERIC STRUCTURE OF A
BLOCKCHAIN

 A genesis block is the first block in the blockchain that is hardcoded at the
time the blockchain was first started.
 Block header and Block Body
 Block header is composed of of pointer to previous block, the timestamp,
nonce, Merkle root, and the block body that contains transactions.
 A nonce is a number that is generated and used only once to (provide replay
protection, authentication, and encryption)
 Merkle root is a hash of all of the nodes of a Merkle tree.
GENERIC ELEMENTS OF A BLOCKCHAIN
GENERIC ELEMENTS OF A BLOCKCHAIN

 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 new address is generated for each transaction, and it is unique.
 A good practice is for users to generate a new address for each transaction in order
to avoid linking transactions to the common owner, thus preventing identification.
 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.
GENERIC ELEMENTS OF A BLOCKCHAIN

 Node: A node in a blockchain network performs various functions such as propose and
validate transactions and perform mining to facilitate consensus and secure the
blockchain.
 Nodes are either miners who create new blocks and mint cryptocurrency (coins) or block
signers who validates and digitally sign the transactions.
 Transactions are first created by nodes and then also digitally signed by nodes using
private keys as proof that they are the legitimate owner of the asset that they wish to
transfer to someone else on the blockchain network.
 Other function :simple payment verification (lightweight nodes), validation, transaction
signing function
GENERIC ELEMENTS OF A BLOCKCHAIN

 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.
 Use cases (identity management, trade finance, record management, insurance, and
e-governance.
 Peer-to-peer network: As the name implies, a peer-to-peer network is a network
topology wherein all peers can communicate with each other and send and receive
messages.
 Scripting or programming language: Scripts or programs perform various
operations on a transaction in order to facilitate various functions.
GENERIC ELEMENTS OF A BLOCKCHAIN

 Virtual machine: 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, while 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
whereby 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.
BENEFITS AND LIMITATIONS 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: Because blockchains are shared and everyone can see what
is on the blockchain, this allows the system to be transparent. As a result, trust is
established.
Immutability: Once the data has been written to the blockchain, it is extremely
difficult to change it back. It is not genuinely immutable, but because changing data is
so challenging and nearly impossible, this is seen as a benefit to maintaining an
immutable ledger of transactions.
BENEFITS AND LIMITATIONS OF BLOCKCHAIN

 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.
Even if some nodes leave the network or become inaccessible, the network as a whole
continues to work, thus making it highly available.
 Highly secure: All transactions on a blockchain are cryptographically secured and thus
provide network integrity.
 Simplification of current paradigms: as a 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.
BENEFITS AND LIMITATIONS OF BLOCKCHAIN

 Faster dealings: Blockchain does not require a lengthy process of verification, 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.
BENEFITS AND LIMITATIONS OF BLOCKCHAIN

 The most sensitive blockchain problems are as follows:


• Scalability
• Adaptability
• Relatively immature technology
• Privacy
BASED ON ACCESSIBILITY, BLOCK CHAIN CLASSIFIED AS

 Permissioned

It is also known as trustless or public blockchains, are available to everyone to participate in the

blockchains process that use to validate transactions and data. These are used in the network where

high transparency is required.

 Permissionless

These are the closed network only a set of groups are allowed to validate transactions or data in a given

blockchain network. These are used in the network where high privacy and security are required.
TYPES OF BLOCKCHAIN

 Public Blockchain.

 Private Blockchain.

 Hybrid Blockchain.

 Consortium Blockchain.
1. Public Blockchain
 These blockchains are completely open to following the idea of decentralization.
They don’t have any restrictions, anyone having a computer and internet can
participate in the network.
 Examples of public blockchain are Bitcoin, Ethereum.
2. Private Blockchain
 These blockchains are not as decentralized as the public blockchain only selected
nodes can participate in the process, making it more secure than the others.
 An example of private blockchains is Hyperledger, Corda.
3. Hybrid Blockchain
 It is the mixed content of the private and public blockchain, where some part is
controlled by some organization and other makes are made visible as a public
blockchain.
 Examples of Hybrid Blockchain are Ripple network and XRP token.
4. Consortium Blockchain
 It is a creative approach that solves the needs of the organization. This blockchain
validates the transaction and also initiates or receives transactions. It also known as
Federated Blockchain. Some part is public and some part is private
 Examples of consortium Blockchain are Tendermint and Multichain.
CONSENSUS MECHANISM

 Blockchains are decentralized, so no single entity is allowed to set the truth. All the

participating entities (computers) usually do not know each other; thus, determining who
is telling the truth or has the correct set of data becomes difficult. This is where a
consensus mechanism is required, which helps these computers agree on the truth.

 The general purpose of a consensus mechanism is to manage which participant in the

network gets to set the state of truth which everyone else follows and agrees on.

 A consensus mechanism is a set of steps that are taken by most or all nodes in a

blockchain to agree on a proposed state or value.


TYPES OF CONSENSUS MECHANISMS

1. PoW: Proof of Work is the first and most recognizable consensus mechanism
developed by Bitcoin's founder Satoshi Nakamoto. In PoW, miners compete with each
other to find the transaction hash, and the miner who finds the hash first is allowed to
add the transaction to a block and then mine the block. The process of finding the block
hash is very computation-intensive; having a high hash rate is aimed by the miners and
thus generates more rewards.
2. PoS: Proof of Stake (PoS) is a consensus mechanism used in blockchain
technologies like Ethereum where participants validate transactions and
create new blocks based on the amount of cryptocurrency they hold.
3. DPoS: Delegated Proof of Stake (DPoS) is a consensus mechanism that involves a
smaller group of “delegates” who are elected by token holders to validate transactions
and produce new blocks.

4. PoH: Proof of History (PoH) is a relatively new consensus mechanism in blockchain


technology that focuses on the order and timestamping of transactions. It uses
a verifiable delay function to establish a reliable timeline for transactions, preventing
double spending and ensuring the integrity of the blockchain.
TYPES OF CONSENSUS MECHANISMS

5. Traditional Byzantine Fault Tolerance (BFT)-based: this method relies on a simple scheme

of nodes that are publisher-signed messages. Eventually, when a certain number of messages are

received, then an agreement is reached.

6. Leader election-based consensus mechanisms: This arrangement requires nodes to compete

in a leader-election lottery, and the node that wins proposes a final value.
7. Proof of Authority (PoA)

Proof of Authority (PoA) is a consensus mechanism used in blockchain technology


where a centralized group of pre-selected validators are responsible for validating
transactions and maintaining the integrity of the blockchain.
ASSIGNMENT 2

 Describe the different tiers of blockchain


 Differentiate symmetric and asymmetric ciphers
 Describe the features of blockchain
 Implement DES in Java/Python/C
CONSENSUS MECHANISMS IN BLOCKCHAIN

 Consensus mechanisms in blockchain are fundamental rules or protocols designed to

achieve agreement among network participants on the state of a distributed ledger.


They are responsible for validating transactions, adding new blocks to the chain and
maintaining security in a decentralized system.
 Consensus mechanisms maintain decentralization, security, and efficiency

in blockchain networks by preventing double spending and ensuring the


integrity of transactions.

 Different consensus mechanisms offer various trade-offs between

scalability, energy consumption, and security, making it essential to


choose the right one for your specific blockchain application.
ADVANTAGES AND DISADVANTAGES OF DIFFERENT CONSENSUS MECHANISMS

Consensus
Advantages Disadvantages
Mechanism
PoW is highly secure and has been successfully It is energy-intensive and may not be the most
Proof of implemented in Bitcoin and Ethereum. It provides a environmentally friendly option. It also requires a
Work (PoW) transparent and democratic process where anyone with high level of computational power, which can
computational resources can participate in the network. lead to centralization.
PoS is less energy-intensive than PoW and promotes
But, it may foster inequality since those with
Proof of decentralization by allowing anyone with a certain
more tokens have a greater chance of earning
Stake (PoS) amount of tokens to participate. It’s also more scalable,
rewards.
allowing for faster transactions.
Delegated DPoS provides high scalability and faster block On the downside, it can lead to centralization due
Proof of times through a democratic system where token to the concentration of power among a small
Stake holders vote for a select group of validators. It’s also group of delegates. It may also be prone to
(DPoS) less energy-intensive than PoW. manipulation if delegates collude.
PoA is centralized and relies on trust
PoA is highly scalable and allows for fast transaction
in the chosen validators. This can
Proof of Authority times. It’s also energy-efficient, as it depends on a pre-
make it less secure than other
(PoA) selected set of validators rather than a competition of
consensus mechanisms and more
resources.
vulnerable to attacks.
But, as a new mechanism, PoH is less
PoH is a new consensus mechanism that doesn’t require
tested and may contain unknown
Proof of History validators to keep a full record of the blockchain, which
vulnerabilities. It also relies on the
(PoH) can make it faster and more scalable. It also ensures
accuracy of timestamps, which can be
transaction order to prevent double-spending.
manipulated.
CHOOSING THE RIGHT CONSENSUS MECHANISM FOR YOUR
BLOCKCHAIN APPLICATION
 Level of decentralization: Evaluate how important decentralization is for your application. Some
consensus mechanisms, like Proof of Work (PoW), offer a high level of decentralization as anyone can
participate in the mining process. On the other hand, consensus mechanisms like Proof of Authority
(PoA) rely on a centralized group of validators.
 Scalability: Consider the scalability requirements of your application. Some consensus mechanisms,
like PoW, can be resource-intensive and may not be suitable for high transaction volumes. Other
mechanisms, like Delegated Proof of Stake (DPoS), may offer faster transaction times and higher
throughput.
 Security: Assess the level of security provided by different consensus mechanisms. PoW is often
considered highly secure due to its computational requirements and network size. PoS mechanisms
also provide security through economic incentives and penalties for malicious behavior.
 Energy efficiency: Take into account the energy consumption associated with different consensus
mechanisms. PoW has faced criticism for its high energy use, while PoS can be more energy-efficient
since it does not require extensive computational power.
Governance model: Consider how decisions are made within the blockchain network. DPoS
allows token holders to elect delegates who make decisions on their behalf, while other
mechanisms may have a more centralized governance structure.
Sybil resistance: Evaluate how well the consensus mechanism prevents Sybil attacks, where an
attacker creates multiple identities to gain control over the network. Mechanisms like DPoS and
PoA rely on reputation or authority to prevent such attacks.
Cost-effectiveness: Determine the cost-effectiveness of each consensus mechanism based on
factors such as hardware requirements, operational costs, and potential rewards for participants.
Compatibility with smart contracts: If your application requires smart contract functionality,
ensure that the chosen consensus mechanism supports it effectively without compromising
security or scalability.
DECENTRALIZATION

 The basic idea of decentralization is to distribute control and authority to the

peripheries of an organization instead of one central body being in full


control of the organization.

 several benefits for organizations, such as increased efficiency, expedited

decision making, better motivation, and a reduced burden on top


management.
DECENTRALIZATION USING BLOCKCHAIN

 Information and Communication Technology (ICT) has conventionally been based

on a centralized paradigm whereby database or application servers are under the control
of a central authority, such as a system administrator.

 With Bitcoin and the advent of blockchain technology, this model has changed and now

the technology exists, which allows anyone to start a decentralized system and operate it
with no single point of failure or single trusted authority.
DECENTRALIZATION USING BLOCKCHAIN

 The following diagram shows the different types of systems that currently exist: central,

decentralized, and distributed.


CENTRALIZED SYSTEMS

 conventional (client-server) IT systems in which there is a single authority that

controls the system, and who is solely in charge of all operations on the system.

 All users of a centralized system are dependent on a single source of service.

 The majority of online service providers including Google, Amazon, eBay, Apple's

App Store, and others use this conventional model for delivering services.
DISTRIBUTED SYSTEM

 Data and computation are spread across multiple nodes in the network. Sometimes, this
term is confused with parallel computing.
 The main difference between these systems is that in a parallel computing system,
computation is performed by all nodes simultaneously in order to achieve the result; for
example, parallel computing platforms are used in weather research and forecasting,
simulation and financial modeling.
 On the other hand, in a distributed system, computation may not happen in parallel and
data is replicated across multiple nodes that users view as a single, coherent system.
 In the parallel system model, there is still a central authority that has control over all
nodes, which governs processing. This means that the system is still centralized in nature.
DISTRIBUTED SYSTEM VS DECENTRALIZED
SYSTEM

 The critical difference between a decentralized system and distributed system is

that in a distributed system, there still exists a central authority that governs the
entire system; whereas, in a decentralized system, no such authority exists.
DECENTRALIZED SYSTEM

 A type of network where nodes are not dependent on a single master node; instead,

control is distributed among many nodes.

 A significant innovation in the decentralized paradigm that has given rise to this new

era of decentralization of applications is decentralized consensus.

 This mechanism came into play with Bitcoin, and it enables a user to agree on

something via a consensus algorithm without the need for a central, trusted third party,
intermediary, or service provider.
METHODS OF DECENTRALIZATION

Two methods can be used to achieve decentralization:

1. disintermediation

2. competition (Contest-driven decentralization).


DISINTERMEDIATION

 The intermediary; eg: bank, is no longer required

 Decentralization is achieved by disintermediation.

 It is debatable, however, how practical decentralization through


disintermediation is in the financial sector due to massive regulatory and
compliance requirements.
CONTEST-DRIVEN DECENTRALIZATION

 In the method involving competition, different service providers compete with each

other in order to be selected for the provision of services by the system.

 In the context of blockchain technology, a system can be envisioned in which smart

contracts can choose an external data provider from a large number of providers based
on their reputation, previous score, reviews, and quality of service.

 This method will not result in full decentralization, but it allows smart contracts to

make a free choice based on the criteria just mentioned.


Scale of decentralization
 On the left-hand side, the conventional approach is shown where a central system is in control; on the

right-hand side, complete disintermediation is achieved as intermediaries are entirely removed.


Competing intermediaries or service providers are shown in the center. At that level, intermediaries or
service providers are selected based on reputation or voting, thus achieving partial decentralization.
DECENTRALIZATION

Advantages disadvantages

 transparency,  security requirements,

 efficiency,  software bugs,

 cost saving,  human errors

 development of trusted
ecosystems, privacy and
anonymity,
ROUTES TO DECENTRALIZATION

 BitTorrent and the Gnutella file sharing system, which to a certain degree could be

classified as decentralized (existed before bitcoin and blockchain)

 Bitcoin was the first choice

 Ethereum has become a more prominent choice because of the flexibility it allows for

programming any business logic into the blockchain.


DECENTRALIZATION FRAMEWORK

 A money transfer system as an example of an application selected to be decentralized.

The four questions discussed previously are used to evaluate the decentralization
requirements of this application. The answers to these questions are as follows:

 What is being decentralized? : Money transfer system

 What level of decentralization is required? : Disintermediation

 What blockchain is used? : Bitcoin

 What security mechanism is used? : Atomicity


BLOCKCHAIN AND FULL ECOSYSTEM
DECENTRALIZATION

 To achieve complete decentralization, it is necessary that the environment

around the blockchain also be decentralized.

 The blockchain is a distributed ledger that runs on top of conventional

systems.

 These elements include storage, communication, and computation.


STORAGE

 Data can be stored directly in a blockchain, and with this fact it achieves

decentralization.

 A significant disadvantage of this approach is that a blockchain is not suitable

for storing large amounts of data by design.

 A better alternative for storing data is to use Distributed Hash Tables (DHTs)

 DHTs were used initially in peer-to-peer file sharing software, such as

BitTorrent, Napster, Kazaa, and Gnutella.


STORAGE

 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.

 InterPlanetary File System (IPFS) by 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 Graph (DAG) to provide

storage and searching functionality, respectively.


COMMUNICATION

 The original vision of the internet was to develop a decentralized communications system.

 Services such as email and online storage are now all based on a paradigm where the

service provider is in control, and users trust such providers to grant them access to the
service as requested.

 This model is based on 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 systems.


COMMUNICATION

 Access to the internet (the communication layer) is based on Internet Service

Providers (ISPs) who act as a central hub for internet users.

 Over the years, with the advent of large-scale service providers such as Google,

Amazon, and eBay, control is shifting towards these big players.

 For example, email is a decentralized system at its core; that is, anyone can run

an email server with minimal effort and can start sending and receiving emails.
COMPUTING POWER AND DECENTRALIZATION
COMPUTING POWER AND DECENTRALIZATION

 At the bottom layer, the internet or Meshnets provide a decentralized communication


layer.
 On the next layer up, a storage layer uses technologies such as IPFS and BigchainDB to
enable decentralization.
 Finally, at the next level up, you can see that blockchain serves as a decentralized
processing (computation) layer.
 Blockchain can, in a limited way, provide a storage layer too, but that severely hampers
the speed and capacity of the system.
 Therefore, other solutions such as IPFS and BigchainDB are more suitable to store large
amounts of data in a decentralized way.

You might also like