0% found this document useful (0 votes)
65 views23 pages

ODD 24-CSE3N4031-BCT-Module 3 Notes-Latest

Uploaded by

kguru8081
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)
65 views23 pages

ODD 24-CSE3N4031-BCT-Module 3 Notes-Latest

Uploaded by

kguru8081
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/ 23

CSEN4031-BCT-MODULE 3 NOTES

BITCOIN BLOCKCHAIN

Bitcoin - Open source P2P money


Bitcoin uses peer-to-peer technology to operate with no central authority or banks;
managing transactions and the issuing of bitcoins is carried out collectively by the
network. Bitcoin is open-source; its design is public; nobody owns or controls Bitcoin
and everyone can take part. Through many of its unique properties, Bitcoin allows
exciting uses that any previous payment system could not cover.
• Fast peer-to-peer transactions
• Worldwide payments
• Low processing fees

A bitcoin, at its core, is a fungible token representing value. The token is digital (or
virtual), and your public key is used to assign it to you. Ownership is transferred when
transactions are made to another person's public key. You use your wallet, the mobile
application, to send or receive Bitcoin.
Choose your wallet
Free Bitcoin wallets are available for all major operating systems and devices to serve
a variety of your needs. For example, you can install an app on your mobile device for
everyday use or a wallet only for online payments on your computer. In any case,
choosing a wallet is easy and can be done in minutes.
Get Bitcoin
You can get Bitcoin by accepting it as a payment for goods and services. There are also
several ways you can buy Bitcoin.
Spend Bitcoin
There are a growing number of services and merchants accepting Bitcoin all over the
world. Use Bitcoin to pay them and rate your experience to help them gain more
visibility.
Bitcoin Blockchain Structure
Bitcoin Blockchain Operations
It includes Mining and Network Consensus.

A blockchain is a decentralized, distributed, and public digital ledger used to record


transactions across many computers so that the record cannot be altered
retroactively without altering all subsequent blocks and the network consensus.
There are two significant participants in the Bitcoin network. The first participants are
people who initiate the transfer of value by creating a transaction.
Mining:
The second group of participants are called miners, which provide the computational
resources needed to:
• Verify transactions
• Broadcast transactions
• Compete for the right to create a block
• Reach consensus by validating the block
• Broadcast the new block
• Confirm transactions
For these computational resources miners provide, they are incentivized (Incentive
model) and rewarded with newly minted bitcoin, which is currently set at 6.25 BTC.

Mining
The algorithm that miners use to reach consensus is called the proof-of-
work protocol, which requires the miner to provide the necessary computational work
to solve a puzzle and claim the right to add a new block to the chain, broadcast their
validation work for consensus based on consensus status add the new block.
Consensus
Give the working of PoW (Proof of Work Consensus)

How does the Bitcoin blockchain work?


1. Step 1 – Record the transaction. A blockchain transaction shows the movement
of physical or digital assets from one party to another in the blockchain network.
...
2. Step 2 – Gain consensus. ...
3. Step 3 – Link the blocks. ...
4. Step 4 – Share the ledger.

Features of Bitcoin Blockchain


Here’s an overview of all the ways Bitcoin differs from two mainstream asset classes:

Bitcoin’s network effects, immutability, censorship resistance, capped supply (cannot


be minted in infinite numbers - maximum limit, which has its supply capped at
21,000,000 coins), and decentralization are what make it unique and set it apart as a
unique asset class.
What makes Bitcoin Different?
• Bitcoin vs. Other Cryptocurrencies: Bitcoin is the first and most well-known
cryptocurrency, using decentralized blockchain technology.
• Unique Features of Bitcoin: Bitcoin has a fixed supply of 21 million coins and
uses proof-of-work for security and transaction validation.
• Economic Principles: Bitcoin's attributes include scarcity, durability, divisibility,
and portability, making it a sound alternative to fiat currencies.
• Market Dominance: Bitcoin remains the leading cryptocurrency by market
capitalization and recognition.
• Ethereum as Number 2: Ethereum, known for its smart contract functionality, is
the second-largest cryptocurrency after Bitcoin.
• Bitcoin as "Digital Gold": Bitcoin is often called "digital gold" due to its fixed
supply and role as a store of value.

Core Features of Bitcoin


• Bitcoin's primary features include its decentralized nature, limited supply, and
the proof-of-work consensus mechanism. Bitcoin's supply is capped at 21
million coins, which creates scarcity and can potentially increase its value over
time. The proof-of-work system, where miners solve complex mathematical
problems to validate transactions and create new blocks, ensures the network's
security and integrity. Additionally, Bitcoin transactions are pseudonymous,
providing a level of privacy to users while maintaining transparency on the
blockchain.
• Bitcoin operates on sound money principles, including scarcity, durability,
divisibility, and portability. Its fixed supply contrasts with the inflationary nature
of fiat currencies, where central banks can print money at will. This
characteristic has led some to refer to Bitcoin as "digital gold." With one Bitcoin
being divisible into 100 million satoshis, Bitcoin's divisibility makes it suitable
for microtransactions and large transfers. Its portability allows it to be
transferred globally within minutes without intermediaries.
• Bitcoin has maintained its position as the leading cryptocurrency regarding
market capitalization and recognition. Its dominance is often reflected in the
cryptocurrency market's overall performance, with many altcoins following
Bitcoin's price trends. However, some altcoins have carved out significant
niches, offering unique features and use cases that Bitcoin does not. Despite
this, Bitcoin's first-mover advantage and widespread acceptance continue to
bolster its dominance.
The Rise of Alternative Cryptocurrencies (Altcoins)

Since Bitcoin's inception, thousands of alternative cryptocurrencies have been


developed. These altcoins aim to address the perceived limitations of Bitcoin and
introduce new functionalities. The cryptocurrency landscape now includes
various types of cryptocurrencies such as those focused on privacy (Pirate
Chain, Zcash), efficiency and transaction speed (Litecoin, Ripple), decentralized
applications (Ethereum), stablecoins (Tether, USDC), governance tokens
(Maker, Compound), and even meme coins (Dogecoin, Shiba Inu).

Notable Altcoins and Their Unique Features


Notable altcoins like Ethereum, Ripple, and Litecoin have gained substantial traction.
Ethereum is known for its smart contract functionality, allowing developers to build
decentralized applications (dApps) on its platform. Ripple focuses on facilitating fast
and low-cost international payments. Litecoin, often referred to as the silver to
Bitcoin's gold, offers faster transaction times and a different hashing algorithm.
Ethereum has firmly established itself as the second-largest cryptocurrency by
market capitalization. Ethereum's introduction of smart contracts has revolutionized
how transactions and agreements are executed on the blockchain. Its transition from
a proof-of-work to a proof-of-stake consensus mechanism, Ethereum 2.0, aims to
improve scalability, security, and energy efficiency.

How secure are Bitcoins?


The Bitcoin network's security is multi-layered. Transaction hashing, mining, block
confirmations, and game theory work together to make Bitcoin's blockchain
impenetrable. Since the first transaction block in 2009, the network has never once
shut down – and no Bitcoin has ever been stolen from the blockchain.
Bitcoin’s safety depends mainly on how you store it. Your choice of crypto wallet and
its encryption level play a big part in keeping your coins safe.
Mechanics of Bitcoins
• Bitcoin Transactions
Bitcoin Transaction

Bitcoin transaction means sending bitcoin from one person to another in the secured
blockchain network. These messages are digitally signed using cryptography and
verified by the miners in the blockchain network.

The transaction input is the Bitcoin address from which the money was sent, and
the transaction output is the Bitcoin address to which the money was sent.

Generally, a Bitcoin transaction takes 10 to 20 minutes to confirm any transactions.


If network congestion occurs, then time might take even 60 minutes.

Why Do Some Bitcoin Transaction Confirmations Take So Long?

The time taken for transaction confirmation mainly depends on two factors:
• Transaction fees: If the user pays minimal transaction fees, then the time
taken to confirm that particular user transaction would take longer vice versa.
The mining process needs significant technology and effort. Therefore,
transaction fees are essential.
• Network load: Every transaction gets stored temporarily in the memory pool
till the miners confirm it. When the transaction activities reach a certain high
threshold, the memory pool gets jammed, thereby slowing the confirmation
time of the transaction even more. Due to this, all the subsequent transactions
become susceptible to delay.

Transactions are the smallest building blocks of a blockchain system.


Transactions generally consist of a recipient address, a sender address, and a value.
This is similar to a standard transaction that you would find in traditional systems.

A Bitcoin transaction moves the value of some Bitcoin from one address to another.
A transaction changes the state of the agreed-correct blockchain.
This constant movement of coins constitutes the data within any blockchain
architecture, while how transactions are handled and verified varies by
implementation.
Format of a Transaction
Transactions contain one or more inputs and one or more outputs.

Transaction outputs consist of two parts:


• An amount of bitcoin, denominated in satoshis, the smallest bitcoin unit
• A cryptographic puzzle that determines the conditions required to spend the
output
The cryptographic puzzle is also known as a locking script, a witness script, or a
scriptPubKey.
Lock Time defines the earliest time a transaction gets validated and can be relayed
on the network.

An input is a reference to an output from a previous transaction.


An output specifies an amount and a recipient address.

An input always references a previous transaction's output. This continual pointer of


inputs to previous transactions' outputs allows for an uninterrupted, verifiable
stream of value (represented by the Bitcoin currency) amongst addresses.
The following diagram shows the stream of value amongst addresses.
Example:

Detailed Example of a Bitcoin Transaction:


• Bitcoin Mining Process

Proof of work is the mining process in Bitcoin Blockchain.


Note: Explain how it works. The pros and cons of it were discussed earlier in module
2.

The miner is the person who solves mathematical puzzles (also called proof of work)
to validate the transaction. Anyone with mining hardware and high processing power
can take part in this. Numerous miners simultaneously take part in solving the
complex mathematical puzzle; the one who solves it wins 12.5 bitcoins as a reward.
The miner verifies the transactions (after solving the puzzle) and then adds the block
to the blockchain when it is confirmed.
Note: Also, mention the difficulty level and its purpose, which were discussed in
earlier modules.

• Bitcoin Network
One of the core components of the Bitcoin system is the peer-to-peer network that
it runs on. While peer-to-peer, or P2P, networks existed before Bitcoin,
understanding what is happening on the Bitcoin P2P network is fundamental to
understanding Bitcoin.
When a new node boots up, it must discover other Bitcoin nodes on the network to
participate. To start this process, a new node must find at least one existing node on
the network and connect to it.
To connect to a known peer, nodes establish a TCP connection, usually to port 8333
(the port generally known as the one used by bitcoin), or an alternative port if one is
provided. Upon establishing a connection, the node will start a "handshake" (see the
initial handshake between peers) by transmitting a version message.
Once one or more connections are established, the new node will send an addr
message containing its IP address to its neighbors. The neighbors will, in turn,
forward the addr message to their neighbors, ensuring that the newly connected
node becomes well known and better connected. Additionally, the newly attached
node can send getaddr to the neighbors, asking them to return a list of other peers'
IP addresses. That way, a node can find peers to connect to and advertise its
existence on the network for other nodes to find it. Address propagation and
discovery shows the address discovery protocol.

A node must connect to a few different peers to establish diverse paths into the
Bitcoin network. Paths are not persistent - nodes come and go - and so the node must
continue to discover new nodes as it loses old connections and assists other nodes
when they bootstrap.
Nodes will periodically send a message to maintain the connection. If a node has not
communicated on a connection for more than 90 minutes, it is assumed to be
disconnected and a new peer will be sought. Thus, the network dynamically adjusts
to transient nodes and network problems and can organically grow and shrink as
needed without any central control.

• Bitcoin Scripts
Bitcoin Script serves as the scripting language behind Bitcoin transactions, allowing
users to define the conditions under which funds can be spent.

It operates by manipulating items on a stack, with various opcodes representing


operations that can be performed. This scripting language is deliberately concise in
nature.

The script is a fundamental programming language. It consists of two things:


1. Opcodes – Simple functions that operate on data.
2. Data – Such as public keys and signatures.

Pay-to-PubKey-Hash (P2PKH) – One type of Bitcoin Script


• Sends bitcoins to a Bitcoin address (hash of a public key).
• ScriptPubKey: OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY
OP_CHECKSIG
• Usage: Standard transactions, most common script type.

• • Locks funds to a particular public key hash (i.e., an address)

A locking script (ScriptPubKey) is placed on every output you create in a transaction:

It locks the funds until certain conditions are met. Check whether the balance is
correct or not. Further, it ensures that the same funds cannot be spent twice. The
output is considered as UTXO – Unspent Transaction Output.

An unlocking script (ScriptSig) must be provided for every input you want to spend
in a transaction:

It checks (Input is drawn from previous outputs) that the transaction initiator has
the necessary permissions to spend the bitcoins.

Every node will then combine and run these two scripts for each input in each
transaction they receive to make sure they validate.
If a full script (unlocking + locking) is valid, the output is "unlocked" and can be spent.

The Characteristics or Properties of Bitcoin Script


Stack-based Architecture
Reverse-Polish Notation (RPN)

Other Bitcoin Script Types


There are several Bitcoin Script types. Here are a few of them.
Pay-to-PubKey (P2PK)
• Sends bitcoins to a public key directly.
• ScriptPubKey: OP_CHECKSIG
• Usage: Early Bitcoin transactions.

Pay-to-Script-Hash (P2SH)
• Sends bitcoins to a script hash, enabling more complex transactions.
• ScriptPubKey: OP_HASH160 <ScriptHash> OP_EQUAL
• Usage: Multisig, escrow, and other complex transaction types.
• Bitcoin Wallets
A Bitcoin wallet is used to store the value of virtual money. The difference is that a
Bitcoin wallet stores a collection of private keys instead of a collection of bills and
cards. Typically, a wallet is encrypted with a strong password to protect it from
unauthorized access.
Unlike the Bitcoin network, a Bitcoin wallet is controlled only by its owner (it's not
distributed and shared like the blockchain).

It's essential to keep your Bitcoin wallet safe by either setting a strong password or
OTPs. This is required to keep it out of reach of malicious individuals.

Types of Wallets
There are many different Bitcoin wallets to choose from.
There are two broad types of wallets: soft wallets and hard wallets.

Soft or Hot Wallets:


• Web Wallets (browser-extension wallets)
Web wallets come in the form of a web browser extension. The software that powers
a web wallet is stored on your internet browser, which can introduce security risks.

Malware frequently targets web wallets, so having a healthy computer before


downloading one is essential. Security measures, such as scanning your computer
before downloading browser extension wallets, can help to mitigate risk.
• Desktop Wallets
The software that powers a wallet is stored on your desktop, which can greatly
reduce security risks. This gives an individual complete control (and responsibility)
over their wallet.
It's essential that strong passwords are used and reliable backups are made of any
desktop wallet.

Desktop wallets fall into two main categories known as "full nodes" and "light"
clients. Full nodes host a full copy of the blockchain (about 31 GB as of January
2015), while light clients provide only Bitcoin storage capabilities while depending on
an external source to read the blockchain.

• Mobile Wallets
The software that powers a wallet is stored on your Mobile. Mobile wallets are
simply Bitcoin wallets designed for a mobile device. This means they can quickly scan
QR codes, easily navigate with a touch screen, and are accessible while moving.
Mobile wallets are almost always "light" clients in that they do not store a full copy
of the blockchain.

The above three are Software Wallets.

• Hard or Cold Wallet


A hardware wallet is a specialized device explicitly designed to store bitcoins. The
advantage is that hardware wallets are much more difficult for a malicious user to
compromise when compared to a desktop or mobile wallet since they use the bare
minimum amount of software required to store bitcoins safely.
In all the above Bitcoin Wallets, Bitcoins are virtual in nature.
Examples of hot and cold wallets

• Custodian and Non-Custodian Wallets

• Paper Wallets
Paper wallets are a way to embody bitcoins in a physical medium such as paper or
metal. Like a printed banknote, if a paper wallet is lost or destroyed, the Bitcoin stored
on it is gone forever. This brings the physical aspect to Bitcoins.
MetaMask

What is MetaMask?

Public blockchains like Ethereum are the next evolution of Internet databases, and
MetaMask is the next evolution of the browser.
MetaMask is a web browser extension and mobile app that allows you to manage your
Ethereum private keys. By doing so, it serves as a wallet for Ether and other tokens and
will enable you to interact with decentralized applications or apps. Unlike some
wallets, MetaMask keeps no information on you: not your email address, not your
password, and not your Secret Recovery Phrase or other private keys. You retain all
power over your crypto-identity.

The MetaMask transaction fee is 0.875% Gas.

How to install MetaMask:


For Browser on laptop
Chrome
1. Visit https://metamask.io/
2. Hit "Download" in the menu bar.
3. Click “Install MetaMask for Chrome”. You will be directed to the Chrome Web
Store.

4. Click “Add to Chrome”.


5. On the pop up, click “Add extension”.
After adding MetaMask Extension, MetaMask will automatically open. You can also
ensure it's easily accessible in your toolbar by clicking the jigsaw icon at the top-right
of the screen and hitting the pin icon.

For Mobile

Android
1. Open the Play Store and search for "MetaMask". The official MetaMask app
looks like the screenshot below. Be VERY CAREFUL that you don't install a fake
MetaMask app! Look for the one with 10M+ downloads.
2. Tap 'Install' and wait for the process to finish.
3. Once installed, open the app and follow the prompts to create your wallet.
4. Back up your Secret Recovery Phrase somewhere safe and offline!

Cryptocurrency Regulations in different countries


Cryptocurrency regulations in the United States

Cryptocurrency regulation still varies considerably between US states; however,


progress is being made at the federal government level. Under the current regulatory
structure in the US, businesses exchanging cryptocurrencies must be registered with
the Financial Crimes Enforcement Network (FinCEN) to trade. They must also have
Anti-Money Laundering/Combating the Financing of Terrorism (AML/CFT) measures
and submit mandatory reports to oversight authorities.

Signifying just how important crypto regulation is at the federal level, in March 2022,
US President Joe Biden announced a “whole-of-government” approach to regulating
crypto assets in a vast executive order. This will force all federal agencies and
departments to consider how they protect consumers and ensure financial stability
and national security while addressing climate risks. Why was this announcement so
pivotal? The President’s statement states, “The United States must maintain
technological leadership in this rapidly growing space, supporting innovation while
mitigating the risks for consumers, businesses, the broader financial system, and the
climate. And, it must play a leading role in international engagement and global
governance of digital assets consistent with democratic values and US global
competitiveness”. As such, this statement shows the world that the US is preparing to
become a world leader in crypto.

Cryptocurrency regulations in the Asia/Pacific region

China

It is well-established that China has a global reputation for burdensome cryptocurrency


regulation. How tough? Consider that in 2021, 10 government authorities, including
the People’s Bank of China (PBOC), jointly stated to clarify that:
▪ virtual currency (cryptocurrency) is not legal tender
▪ cryptocurrency business activities are illegal
▪ cryptocurrency exchanges from overseas providing services to Chinese
residents online are deemed illegal financial activities.
Given the highly harsh regulatory environment for crypto trading in China, there is no
expectation that this position will change in the near or medium term. However, the
Chinese government will still embrace cryptocurrency. China is soon expected to
introduce its Central Bank Digital Currency (CBDC) (the so-called digital RMB or e-CNY),
which is undergoing extensive testing. e-CNY was even used by overseas attendees of
the 2022 Winter Olympics in Beijing.

Australia

Compared to many other countries, cryptocurrency regulation is relatively advanced


in Australia. Cryptocurrencies and exchanges are both legal in the country. Crypto
exchanges wishing to trade in Australia must register with and get approval from the
Australian Transaction Reports and Analysis Centre (AUSTRAC). AUSTRAC, like the FCA
in the UK, has the task of preventing, detecting, and responding to criminal abuse of
the financial system, including in crypto markets. Exchanges are, therefore, required to
adhere to strict AML and CFT regulations and reporting obligations. The Australian Tax
Office (OTA) has also made it clear that the disposal of cryptocurrency (i.e., selling,
gifting, trading, converting, or using) may attract capital gains tax (CGT).
The Australian Securities and Investments Commission (ASIC) has also provided
extensive regulatory guidance for businesses handling crypto-assets. This provides
regulatory guidance on:
▪ What should be considered when offering crypto-assets
▪ What is considered misleading or deceptive conduct about a crypto-asset or an
initial coin offering (ICO)
▪ When a crypto-asset or an ICO is considered a financial product
▪ When a crypto-asset trading platform becomes a financial market
We expect the Australian authorities to continue their rapid pace regarding crypto
assets regulation, further tightening the rules for crypto exchanges and potentially
becoming a world leader in this space.
Cryptocurrency Regulations in the European Union

As a bloc of nations overseen by Brussels, countries in the EU are not permitted to


establish their cryptocurrencies in the way that many other countries are. The use of
cryptocurrencies is legal across the EU, but there needs to be a consistent picture of
crypto exchanges. Crypto exchanges must register and gain approval from state-level
regulators before trading. Usefully, where an exchange gains authorization in one EU
country, the rights to trade are effectively passported, allowing them to operate across
the EU. Cryptocurrency exchanges must adhere to the strict requirements of 6AMLD
(the EU anti-money laundering directive).
The EU is now working on a new set of crypto regulations to take advantage of the
potential gains while mitigating the risks it poses. The Markets in Crypto-assets (MiCA)
Regulation was introduced in 2020 to provide a regulatory basis to enable crypto-asset
markets to develop within the EU where existing financial regulatory models could not
be used. Negotiations are now ongoing on the final shape of these crypto regulations
with individual EU nations. This includes a new regulatory approach to licensing crypto-
asset issuers, rules of conduct for those trading in crypto, and updated consumer
protections.

Question Bank
1. What is the primary difference between SHA-1 and SHA-256? Evaluate the
strengths and weaknesses of SHA-256.

2. Briefly describe the role of cryptographic hash functions in digital signatures.

3. What is the term for a Bitcoin wallet that stores private keys offline for
enhanced security? What term describes generating a Bitcoin wallet's address
from a public key?

4. Explain the use of SHA-256 in digital certificates and SSL/TLS protocols. What
operation in Bitcoin Script verifies a digital signature?

5. Analyze the significance of hash pointers in ensuring the integrity of


blockchain transactions.

6. Analyze the impact of Bitcoin halving events on the cryptocurrency's supply,


miner incentives, and market price. How do these events shape the Bitcoin
economy?

7. Describe the four independent processes contributing to Bitcoin’s


decentralized consensus mechanism. Explain how each process operates, and
discuss how these processes collectively ensure the integrity and security of the
Bitcoin network.

8. What is a Merkle tree? Describe its construction. "Distributed consensus is


impossible in an asynchronous system with a single failure." Describe how this
is handled in the blockchain.
9. Brief the proof-based consensus algorithms with the miner selection strategy
and their adoption of blockchain platforms. Vote-based consensus algorithms
for the blockchain require a minimum of 51% processes fault-free for _ type of
fault.

10. Distinguish among the roles and responsibilities of different types of nodes
in the Bitcoin network.

11. Describe the basic structure of a Bitcoin script and explain the significance
of the stack-based execution model. How does a Bitcoin script validate a
transaction's spending conditions? Provide an overview of the process involved.

12. Discuss in detail the types of consensus without identity. What is a hash
pointer? How is it different from a regular pointer?

13. Suppose there is a sudden increase in the number of miners joining the
Bitcoin network due to a rise in the price of Bitcoin. With this influx of new
miners, the network's total computational power (hash rate) significantly
increases significantly. Describe how the Proof of Work consensus model
handles this situation to ensure that blocks are added approximately every 10
minutes.

14. What is proof-based consensus? Mention any two approaches to it.

15. What is vote-based consensus? Mention any two approaches to it.

16. Describe generating a SHA-256 hash from a given input.

17. Brief Zero Knowledge Proof. Why are heavy nodes considered essential in
the Bitcoin network?

18. What is a crucial feature of Bitcoin Script that helps ensure transaction
validity and security?

19. How does Bitcoin ensure the anonymity of transactions?

20. Explain why hash pointers are considered more secure than traditional
pointers in data structures.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy