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

Module 1 Blockchain

The document provides an overview of blockchain technology, focusing on its foundation in distributed systems and the historical development leading to its inception with Bitcoin in 2009. It outlines key concepts such as the characteristics of distributed systems, the significance of consensus mechanisms, and the essential elements of a blockchain structure. Additionally, it discusses the challenges of accountability and anonymity in electronic cash systems, which blockchain technology aims to address.

Uploaded by

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

Module 1 Blockchain

The document provides an overview of blockchain technology, focusing on its foundation in distributed systems and the historical development leading to its inception with Bitcoin in 2009. It outlines key concepts such as the characteristics of distributed systems, the significance of consensus mechanisms, and the essential elements of a blockchain structure. Additionally, it discusses the challenges of accountability and anonymity in electronic cash systems, which blockchain technology aims to address.

Uploaded by

Prathishta Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Blockchain Technology (BCS613A)

Module 1
Distributed Systems
 Understanding distributed systems is essential for understanding blockchain.
 Blockchain is a distributed system.
 It is a distributed ledger that can be centralized or decentralized.
 A blockchain is usually used as a decentralizedplatform.
 It can be thought of as a system that has properties of the both decentralized
anddistributed paradigms.
 It is a decentralized-distributed system.
 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.
 A node can be defined as an individual player in a distributed system.
 All nodes 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 irrational behavior is also known as a Byzantine node after the
Byzantine Generals problem.
 Inconsistent behavior of Byzantine nodes can be intentionally malicious, which
is detrimental to the operation of the network.
 Any unexpected behavior by a node on the network, whether malicious or not, can be
categorized as Byzantine.

Example of Distributed System


A small-scale example of a distributed system is shown in the Figure 1.1.

Figure 1.1: Design of a distributed system: N4 is a Byzantine node and L2 is broken or a


slow network link

Department of CSE Page 1


Blockchain Technology (BCS613A)

 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.
 The primary challenge of a distributed system design is the coordination between nodes
and fault tolerance.
 Even if some (a certain threshold dictated by the consensus protocol) of the
nodes become faulty or network links break, the distributed system should be able to
toleratethis and continue to work to achieve the desired result.
 This problem has been an active areaof distributed system design research for many
years, and several algorithms and mechanismshave been proposed to overcome these
issues.
 Distributed systems are so challenging to design that a theory known as the CAP
theorem has been proven.
 CAP theorem states that a distributed system cannot have all three of the much-desired
properties simultaneously; that is, consistency, availability, and partition tolerance.
 Even though blockchain can be considered to be both a distributed and decentralized
system, there are, however, critical differences between distributed systems and
decentralized systemsthat make both of these systems architecturally different.

The History of Blockchain


 Blockchain was introduced with the invention of Bitcoin in 2008.
 Its practical implementation then occurred in 2009.
The events that led to blockchain are as follows:

 1960s – Invention of computer networks


 1969 – Development of ARPANET
 1970s – Early work on secure network communication including public key cryptography
 1970s – Cryptographic hash functions
 1973 – Extension of ARPANET to other geographic locations
 1974 – First internet service provider, Telenet
 1976 – Diffie–Hellman work on securely exchanging cryptographic keys
 1978 – Invention of public key cryptography
 1979 – Invention of Merkle Trees (hashes in a tree structure) by Ralph C. Merkle
 1980s – Development of TCP/IP
 1980 – Protocols for public key cryptosystems, Ralph C. Merkle
 1982 – Blind signatures proposed by David Chaum
 1982 – The Byzantine Generals Problem
 1985 – Work on elliptic curve cryptography by Neal Koblitz and Victor Miller
 1991 – Haber and Stornetta work on tamper proofing document timestamps. This can
beconsidered the earliest idea of a chain of blocks or hash chains
 1992 – Cynthia Dwork and Moni Naor publish Pricing via Processing or Combatting
JunkMail. This is considered the first use of Proof of Work (PoW)

Department of CSE Page 2


Blockchain Technology (BCS613A)

 1993 – Haber, Bayer, and Stornetta upgraded the tamper-proofing of document


timestamps system with Merkle trees
 1995 – David Chaum's Digicash system (an anonymous electronic cash system) startedto
be used in some banks
 1998 – Bit Gold, a mechanism for decentralized digital currency, invented by NickSzabo.
It used hash chaining and Byzantine Quorums
 1999 – Emergence of a file-sharing application mainly used for music sharing, Napster,
which is a P2P network, but was centralized with the use of indexing servers
 1999 – Development of a secure timestamping service for the Belgian project TIMESEC
 2000 – Gnutella file-sharing network, which introduced decentralization
 2001 – Emergence of BitTorrent and Distributed Hash Tables (DHTs)
 2002 – Hashcash by Adam Back
 2004 – Development of B-Money by Wei Dei using hashcash
 2004 – Hal Finney, the invention of the reusable PoW system
 2005 – Prevention of Sybil attacks by using computation puzzles, due to James Aspnes
 2009 – Bitcoin (first blockchain)
 The aforementioned technologies contributed in some way to the development of Bitcoin.

Electronic cash
 The concept of electronic cash (e-cash), or digital currency, is not new.
 Since the 1980s, e-cash protocols have existed that are based on a model proposed by
David Chaum.
 The idea of e-cash is essential in order to appreciate the first, and astonishingly
successful, application of blockchain, Bitcoin, and more broadly, cryptocurrencies in
general.

Two fundamental e-cash system issues need to be addressed:


1. Accountability
 Accountability is required to ensure that cash is spendable only once (addressing the
double-spending problem) and that it can only be spent by its rightful owner.
 The double-spending problem arises when the same money can be spent twice.
 As it is quite easy to make copies ofdigital data, this becomes a big issue in digital
currencies as you can make many copies of the same amount of digital cash.
2. Anonymity
 Anonymity is required to protect user’s privacy.
 With physical cash, it is almost impossible to trace back spending to the individual who
actually paid the money, which provides adequateprivacy should the consumer choose to
hide their identity.
 In the digital world, however, providing such a level of privacy is difficult due to inherent
personalization, tracing, and logging mechanisms in digital payment systems such as
credit card payments.
 This is indeed arequired feature for ensuring the security and safety of the financial
network, but it is also often seen as a breach of privacy.

Department of CSE Page 3


Blockchain Technology (BCS613A)

 David Chaum solved both of these problems(Accountability and Anonymity) during his
work in the 1980s by using twocryptographic operations, namely, blind signatures and
secret sharing.
 Blind signatures allow for signing a document without actuallyseeing it.
 Secret sharing is a concept that enables the detection of double-spending, that is,using
the same e-cash token twice.
 In 2009, the first practical implementation of an e-cash system named Bitcoin appeared.
 The term cryptocurrency emerged later.
 For the very first time, it solved the problem of distributedconsensus in a trustless
network.
 It used public key cryptography with a PoW mechanism to provide a secure, controlled,
and decentralized method of minting digital currency.
 The key innovation was the idea of an ordered list of blocks composed of transactions
which is cryptographically secured by the PoW mechanism to prevent double-spending in
a trustless environment.

Figure 1.2: The various ideas that supported the invention of Bitcoin and blockchain

Introduction to Blockchain
 In 2008, a groundbreaking paper, entitled Bitcoin: A Peer-to-Peer Electronic Cash
System, was written on the topic of peer-to-peer e-cash under the pseudonym of Satoshi
Nakamoto.
 It introduced the term chain of blocks.
 The term "chain of blocks" evolved over the years into the word "blockchain.
 Blockchain technology incorporates a multitude of applications that can be implemented
in various economic sectors.
 Particularly in the finance sector, significant improvement in the performance of financial
transactions and settlements manifests as highly desirable time-and-cost reductions.
 Nearly all economicsectors have already realized the potential and promise of blockchain,
and have embarked, orwill do so soon, on the journey to capitalize on the benefits of
blockchain technology.

Department of CSE Page 4


Blockchain Technology (BCS613A)

Various technical definitions of blockchains


There are two most widely accepted definition of blockchain.
1. 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.

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

Keywords of Technical Definition of Blockchain


Peer-to-peer

 The first keyword in the technical definition is peer-to-peer, or P2P.


 This 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

 Cryptographically secure means that cryptography has been used to provide security
services that make this ledger secure against tampering andmisuse.
 These services include non-repudiation, data integrity, and data origin
authentication.

Append-only

 Append-only 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.

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.

Department of CSE Page 5


Blockchain Technology (BCS613A)

 In this scenario, no central authority is in controlof updating the ledger.


 Instead, any update made to the blockchain is validated against strictcriteria defined by
the blockchain protocol and added to the blockchain only after a consensus has been
reached among all participating peers/nodes on the network.
 To achieve consensus,there are various consensus facilitation algorithms that ensure all
parties agree on the final state of the data on the blockchain network and resolutely agree
upon it to be true.

Generic Elements of a Blockchain


The structure of a generic blockchain can be visualized with the help of the following diagram:

Figure 1.3: Generic structure of a blockchain

Elements of a generic blockchain are as follows:

1. 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.
2. Transaction
 A transaction is the fundamental unit of a blockchain.
 A transaction represents a transfer of value from one address to another.
3. 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.
A block contains several elements,
i) Pointer’s to Previous Block’s Hash
 A reference to a previous block is also included in the block unless it is a genesis block.

Department of CSE Page 6


Blockchain Technology (BCS613A)

 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.
ii) Nonce
 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.
 In blockchain, it's used in PoW consensus algorithms and for transaction replay
protection.
 A block also includes the nonce value.
iii) Timestamp
 A timestamp is the creation time of the block.
iv) Merkle Root
 Merkle root is a hash of all of the nodes of a Merkle tree.
 In a blockchain block, it is the combined hash of the transactions in the block.
 Merkle trees are widely used to validate large data structures securely and efficiently.
 In the blockchain world, Merkle trees are commonly used to allow efficient verification
of transactions.
 Merkle root in a blockchain is present in the block header section of a block, which is the
hash of all transactions in a block.
 This means that verifying only the Merkle root is required to verify all transactions
present in the Merkle tree instead of verifying all transactions one by one.
v) Transactions
 In addition to the block header, the block contains transactions that make up
the block body.
 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.
 A block contains transactions and its size varies depending on the type and design of the
blockchain.

Figure 1.4: The generic structure of a block

Department of CSE Page 7


Blockchain Technology (BCS613A)

4. Peer-to-peer network
 A peer-to-peer network is a network topology wherein all peers can communicate with
each other and send and receive messages.
5. 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, it only allows essential operations that are necessary for
executing transactions, but it does not allow for arbitrary program development.
 To facilitate arbitrary program development on a blockchain, a Turing complete
programming language is needed, and it is now a very desirable feature to have for
blockchains.
6. 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.
 However, 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).
7. 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.
8. 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 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
blockchain applications.
 Smart contracts have many use cases, including but not limited to identity management,
capital markets, trade finance, record management, insurance, and e-governance.
9. 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.

Department of CSE Page 8


Blockchain Technology (BCS613A)

 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.
A high-level diagram of blockchain architecture highlighting the key elements is shown in
Figure 1.5.

Figure 1.5: 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.
 The blockchain is then further magnified(middle) to show the structure of the chain of
blocks, which is again magnified (bottom) to showthe structure of a transaction.

How blockchain works


Nodes are either
1. Miners who create new blocks and mint cryptocurrency (coins) or
2. Block signers who validate and digitally sign the transactions.
A critical decision that every blockchain network has to make is to figure out which node will
append the next block to the blockchain. This decision is made using a consensus mechanism.

Department of CSE Page 9


Blockchain Technology (BCS613A)

1. Transaction 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. Most commonly, this is a data structure
that represents the transfer of value between users on the blockchain network. Transactions are
usually either a cryptocurrency transfer (transfer of value) or smart contract invocation that can
perform any desired operation. A transaction occurs between two or more parties.

2. Transaction 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.
Before a transaction is propagated, it is also verified to ensure that it is valid.

3. Find 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. This process is
also sometimes referred to as "finding a new block." Here, nodes called miners race to finalize
the block they've created by a process known as mining.

4. New 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. At this
point, the transaction is considered confirmed.Usually, in cryptocurrency blockchains such as
Bitcoin, the miner who solves the mathematical puzzle is also rewarded with a certain number
of coins as an incentive for their effort and the resources they spent in the mining process.

5. 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.Peers also validate and execute the block. It now becomes part of
the blockchain (ledger), and the next block links itself cryptographically back to this block. This
link is called a hash pointer.

Figure 1.6: How a block is generated

Department of CSE Page 10


Blockchain Technology (BCS613A)

Features of Blockchain
The features of a blockchain are as follows:
1. Distributed consensus
 Distributed consensus is the primary underpinning 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.

2. 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.
3. Platform for smart contracts
• A blockchain is a platform on which programs can run to execute business logic on
behalf of the users.
• Not all blockchains have a mechanism to execute smart contracts.
• However, this is a very desirable feature, and it is available on newer blockchain
platforms such as Ethereum and MultiChain.
4. 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.

5. Generation of cryptocurrency
• This feature is optional depending on the type of blockchain in use.
• A blockchain can create cryptocurrency as an incentive to its miners who validate the
transactions and spend resources to secure the blockchain.
6. 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.
• 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, but none of them is enforceable in such a way as
blockchain based DRM can be.
• Blockchain can provide DRM functionality in such a way that it can be enforced fully.
7.Provider of security
• The blockchain is based on proven cryptographic technology that ensures the integrity
and availability of data.
• Generally, confidentiality is not provided due to the requirements of transparency.
• This limitation is the leading barrier to its adoption by financial institutions and other
industries that require privacy and confidentiality of transactions.
• As such, the privacy and confidentiality of transactions on the blockchain is being
researched very actively, and advancements are already being made.

Department of CSE Page 11


Blockchain Technology (BCS613A)

• It could be argued that, in many situations, confidentiality is not needed and transparency
is preferred.
8.Immutability
• This is another critical feature of blockchain.
• Once records are added to the blockchain, they are immutable.
• There is the remote possibility of rolling back changes, but this is to be avoided at all
costs as doing so would consume an exorbitant amount of computing resources.
• 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.
9. Uniqueness
• This blockchain feature ensures that every transaction is unique and has not already been
spent (double-spend problem).
• This feature is especially relevant with cryptocurrencies, where detection and avoidance
of double spending are a vital requirement.

Benefits of Blockchain
The benefits of blockchain technology are as follows:
1. Decentralization
 This is a core concept and benefit of blockchain.
 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.
2. Transparency and trust
 As 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.
 This is more relevant in scenarios such as the disbursement of funds or benefits
wherepersonal discretion in relation to selecting beneficiaries needs to be restricted.
3. 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 sochallenging and nearly
impossible, this is seen as a benefit to maintaining an immutable ledger of transactions.
4. High availability
 As the system is based on thousands of nodes in a peer-to-peernetwork, and the data is
replicated and updated on every node, the system becomeshighly available.
 Even if some nodes leave the network or become inaccessible, thenetwork as a whole
continues to work, thus making it highly available.
 This redundancy results in high availability.
5. Highly secure
 All transactions on a blockchain are cryptographically secured and thusprovide network
integrity.

Department of CSE Page 12


Blockchain Technology (BCS613A)

 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.
 The blockchain is based on proven cryptographic technologythat 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.
6. Simplification of current paradigms
 The current blockchain model in many industries, such as finance or health, is somewhat
disorganized.
 In this model, multiple entities maintain their own databases and data sharing can become
very difficult due to the disparate nature of the systems.
 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.
7. Faster dealings
 In the financial industry, especially in post-trade settlement functions, blockchain can
play a vital role by enabling the quick settlement of trades.
 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.
8. 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 arepaid to
such parties.
9. Platform for smart contracts
 A blockchain is a platform on which programs can run that execute business logic on
behalf of the users.
 This is a very useful feature but not all blockchains have a mechanism to execute smart
contracts.
 It is available on newer blockchain platforms such as Ethereum and MultiChain, but not
on Bitcoin.
10. 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.
 Blockchain can provide digital rights management functionality in such a way that it can
be enforced fully.

Department of CSE Page 13


Blockchain Technology (BCS613A)

 On a blockchain, however, if you own an asset, no one else can claim it unless you decide
to transfer it.

Limitations of Blockchain
The most sensitive blockchain problems are as follows:

1. Scalability

 Currently, blockchain networks are not as scalable as, for example, currentfinancial
networks.
 This is a known area of concern and a very ripe area for research.

2. Adoption

 Often, blockchain is seen as a nascent technology.


 Even though 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.

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

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

5. 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 impeccable
solutions has already been developed.

Tiers of blockchain technology


• Due to the rapid development and progress being made in blockchain technology,
many applications will evolve.

Department of CSE Page 14


Blockchain Technology (BCS613A)

• Some of these advancements have already been realized, while others are anticipated in
the near future based on the current rate of advancement in blockchain technology.
Different tiers of blockchain are as follows:

1. Blockchain 1.0
• This tier was introduced with the invention of Bitcoin, and it is primarily used for
cryptocurrencies.
• This first generation of blockchain technology 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.

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

3. 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.
• 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.

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

Department of CSE Page 15


Blockchain Technology (BCS613A)

• It will be a public and open distributed ledger with general-purpose rational agents
(Machina economicus) 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.
• Machina Economicus is a concept which comes from the field of Artificial Intelligence
(AI) andcomputational economics.
• It can be defined as a machine that makes logical and perfect decisions.

CAP theorem and Blockchain


CAP theorem states that any distributed system cannot have consistency, availability, and
partition tolerance simultaneously.
 Consistency
 Consistency is a property that ensures that all nodes in a distributed system have a
single, current, and identical copy of the data.
 Consistency is achieved using consensus algorithms in order to ensure that all nodes
have the same copy of the data.
 This is also called state machine replication.
 The blockchain is a means for achieving state machine replication.
 Availability
 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.
 Data is available at each node and the nodes are responding to requests.
 Partition tolerance
 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:

Department of CSE Page 16


Blockchain Technology (BCS613A)

Figure 1.7: 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.

Example:
• Consider a distributed system with two nodes.
• Apply the three theorem properties on this smallest of possible distributed systems only
with two nodes:
1. Consistency is achieved if both nodes have the same shared state; that is, they have the
same up to-date copy of the data.
2. Availability is achieved if both nodes are up and running and responding with the latest
copy of data.
3. Partition tolerance is achieved if, despite communication failure or delay between nodes,
the network (distributed system) continues to operate.

 Consider scenario where a partition occurs, and nodes can no longer communicate with
each other.
 If new updated data comes in now, it can only be updated on one node only.

Department of CSE Page 17


Blockchain Technology (BCS613A)

 In that case, if the node accepts the update, then only that one node in the network is
updated and therefore consistency is lost.
 If the update is rejected by the node, that would result in loss of availability.
 In that case, due to partition tolerance, both availability and consistency are unachievable.

Byzantine Generals problem


• In distributed systems, a common goal is to achieve consensus (agreement) among nodes
on the network even in the presence of faults.
• In order to explain the problem, Lamport came up with an allegorical representation of
the problem and named it the Byzantine generals problem.
• A Byzantine army, divided into different units, is spread around a city.
• They are planning to attack or retreat from a city.
• A general commands each unit, and they can only communicate with each other using a
messenger.
• To be successful, the generals must coordinate their plan and decide whether to attack or
retreat.
• Any generals could potentially be disloyal and act maliciously to obstruct agreement
upon a united plan and send a misleading message.
• Every honest general must somehow agree on the same decision even in the presence of
treacherous generals.
• In order to address this issue, honest (loyal) generals must reach a majority agreement on
their plan.

• Traitors are byzantine nodes Nodes with arbitrary behaviour


• Messenger is channel for communication between generals.
• In the digital world, generals are represented by computers (nodes) and communication
links are messengers carrying messages.
• Disloyal generals are faulty nodes.
 Byzantine General Problem was solved in 1999 by Castro and Liskov who presented the
Practical Byzantine Fault Tolerance (PBFT) algorithm, which solves the consensus
problem in the presence of Byzantine faults in asynchronous networks by utilizing the
state machine replication protocol.
 PBFT goes through a number of rounds to eventually reach an agreement between nodes
on the proposed value.
Consensus
 Consensus is the backbone of a blockchain, as it provides the decentralization of control
through an optional process known as mining.

Department of CSE Page 18


Blockchain Technology (BCS613A)

 The choice of the consensus algorithm to utilize is governed by the type of blockchain
in use; that is, not all consensus mechanisms are suitable for all types of blockchains.
 For example, in public permissionless blockchains, it would make sense to use PoW
instead of mechanisms that are more suitable for permissioned blockchains, such as
Proof of Authority (PoA) or traditional Byzantine fault-tolerant consensus mechanisms.
Therefore, it is essential to choose an appropriate consensus algorithm for a particular
blockchain project.
 Consensus is a process of achieving agreement between distrusting nodes on the final
state of data.
 To achieve consensus, different algorithms are used.
 It is easy to reach an agreement between two nodes (in client-server systems, for
example), but when multiple nodes are participating in a distributed system and they need
to agree on a single value, it becomes quite a challenge to achieve consensus.
 This process of attaining agreement on a common state or value among multiple nodes
despite the failure of some nodes is known as distributed consensus.

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.
Following describes the two main categories of consensus mechanisms:

1. Proof-based, leader-election lottery-based, or the Nakamoto consensus


 In this approach,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
 This 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.
Leader-election lottery-based (PoW) consensus mechanisms scale very well but perform very
slowly.
Different consensus algorithms are as follows:

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.

Department of CSE Page 19


Blockchain Technology (BCS613A)

 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.
2. Proof of Stake (PoS)
 This algorithm works on the idea that a node or user has an adequate stake in the system.
 i.e The user has invested enough 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.
3. 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.
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.
 It requires the Intel SGX (Software Guard Extensions) processor to provide the security
guarantee for it to be secure.
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)
 This idea is significant and different from PoS. 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
 This mechanism is used in the stellar consensus protocol.
 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 achieves SMR, which provides tolerance against Byzantine nodes.
 Various other protocols, including PBFT, PAXOS, RAFT, and Federated Byzantine
Agreement (FBA), are also being used or have been proposed for use in many different
implementations of distributed systems and blockchains.
10. Proof of Activity (PoA)

Department of CSE Page 20


Blockchain Technology (BCS613A)

 This scheme is a combination of PoS and PoW, which ensures that a stakeholder is
selected in a pseudorandom but uniform fashion.
 This is a comparatively more energy-efficient mechanism as compared to PoW. It utilizes
a new concept called "Follow the Satoshi."
 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.
 Several variations of this scheme have been proposed, such as Proof of Replication, Proof
of Data Possession, Proof of Space, and Proof of Space-time.
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.

Department of CSE Page 21

You might also like