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

Ppt-2 Blockchain Structure

Blockchain uses a structure of blocks and transactions to form a tamper-proof ledger. Each block contains a header with metadata like a timestamp and reference to the previous block, ensuring chronological order. Transactions are organized into a Merkle tree for validation. Miners compete to validate blocks through proof-of-work or proof-of-stake algorithms, earning rewards to incentivize participation and secure the network through consensus.

Uploaded by

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

Ppt-2 Blockchain Structure

Blockchain uses a structure of blocks and transactions to form a tamper-proof ledger. Each block contains a header with metadata like a timestamp and reference to the previous block, ensuring chronological order. Transactions are organized into a Merkle tree for validation. Miners compete to validate blocks through proof-of-work or proof-of-stake algorithms, earning rewards to incentivize participation and secure the network through consensus.

Uploaded by

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

BLOCKCHAI

N
STRUCTURE
Athira Jayavarma
Dept. of EEE
Blockchain
Structure
Two components:
o Block header
oList of Transactions
Previous Block Hash(Parent hash)

oEvery block inherits from the previous block

oWe use the previous block’s hash to create

the new block’s hash

oMakes the blockchain tamperproof


Block Number: A unique identifier assigned to the block, indicating its position within
the blockchain's sequence.

Timestamp: The timestamp denotes the time when the block was created or added
to the blockchain. It helps establish the chronological order of blocks.

Nonce: A nonce (number used once) is a value that miners or validators modify
during the block creation process to meet certain criteria, such as the difficulty level of
the consensus algorithm.

Difficulty Target: The difficulty target is a value that defines the level of difficulty
miners or validators must meet to create or validate a block. It ensures that block
creation or validation requires a certain amount of computational work, contributing
•The difficulty is adjusted periodically (usually every few blocks) to ensure that the
average time between blocks remains relatively constant over time.
•The difficulty level and the target value have an inverse relationship. The lower the
target value, the higher the difficulty, and the more repetitions of the hash function
a miner must go through to find a valid block hash.
•Higher Difficulty: A lower target value means miners need to find a block hash with
more leading zeros, which is more challenging. This requires more computational
effort, as miners have to try many different nonce values and hash combinations to
find a valid hash.
•Lower Difficulty: A higher target value means miners need to find a block hash with
fewer leading zeros, which is easier. This requires less computational effort, as
miners have a larger range of valid hash values they can find with various nonce
values.
Merkel Tree Root
The transactions are organized in a Merkel Tree Structure.
The root of the Merkel Tree is the verification of all the transactions.
•The Merkle root hash is a cryptographic hash that represents all the transactions
included in a block.

•It is computed by creating pairs of transaction hashes, hashing them together, and then
repeating this process until a single hash (the Merkle root) is obtained.

•Each block contains a Merkle tree (also known as a binary hash tree) of all its
transactions, with the Merkle root at the top.

•Miners must calculate the Merkle root hash for the selected transactions and include it
in the block header.

•This Merkle root serves as a summary of all the transactions included in the block. By
having the Merkle root hash, other nodes on the network can efficiently verify that the
transactions are valid and have not been tampered with.
Merkle trees benefits:

•Verification of data integrity.

•Reduced storage

•security
Block Header
Distributed
Consensus
A procedure to reach in a common agreement in a
decentralized platform

Important for a message passing environment

Why consensus?

 Ensure correct operation in the presence of


faulty individuals – Reliability and Fault
Tolerance In a distributed system.
Properties of Distributed Consensus
Termination- Every correct individual decides some value at the end of the consensus protocol.

Validity-The value or decision agreed upon should be a valid and legitimate value within the system's rules

Integrity- The consensus process should be secure and protect against unauthorized modifications or
tampering of data. Nodes should not be able to maliciously manipulate the agreed-upon value.

Agreement- Every correct individual must agree on the same value.


Proof of Work (PoW)
Proof of Work (PoW) is a consensus algorithm used in blockchain networks to validate transactions
and maintain the integrity of the distributed ledger.

The main idea behind PoW is to require participants, known as miners, to solve a computational
puzzle in order to add new blocks to the blockchain.

Cryptocurrencies like Litecoin, and Bitcoin are currently using PoW. Ethereum was using PoW
mechanism, but now shifted to Proof of Stake(PoS).

The Proof of Work consensus algorithm involves solving a computationally challenging puzzle in
order to create new blocks in the Bitcoin blockchain.
steps
1. Transactions are broadcasted to the network and collected into a block.

2. Miners compete to solve a computationally intensive mathematical puzzle, which


involves finding a hash value that meets certain criteria. In the case of Bitcoin,
miners need to find a hash value that, when combined with the block's data,
produces a hash with a specific number of leading zeros.

3. Miners use their computational power to perform numerous calculations, trying


different values (nonce) to find a hash that satisfies the required criteria. The
process is known as ‘mining’, and the nodes in the network that engages in
mining are known as ‘miners’.
4. The first miner to find a valid hash is rewarded and broadcasts the solution to
the network. Other miners can quickly verify the solution to confirm its validity.

5. Once the solution is verified, the winning miner adds the block, to the
blockchain. The block contains the validated transactions, a timestamp, and the
hash of the previous block, which links the new block to the existing chain.

6. The other nodes in the network update their copy of the blockchain to include
the new block and continue the process, starting from step 1.
The proof of work lies in the fact that miners need to invest computational
resources (computing power and energy) to solve the puzzle.

The difficulty changes for every 2016 blocks

This ensures that adding new blocks to the blockchain requires real-world effort,
making it difficult for malicious actors to manipulate the system.

As long as the majority of miners are honest and control more computational
power than any potential attacker, the blockchain remains secure.

Attempting to alter a previously validated block would require an enormous


amount of computational power, making it practically infeasible.
The incentive for mining transactions lies in economic payoffs, where competing
miners are rewarded with 6.25 bitcoins and a small transaction fee.

This reward will get reduced by half its current value with time.

Security, incentives for participants are some of the advantages ,moreover, High
energy consumption,hardware requirements,scalabilty are some of the challenges.
Proof of Stake (PoS)
•Proof of Stake (PoS) is a consensus algorithm used in blockchain networks as an
alternative to Proof of Work (PoW).

•Instead of relying on computational work and energy consumption, PoS determines


the creator of the next block in the blockchain based on the amount of
cryptocurrency (stake) a participant holds and is willing to "stake" as collateral.
PoS Working:
1) Validators: In a PoS system, participants are called validators instead of miners. Validators are
individuals or entities that hold a certain amount of cryptocurrency as a stake in the network.

2) Selection of Validator: The selection of the validator who gets to create the next block is usually
done through a deterministic process that takes into account the amount of stake held by each
participant. The more cryptocurrency a validator holds, the higher the probability of being selected
as the block creator.

3) Block Creation: The chosen validator creates the next block by adding transactions to the
blockchain. The validator verifies the transactions and proposes the new block to the network.
4) Block Validation: Other validators in the network then validate the proposed block and check for its
correctness. They ensure that the proposed block follows the consensus rules, including the
validity of transactions and the order of blocks.

5) Consensus and Rewards: If the proposed block is validated by a sufficient number of other
validators and reaches consensus, it is added to the blockchain. The validator who created the
block is rewarded with transaction fees and newly minted cryptocurrency as an incentive for their
participation and contribution to the network.

6) Block Finality: PoS systems usually have a process for finalizing blocks, which adds an additional
layer of security and ensures that blocks cannot be easily reversed or modified. Finality helps
achieve faster confirmation times for transactions.
•Energy efficiency,Scalability are some of the advantages

•Wealth accumulation, Centralization risks are some of the challenges.


Delegated Proof of Stake
(DPoS)
•Delegated Proof of Stake (DPoS) is a consensus algorithm used in blockchain networks that
combines elements of both Proof of Stake (PoS) and representative democracy (users of the
network vote and elect delegates to validate the next block).

• It was introduced to address some of the limitations of traditional PoS, such as scalability
and potential centralization.

•In DPoS, token holders in the network can vote to elect a limited number of delegates or
"witnesses."

•These witnesses are responsible for producing blocks and validating transactions on behalf
of the network.

•The selected witnesses take turns in producing blocks in a round-robin fashion.


DPoS Working
I. Token Holders and Voting: Token holders in the network have the ability to vote for
delegates/witnesses who will represent their interests in block production and
transaction validation. The number of witnesses is typically limited, often ranging
from a few to a couple of dozen.

II. Delegate Selection: The voting process determines which participants become
delegates. Those with the highest number of votes are typically elected as witnesses.
The weight of a vote can be proportional to the stake held by the voter, although
some DPoS implementations may consider other factors like reputation or expertise.
III. Block Production and Validation: The elected delegates take turns in producing blocks and
validating transactions. Each delegate has a predefined time slot during which they are
responsible for creating a block. They include verified transactions, timestamp the block, and
propose it to the network.

IV. Block Confirmation: Once a block is proposed, other delegates in the network validate its
correctness and confirm its validity. This consensus process helps ensure that only valid
transactions are added to the blockchain.
V. Block Finality: DPoS systems often employ mechanisms for quick finality of
blocks, reducing the chances of chain reorganizations or forks. This means that
confirmed blocks are unlikely to be reversed, providing faster transaction
confirmations and improved network efficiency.

VI. Rewards and Incentives: Witnesses or delegates are typically rewarded for their
block production and validation activities. They may receive transaction fees
associated with the blocks they produce, and some DPoS systems may also
allocate a portion of newly minted tokens as rewards.
•Scalability, Energy efficiency, Governance and flexibility are some of the advantages

•Centralization risks, Reliance on trust etc are some of the disadvantages.


Practical Byzantine Fault Tolerance (PBFT)
•Practical Byzantine Fault Tolerance (PBFT) is a consensus algorithm designed to achieve
consensus in distributed systems where some participants may exhibit Byzantine faults.

•Byzantine faults refer to arbitrary and malicious behavior, such as sending conflicting
information, delaying or dropping messages, or colluding to disrupt the system.

•PBFT was introduced by Castro and Liskov in 1999 and has been widely used in various
blockchain and distributed systems to ensure the integrity and consistency of
replicated state machines.

• It is often used in permissioned or private blockchain networks where the number of


participating nodes is known and trusted.
An overview of PBFT working:
a. Node Setup: The system consists of a set of replicas (nodes) that communicate
with each other to reach consensus. These replicas are identified as a primary
node(leader) and a set of backup nodes.

b. Request and Pre-Prepare Phase: A client initiates a request by sending it to the


primary node. The primary node assigns a sequence number to the request and
broadcasts a "pre-prepare" message containing the request and the assigned
sequence number to all the backup nodes.
•Prepare Phase: In the Prepare phase, each replica receives the Pre-Prepare
messages from the primary and the other replicas.Upon receiving a Pre-Prepare
message, a replica checks the validity of the message, including the digest and
sequence number.If the Pre-Prepare message is valid, the replica sends a Prepare
message to all other replicas, indicating that it has accepted the proposed command
and agrees with its sequence number.
Commit phase: The final phase of the PBFT consensus algorithm. Upon receiving a
Prepare message from a quorum of replicas (a majority of replicas in the system),
each replica sends a Commit message to all other replicas. When a replica receives
Commit messages from a quorum of replicas, it knows that the command has been
accepted by a majority and can be executed safely. The replica then applies the
command to its local state machine, updating its state accordingly. Once a replica has
executed the command, it sends a reply to the client acknowledging the completion of
the operation.
Proof of Authority (PoA)
•Proof of Authority (PoA) is a consensus algorithm used in blockchain networks that relies
on a set of approved validators, often called authorities, to validate and confirm
transactions and create new blocks. Validators are preselected and appointed by the
network administrators or consortium members.

• Unlike Proof of Work (PoW) or Proof of Stake (PoS), where participants compete based
on computational power or stake, PoA relies on the identity and reputation of the
validators.
PoA Working:
a) Validators: A limited number of validators or authorities are pre-selected and known in
advance. These validators are typically trusted entities or individuals who have been
authorized to participate in block validation and consensus.

b) Block Validation: Validators take turns proposing and validating blocks. Each validator has
the authority to create blocks and verify the transactions within those blocks.

c) Consensus: Consensus is achieved when a majority of validators agree on the validity of a


proposed block. Validators, being trusted entities, are expected to act honestly and
follow the consensus rules.
d) Block Finality: Once a block is validated and accepted by the majority of
validators, it is considered final and added to the blockchain. Finality ensures that
the transactions within the block are confirmed and cannot be easily reversed.

•Efficiency, Scalability, and Governance are some of the advantages

•Centralization, Trust assumption, and Lack of permissionless participants are some


of the disadvantages

You might also like