BCT Unit-1
BCT Unit-1
What Is Blockchain?
• Blockchain technology is a digital database where information or data is
stored in blocks that are linked together to form a chain using cryptographic
hashes as unique IDs.
• Blockchain is a ledger i.e file that constantly grows and keeps the record of
all transactions permanently.
• 1992: After that in 1992, Merkle Trees formed a legal corporation by using a system developed
by Stuart Haber and W. Scott Stornetta with some more features.
• 2000: In the year 2000, Stefan Konst published his theory of cryptographic secured chains, plus
ideas for implementation.
• 2004: In the year 2004, Cryptographic activist Hal Finney introduced a system for digital cash
known as “Reusable Proof of Work”.
►
• 2008: After that 2008, Satoshi Nakamoto conceptualized the concept of
“Distributed Blockchain” in his white paper: ”A Peer to Peer Electronic Cash
System”.
• 2009: After that, the evolution of Blockchain is steady and promising and became
a need in various fields. In 2009, Satoshi Nakamoto Releases Bitcoin White
Paper.
• 2014: The year 2014 is marked as the turning point for blockchain technology.
Blockchain technology is separated from the currency and Blockchain 2.0 is born.
• 2018: Bitcoin turned 10 in the year 2018. The bitcoin value continued to
drop, reaching the value of $3,800 at the end of the year
• The way people use Blockchain and distributed ledger technologies or networks, on
the other hand, differs from context to situation.
• For example, Bitcoin is a digital cryptocurrency transacted using Blockchain and DLT
technology. because anyone from anywhere in the world can become a node, verify
other nodes, and exchange bitcoins, this form of a blockchain network is a public
network.
Types of Blockchain
1. Public Blockchain
• 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.
Advantages:
• Trustable: There are algorithms to detect no fraud. Participants need
not worry about the other nodes in the network
• Secure: This blockchain is large in size as it is open to the public. In a
large size, there is greater distribution of records
• 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.
• Decentralized: There is no single platform that maintains the
network, instead every user has a copy of the ledger.
Disadvantages:
• 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.
• Energy Consumption: Proof of work is high energy-consuming. It requires good
computer hardware to participate in the network
• Acceptance: No central authority is there so governments are facing the issue to
implement the technology faster.
Use Cases: Public Blockchain is secured with proof of work or proof of stake they can
be used to displace traditional financial systems.
Examples of public blockchain are Bitcoin, Ethereum.
2. Private Blockchain
It is a creative approach that solves the needs of the organization. This blockchain
validates the transaction and also initiates or receives transactions.
► Approval: All the members approve the protocol making it less flexible. Since
one or more organizations are involved there can be differences in the vision of
interest.
► Transparency: It can be hacked if the organization becomes corrupt.
Organizations may hide information from the users.
► Vulnerability: If few nodes are getting compromised there is a greater chance
of vulnerability in this blockchain
Use Cases: It has high potential in businesses, banks, and other payment
processors. Food tracking of the organizations frequently collaborates with their
sectors making it a federated solution ideal for their use.
Examples of consortium Blockchain are Tendermint and Multichain.
Components of blockchain
The technology behind Bitcoins is the Blockchain Network. Following are the
components of a Blockchain network –
1. Node
2. Ledger
3. Wallet
4. Nonce
5. Hash
1. Node –
It is of two types – Full Node and Partial Node.
Full Node –
It maintains a full copy of all the transactions. It has the capacity
to validate, accept and reject the transactions.
Partial Node –
It is also called a Lightweight Node because it doesn’t maintain
the whole copy of the blockchain ledger.
• It maintains only the hash value of the transaction. The whole
transaction is accessed using this hash value only.
• These nodes have low storage and low computational power.
2. Ledger –
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
1. 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.
2. 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.
The focus of wallets is on these three things –
1. Privacy
2. Transactions should be secure
3. Easy to use
► Privacy of a wallet is maintained using public and private key pairs. Transactions are made
secure as a private key is used both to send fund and to open the encrypted message.
4. 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.
5. 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
Blockchain Architecture
• Timestamp
• Blockchain Version
• Merkle Root
• Difficulty Target
• Nonce
• Previous Hash
Timestamp
• Timestamp is a small size data, which is stored in block header as a unique
serial.
• Its main function is to determine the exact moment in which the block has been
mined and validated by the network.
Block Version
• Block version’s function is used to talk about which kind of version of block is
using. Most of the block versions are:
• Blockchain Version 1.0 (Cryptocurrency): It is mainly used in public ledgers
containing systems. For example: Bitcoin, Bitcoin Cash
• Blockchain Version 2.0 (Smart Contracts):
• Blockchain Version 3.0 (DAPPS): It talks about decentralized applications.
• Blockchain Version 4.0 (Blockchain for Industry)
Merkle Root
• To understand Merkle root, we will have to understand the concept of Merkle
Tree. to get a hash value of each block we use this concept. A block within the
blockchain system, contains a number of transactions, and each transaction is
assumed as the leaf of the Merkle tree, and these leaves or transaction have their
own hash values.
A number of leaves or transactions make sub-branches. And, eventually all of the
branches’ hash values refers to the hash value of Merkle Root .
Difficulty Target
• Difficulty target refers to the measurement of difficulty level within block
mining. Where mining is a peer-to-peer process (P-2-P process), which is used
to secure and verify transactions.
• This blockchain mining process is done by blockchain miners who add data
transactions to the distributed public ledger.
Nonce
► Nonce is a number that can be used once, in cryptography it is a one-time code.
► In mining process, the main of miners is to find the hash value below a target number,
which is calculated based on the difficulty level.
► The server generates the nonce (a nonce) and sends it to the client. The client uses the
received code, adding it to the password before encryption, encrypts the received
string, and returns the resulting message to the server.
• The server decrypts the message from the received string to "subtract" the known
nonce and verifies the password.
• This nonce is used once and only once, all subsequent transfers of passwords with
the same nonce will be rejected by the server, so an attacker who intercepts a
message with an encrypted password will not be able to gain access by resending
the intercepted message to the server.
Previous Hash
• Previous hash is the hash value of previous block lying within the blockchain
system.
• Through a combination of pointer and hash function, blocks connect themselves
and do the chain formation. And the same reason is behind tamperproof ledger,
which is if any person tries to break the chain or edit any information, he will have
to change the whole nodes. Otherwise, it will regain its previous form.
Block Body