CS-3511 - Unit I
CS-3511 - Unit I
COMPUTER SCIENCE
CS-3511 :
Blockchain
Technology
Mrs. Rakhshanda Jamadar
(Asst. Professor)
Reference Books:
Textbook: 1. Beginning Blockchain : A Beginner’s Guide to Building Blockchain Solutions By
Bikramaditya Singhal, Gautam Dhameja, Priyansu Sekhar Panda, Apress Media
Reference Books:
2. Mastering Blockchain by Imran Bashir, Third Edition, Packt Publication
3. Waterhole, The Science of the Blockchain
4. Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System
5. Mastering Ethereum: Building Smart Contracts and DAPPS, by Andreas Antonopoulos, Dr.
Gavid Wood, Oreilly Publication
Unit 1: Introduction to Blockchain
▪ Foundational Computing Concepts (Client-Server systems vs Peer to Peer Systems)
▪ Evolution of Blockchain
▪ Blockchain Vs Database
▪ Essentials of Blockchain (Blockchain generations, types of blockchain, benefits and
challenges of blockchain usage)
▪ Types of Networks
▪ Layered Architecture of Blockchain Ecosystem
▪ Components of blockchain
▪ Cryptography (private and public keys, Hashing & Digital Signature)
▪ Consensus Mechanisms
▪ Cryptocurrency, Digital Currency Bitcoin and Ethereum
▪ Smart Contracts
▪ Blockchain use cases
Foundational Computing Concepts
(Client-Server systems vs Peer to Peer Systems)
► Client-Server Network:
This model are broadly used network model. In Client-Server Network, Clients and
server are differentiated, Specific server and clients are present. In Client-Server
Network, Centralized server is used to store the data because its management is
centralized. In this, Server respond the services which is request by Client.
Foundational Computing Concepts
(Client-Server systems vs Peer to Peer Systems)
► Peer-to-Peer Network: This model does not differentiate the clients and the servers,
In this each and every node is itself client and server. In this, Each and every node
can do both request and respond for the services.
► Peer-to-peer networks are often created by collections of 12 or fewer machines. All of
these computers use unique security to keep their data, but they also share data with
every other node.
► In peer-to-peer networks, the nodes both consume and produce resources.
Therefore, as the number of nodes grows, so does the peer-to-peer network’s
capability for resource sharing. This is distinct from client-server networks where an
increase in nodes causes the server to become overloaded.
Foundational Computing Concepts
(Client-Server systems vs Peer to Peer Systems)
► It is challenging to give nodes in peer-to-peer networks proper security because they
function as both clients and servers. A denial of service attack may result from this.
► The majority of contemporary operating systems, including Windows and Mac OS,
come with software to implement peer.
Blockchain???
What is Blockchain???
• Business runs on information. The faster information is received and the more
accurate it is, the better.
• A blockchain network can track orders, payments, accounts, production and much
more. And because members share a single view of the truth, you can see all
details of a transaction end to end, giving you greater confidence, and new
efficiencies and opportunities.
Evolution of Blockchain Technology
1. Bitcoin:
The peer-to-peer network used by Bitcoin, the first decentralized cryptocurrency,
eliminates the need for middlemen. A person or group of persons going by the
moniker Satoshi Nakamoto created the Bitcoin cryptocurrency in 2008. Transactions
for Bitcoin are kept on the public ledger known as the blockchain. Right now, there
are more than 18. compared to the current ceiling of 21 million Bitcoin tokens in
circulation.
Evolution of Blockchain Technology
2. Litecoin:
Charlie Lee, a former Google employee, invented Litecoin in 2011. Shorter
transaction speeds, cheaper fees, and a concentration of miners were some of the
improvements he made to Bitcoin technology.
3. Ethereum:
Vitalik Buterin introduced Ethereum in July 2015. The second-largest cryptocurrency
by market cap right now is Ethereum, behind only Bitcoin. The blockchain platform
Ethereum has its own programming language, Solidity, as well as its own digital
currency, Ether (ETH).
Evolution of Blockchain Technology
4. Ripple:
5. NEO:
6. IOTA:
IOTA, a 2016 invention, is an Internet of Things (IoT) application. By 2020, there would
be billions of gadgets online. Smart devices can communicate data and payment
information with numerous other devices in transactions carried out throughout the day
inside this Internet of Things environment. IOTA wants to replace other methods of
performing transactions on smart devices as the norm.
Blockchain v/s Database
Database Blockchain
Database uses centralized storage of data. Blockchain uses decentralized storage of data.
Centralized databases keep information that is up-to-date at a Blockchain keeps the present information as well as the past
particular moment information that has been stored before.
Examples: Ethereum, which introduced smart contracts and a more flexible programming
environment. Other examples include NEO and Cardano.
Blockchain Generations
● Purpose: Addresses scalability, interoperability, and governance issues found in earlier generations.
● Key Feature: Innovations to improve transaction speed, reduce costs, and enable different blockchains to
communicate with each other.
● Consensus Mechanism: Adoption of various new mechanisms, including PoS, Delegated Proof of Stake
(DPoS), and hybrid models.
● Limitations: Complexity in achieving true interoperability, and ongoing challenges with network security and
decentralization.
Examples:
● Purpose: Further improvements in scalability, privacy, and integration with real-world applications.
● Key Feature: Enhanced privacy features, integration with existing systems, and the ability to handle
complex decentralized applications (DApps) and enterprise solutions.
● Consensus Mechanism: Continued evolution, including advanced PoS models, zero-knowledge proofs,
and hybrid approaches.
● Limitations: Balancing scalability, decentralization, and security, and navigating regulatory challenges.
Examples:
● Algorand: Focuses on high-speed transactions and scalability with a unique consensus mechanism.
● Cosmos: Designed for interoperability and scaling with a focus on connecting various blockchains.
● Avalanche: Aims for high performance and low latency with a consensus protocol that supports multiple
blockchains.
Blockchain Generations
● Purpose: Envisions a decentralized internet (Web3) where users have more control over their data and
interactions.
● Key Feature: Integration of blockchain with AI, IoT (Internet of Things), and other emerging technologies.
Emphasis on user-centric decentralized applications (DApps) and improved governance.
● Consensus Mechanism: Incorporates advancements in consensus protocols, often focusing on sustainability
and reducing environmental impact.
● Limitations: Emerging field with ongoing development challenges, including user adoption and regulatory
concerns.
Examples:
1. Public Blockchains
2. Private Blockchains
3. Consortium Blockchains
4. Hybrid Blockchains
5. Sidechains
6. Layer 2 Solutions
Types of Blockchain
1. Public Blockchains:
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.
● As the name is public this blockchain is open to the public, which means it is not owned by anyone.
● Anyone having internet and a computer with good hardware can participate in this public
blockchain.
● 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.
2. Private Blockchains
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 are not as open as a public blockchain.
● They are open to some authorized users only.
● These blockchains are operated in a closed network.
● In this few people are allowed to participate in a network within a
company/organization.
● An example of private blockchains is Hyperledger, Corda.
Types of Blockchain
3. Consortium Blockchains
It is a creative approach that solves the needs of the organization. This blockchain validates
the transaction and also initiates or receives transactions.
● Also known as Federated Blockchain.
● This is an innovative method to solve the organization’s needs.
● Some part is public and some part is private.
● In this type, more than one organization manages the blockchain.
● Examples of consortium Blockchain are Tendermint and Multichain.
Types of Blockchain
4. Hybrid Blockchains
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.
● It is a combination of both public and private blockchain.
● Permission-based and permissionless systems are used.
● User access information via smart contracts
● Even a primary entity owns a hybrid blockchain it cannot alter the transaction
● Examples of Hybrid Blockchain are Ripple network and XRP token.
Types of Blockchain
5. Sidechains
● A sidechain is a separate blockchain network that connects to another blockchain – called a parent
● These secondary blockchains have their own consensus protocols allowing a blockchain network to
improve its privacy and security, and minimize the additional trust required to maintain a network.
● A key component of sidechains is their ability to facilitate a smoother asset exchange between the
mainnet and the secondary blockchain. This means that digital assets such as tokens can be securely
manner.
Types of Blockchain
6. Layer 2 Solutions
● A Layer-2 solution refers to infrastructure built on top of an existing blockchain
that can execute transactions off-chain. While they process transactions
separately, Layer-2 blockchains are still secured by the underlying Layer-1
blockchain.
● Protocols built on top of existing blockchains to enhance scalability and
efficiency. They work by processing transactions off the main blockchain and then
settling them back on the main chain.
● Features include improved transaction speed and reduced costs while still
leveraging the security of the underlying blockchain.
● Examples: Lightning Network (for Bitcoin), Optimistic Rollups (for Ethereum).
Benefits of Blockchain Technology
► Open: One of the major advantages of blockchain technology is that it is accessible to all means anyone can
become a participant in the contribution to blockchain technology, one does not require any permission from
anybody to join the distributed network.
► Verifiable: Blockchain technology is used to store information in a decentralized manner so everyone can verify
the correctness of the information by using zero-knowledge proof through which one party proves the correctness
of data to another party without revealing anything about data.
► Permanent: Records or information which is stored using blockchain technology is permanent means one needs
not worry about losing the data because duplicate copies are stored at each local node as it is a decentralized
network that has a number of trustworthy nodes.
► Free from Censorship: Blockchain technology is considered free from censorship as it does not have control of
any single party rather it has the concept of trustworthy nodes for validation and consensus protocols that
approve transactions by using smart contracts.
Benefits of Blockchain Technology
► Tighter Security: Blockchain uses hashing techniques to store each transaction on a block that is connected
to each other so it has tighter security. It uses SHA 256 hashing technique for storing transactions.
► Immutability: Data cannot be tampered with in blockchain technology due to its decentralized structure so
any change will be reflected in all the nodes so one cannot do fraud here, hence it can be claimed that
transactions are tamper-proof.
► Transparency: It makes histories of transactions transparent everywhere all the nodes in the network have a
copy of the transaction in the network. If any changes occur in the transaction it is visible to the other nodes.
► Efficiency: Blockchain removes any third-party intervention between transactions and removes the mistake
making the system efficient and faster. Settlement is made easier and smooth.
► Cost Reduction: As blockchain needs no third man it reduces the cost for the businesses and gives trust to
the other partner.
Challenges in blockchain Technology
1. Scalability
● Many blockchain networks struggle with high transaction volumes, leading to slower processing times compared to
traditional systems.
2. Energy Consumption
● Blockchains using PoW, like Bitcoin, require significant computational power, leading to high energy consumption and
environmental concerns.
3. Security Risks
● Bugs or flaws in smart contracts can lead to significant financial losses.
● If a single entity controls more than 50% of the network’s mining power, they could potentially manipulate the
blockchain.
7. Cost
● Setting up and maintaining a blockchain network, especially one requiring substantial computational resources, can be
expensive.
● Fees can vary widely depending on network congestion and can be a deterrent for smaller transactions.
8. Data Privacy
● Transparency vs. Privacy: While blockchains are often praised for their transparency, this can conflict with the need for data
privacy, especially in sensitive applications.
Types of Networks
2. Storage area network (SAN) - Fibre Channel (FC), Ethernet, and InfiniBand
3. Passive optical local area network (POLAN)- campus buildings where departments share a
common network, hospitals that have a shared network with on-site pharmacy and patient needs
5. Virtual private network (VPN) - employees at a branch office could use a VPN to connect to the main
● 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
● Only the first block of the network, the genesis block, is connected forwards and not
backwards.
Network layer
● The network layer is also known as the peer-to-peer (P2P) layer. In addition to being
known as the propagation layer, it is in charge of inter-node communication.
● 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.
● Blockchain platforms cannot function without the consensus layer. Whether using
Ethereum, Hyperledger, or another blockchain, the consensus layer is the most
important and fundamental layer.
● The consensus layer is in charge of validating the blocks, putting them in the proper
sequence, and making sure everyone is in agreement.
● The distributed peer-to-peer network’s consensus layer establishes a certain set of
agreements between nodes.
● Power remains distributed and decentralized due to the consensus layer.
Incentive 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.
● These implementations may consist of anything, like wallets, social media
Apps, browsers, Defi Apps, and NFT platforms, to name a few.
● While the UI/UX of the app is identical to that of any other standard
application, the backend data storage of these applications is
decentralized.
Components of Blockchain
It is a digital database of information. Here, we have used the term ‘digital’ because the currency
exchanged between different nodes is digital i.e cryptocurrency. There are three types of ledger. They are –
1. Public Ledger –
It is open and transparent to all. Anyone in the blockchain network can read or write something.
2. Distributed Ledger –
In this ledger, all nodes have a local copy of the database. Here, a group of nodes collectively
execute the job i.e verify transactions, add blocks in the blockchain.
3. Decentralized Ledger –
In this ledger, no one node or group of nodes has a central control. Every node participates in the
execution of the job.
3. Wallet
It is a digital wallet that allows user to store their cryptocurrency. Every node in the
blockchain network has a Wallet. Privacy of a wallet in a blockchain network is
maintained using public and private key pairs. In a wallet, there is no need for
currency conversion as the currency in the wallet is universally acceptable.
Cryptocurrency wallets are mainly of two types –
1. Hot Wallet
2. Cold Wallet
Hot Wallet
These wallets are used for online day-to-day transactions connected to the internet. Hackers
can attack this wallet as it is connected to the internet. Hot wallets are further classified into
two types –
a. Online/ Web wallets –
These wallets run on the cloud platform. Examples – MyEther Wallet, MetaMask Wallet.
b. Software wallets –
It consists of desktop wallets and mobile wallets. Desktop wallets can be downloaded on a
desktop and the user has full control of the wallet. An example of a desktop wallet is
Electrum.
c. Mobile wallets –
They are designed to operate on smartphone devices. Example – mycelium.
Cold Wallet
These wallets are not connected to the internet. It is very safe and hackers cannot attack it.
These wallets are purchased by the user. Example – Paper wallet, hardware wallet.
a. Paper wallet –
They are offline wallets in which a piece of paper is used that contains the crypto address. The
private key is printed in QR code format. QR code is scanned for cryptocurrency transactions.
b. Hardware wallet –
It is a physical electronic device that uses a random number generator that is associated with
the wallet.
Nonce
A nonce is an abbreviation for “number only used once,” which is a number added to a
hashed or encrypted block in a blockchain. It is the 32-bit number generated randomly
only one time that assists to create a new block or validate a transaction. It is used to
make the transaction more secure.
It is hard to select the number which can be used as the nonce. It requires a vital
amount of trial-and-error. First, a miner guesses a nonce. Then, it appends the guessed
nonce to the hash of the current header. After that, it rehashes the value and compares
this to the target hash. Now it checks that whether the resulting hash value meets the
requirements or not. If all the conditions are met, it means that the miner has created
an answer and is granted the block.
Hash
The data is mapped to a fixed size using hashing. It plays a very important role
in cryptography. In a blockchain network hash value of one transaction is the
input of another transaction. Properties of the hash function are as follows –
● Collision resistant
● Hiding
● Puzzle friendliness
Cryptography
● Confidentiality: Information can only be accessed by the person for whom it is intended and no other person
except him can access it.
● Integrity: Information cannot be modified in storage or transition between sender and intended receiver
without any addition to information being detected.
● Non-repudiation: The creator/sender of information cannot deny his intention to send information at a later
stage.
● Authentication: The identities of the sender and receiver are confirmed. As well destination/origin of the
information is confirmed.
● Interoperability: Cryptography allows for secure communication between different systems and platforms.
● Adaptability: Cryptography continuously evolves to stay ahead of security threats and technological
advancements.
Types of Cryptography
In Asymmetric Key Cryptography, a pair of keys is used to encrypt and decrypt information. A
receiver’s public key is used for encryption and a receiver’s private key is used for decryption. Public
keys and Private keys are different. Even if the public key is known by everyone the intended receiver
can only decode it because he alone knows his private key. The most popular asymmetric key
cryptography algorithm is the RSA algorithm.
Types of Cryptography
Hash Function
This algorithm makes no use of any keys. A hash value with a fixed length is calculated based on
the plain text, making it impossible to recover the plain text’s contents. Many operating systems
encrypt passwords using hash functions.
Digital Signature
It's the digital equivalent of a handwritten signature or stamped seal, but it offers far
more inherent security. A digital signature is intended to solve the problem of tampering
and impersonation in digital communications.
Digital signatures can provide evidence of origin, identity and status of electronic
documents, transactions and digital messages. Signers can also use them to
acknowledge informed consent.
Digital Signature
The key generation algorithm selects private key randomly from a set of possible private keys. This
algorithm provides the private key and its corresponding public key.
2. Signing algorithm
Digital signatures are based on public key cryptography, also known as asymmetric
cryptography. Using a public key algorithm, such as Rivest-Shamir-Adleman, or RSA, two keys are
generated, creating a mathematically linked pair of keys: one private and one public.
Digital signatures work through public key cryptography's two mutually authenticating
cryptographic keys. For encryption and decryption, the person who creates the digital signature
uses a private key to encrypt signature-related data. The only way to decrypt that data is with the
signer's public key.
If the recipient can't open the document with the signer's public key, that indicates there's a
problem with the document or the signature. This is how digital signatures are authenticated.
Cryptocurrency
Cryptocurrency
The blockchain concept was originally developed to manage cryptocurrencies such as
bitcoin. Given the anonymity of crypto coins, blockchain is an effective way to
document transactions accurately and provide privacy for the parties involved.
Healthcare
The possibilities for blockchain use in healthcare seem endless. There are a number
of potential use cases: managing electronic medical record data, protecting
healthcare data, safeguarding genomics information, and tracking disease and
outbreaks,etc.
Use Cases of Blockchain
Government
There are many blockchain use cases in government agencies, including voting applications and
personal identification security.
Because blockchains can't usually be forged or their data manipulated, they can hold digital IDs,
certificates of any kind and even passports, Rafferty said. "This data can be accessed and
viewed at any time in a completely transparent manner, which will bolster international travel
industries."