8/25/2025
Unit -2
Bitcoin and Blockchain
Bitcoin
• Bitcoin is an innovative digital payment system. It is an example of
a cryptocurrency and the next big thing in finance.
• It is a virtual currency designed to act as money and outside the
control of any person or group thus eliminating the need for third-
party in financial transactions.
• It is used as a reward for the miners in bitcoin mining.
• It can be purchased on several exchanges.
1
8/25/2025
Creation of Coins
• The units of cryptocurrency are created through a process called
mining.
• Mining is the process of validating cryptocurrency transactions and
creating new units of cryptocurrency.
• The mining process uses powerful computer hardware and software to
solve complex mathematical problems that generate coins.
• Cryptocurrencies use blockchain technology. Therefore, whenever a
cryptocurrency transaction occurs, cryptocurrency miners try to
decrypt the block containing the transaction information.
• Cryptocurrencies are broadly divided into two groups – coins and
tokens.
• A coin is a cryptocurrency application that runs on its own blockchain,
where all transactions take place.
• Tokens, on the other hand, work on existing blockchain infrastructure
and are typically used for physical objects like smart contracts. digital
services, etc.
• The coin creation process is not that challenging.
• You can simply copy Bitcoin’s code, add a new variable, or even
change its value, and that’s it – you have your blockchain and your
coin.
2
8/25/2025
S No. Coins Tokens
A new blockchain must be created Tokens can use an existing
1.
for the coin. blockchain
An in-depth understanding of how
Tokens use open-source code and are
2. blockchain works and programming
relatively easier to create.
skills are required.
Due to the creation of a new
3. blockchain, the investment can be Creating tokens is faster and cheaper.
significant.
Payments and double spending
• What is payment in blockchain?
• Blockchain facilitates fast, secure, low-cost international payment
processing services (and other transactions) through the use of
encrypted distributed ledgers that provide trusted real-time verification
of transactions without the need for intermediaries such as
correspondent banks and clearinghouses.
3
8/25/2025
4
8/25/2025
• What Is Bitcoin Script?
• Bitcoin Script is the programming language that underpins Bitcoin
transactions.
• If you're wondering “what is Bitcoin Script?”, it serves as a crucial
mechanism that allows users to define the conditions under which
funds can be spent.
• Unlike traditional financial transactions, Bitcoin transactions involve
the execution of specific conditions encoded in Bitcoin Script.
• It operates by manipulating items on a stack, with various opcodes
representing operations that can be performed.
5
8/25/2025
• This scripting language is deliberately limited and designed to be non-
Turing complete for security reasons, preventing potentially malicious
or infinite loops from being executed on the Bitcoin network.
What are Peer-to-Peer (P2-P) Networks?
• Peer-to-peer (P2P) networks are decentralized networks that distribute
workloads among peers, which are equally privileged, equipotent
participants in the application.
• They are designed to share resources among the participants without
the need for a centralized administrative system.
• Each peer in a P2P network acts as both a client and a server, making
the network highly resilient and scalable. This architecture allows for
the direct sharing of information, files, or resources among peers.
6
8/25/2025
How do peer-to-peer (P2P) networks work?
• As we know, a P2P network has no central server overlooking them;
the users or nodes are responsible for maintaining the network.
• Every node participating in the network acts as a server that can
upload, download, and share files with other nodes.
• The nodes use their hard drives instead of a central server to store this
data.
• As these capabilities to transmit, receive and store files lie with each
node, the P2P network is more secure, fast and efficient.
• It is important to note that to make peer nodes easily locatable to new
peers that join the network, the P2P architecture must have many
active nodes in the blockchain network, as this is when it functions
best.
• If many nodes leave the network, it is necessary to ensure enough are
left to pick up the slack.
7
8/25/2025
Types of peer-to-peer (P2P) networks
• The network is categorized into three types of P2P networks based on
their architectural differences.
• Structured peer-to-peer networks
• In this network, an organized structure is used in which the nodes
interact, making it possible for the nodes to easily search for files even
if the data is unavailable.
• Due to this organized structure, some amount of centralization exists
in this type of network.
• Despite providing easy access to data, a structured P2P network is
more challenging and costly to set up.
2.Unstructured peer-to-peer networks
• In this type of network, there is no set structure for the nodes to
follow. Participants can join or leave the network as and when they
desire.
• This lack of a definite structure leads participants to communicate
randomly with each other.
• This network is easy to build, but it requires high CPU power as all
nodes must remain active to process a high number of transactions.
• Memory usage is also increased as search queries are sent to the
whole network.
• An unstructured peer-to-peer network is best applicable for high churn
activity, such as for a social platform.
8
8/25/2025
3. Hybrid peer-to-peer networks
• A hybrid P2P network is a combination of a peer-to-peer and client-
server model.
• The network has a central server that stores information on the
location of resources and uses this server to conduct searches.
• In comparison to the structured and unstructured P2P network, a
hybrid P2P network has better performance.
• It provides centralization, which is required for specific queries while
providing the benefits of a decentralized network.
Role of Peer-to-peer (P2P) in Blockchain
• P2P networking architecture is a fundamental element in blockchain
technology, as it allows cryptocurrencies (e.g. Bitcoin network) to be
transferred globally without any intermediary, middleman or central server.
• The creator of Bitcoin, Satoshi Nakamoto, referred to it as a “peer-to-peer
electronic cash system” which was created with the aim of having a P2P
digital form of money.
• Blockchain leverages the P2P network technology to provide a decentralized
ledger for one or more digital assets.
• In this decentralized P2P network, all the nodes or computers are connected to
one another in some way.
• A complete copy of the ledger is maintained by each node and is compared to
other nodes to ensure the accuracy of data. This is the opposite of a bank,
where transactions are privately stored and can only be managed by the bank.
9
8/25/2025
Benefits of P2P networks:
Low cost
• In a P2P network, every node acts as a server, and there is no central server.
This saves the cost of buying an expensive server, making it a cost-effective
network.
Scalable
• Bottlenecks faced in a centralized server model, when the number of clients
increases, are eliminated in a P2P network as each node can be a server. The
P2P network is designed to be scalable, as an increase in the number of
clients results in an equal increase in the number of servers.
Resilient
• Compared to centralized networks, a P2P network is more resilient to
failure as the loss of a single node does not bring down the entire network.
Transaction in Bitcoin
10
8/25/2025
Blockchain Mining
11
8/25/2025
Blockchain Mining
12
8/25/2025
Block Propagation
• Definition:
• It's the mechanism by which a
newly mined or created block is
disseminated(circulate) from the
miner to all other nodes in the
blockchain network.
• This term refers to the mechanism
by which new blocks are
distributed and shared across a
blockchain network.
• Efficient block propagation is vital
for maintaining the integrity,
security, and speed of blockchain
operations.
Purpose:
• Ensures that all nodes have the most up-to-date version of the blockchain,
maintaining the integrity and consistency of the ledger.
Importance:
• Efficient block propagation is vital for network speed, security, and the
overall smooth operation of the blockchain.
Process:
• When a miner adds a new block, it's broadcast to its connected peers, who
then forward it to their peers, and so on, until all nodes have received the
block.
Challenges:
• Slow block propagation can lead to longer transaction confirmation times
and potential forking issues where different nodes have different versions of
the blockchain.
13
8/25/2025
Block Relay
• Definition:
• A technique to optimize the block propagation process, aiming/focus
to reduce network load and propagation time.
Purpose:
• To minimize the amount of data transmitted and the number of hops
required for a block to reach all nodes.
Optimizations:
• Block relay often involves techniques like compact block relay, where
only essential data is transmitted, or the use of efficient protocols like
Graphene protocol.
Benefits:
• Reduced network congestion, faster block propagation, and improved
overall network efficiency.
Examples:
• Compact Block Relay: Only transmits necessary block data, reducing
the amount of information that needs to be sent.
• Graphene Protocol: An advanced technique for efficient block
propagation, optimizing data transmission.
• Block propagation is the fundamental process of distributing new
blocks, while block relay is a set of techniques used to improve the
efficiency and speed of that distribution process.
• Optimizing both is crucial for maintaining a scalable and efficient
blockchain network.
14
8/25/2025
Working with consensus in Bitcoin
Consensus mechanisms
The primary consensus mechanism used in Bitcoin is Proof-of-
Work (PoW).
15