Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views13 pages

Blockchain Module1

The document discusses blockchain technology, highlighting its nature as a distributed system and its core features such as decentralization, immutability, and consensus mechanisms. It outlines the history of blockchain, its generic elements, benefits, limitations, and various tiers of technology, from Blockchain 1.0 focused on cryptocurrencies to Blockchain 3.0 which extends to various industries. Additionally, it explains consensus mechanisms, emphasizing the importance of achieving agreement among nodes in a blockchain network.

Uploaded by

Spoorthi Harkuni
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)
8 views13 pages

Blockchain Module1

The document discusses blockchain technology, highlighting its nature as a distributed system and its core features such as decentralization, immutability, and consensus mechanisms. It outlines the history of blockchain, its generic elements, benefits, limitations, and various tiers of technology, from Blockchain 1.0 focused on cryptocurrencies to Blockchain 3.0 which extends to various industries. Additionally, it explains consensus mechanisms, emphasizing the importance of achieving agreement among nodes in a blockchain network.

Uploaded by

Spoorthi Harkuni
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/ 13

Blockchain Technology (BCS613A)

Module-1
Distributed systems
• The Blockchain is a distributed system at its core.
• It is a distributed ledger that can be centralized or decentralized.
• Distributed systems are a computing paradigm whereby two or more nodes work
with each other in a coordinated fashion to achieve a common outcome.
• It is modeled in such a way that end users see it as a single logical platform. For
example, Google's search engine is based on a large distributed system; however,
to a user, it looks like a single, coherent platform.
• All nodes in distributed systems are capable of sending and receiving messages to
and from each other. Nodes can be honest, faulty, or malicious, and they have
memory and a processor.
• A node that exhibits faulty behavior is also known as a Byzantine node after the
Byzantine Generals problem. This type of inconsistent behavior of Byzantine
nodes can be intentionally malicious, which is harmful to the operation of the
network. Any unexpected behavior by a node on the network, whether malicious
or not, can be categorized as Byzantine.
• A small-scale example of a distributed system is shown in the following diagram.
This distributed system has six nodes, out of which one (N4) is a Byzantine node
leading to possible data inconsistency. L2 is a link that is broken or slow, and this
can lead to a partition in the network, as shown in the Fig below.

Fig: Design of a distributed system: N4 is a Byzantine node and L2 is broken or a slow network link

• The primary challenge of a distributed system design is the coordination between


nodes and fault tolerance. Even if some of the nodes become faulty or network
links break, the distributed system should be able to tolerate this and continue to
work to achieve the desired result.
• Distributed systems are so challenging to design that a theory known as the CAP
theorem has been proven, which states that a distributed system cannot have all
three of the much-desired properties simultaneously; that is, consistency,
availability, and partition tolerance.

The history of blockchain and Bitcoin Blockchain was introduced with the invention of
Bitcoin in 2008. Its practical implementation then occurred in 2009.

Blockchain defined
Layman's definition: Blockchain is an ever-growing, secure, shared recordkeeping
system in which each user of the data holds a copy of the records, which can only be
updated if all parties involved in a transaction agree to update.

Technical definition: Blockchain is a peer-to-peer, distributed ledger that is


cryptographically secure, append-only, immutable (extremely hard to change), and
updateable only via consensus or agreement among peers.
Peer-to-peer: Peer-to-peer (P2P) means that there is no central controller in the
network, and all participants (nodes) talk to each other directly. This property allows for
transactions to be conducted directly among the peers without third-party involvement,
such as by a bank.
Distributed ledger: Blockchain is a "distributed ledger," which means that a ledger is
spread across the network among all peers in the network, and each peer holds a copy of
the complete ledger.
Cryptographically secure means that cryptography has been used to provide security
services that make this ledger secure against tampering and misuse. These services
include non-repudiation, data integrity, and data origin authentication.
Append-only: Another property that we encounter is that blockchain is "append-only,"
which means that data can only be added to the blockchain in time-sequential order. This
property implies that once data is added to the blockchain, it is almost impossible to
change that data and it can be considered practically immutable. In other words, blocks
added to the blockchain cannot be changed, which allows blockchain to become an
immutable and tamper-proof ledger of transactions.
However, it can be changed in rare scenarios wherein attack against the blockchain
network by bad actors succeeds in gaining more than 51 percent of the power.
Updatable via consensus: The most critical attribute of a blockchain is that it is
updateable only via consensus. This is what gives it the power of decentralization. In this
scenario, no central authority is in control of updating the ledger.

Generic elements of a blockchain


The structure of a generic blockchain can be visualized with the help of the following
diagram.
Fig: Generic Structure of a blockchain

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.
• 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. A block is composed of a block
header and a selection of transactions bundled together and organized logically.

Fig. The Generic Structure of a block


A block contains several elements, as follows:
1. A reference to a previous block is also included in the block unless it is a genesis
block. This reference is the hash of the header of the previous block. A genesis
block is the first block in the blockchain that is hardcoded at the time the
blockchain was first started. The structure of a block is also dependent on the type
and design of a blockchain.
2. A nonce is a number that is generated and used only once. A nonce is used
extensively in many cryptographic operations to provide uniqueness,
authentication, and encryption.
3. A timestamp is the creation time of the block.
4. Merkle root is a hash of all of the nodes of a Merkle tree.
5. Merkle trees are widely used to validate large data structures securely and
efficiently.
6. In addition to the block header, the block contains transactions that make up the
block body.
7. 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.
8. A block contains transactions and its size varies depending on the type and design
of the blockchain.
• 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.
• The scripting or programming language:
Scripts or programs perform various operations on a transaction in order to facilitate
various functions. For example, in Bitcoin, transaction scripts are predefined in a language
called Script, which consists of sets of commands that allow nodes to transfer bitcoins
from one address to another.
Script is a limited language, in the sense that it only allows essential operations that are
necessary for executing transactions, but it does not allow for arbitrary program
development. Hence not a Turing complete programming language.
• 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.
Various blockchains use virtual machines to run programs such as Ethereum Virtual
Machine (EVM) and Chain Virtual Machine (CVM). EVM is used in the Ethereum
blockchain.
• 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: These programs run on top of the blockchain and encapsulate the
business logic to be executed when certain conditions are met. These programs are
automatically executable. Smart contracts have many use cases, including but not limited
to identity management, capital markets, trade finance, record management, insurance,
and e-governance.
• 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 (lightweight
nodes), validation, and many other functions depending on the type of the blockchain
used and the role assigned to the node.
Nodes also perform a transaction signing function. 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. This asset is usually a token or virtual currency, such as Bitcoin.
A high-level diagram of blockchain architecture highlighting the key elements mentioned
previously is shown as follows:

Fig. Generic Structure of a blockchain network


The preceding diagram shows a four-node blockchain network (top), each maintaining a
chain of blocks, virtual machine, state machine, and address.
Features of a blockchain
The features of a blockchain are described here:

• Distributed consensus: Distributed consensus is the primary principle of a


blockchain. This mechanism allows a blockchain to present a single version of the
truth, which is agreed upon by all parties without the requirement of a central
authority.
• Transaction verification: 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.
• Platform for smart contracts: A blockchain is a platform on which programs can
run to execute business logic on behalf of the users this is a very desirable feature.
• Transferring value between peers: Blockchain enables the transfer of value
between its users via tokens. Tokens can be thought of as a carrier of value.
• Generation of cryptocurrency: A blockchain can create cryptocurrency as an
incentive to its miners who validate the transactions and spend resources to
secure the blockchain.
• Smart property: It is now 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. Digital Rights Management (DRM) schemes are being used currently
along with copyright laws.
• Provider of security: The blockchain is based on proven cryptographic
technology that ensures the integrity and availability of data. Other security
services, such as non-repudiation and authentication, are also provided by
blockchain, as all actions are secured using private keys and digital signatures.
• Immutability: This is another critical feature of blockchain: once records are
added to the blockchain, they are immutable. For example, with Bitcoin if a
malicious user wants to alter previous blocks, then it would require computing the
PoW once again for all those blocks that have already been added to the
blockchain. This difficulty makes the records on a blockchain essentially
immutable.
• Uniqueness: This blockchain feature ensures that every transaction is unique and
has not already been spent (double-spend problem).

Benefits and Limitations of Blockchain


The following are the benefits 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.
• 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. This redundancy results in high availability.
• Highly secure: All transactions on a blockchain are cryptographically secured and
thus provide network integrity.
• Simplification of current paradigms: The current blockchain model in many
industries, such as finance or health, is somewhat disorganized. However, 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.
• Faster dealings: In the financial industry, blockchain can play a vital role by
enabling the quick settlement of trades. Blockchain does not require a lengthy
process of verification 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 is required in the blockchain model, this can
massively eliminate overhead costs in the form of the fees which are paid to such
parties.

The following are the limitations of Blockchain:


• Scalability: Currently, blockchain networks are not as scalable as, for example,
current financial networks.
• Adoption: Eventhough this perspective is rapidly changing, there is still a long
way to go before the mass adoption of this technology. The challenge here is to
allow blockchain networks to be easier to use so that adoption can increase.
• Regulation: Due to its decentralized nature, regulation is almost impossible on
blockchain. This is sometimes seen as a barrier toward adoption because,
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. However, in blockchain networks, no such regulatory authority and
control exists, which is an inhibiting factor for many consumers.
• Relatively immature technology: As compared to traditional IT systems that
have benefited from decades of research, 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. This is
also a known concern and a lot of valuable research with some solutions has
already been developed. However, further research is still required to drive the
mass adoption of blockchain.
Tiers of Blockchain Technology
• Blockchain 1.0:
-This tier was introduced with the invention of Bitcoin, and it is primarily used for
cryptocurrencies. Also, as Bitcoin was the first implementation of
cryptocurrencies, it makes sense to categorize this first generation of blockchain
technology to include only cryptographic currencies.
-All alternative cryptocurrencies as well as Bitcoin fall into this category. It
includes core applications such as payments and applications.
-This generation started in 2009 when Bitcoin was released and ended in early
2010.
• Blockchain 2.0:
-This second blockchain generation is used by financial services and smart
contracts.
-This tier includes various financial assets, such as derivatives, options, swaps, and
bonds. Applications that go beyond currency, finance, and markets are
incorporated at this tier.
-Ethereum, Hyperledger, and other newer blockchain platforms are considered
part of Blockchain 2.0.
-This generation started when ideas related to using blockchain for other purposes
started to emerge in 2010.
• Blockchain 3.0:
-This third blockchain generation is used to implement applications beyond the
financial services industry and is used in government, health, media, the arts, and
justice.
-Again, as in Blockchain 2.0, Ethereum, Hyperledger, and newer blockchains with
the ability to code smart contracts are considered part of this blockchain
technology tier.
-This generation of blockchain emerged around 2012 when multiple applications
of blockchain technology in different industries were researched.
• Blockchain X.0:
-This generation represents a vision of blockchain singularity where one day there
will be a public blockchain service available that anyone can use just like the
Google search engine.
-It will provide services for all realms of society. It will be a public and open
distributed ledger running on a blockchain, making decisions, and interacting with
other intelligent autonomous agents on behalf of people, and regulated by code
instead of law or paper contracts.
-This does not mean that law and contracts will disappear, instead law and
contracts will be implementable in code.
Consensus in blockchain
• Consensus is a distributed computing concept that has been 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.
• The following describes the two main categories of consensus mechanisms:

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. This category is also referred to as the fully decentralized or
permissionless type of consensus mechanism. This type is well 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. This class of consensus is also known as the consortium or
permissioned type of consensus mechanism.

• BFT-based consensus mechanisms perform well when there are a limited number
of nodes, but they do not scale well.
• On the other hand, leader-election lottery-based (PoW) consensus mechanisms
scale very well but perform very slowly.
• The following includes all notable algorithms:
1. Proof of Work (PoW):
• 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.
• Successful against any collusion attacks on a blockchain
network, such as the Sybil attack.
2. Proof of Stake (PoS):
• This algorithm works on the idea that a node or user has an
adequate stake (means cryptocurrency) in the system;
• This idea was first introduced by Peercoin, and it is going to be
used in the Ethereum blockchain version called Serenity.
3. Delegated Proof of Stake (DPoS):
• This is an innovation over standard PoS.
• Each node that has a stake in the system can delegate the
validation of a transaction to other nodes by voting.
4. 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 election process via a guaranteed wait time.
• Used in Hyperledger, in the context of the Intel Sawtooth Lake
blockchain project.
5. 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.
6. Proof of Importance (PoI):
• PoI not only relies on how large a stake a user has in the system,
but it also monitors the usage and movement of tokens by the
user in order to establish a level of trust and importance.
• It is used in the NEM coin blockchain.
7. Federated consensus or federated Byzantine consensus:
• Nodes in this protocol retain a group of publicly-trusted peers
and propagate only those transactions that have been validated
by the majority of trusted nodes.
8. Reputation-based mechanisms:
• A leader is elected by the reputation it has built over time on the
network.
• It is based on the votes of other members.
9. Practical Byzantine Fault Tolerance (PBFT):
• This mechanism provides tolerance against Byzantine nodes.
• Byzantine nodes are those nodes which exhibit irrational
behaviour or misbehaviour, also known as malicious node.
10. Proof of Activity (PoA):
• In this scheme, PoW and PoS are combined together to achieve
consensus and a good level of security.
• This scheme is more energy efficient as PoW is used only in the
first stage of the mechanism; after the first stage, it switches to
PoS, which consumes negligible energy.
11. Proof of Capacity (PoC):
• This scheme uses hard disk space as a resource to mine the
blocks.
• This is different from PoW, where CPU resources are used.
• In PoC, hard disk space is utilized for mining and, as such, is also
known as hard drive mining.
• This concept was first introduced in the BurstCoin
cryptocurrency.
12. Proof of Storage:
• This scheme allows for the outsourcing of storage capacity.
• This scheme is based on the concept that a particular piece of
data is probably stored by a node, which serves as a means to
participate in the consensus mechanism.
13. Proof of Authority (PoA):
• This scheme utilizes the identity of the participants called
validators as a stake on the network.
• Validators are known and have the authority to propose new
blocks.
• Validators propose the new blocks and validate them as per
blockchain rules.
• Commonly used PoA algorithms are Clique and Aura.

Applications of Blockchain Technology:


Blockchain technology has numerous applications across different industries. Here are
some key ones:
1. Cryptocurrencies & Payments
• Bitcoin, Ethereum, and Other Cryptocurrencies – Enables decentralized digital
currencies without intermediaries.
• Cross-border Payments – Reduces transaction time and costs (e.g., Ripple for
international remittances).
2. Smart Contracts & Decentralized Finance (DeFi)
• Smart Contracts – Self-executing contracts with automated enforcement (e.g.,
Ethereum, Binance Smart Chain).
• DeFi (Decentralized Finance) – Lending, borrowing, and trading without banks
(e.g., Aave, Uniswap, MakerDAO).
3. Supply Chain Management
• Transparency & Traceability – Tracks goods from production to delivery (e.g.,
IBM Food Trust, VeChain).
• Fraud Prevention – Reduces counterfeit goods by verifying authenticity.
4. Healthcare
• Patient Records Management – Secure and tamper-proof storage of medical
records (e.g., Medicalchain).
• Drug Traceability – Prevents fake medicines by tracking pharmaceutical supply
chains.
5. Voting Systems
• Secure Digital Voting – Ensures transparency and prevents election fraud (e.g.,
Voatz, Follow My Vote).
6. Identity Management
• Decentralized Digital IDs – Provides users with control over personal data (e.g.,
Microsoft’s ION, Sovrin).
• KYC (Know Your Customer) Solutions – Streamlines identity verification for
banks and businesses.
7. Real Estate & Land Registration
• Property Ownership Records – Prevents fraud and speeds up transactions (e.g.,
Propy, Ubitquity).
• Smart Contracts for Buying & Selling Property – Eliminates middlemen and
reduces costs.
8. Gaming & NFTs (Non-Fungible Tokens)
• Play-to-Earn Games – Rewards players with crypto (e.g., Axie Infinity,
Decentraland).
• Digital Art & Collectibles – Ensures ownership and authenticity of digital assets
(e.g., OpenSea, Rarible).
9. Internet of Things (IoT) & Data Security
• Device-to-Device Transactions – Enables secure machine communication (e.g.,
IOTA, Helium).
• Cybersecurity – Prevents hacking and unauthorized access to data.
10. Government & Public Services
• Tax Collection & Fraud Prevention – Automates and secures tax records (e.g.,
Dubai’s blockchain strategy).
• Welfare & Aid Distribution – Ensures fair and transparent fund allocation (e.g.,
UN’s blockchain-based refugee aid).

CAP Theorem:
• The CAP theorem, also known as Brewer's theorem, was introduced by Eric
Brewer in 1998.
• The theorem states that any distributed system cannot have consistency,
availability, and partition tolerance simultaneously:
1. Consistency is a property that ensures that all nodes in a distributed
system have a single, current, and identical copy of the data.
2. Availability means that the nodes in the system are up, accessible for use,
and are accepting incoming requests and responding with data without any
failures as and when required. In other words, data is available at each node
and the nodes are responding to requests.
3. Partition tolerance ensures that if a group of nodes is unable to
communicate with other nodes due to network failures, the distributed
system continues to operate correctly. This can occur due to network and
node failures.
A Venn diagram is commonly used to visualize the CAP theorem:
Figure: CAP theorem
The preceding diagram shows that only two properties at a time can be achieved. Either
AP, CA, or CP.
In summary:
1. If we opt for CP (consistency and partition tolerance), we sacrifice availability.
2. If we opt for AP (availability and partition tolerance), we sacrifice consistency.
3. If we opt for AC (availability and consistency), we sacrifice partition tolerance.
Usually, a network partition cannot be ignored; therefore, the choice mostly becomes
either consistency or availability in the case of a network partition.
In blockchains, consistency is sacrificed in favour of availability and partition
tolerance. In this scenario, Consistency (C) on the blockchain is not achieved
simultaneously with Partition tolerance (P) and Availability (A), but it is achieved over
time. This is called eventual consistency, where consistency is achieved as a result of
validation from multiple nodes over time.
It means that there can be a temporary disagreement between nodes on the final
state, but it is eventually agreed upon. For example, in Bitcoin, multiple transaction
confirmations are required to achieve a good level of confidence that transactions may
not be rolled back in the future and eventually a consistent view of transaction history is
available to all nodes. Multiple confirmations of a transaction over time provide
eventual consistency in Bitcoin.

You might also like