Unit - I

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 45

INTRODUCTION

What is blaockchain?
 A Blockchain is “an open, distributed legder that can record transactions
betwwen two parties efficiency and in a verifiable and permanent way”.
 The keywords:
o Open :accessible to all
o Distributed or Decentralized: no single party control
o eficient :fast and scalable,
o Verfiable :everyone can check the validity of informatio
o Permanent: the information is persistent.

Need of the blockchain


Below cases explain the need of blockchain technology industries.

Case:1 information sharing in traditional way

 Alice wants to share some documents with Bob.


 Alice will write down her content inside her document and share it with
Bob.
 Later, Bob updates it and shares it again with Alice.

Disadvantage:

The major disadvantage of this method is that both can’t simultaneously edit the
document.
Case:2 information sharing by using centralized database.
The shared Google docs or similar platforms, both Alice and Bob can write the
document simultaneously.

disadvantage of a centralized environment.

 The major problem of a centralized system is a single point of failure.


 If we do not have sufficient bandwidth, we will not download and edit the
document.
 What if the server crashes? There will be a 100% loss of data.

Case:3 information sharing by using blockchain technology

 Alice will keep her copy of the document.


 Bob will keep his copy of the document.
 They can independently write/modify their copy. The Blockchain
platform will ensure that the information inside the document will be
synchronized; both can see the most updated copy.
 This is the advantage of Blockchain technology.
 Blockchain is a decentralized database with strong consistency
support.
 It helps both Alice and Bob to simultaneously read or write the
documents.

Blockchain Architecture:
The below picture represents the Blockchain Technology where multiple nodes
(Entities or Users or Computers or Network Applications) communicate without
depending on a centralized system.

Fig:
1. Every node maintains a local copy of the global datasheet
2. The system ensures consistency among the local copies
 The local copies at every node are identical
 The local copies are continuously updated based on the global
information
3. In general, it is named as a public ledger
 A database of historical information available to everyone
 The historical information may be utilized for future computation
 Example from banking system:
 The historical information is the banking transactions
 The old transactions are used to validate the new transactions

Public Ledger or ledger: It works like a database containing the historical


information available to everyone, and it can be utilized for future computation.

Distributed ledger:

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.

Fig:

How does distributed leger works?


Example of the distributed ledger in banking sector

 Decentralized banking system every individual has their copy of the


global transactions, which are synchronized and consistent.

 Whenever we are trying to make a new transaction, the new transaction is


validated against the old transactions that are already there inside the
public ledger.

 We have 3 participants Alice, Bob, Eve, and Jane.

 Alice transfers 50$ to Bob


 As this is a valid transaction and this will be updated into the public ledger

 Bob transfers 30$ to Eve,

 it is also a valid transaction by seeing the public ledger.


 Alice tries to send 80$ to Eve.

 This transaction is not valid, and the participant will not accept it. Hence, it will
not be added into the public ledger as the record shows Alice is only having
50$.
WHAT IS BLOCKCHAIN TECHNOLOGY?

 A blockchain is a ledger that records data, documents, and transactions.


 “Blockchain” is a combination of the words “block” and “chain.” Data
recorded on the ledger is stored on the blocks, and blocks are chained
together in a cryptographical sequence.
 Blockchain protocol possesses three fundamental traits:
o decentralization,
o peer-to-peer network,
o Distributed storage of data.
Structure of block:

Body of the block:


Elements in the block:
Hash:
 A hash value is a hexadecimal value of a fixed length that uniquely identifies data.
Previous Hash:
 Hash value of the previous block
Transaction list:
 Details of the transaction such as sender name receiver name amount.
Time stamp:
 Timestamp information: displays the time and date of the block's creation.
Nonce:
 The number that is required to be solved by miners.

Structure of Blockhain:
 Blockchain is a linear chain of blocks.
 Each block contains a set of transactions and other essential details.
 Blocks are linearly connected and cryptographically secured.

Genesis Block

 Each block header contains the previous block hash, current block hash,
nonce, Merkle root, and other details.
 All blocks are connected linearly by carrying the hash of the previous
block.
 The previous block hash is used to compute the current block hash.
 The first block with no previous block hash is called “Genesis Block.”
 For adding a new block to the network, the blockchain follows consensus
mechanisms like proof of work (PoW), proof of stake (PoS), etc.
How does Blockchain Works?

Typical Blockchain Transaction Flow:

The transaction request is initiated by one entity to another in the network.


The transaction can be any digital asset.

The authenticity of a transaction gets verified by the other entities in the


network which has the copy o f the complete ledger.
Once the transaction is validated by the network, the same gets placed in
the transaction pool along with other transactions.

The validating nodes will then pick up a set of transactions and add it to a
new block.
After encrypting and digitally signed, the block will have the hash of the
last block in the blockchain added in its header. This block will be
validated by validator nodes.

Once the validation is completed, the block is added to the blockchain and
transaction data is secured in the blockchain.

This completes the transaction.


Nodes in Blockchain:

We had seen different set of nodes with different set of responsibilities.

1. A set of nodes which are initiating transactions


2. A set of nodes which are verifying transactions
3. A set of nodes which are creating and validating blocks
1. The set of nodes which are initiating the transactions:
o These could be simple blockchain client apps on a mobile or a PC.
Such nodes that can only initiate a transaction are called Light
nodes.
2. A set of nodes which are verifying transactions
o These nodes are called Full nodes. Full nodes can initiate the
transactions as well as verify the transactions initiated by other
nodes.
3. A set of nodes which are creating and validating blocks
o These nodes are called Miner and Validator nodes. These nodes
need to have the full copy of the blockchain. The miner or validator
nodes can initiate the transactions as well as verify the
transactions initiated by other nodes in the network.

The End user of the blockchain network can initiate the transaction by
installing an application which could either be the light node or full node.
The Blockchain developer community is responsible for designing the
protocol and implementing it into software.
The running of Blockchain network is handled by full nodes and
Miner/Validator nodes.
Blockchain History
Fig :

1991

In 1991, two scientists, Stuart Haber and W. Scott Stornetta, published a chain
of blocks secured using cryptography, the content and its date couldn't be
tampered with. This system later became known as Blockchain Technology.

1992

Merkle Trees was included to make it more efficient. This made adding
multiple documents on one block in a Blockchain possible.

2000

Stefan Konst published his theory for cryptographically secured chains


and their implementation.

2004

Hal Finney introduced a digital Cash system in the year 2004. This
system was referred to as a Reusable proof of work, and it solved the critical
issue of double spending.

2008

Satoshi Nakamoto publish is white paper “a peer-to-peer electronic cash


system” the concept of a Distributed Blockchain was documented.

2009

• Satoshi Nakamoto released the white paper for bitcoin in the year 2009.

• The first successful Bitcoin (BTC) transaction occurs between computer


scientist Hal Finney and the Satoshi Nakamoto.

2010

Laszlo Hanycez completes the first ever purchase using Bitcoin — two Papa
John’s pizzas. Hanycez transferred 10,000 BTCs, worth about $60 at the time.

2011

1 BTC = 1 USD, giving the cryptocurrency parity with the US dollar.


2012

• Blockchain and cryptocurrency are mentioned in popular television


shows like The Good Wife, injecting blockchain into pop culture.

• Bitcoin Magazine launched by early Bitcoin developer Vitalik Buterin.

2013

• Bit coin reached $100/BTC for the first time.

• Buterin publishes the “Ethereum Project” paper.

2014:

• Block chain 2.0 is born.

• The Ethereum Foundation got established by Vitalik Buterin

• In 2015, the concept of Smart contracts launched and turns out to be one
of the biggest applications of Blockchain.

2016

• IBM announces a block chain strategy for cloud-based business solutions.

2017

• Bit coin reaches $1,000/BTC for the first time.

• Japan legalized bit coin as a currency.

• Bit coin reaches its all-time high at $19,783.21/BTC.

2018

• Bit coin value dropped to $3,800.

• Google, Face book, and Twitter banned crypto currency advertisements.

• Completed 10 years in 2018.

2019
• Face book showed interest in the block chain space and announced their
crypto currency named Libra.

• Later, Amazon Web Services (AWS) announced the Amazon Block chain
service on its cloud platform

• Reaching the end of the year made nearly 450M+ blockchain-based


transactions.

2020

• In 2020, BTC almost reaches $30,000 by the end of 2020.

• PayPal announces it will allow users to buy, sell and hold


cryptocurrencies.

• Ethereum announced the building of Ethereum 2.0.

2021

• Bitcoin reaches $1 trillion in market value for the first time.

• Tesla buys $1.5 billion in BTC, becoming the first car manufacturer to
accept Bitcoin as a form of automobile payment.

• bitcoin value reached to $64,829.14 (highest yet) and declined to $35,000


as well.

• Popularity for the implementation of Web3 rises.

2022

• Ethereum has shifted from Proof of Work(PoW) to Proof of Stake(PoS)


consensus mechanism.

• Google launches a dedicated Digital Assets Team to provide customer


support on blockchain-based platforms.

• Cryptocurrency loses $2 trillion in market value, due to economic


inflation and rising interest rates.
Versions of blockchain Technology

Fig :

Blockchain technology had three basic iterations over the years.

Blockchain 1.0: The Origin of the Modern Blockchain

Blockchain 2.0: Smart Contracts

Blockchain 3.0: Decentralized Enterprise Level Applications

Blockchain 1.0
The Rise and Struggles of Blockchain as a Future Technology (2013 –
2018)

• Blockchain 1.0 was the first application of the technology implemented


by Nakamoto.

• This version is the simplest form of a decentralized ledger for recording


transactions and storing the data across several computers.

• we are referring to was a digital currency.

• Examples of blockchain 1.0 implementations cryptocurrencies such as


Bitcoin, Dogecoin, Litecoin, and Monero

1.Bitcoin:
• Bitcoin is essentially an electronic cash transfer system that is automated
and functions without the need for human intervention between
transactions as a trusted authority.

• Launched in 2009, Bitcoin is the world's largest cryptocurrency by


market capitalization.

• Bitcoin is a protocol which implements a public, permanent, and


decentralized ledger. Bitcoin transactions are verified by network nodes
through cryptography and recorded in a public distributed ledger called a
blockchain.

Fig:

2. Dogecoin:

• Dogecoin is a cryptocurrency created by software engineers Billy Markus


and Jackson Palmer in 2013.

• It is based on Litecoin and uses the same proof-of-work technology.

• It is considered an altcoin.
Fig:

3. Litecoin:

• Litecoin is a cryptocurrency founded in 2011, two years after Bitcoin, by


a former Google engineer named Charlie Lee.

• Litecoin has a faster transaction processing time compared to Bitcoin.

• A Blockchain cloned from Bitcoin

Fig:

4. Monero:(XMR)

 Monero was launched in April 2014.


 Monero is electronic cash that allows fast, inexpensive payments to and
from anywhere in the world.
 Monero is a cryptocurrency which uses a blockchain with privacy-
enhancing technologies

Fig:
Blockchain 2.0
• The next development in blockchain technology expanded on the
capabilities of the blockchain protocols.

• Vitalik Buterin introduced the concept of Ethereum, a technology based


on blockchain with some notable improvements over the previous
generation.

• Ethereum was the first blockchain with the smart contract integrated into
its protocol.

• Ethereum is a technology with multiple components - a virtual machine


with multiple layers of information, user accounts, contracts, and cost
accounting (a metric known as ‘gas’).

1. Smart contracts:

• Smart contracts are simply programs stored on a blockchain that run


when predetermined conditions are met

• They typically are used to automate the execution of an agreement


between two users and enable two users do cryptocurrency transactions.

Examples of Blockchain 2.0 technologies

• cryptocurrency platforms (Ethereum, Lisk, and Neo),

• Defi applications (like MakerDAO, Uniswap), and

• Browser extensions like MetaMask.

Blockchain 3.0
 Blockchain 3.0 is the final developmental stage of blockchain technology.
 Blockchain 3.0 has applications in a broader set of industries outside the
domain of finance and economics.
 The major concerns for this generation of blockchains are sustainability,
scalability, cost-effectiveness, more decentralization, and improved
security

Examples of these applications

• Healthcare (smart contracts for medical services and EMR storage),

• Cybersecurity (multi-factor authentication),

• Supply chain (smart delivery contracts),

• Manufacturing.

What is Cryptography?
Cryptography uses mathematical techniques to transform data and prevent it from being read or
tampered with by unauthorized parties.

Basic terms used in cryptography:


Plain Text –
o The original message or ordinary readable text.

Ciphertext :
o Ciphertext is encrypted text transformed from plaintext using an encryption algorithm.

Encryption –
o A process of transforming Plain Text into Cipher Text is known as Encryption.

Decryption –
o A reverse process of encryption is known as Decryption. It is a procedure of transforming
Cipher Text into Plain Text.

Key :
o A key is a group of random characters in a particular order, known only to
sender/receiver
Working of Cryptography:

Types of Cryptography:
Symmetric Cryptograph or private key cryptography:
Asymmetric Cryptography or public key Cryptography:

Applications of Cryptography
 Transaction through Digital Currency
 Computer Passwords
 Secure Web Browsing
 Electronic Signature
 Authentication
 Cryptocurrency
 Email Delivery
 End to End encryption

Principles of cryptography:
 Confidentiality:
o Confidentiality refers to the ability to keep information private and secure.
 Integrity:
o Integrity ensures a message or transaction has not been tampered with .
 Non-repudiation :
o Non-repudiation refers to the ability to prevent someone from denying that they
performed a particular action.
 Authentication :
o Authentication refers to the process of verifying the identity of a user or device.

Currency:
Before we understand cryptocurrency, let’s first understand some basics about
currency that is being used in today’s world. It is also known as “Fiat Currency.”
Characteristics of Fiat Currency:

1. These are owned by government of respective country.

2. These are centrally controlled through various financial institutions like banks
and legal entities.

3. It is very Inflationary which means over a period of time, the value of the
currency decreases and inflation use in the intuition all together.

4. It include various security properties which are being implemented to prevent it


from counterfeiting or being cheated.

5. But, it is not really impossible to counterfeit these currencies. We probably


come across various cases where these currencies across the globe have been
counterfieted in some other way.

6. That is the reason why Law enforcement comes in picture to stop and to
prosecute those who involve into counterfeit Fiat currency.

There are various Security Features that are being implemented in Fiat
Currencies:These are very common across the globe like Watermark, Security
Thread, Images, Identification marks, fluroscent inks are being used in currency
notes.
Watermark
Security Thread

Cryptocurrency
 A cryptocurrency is a digital currency, which is an alternative form of payment
created using encryption algorithms.

 The term cryptocurrency, also known as crypto or crypto-currency.

Types of cryptocurrency:
Working of cryptocurrency:
o Cryptocurrency transactions occur through electronic messages that are sent to the entire
network with instructions about the transaction.
o The instructions include information such as the electronic addresses of the parties
involved, the quantity of currency to be traded, and a time stamp.
o Suppose Alice wants to transfer one unit of cryptocurrency to Bob. Alice starts the
transaction by sending an electronic message with her instructions to the network, where
all users can see the message.
o The transaction sits with a group of other recent transactions waiting to be compiled into
a block (which is just a group of the most recent transactions).

o The information from the block is turned into a cryptographic code and miners compete
to solve the code to add the new block of transactions to the blockchain.
o Once a miner successfully solves the code, other users of the network check the solution
and reach an agreement that it is valid.

o The new block of transactions is added to the end of the blockchain,


o Alice's transaction is confirmed.

Example of crypto currency transaction by using public key:


Advantages of Cryptocurrency:
1. Transaction speed

If you want to send someone money in the United States, there are few ways to move money
or assets from one account to another faster than you can with cryptocurrency.

2. Transaction costs

The cost of transacting in cryptocurrency is relatively low compared to other financial


services.

3. Accessibility

Anyone can use cryptocurrency. All you need is a computer or smartphone and an internet
connection. The process of setting up a cryptocurrency wallet is extremely fast compared to
opening an account at a traditional financial institution. There's no ID verification. There's no
background or credit check.

4. Security

Unless someone gains access to the private key for your crypto wallet, they cannot sign
transactions or access your funds.

5. Privacy
Transactions are pseudonymous, which means you have an identifier on the blockchain --
your wallet address -- but it doesn't include any specific information about you.

6. Transparency

All cryptocurrency transactions take place on the publicly distributed blockchain ledger.
There are tools that allow anyone to look up transaction data, including where, when, and
how much of a cryptocurrency someone sent from a wallet address.

Disadvantages:
1. Scalability
The number of users, transactions, and applications increases, the ability
of blockchain networks to process and validate them in a timely way becomes
strained.
2. Interoperability
Interoperability, or the ability of different blockchain networks to
communicate and interact with each other, is another crucial challenge facing the
industry.
3. Complexity
Blockchain is a complex technology that requires a high level of technical
expertise to implement and maintain.
4. Energy Consumption
The process of validating transactions on a blockchain network requires a lot of
computing power, which in turn requires a lot of energy.

Financial Services:
There are many financial services for buying, selling, exchange the bitcoin online.

Ripple:

 Ripple is a for-profit platform and cryptocurrency and a product of Ripple Labs.


 The cryptocurrency of Ripple is XRP.
 Ripple’s cryptocurrency, XRP, has a valuation of more than $90 billion.
 Ripple has RippleNet, a network of payment facilitators. These are primarily banks and
finance companies that use Ripple for conducting transactions smoothly all across the
globe.
 Ripple is also developing a smart contracts platform and language, Codius.

Coinffeine:

 Coinffeine will allow customers in over 70 countries to purchase and sell bitcoin.
 Coinffeine has launched its decentralised open-sourced P2P bitcoin exchange in over 70
countries.
 By integrating with Russia-based payment processor OKPay, the Spanish company
has enabled bitcoin enthusiasts to purchase and sell the digital currency in countries including
Russia, China, Indonesia, Brazil and the Eurozone.

Paypal

 Crypto, short for cryptocurrency, is a digital currency you can buy, sell, and securely hold in
your PayPal account.
 PayPal also supports the transfer of cryptocurrencies between PayPal, Venmo, and other
supported wallets and exchanges.

Kraken

 Kraken is a United States–based cryptocurrency exchange, founded in 2011.


 Kraken is a cryptocurrency exchange based in San Francisco where market participants can
trade various cryptocurrencies.
 The participants are allowed to buy or sell the cryptocurrencies using various fiat currencies
that include U.S. dollars, Canadian dollars, euros, and the Japanese yen.

BTCjam:

 BTCjam was a peer-to-peer lending (aka "P2P lending") service where individuals
could borrow or lend using bitcoin.

Tera Exchange:

 TeraExchange, LLC, is a Commodity Futures Trading Commission regulated swap execution


facility (SEF) offering institutional market participants Dodd-Frank Act compliant end-to-end
exchange services,

Vaurum:

 Vaurum is building an API for financial institu‐ tions to offer traditional brokerage investors
and bank customers access to Bitcoin.

Buttercoin

 Buttercoin, a Bitcoin trading platform and exchange for high-volume transactions (200,000–
500,000 Bitcoin, or $70–$175 million), targeted at a business clientele who has a need to
complete large-scale Bitcoin transactions

DTCC:

 Depository Trust Company and the National Securities Clearing Corporation, or DTCC is
current stock trading market infrastructure that provides clearing, settlement, risk
management, central counterparty services and a guarantee of completion for certain
transactions.
Bitcoin Prediction Markets:
What is prediction:
A prediction is what someone thinks will happen. A prediction is a forecast, but not only
about the weather. Pre means “before” and diction has to do with talking. So a prediction is a
statement about the future. It's a guess, sometimes based on facts or evidence .

 Crypto prediction markets allow users to earn money by predicting random crypto-related
events.
 One example of new tech with old tech is Bitcoin prediction markets like Predictious and
Fairlay.

Predictious:
Predictious is an online Bitcoin prediction marketplace. Users can trade predictions on Sport, Movies,
TV, Politics, Bitcoin Economy, etc. and if they are correct, they can win Bitcoins. Members can use
the Predictious' API to create custom applications and prediction market bets are futures contracts.
Fairlay:
Fairlay is a beta website which seeks to predict the bitcoin market and gain foreknowledge of its ups and
downs.

Centralized Vs Decentralized
Centralized:
A centralized database is a collection of data that is stored, located, and maintained in a single location.
This kind of database is modified and managed from that single location only. For instance, a desktop or
server CPU or a mainframe computer can be called a centralized database system.

Disadvantages:

 Single point of failure — One of the main risks is a “single point of


failure”. In the event of a failure, the entire data stored on the server
becomes vulnerable.
 Bottlenecks — A centralized database causes high data traffic and results
in bottlenecks because the entire data is located in a single place.
 Siloed ecosystems — It can cause data silos, which makes the data
unavailable to some parts of the organization.
 Lack of privacy — In some cases, centralized database systems share the
user data with third parties. Hence, They do not provide privacy of user
data.
 Vulnerable to thefts — Centralized systems are vulnerable to hacks and
thefts of the data, which makes it less secure.

Decentralized:

A decentralized database does not have a central owner or a single authority.


Unlike the centralized database, the entire data is spread across multiple servers
and controlled by several nodes or users. When modifications are made to the data
by one node, it reflects in all computers of the network. Decentralized databases
solve several issues of the traditional systems and are proven to be more efficient.

Advantages:
 Decentralized — A decentralized framework using blockchain eliminates a
single point of failure.
 Distributed — Data is distributed across several nodes. This ensures that
data can always be accessed even if one or more nodes are down.
 Security — A decentralized database uses cryptographic techniques to
ensure full privacy and security of information.
 Scalability — The central server resources are finite in centralized systems.
If the number of clients increases, the server load may increase and cannot
perform well. In the case of decentralized databases, the capacity increases,
and more users can access the data at the same time.
 Immutability — The data once stored on the blockchain cannot be altered
or manipulated. This ensures that data is resilient thereby giving more
accountability to information.

Characteristics of Blockchain

Blockchain has the following characteristics:


1. Distributed
2. Decentralized
3. Immutable
4. Highly available
5. Transparent
6. Supporting privacy
7. Auditable
8. Secure

Didtributed:

Blockchain processes and store data at multiple participants, so by nature blockchain is


distributed system.
Decentralized:

Highly Available:

Immutable:

Transparent:

Auditable:

Secure:

Supporting privacy:
Distributed trust:
Blockchain is a complex technology, but it is very simple - distributed trust. This means you
can trust the network, without trusting anyone - or anything on the network.

The following features make the blockchain network is a distributed trusted network.

 Peer-to-peer network
 Immutable
 Transparency
 Auditable
 Distributed ledger
 No third party

Peer-to-per network:
Blockchain is decentralized and peer-to-peer networking system so it enables direct peer-to-
peer transactions.

Immutable:

Once data stored on blockchain database that we cannot altered and tempered.

Transparency:
All transactions are recorded on distributed ledger and every participant have one copy of
ledger is mechanism encourage the transparency on the network.

Auditable:
Blockchain records the entire journeys of transaction from starting to end these are called
logs. These logs are available at every node for auditing.

Distributed ledger:
Blockchain database is also called the distributed ledger because every node has copy of
database.

No third party:
There is no third party as intermediate for verifications of transaction. We can directly
transfer the amount one account to another.
Advantage using blockchain :
1. It provides greater trust among users.
2. It provides greater security among data.
3. Reduce the cost of production.
4. Improve Speed.
5. Invocation and tokenization.
6. It provides immutable records.
7. Smart contracts
Disadvantages using blockchain :
1. Data modification is not possible.
2. It requires large storage for a large database.
3. The owner cannot access the private key again if they forget or lose it.

You might also like