Unit 1 Notes
Unit 1 Notes
Blockchain
Blockchain is a distributed software network that functions both as a digital ledger
and a mechanism enabling the secure transfer of assets without an intermediary.
Just as the internet is a technology that facilitates the digital flow of information,
blockchain is a technology that facilitates the digital exchange of units of value.
Blocks are files where data pertaining to the Bitcoin network are permanently
recorded. A block records some or all of the most recent Bitcoin transactions that
have not yet entered any prior blocks. Thus, a block is like a page of a ledger or
record book.
Many people confuse and believe blockchain to be bitcoin. But, bitcoin is one
application of the blockchain technology. There are many other applications
and use cases that can be solved using blockchain other than just payment
systems.
Advantages of Blockchain
1. Blockchains are expected to be implemented by most businesses because of the
several benefits it provides.
2.The blockchain eliminates the need of a third party between two entities that are
willing to exchange something.
3.This saves time as exchanges can be done without any outside interference. It
saves money as it reduces overhead and cost of intermediaries.
4. It reduces risk of tampering, fraud and cyber crime due to its immutable nature.
5. There is no need to trust a third party now as the records are stored in distributed
ledgers.
Types of Blockchain
There are different types of blockchains possible in the ecosystem.
1. Public –
A public blockchain is also known as permission-less blockchain. Here,
everyone can be a part of this blockchain and can participate by running as a
node, by mining a block or by making transactions in the blockchain. Bitcoin
and Litecoin are examples of public blockchains.
2. Private –
A private blockchain is also known as permissioned blockchain. Here, there
are restrictions on the participation as only selected individuals or member of
an organisation can be a part of the blockchain. Multichain and Hyperledger
projects (Fabric, Sawtooth) are examples of private blockchain.
3. Consortium (an association)–
A consortium blockchain are said to be partially-decentralised or semi-
decentralised. It is controlled by a group of organisations unlike one
organisation as in private blockchain. The member organisations has the
authority to participate by running as a full node, by mining etc. R3 and EWF
(Energy Web Foundation) are examples of consortium blockchain.
Blockchain architecture:
Mostly people think that Blockchain is Bitcoin and vice-versa. But it’s not the
case. In fact, Bitcoin is a digital currency or cryptocurrency that works
on Blockchain Technology.
As the name suggests, blockchain is a chain of blocks that contains information.
Each block consists of a number of transactions and each transaction is recorded in
the form of Hash. Hash is a unique address assigned to each block during its
creation and any further modification in the block will lead to a change in its hash.
Blockchain vs Bitcoin
Bitcoin is a crypto-currency (a kind of digital currency), mainly created to simplify
a transaction without having third-party intermediaries. It all started when this
mysterious man under the name of Satoshi Nakamoto (whose actual identity is
still unknown) published a white-paper named Bitcoin: A Peer-to-Peer
Electronic Cash System in 2009. A Satoshi is the smallest unit of Bitcoin. A
unit of Satoshi is equal to 0.00000001 bitcoin.
The most interesting part here is that these Bitcoins are not issued by any
centralised banks or authorities. They are ‘mined’ by a group of people called
as ‘miners’. They solve complex mathematical problems/puzzles and are issued a
certain number of Bitcoins in exchange.
Blockchain
Blockchain is a data structure or ledger that stores information about any
transactions that occurs(not just bitcoin). Anything that is stored once can’t be
changed or modified. This feature of Blockchain makes it the most secure. It
is decentralized and establishes a peer to peer network thus eliminating any
middle-men.
Blockchain is made up of blocks that are stored in a chronological order. Each
block has a capacity of around 500 transactions on an average. Thanks to the
cryptography involved, these blocks are extremely secure. Each block will a
unique ‘hash’ value attached to it which is calculated based on the data stored in
the block. Every-time a new block is added to the chain, the new block contains the
hash of the previous block as well. So modifying the contents of any previous
block is practically impossible(and would destroy the whole chain). This makes
Block-chain immutable.
Hashing process:
For this hash function we can use Anders Brownworth Hash Program, a program
developed by Anders Brownworth.
If we type any character in the data section, we will observe its corresponding
cryptographic hash in the hash section.
Small Changes In The Input Changes the Hash:
If we make a small change in the input, the equivalent hash produced will be
entirely different.
Changing the capital “T” to small “t” completely changed the equivalent hash.
It is very difficult to determine the original string from the equivalent hash but its
not impossible. The only method to determine the original string from its hash is
by using “brute-force”. Brute-force basically means that we have to take random
inputs, hash them and compare them with the target hash.
Features of Hashing
1. Fixed-Length Output
o No matter the size of the input, the output hash is always of a fixed
length.
o Example: SHA-256 always produces a 256-bit hash.
2. Deterministic
o The same input always produces the same hash.
3. Fast Computation
o Hash functions are optimized to generate hash values quickly.
4. Irreversibility (One-Way Function)
o It is computationally infeasible to reverse-engineer the original input
from the hash.
5. Avalanche Effect
o A small change in input results in a completely different hash.
o Example:
vbnet
CopyEdit
Input: "Hello"
Hash:
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
Cryptography
Cryptography is the practice of securing information by converting it into an
unreadable format to prevent unauthorized access. It ensures confidentiality,
integrity, authentication, and non-repudiation of data. Cryptography is widely
used in blockchain, secure communications, digital signatures, and online
transactions.
Types of Cryptography
1. Symmetric-Key Cryptography (Secret Key Cryptography)
o Uses a single key for both encryption and decryption.
o Fast but less secure if the key is compromised.
o Example: AES (Advanced Encryption Standard), DES (Data
Encryption Standard).
2. Asymmetric-key cryptography (Public Key Cryptography)
o Uses a pair of keys: Public Key (for encryption) and Private Key
(for decryption).
o More secure but computationally slower.
o Example: RSA, Elliptic Curve Cryptography (ECC), ECDSA.
3. Hashing (One-Way Cryptography)
o Converts data into a fixed-length hash value.
o Used for data integrity and authentication.
o Example: SHA-256, Keccak-256 (SHA-3), MD5.
4. Quantum Cryptography (Emerging Technology)
o Uses quantum mechanics for ultra-secure encryption.
o Example: Quantum Key Distribution (QKD).
Distributed ledger
A distributed ledger (also called a shared ledger or distributed ledger
technology or DLT) is a consensus of replicated, shared, and synchronized digital
data geographically spread across multiple sites, countries, or institutions. Unlike
with a distributed database, there is no central administrator.
The most important difference to remember is that blockchain is just one type
of distributed ledger. Although blockchain is a sequence of blocks, distributed
ledgers do not require such a chain. Furthermore, distributed ledgers do not need
proof of work and offer – theoretically – better scaling options.
Consensus in blockchain
All the decisions are taken by the leader or a board of decision makers. This isn’t
possible in a blockchain because a blockchain has no “leader”. For the blockchain
to make decisions, they need to come to a consensus using “consensus
mechanisms”.
So, how do these consensus mechanisms work and why did we need them? What
are some of the consensus mechanisms used in cryptocurrencies?
So now what we have defined what a consensus is, let’s look at what the objectives
of a consensus mechanism are
• Cooperative: All the participants shouldn’t put their own interests first and
work as a team more than individuals.
• Egalitarian: A group trying to achieve consensus should be as egalitarian as
possible. What this basically means that each and every vote has equal
weightage. One person’s vote can’t be more important than another’s.
Permission in Blockchain
A blockchain can be built and accessed in multiple ways. There are certain
other blockchains that need special permissions to read, access, and write
information on them. ... It may also include maintaining the identity of
each blockchain participant on the network. Such blockchains are called
permissioned blockchains.
The major drawback is that they are quite slow. They can validate only a limited
number of transactions per second. These entail a high amount of energy
consumption. One of the biggest threats of these blockchains is the 51% attack
risk. A small number of nodes have the ability to make the network more
vulnerable to hacking risks and collusions.
Conclusion
Both permissioned and permissionless blockchains are branches of the same
technology that have been developed for different needs. Both have their own
advantages and can help benefit different technologies depending on the use cases.
Privacy in Blockchain
We will describe the blockchain structure, its components, and their interaction, namely:
▪ Proof-of-work
The term blockchain was first described back in 1991. A group of researchers wanted to
create a tool to timestamp digital documents so that they could not be backdated or
changed. Further, the technique was adapted and reinvented by Satoshi Nakamoto. In
2008, Nakamoto created the first cryptocurrency, the blockchain-based project called
Bitcoin.