0% found this document useful (0 votes)
496 views19 pages

RGPV Is501 Unit1

Uploaded by

Aayush Sinha
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)
496 views19 pages

RGPV Is501 Unit1

Uploaded by

Aayush Sinha
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/ 19

Unit 1

1.1 Introduction to Blockchain


History
The idea of blockchain originated in 1991 from a paper titled “How to time-stamp a
digital document” by Stuart Haber and W Scott Stornetta which conveys the idea
of a system by which digital documents could be timestamped securely.

In 2012 the paper “Improving the Efficiency and Reliability of Digital Time-
Stamping” by Dave Bayer, Haber and Stornetta incorporated a cryptographic hash
tree known as Merkle Tree into design to improve efficiency and security.

A Merkle tree is recursively defined as a binary tree of hash lists where the parent
node is the hash of its children, and the leaf nodes are hashes of the original data
blocks.

A hash is the result of the cryptographic formula that has taken some form of data
encrypted it and returned the result as single string of characters.

Bitcoin was introduced by Satoshi Nakamoto in his official Bitcoin whitepaper


(Bitcoin: A Peer-to-Peer Electronic Cash System) and is the one who created and
deployed bitcoin’s original reference implementation.
What is a blockchain?
A blockchain is a distributed ledger often referred as DLT(Distributed Ledger
Technology) which is accessible to everyone meaning it is decentralized.

Once data is stored within a block it becomes extremely difficult to change it.

Unit 1 1
A block is comprised of three things: Data, a hash and the hash of the previous
block.The data in a blockchain all depends on what type of blockchain there is.

Data in block
So lets assume we have the Bitcoin Blockchain. The data that is stored in there will
be the sender, the receiver and the amount.

The block hash


The block will also contain a Hash. The bitcoin uses the SHA-256 Hash Algorithm.
When the block is created, the data is taken and the hash is calculated from the
Data. This process is called cryptography. Because the hash will be unique to the
block and the data inside, it can be treated as and is often referred to as a "digital
fingerprint".

Unit 1 2
The previous block hash

The block also contains the hash of the previous block and it is this which created
the chain. It is also this which is integral to the security of the blockchain.

But there must be some starting point for a block?


Yes Block 0 or sometimes called block 1 is known as the Genesis Block. A genesis
block is the first block of a block chain. Modern versions of Bitcoin number it as
block 0, though very early versions counted it as block 1. The genesis block is
almost always hardcoded into the software of the applications that utilize its block
chain. It is a special case in that it does not reference a previous block
Transaction in a blockchain

Suppose there is a transaction between Susan Bloggs and Chris Bloggs of BTC
3.456 which creates a new block on the chain with the data of the transaction, the
hash of that data and the hash from the initial block.

Unit 1 3
So the data we are encrypting is Sender: Susan Boggs , Receiver: Chriss Bloggs and
Amount: 3.456 BTC

Using our hashing function we get the hash: b4de b27c 02e8 bdbe 6beb 48c5 a943 d189 .
We then add this hash to our block. In order to add a new block to our blockchain
we check that the new blocks previous hash matches the previous block. In our
example it is: b4de b27c 02e8 bdbe 6beb 48c5 a943 d189 It is exactly the same and thus
we know that nothing has been tampered
with. This confirmation process verifies that all hashes are consistent back to the
Genesis block.

What problem can a blockchain solve?

Blockchain technology offers numerous benefits, including secure digital time


stamping of documents, decentralization in transactions, and the ability to raise
substantial amounts in a short amount of time. It eliminates the need for third-
party intermediaries, reducing fees and ensuring the protection of personal data.
Blockchain also eliminates the need for trust in third-party services, allowing
transactions to be almost instant and free of fees.

In 2018, ConsenSys introduced Project i2i, a payment network built on Ethereum


to connect rural community banks in the Philippines. This system, known as
crypto-cash, uses crypto-tokens backed by fiat currency.

Ethereum's Crowdsale and Smart Contracts have allowed start-ups to raise


substantial amounts quickly. Filecoin, an open-source decentralized storage
market, raised $257,000,000 in just a few hours.

Blockchain storage solutions, like Filecoin and Storj.io, provide full control over
data and ensure only authorized access. Blockchain technology can also be used
for voting, eliminating fraud and boosting turnout. This technology can help
maintain transparency, minimize costs, and streamline the voting process.

1.2 Need for Distributed Record Keeping

What are Distributed Ledgers?

Unit 1 4
Distributed ledgers are the databases shared across a network and spread over
various geographical locations. A ledger is a collection of financial accounts and,
in such a case, distributed means spread out and controlled globally. Thus,
distributed ledgers are held and re-organized by multiple parties in different
locations and institutions.

How Distributed Ledgers Work


Distributed ledgers are held, reorganized, and controlled by individuals called
nodes. The database is constructed independently by each node.

Every transaction occurring on the network is processed, and a conclusion on the


development of the database is created by each node.

Unit 1 5
Based on the transaction, voting is carried out on the changes completed on the
database. All nodes participate in the voting, and if at least 51% of them agree, the
new transaction is accepted on the database.

Afterward, the nodes update the versions of the database so that all the devices
or nodes will be of the same version. The new transaction is written onto a block
on the blockchain.

Nodes in Proof-of-Work blockchain are also called miners. When a miner


successfully puts a new transaction into a block, they receive a reward. It requires
a dedicated 24×7 computer power. It is the responsibility of miners to compute
the cryptographic hash for new blocks. Whoever, among the miners, successfully
finds the hash first, gets the reward.

Miners dedicating more computational power to find the hash will be more
successful. However, as blocks keep generating, it becomes more difficult to find
subsequent hash scales. The goal is to keep a constant speed of generating the
blocks.

Benefits of Distributed Ledgers

1. Highly Transparent, Secure, Tamper-Proof, and Immutable:

Entries occur without third-party involvement

Records written into distributed ledgers cannot be altered by any other


party

2. Elimination of Third-Party Need:

Saves money and time, especially in supply chain business

Sensors can write results directly to the blockchain without third-party


involvement

3. Inherently Decentralized:

Decentralized nature adds an additional layer of security

Unit 1 6
Database is globally spread, making it difficult to attack

4. Highly Transparent:

Presents a high level of transparency

All stored information is freely and easily viewable

Provides the desired transparency for various industries

1.3 Blockchain Architecture


Blockchain architecture is being used very broadly in the financial industry.
However, these days, this technology helps create software development
solutions for cryptocurrencies and record keeping, digital notary, and smart
contracts.

The blockchain architecture supports a growing list of ordered records known as


blocks. Each block maintains a timestamp and a link to the previous block.

Database vs Blockchain Architecture

The traditional architecture of the World Wide Web uses a client-server network.
In this case, the server keeps all the required information in one place so that it is

Unit 1 7
easy to update, due to the server being a centralized database controlled by a
number of administrators with permissions.

In the case of the distributed network of blockchain architecture, each participant


within the network maintains, approves, and updates new entries. The system is
controlled not only by separate individuals, but by everyone within the blockchain
network.Each member ensures that all records and procedures are in order, which
results in data validity and security. Thus, parties that do not necessarily trust
each other are able to reach a common consensus.

The structure of blockchain technology is represented by a list of blocks with


transactions in a particular order.

Characteristics of Blockchain Architecture

Cryptography — Blockchain transactions are verified and trustworthy because


of complex computations and cryptographic proof between the parties.

Immutability — Records in a blockchain can’t be modified or deleted.

Provenance — It’s possible to trace the origin of each transaction in the


blockchain ledger.

Decentralization — Every member of the blockchain structure is able to


access the entire distributed database. Unlike in a centralized system, a
consensus algorithm is responsible for network management.

Anonymity — Every member of the blockchain network has a generated


address, not a user ID. This preserves the anonymity of users, especially in a
public blockchain.

Transparency — The blockchain system is unlikely to be damaged as it takes


enormous computing power to completely rewrite the blockchain network.

Types of Blockchain Architecture

All blockchain structures fall into three categories:

Unit 1 8
Public blockchain architecture
A public blockchain architecture means that the data and access to the system is
available to anyone who is willing to participate (e.g. Bitcoin, Ethereum, and
Litecoin blockchain systems are public).

Private blockchain architecture


As opposed to public blockchain architecture, the private system is controlled only
by users from a specific organization or authorized users who have an invitation
for participation.

Consortium blockchain architecture

This blockchain structure can consist of a few organizations. In a consortium,


procedures are set up and controlled by the preliminary assigned users.

Consortium
Property Public blockchain Private blockchain
blockchain

Consensus Selected set of Within one


All miners
determination nodes organization

Read permission Public Public or restricted Public or restricted

Almost impossible to
Immutability level Could be tampered Could be tampered
tamper

Efficiency (use of
Low High High
resources)

Centralization No Partial Yes

Consensus process Permissionless Needs permission Needs permission

Core Components of Blockchain Architecture

These are the core blockchain architecture components:

Node - user or computer within the blockchain architecture (each has an


independent copy of the whole blockchain ledger)

Unit 1 9
Transaction - smallest building block of a blockchain system (records,
information, etc.) that serves as the purpose of blockchain

Block - a data structure used for keeping a set of transactions which is


distributed to all nodes in the network

Chain - a sequence of blocks in a specific order

Miners - specific nodes which perform the block verification process before
adding anything to the blockchain structure

Consensus (consensus protocol) - a set of rules and arrangements to carry


out blockchain operations

Any new record or transaction within the blockchain implies the building of a new
block. Each record is then proven and digitally signed to ensure its genuineness.
Before this block is added to the network, it should be verified by the majority of
nodes in the system.

Following is a blockchain architecture diagram that shows how this actually works
in the form of a digital wallet.

Unit 1 10
Benefits of Blockchain Architecture
Blockchain architecture can serve the following purposes for organizations and
enterprises:

Cost reduction - lots of money is spent on sustaining centrally held databases


(e.g. banks, governmental institutions) by keeping data current secure from
cyber crimes and other corrupt intentions.

History of data - within a blockchain structure, it is possible to check the


history of any transaction at any moment in time. This is a ever-growing
archive, while a centralized database is more of a snapshot of information at a
specific point.

Data validity & security - once entered, the data is hard to tamper with due to
the blockchain’s nature. It takes time to proceed with record validation, since
the process occurs in each independent network rather than via compound
processing power. This means that the system sacrifices performance speed,
but instead guarantees high data security and validity.

1.4 Abstract Models in Blockchain


A Model represents how the functional components of a system are
interconnected in one's perception or for a purpose. An architectural modal
represents the software design at the highest abstraction level. Deriving an
Architectural model is about identifying the design aspects to achieve the
embedded characteristics, making use of the components of Blockchain.

Layered Structure of Blockchain Technology

Unit 1 11
Primarily, blockchain is composed of five layers: the hardware infrastructure layer,
the data layer, the network layer, the consensus layer, and the application layer.
Every layer has a distinct function. Together, these layers make the blockchain a
comprehensive solution for everything from back-end data administration to front-
end application development.

Hardware layer: Blockchains are predicated on peer-to-peer sharing of data. This


layer consists of the physical components that support the blockchain network,
such as computers and servers. A node is a computer or network of computers
that decrypts transactions, and a blockchain is the sum of all nodes.

Data layer: Following the hardware layer is the data layer, where transaction
details are stored. The transaction information recorded on a block (the basic unit
of a blockchain) includes information about the sent crypto, the public key of the
recipient, and the private key of the sender. Each data-containing block is
connected to the block that came before it and the block that will be generated
next. Only the first block of the network, the genesis block, is connected forwards
and not backwards.

Unit 1 12
Network layer: This layer handles the communication between blockchain nodes.
It connects nodes, propagates transactions, and distributes data throughout the
network. Since blockchain is an open system, each node must be aware of the
transactions being validated by other nodes. The network layer facilitates this
communication.
Consensus layer: This layer guarantees that all nodes in the network concur on
the validity of each transaction. It uses a consensus mechanism, such as Proof of
Work (PoW) or Proof of Stake (PoS), to validate and add transactions to the
blockchain.
Application layer: The Application layer in the blockchain is the one on which
apps are built. This layer includes smart contracts, decentralized applications
(dApps), and other software that run on top of the blockchain network. It allows
developers to create new applications and services that leverage the security and
transparency of the blockchain.

1.5 Consensus Algorithms


Consensus is the process by which a group of peers — known as ‘nodes’ — on a
network determine which blockchain transactions are valid and which are not.
Consensus mechanisms are the methodologies used to achieve this agreement.
It’s these sets of rules that help to protect networks from malicious behaviour and
hacking attacks.

Liveliness and Fairness in Blockchain


Liveness in blockchain refers to the ability of the network to keep making
progress, ensuring that transactions are processed, and the system doesn't get
stuck. It's about maintaining a lively and functional state. In a blockchain,
consensus algorithms play a crucial role in achieving liveness by reaching an
agreement on the order of transactions.

Fairness in blockchain is often related to the consensus mechanism as well. The


goal is to ensure that all participants in the network have an equal chance of
adding a new block to the blockchain. This prevents centralization and maintains
the decentralized nature of blockchain networks. Fairness also extends to issues

Unit 1 13
like preventing double-spending and ensuring that all valid transactions have an
opportunity to be included in the blockchain.
In blockchain systems like Bitcoin, Proof-of-Work (PoW) is used to achieve
consensus, providing a level playing field for participants to contribute to block
creation. Other systems, like Ethereum, are moving toward Proof-of-Stake (PoS) to
address scalability concerns while still aiming for fairness.
Types of Blockchain
There are many different types of consensus mechanisms

Proof Of Work (PoW)

Used by Bitcoin and many other public blockchains, Proof of Work (PoW) was the
very first consensus mechanism created. It is generally regarded as the most
reliable and secure of all the consensus mechanisms, though concerns over
scalability are rife

In PoW, ‘miners’ essentially compete against one another to solve extremely


complex computational puzzles using high-powered computers. The first to come
up with the 64-digit hexadecimal number (‘hash’) earns the right to form the new
block and confirm the transactions. The successful miner is also rewarded with a
predetermined amount of crypto, known as a ‘block reward’.

Unit 1 14
As it requires large amounts of computational resources and energy in order to
generate new blocks, the operating costs behind PoW are notoriously high. This
acts as a barrier of entry for new miners, leading to concerns about centralisation
and scalability limitations.

Proof Of Stake (PoS)


As the name suggests, this popular method of consensus revolves around a
process known as ‘staking‘. In a Proof of Stake (PoS) system, ‘validators’ pledge a
stake of digital currency for a chance to be randomly chosen to validate a block,
which earns them a reward. The process is not unlike a lottery, whereby the more
coins staked, the better the odds.

Unit 1 15
Unlike in PoW, where miners are incentivised by block rewards (newly generated
coins), those who contribute to the PoS system simply earn a transaction fee.
PoS is seen as a more sustainable and environmentally friendly alternative to PoW,
and one that’s more secure against 51% attacks. However, as the system favours
entities with a higher number of tokens, PoS has drawn criticism for its potential to
lead to centralisation.

Hybrid (PoW + PoS)


Hybrid PoW/PoS consensus mechanisms utilize elements of both PoW and PoS
models when determining transaction validation rights, and for doing so, hybrid
aims to mitigate the weaknesses of each consensus mechanism.

A hybrid consensus starts with having PoW miners to create new blocks
containing transactions to be added to the blockchain. Once these blocks are
created, PoS miners decide whether to confirm them or not. PoS miners purchase
votes by staking a portion of their tokens. However, instead of examining the total
vote count, the hybrid PoW/PoS mechanism randomly chooses 5 ‘votes’ to
determine the efficacy of the newly created block; if 3 of the 5 chosen votes are
affirmative, the block is added to the blockchain.

In exchange for these services, PoW miners receive 60% of the block reward, PoS
miners receive 30%, and the remaining 10% is dedicated to developmental efforts.

Unit 1 16
1.6 Types of Blockchain
There are majorly four types of Blockchain -

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. All the computer in the network hold the copy of other
nodes or block present in the network. In this public blockchain, we can also
perform verification of transactions or records

Advantage:

Decentralized: There is no single platform that maintains the network, instead


every user has a copy of the ledger.

Anonymous Nature: It is a secure platform to make your transaction properly


at the same time, you are not required to reveal your name and identity in
order to participate.

Disadvantage

Processing: The rate of the transaction process is very slow, due to its large
size. Verification of each node is a very time-consuming process.

Acceptance: No central authority is there so governments are facing the issue


to implement the technology faster.

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.
These blockchains are operated in a closed network.

Advantage:

Unit 1 17
Speed: The rate of the transaction is high, due to its small size. Verification of
each node is less time-consuming.

Scalability: We can modify the scalability. The size of the network can be
decided manually.

Privacy: It has increased the level of privacy for confidentiality reasons as the
businesses required.

Disadvantage:

Security- The number of nodes in this type is limited so chances of


manipulation are there. These blockchains are more vulnerable.

Count- Since there are few nodes if nodes go offline the entire system of
blockchain can be endangered.

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. User access information via smart contracts. Even a primary entity
owns a hybrid blockchain it cannot alter the transaction

Advantage:

Ecosystem: Most advantageous thing about this blockchain is its hybrid


nature. It cannot be hacked as 51% of users don’t have access to the network.

Architecture: It is highly customizable and still maintains integrity, security,


and transparency.

Operations: It can choose the participants in the blockchain and decide which
transaction can be made public.

Disadvantage:

Unit 1 18
Efficiency: Not everyone is in the position to implement a hybrid Blockchain.
The organization also faces some difficulty in terms of efficiency in
maintenance.

Transparency: There is a possibility that someone can hide information from


the user. If someone wants to get access through a hybrid blockchain it
depends on the organization whether they will give or not.

Consortium Blockchain
In the same way that a hybrid blockchain has both private and public blockchain
features, a Consortium blockchain, also known as a federated blockchain, does.
However, it differs because it involves various organizational members working
together on a decentralized network. Predetermined nodes control the consensus
methods in a consortium blockchain. It has a validator node responsible for
initiating, receiving, and validating transactions. Transactions can be initiated or
received by member nodes.
Advantages

Secure: A consortium blockchain is more secure, scalable, and efficient than a


public blockchain network. It, like private and mixed blockchains, has access
controls.

Disadvantages

Lack of Transparency: The consortium blockchain has a lower degree of


transparency. If a member node is infiltrated, it can still be hacked, and the
Blockchain's rules can render the network inoperable.

Unit 1 19

You might also like