Unit 1
Unit 1
BLOCKCHAIN TECHNOLOGY-UNIT-01
Overview of Blockchain
What is a Blockchain?
Important keywords
● Decentralized
● Computation and Information sharing platform
● Multiple Authoritative Domains
● Cooperate, Coordinate and Collaborate
● Rational Decision-making Process
●
The important aspect of Blockchain is that we can combine multiple authoritative
domains that do not trust each other. They can come to a common platform to cooperate,
coordinate and collaborate in the application development process at the business intelligence
process.
A blockchain is an open, distributed ledger that can record transactions between two parties
efficiently and in a verifiable and permanent way.
Leveraging the shared Google docs or similar platforms, both Alice and Bob can write
the document simultaneously. However, this environment is still centralized. So the
question arises, Does a centralized environment harm, or what is the disadvantage of
a centralized environment?
Alice has her copy of the document, and Bob has his own of the document. These copies belong
to both Alice and Bob, and they can simultaneously write/modify their document.
The document sharing technology in between ensuring that the information consistencies
maintained between the documents which both possess.
The above example is an ideal use case where we can use the Blockchain platform. The
Blockchain platform which is spans over the network and it will help us to make this kind of
cooperation and coordination, and it goes as follows:
They can independently write/modify their copy. The Blockchain platform will ensure that the
information inside the document will be synchronized within the finite interval. As a
consequence, both can see the most updated copy while keeping track of document
modification history.
The local copies are continuously updated based on the global information
Public Ledger: It works like a database containing the historical information available to inform
everyone, and it can be utilized for future computation.
Whenever we are going to the bank and request to make a transaction, the bank checks our
records and validates transactions stored in a centralized information system. However, in a
public ledger, we are moving from a centralized banking system to a decentralized banking
system. Moreover, where every individual has their copy of the global transactions, which are
synchronized and consistent. Whenever we are trying to make a new transaction, or someone
else is 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, and Eve. Now assume that Alice initially has
As this is a valid transaction and this will be updated into the public ledger. The public ledger
possesses by all participants is as follows.
Alice: $100
Bob transfers 30$ to Eve, and it is also a valid transaction by seeing the public ledger. The
public ledger possesses by all participants is as follows.
1.
1. Alice: 100$
2. Alice -> Bob: 50$ (Alice: 50$, Bob: 50$)
3. Bob -> Eve: 30$ (Alice: 50$, Bob: 20$, Eve: 30$)
● 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$.
Blockchains are nothing but a public ledger; however, whenever we are implementing such kind
of Blockchain by utilizing the concept of the public ledger, we need to ensure several different
aspects.
A public ledger derives its name from the age-old record-keeping system used to record
information, such as agricultural commodity prices, news, and analysis. The public ledger was
available for general public viewing as well as for verification. As cryptocurrency-based
blockchain systems emerged, which rely on a similar record-keeping and public verification
mechanism, the use of the public ledger gained popularity in the world of cryptocurrency.
This article explores cryptocurrency public ledgers, how they work, and the challenges they
face.
KEY TAKEAWAYS:
The ledger maintains participants’ identities anonymously, their respective cryptocurrency balances,
and a record of all the genuine transactions executed between network participants.
Scaling and security concerns are one challenge for cryptocurrency public ledgers and transactions.
To draw a parallel, think about writing a check to a friend, or making an online transfer to
their bank account for $200. In both cases, the details of the transaction will be updated in
the bank's records—the sender’s account is debited by $200 while the receiver’s account is
credited by the same amount. The bank’s accounting systems maintain the record of
balances and ensure that the sender’s account has sufficient funds; otherwise, the check
bounces or the online transfer will not be allowed. If the sender has only $200 in their
account, and they issue two $100 checks, the order in which the checks are
presented determines who will receive the money and whose check will bounce.
Verifying Transaction Details
The transaction's details in the bank's records can be queried and verified by the two
parties between whom the transaction took place. Additionally, the bank record is
accessible only by the designated bank officials and the concerned (central) authorities like
the tax department or the government on a need basis. No one else can have access to
those details.
As a data storage container, the public ledger forms the backbone of a cryptocurrency by
storing information after verification. While its use is being widely adopted, configuring the
public ledger with the right parameters is important to maintain decentralized and
anonymous features for hassle-free transactions in cryptocurrencies.
Bitcoin
What is Bitcoin & how does it work?
Bitcoin is a decentralized digital currency that enables instant payments to
anyone, anywhere in the world.
The entire system runs and manages two broad operations: transaction
management and money insurance. The transaction management includes the
transferring of bitcoins from one user to another safely. The money issuance
mechanism generates bitcoins in an economic aspect to properly regulate the
monetary base of bitcoin.
In the bitcoin cryptocurrency system, there are two types of users: miners and
normal users.
The major difficulty is how to validate the transactions when each individual
does not know or trust each other. This is achieved via the challenge-response
consensus protocol among the nodes. However, this kind of consensus protocol
cannot be used in the conventional distributed system.
● Completely Decentralized:
○ No central party for ordering or recording, or controlling
anything such as currencies.
○ Compare to the Banking system, which is centralized
and compliant to Government institutions’ rules and
regulations.
● Peer-to-Peer:
○ Software that runs on machines of all stakeholders to
form the system.
○ We do not have a central system with which all the
peers are connected. Rather, we have a complete
decentralized system where individual peers are
connected, and they share the information among
themselves.
● Permissionless:
○ No identity; no need to signup anywhere to use; no
access control – anyone can participate in any role.
○ Anyone can join the bitcoin network and performs the
transaction.
○ How can we ensure the system’s security, as the
persons who are joining the network are not
authenticated? They can be malicious or perform
malicious activity. The system should have the
mechanism to sustain and preserve integrity in the
presence of such kinds of malicious attacks.
This was the interesting concept that has been put forward in this Bitcoin
architecture.
Bitcoin
Price as per Feb 2021
● Block 1: A = 100₹
● Block 2: A -> B 50₹
● Block 3: B -> J 30₹
All these blocks are connected using the concept of a hash chain. The
advantage of hash chaining is that it requires re-generation and updation of all
the subsequent transaction hash values to alter a single transaction record from
a block. The blockchain copy is available to every individual party, such as
Alice, Bob, Eve, and Jane. The case of a fraudulent transaction by an
individual can easily detect by others by verifying the old records that existed in
the blockchain.
The first task is to validate the transactions and construct a new block.
Once they have constructed a new block, they employ their hash power
and vote on consensus to determine who will complete the work first and then
propose that block as a new block.
Add that new block to the existing bitcoin blockchain, and broadcast that
updated blockchain to the peers. So that way, the entire blockchain gets
propagated in the network.
Mining Bitcoin
• The first and foremost task is to join the network, listen for
transactions, and validate the proposed transactions from the
network clients.
• Listen for the new blocks proposed by other miners, validate, and
re-broadcast to the peer nodes. However, re-broadcast to a node
that resides in a subnet of the bitcoin network. This is the standard
policy followed by the bitcoin network nodes to avoid the Sybil
attack.
• Collect the transactions for a predefined time, and construct a new
block that includes all the transactions not included in a block of
the main bitcoin blockchain received from the peer nodes.
• Participate in the mining procedure, where the miner task is to find
a nonce [number once generated] to make the new block valid by
utilizing the predefined difficulty function. That means the proposed
new block must have a certain minimum number of zeros at the
prefix. This is also called “Proof of Work” for consensus that a
miner had done some work quicker than other miners in the bitcoin
network.
• Once a miner can generate a valid block and quicker compared to
other miners. The miner will broadcast that new block to the peers,
and everybody in the peering system will accept that block if it is
part of the main chain.
• In the typical bitcoin network, multiple new valid blocks
may be generated together by the different miners, and
these blocks may or may not have a list of the same
transactions.
• Flooding rule: If multiple valid blocks are received from
the peer nodes to an individual (a node or miner), the
individual will accept the valid blocks but rebroadcast the
block received from more peers.
• The bitcoin blockchain always has the main chain and
multiple orphans blocks. The main chain is the longest
blockchain in the network, and orphans blocks are blocks
from the fork chain that come out from the main chain but
do not grow longer than the main chain.
• Whenever a miner finds a new valid block and can successfully
append it to the main chain, the miner earns a certain reward.
However, other mines may be trying to generate a valid block
during the same period, but already one of the miners found the
valid one. In that case, they will discard the generation process and
start collecting all the new transactions that are not there in the new
append block of the bitcoin blockchain.
Mining Difficulty
It is a measure of how difficult it is to find a hash below the giving target. The
mining procedure says that we are going to generate a 256-bit hash value. And
there is mining difficulty, and it is represented in this way. Out of 256-bit hash,
at least the first 64 bit should be zeros. This says that you have to generate a
hash value wherein the final hash result, at least the first 64 bits, should be zero,
and after that, the remaining bits can be zeros and ones.
This is the difficulty of the mining procedure, and based on that, we defined a
metric called mining difficulty.
These difficulty parameters change for every 2016 block or every two weeks.
The desire rate of generation of a block is every 10 minutes. If the system tries
to generate a new block every 10 minutes, then 2 weeks are required to
generate 2016 blocks.
Difficulty level readjustment mechanism (Valid for every 2 weeks or 2016 blocks):
The difficulty level readjustment works as follows. The system finds out whether
miners can generate 2016 blocks within 2 weeks or not. If they are taking less
time, that means the difficulty is too simple for the miners.
So the system increases the difficulty parameters for the next round of 2016
blocks.
On the other hand, if the miners take more than 2 weeks to generate 2016
blocks. It means that the current difficulty is too hard for the miners. So the
system reduces the difficulty parameters for the next round of 2016 blocks.
This way, the bitcoin network dynamically changes the difficulty levels. In
general, the change in difficulty is in proportion to the amount of time over or
under two weeks the previous 2016 blocks took to find.
Difficulty formula
The difficulty level readjustment happens after every two weeks or 2016 blocks,
whichever comes first. The expectation is that within 2 weeks, 2016 blocks
must be generated so that inter-block generation time becomes equal to 10
minutes. The formula to generate or find the current difficulty is as follows:
The hash is a random number between 0 and . To find a block, the hash
must be less than a given target.
If D is a more difficult value, then generate more hashes to get the resulted
target well.
Smart Contracts,
A smart contract is a self-executing contract and the contract terms between
the two parties are written directly in code or programable logic using some
general-purpose, high-level programming language rather than on paper
documents.
Even the bitcoin script, apart from basic scripts like transfer bitcoins from sender
to receiver, the sender can also write a script in such a way so that the receiver
will not able to spend the bitcoins immediately. Rather, the bitcoins will become
spendable only when the imposed condition is met.
In the smart contract, generally, there are buyer, seller, assets, and contracts.
A buyer is willing to buy the asset which the seller possesses, and the contract
is the agreement between the two.
In general, a certain script will be executed at the seller’s end whenever a buyer
buys something, and similarly, a certain script will be executed at the buyer’s
ends.
Suppose the buyer has sent a certain amount of currency to the seller, and the
contract actually verifies that this amount of money has been transferred from
the buyer to the seller.
Then, the seller sends the ownership of that particular asset to the buyer. So in
the future, the seller will not be able to claim ownership of that asset. At the
same time, the buyer will be able to claim his or her ownership of that particular
asset. This is the concept of smart contracts, which are executed in a closed
environment with the help of blockchain.
Sequential execution
The blockchain concept came from a permissionless environment, and the best
use case is bitcoin cryptocurrency. In bitcoin, the transactions are executed
sequentially based on the consensus. If a transaction gets verified and
committed, that will be executed first, and the transaction committed later will
be executed next. Similarly, in the context of smart contracts, the request to the
applications (i.e., smart contracts) are ordered by order of the consensus in
which the individual application of the contracts get a consensus, and they are
executed in that particular order.
These sequential order types actually give the effective throughput and ensure
that certain consensus or ordering of transactions is made. We can apply “Proof
of Work” based techniques in the permissionless model where the network
chooses a challenge, and the user tries to solve that particular challenge
individually. The nature of the challenge is that it is difficult to find a solution for
that challenge, but once a solution is found, everyone can verify it very easily.
So with that particular challenge-response-based method, the nodes try to
come to a consensus.
This can be a possible attack on the smart contract platform. The attacker
introduces a contract that will take a long time to execute, and that is why if a
certain contract takes a huge time to execute, the other contracts will not be
able to execute further, as once the consensus for the previous contract has
been reached, then only other will be able to execute the contracts which are
submitted later on.
Non-deterministic execution
For example, in golang, iteration over a map construct may produce a different
order in two executions. However, the smart contract execution is contrary; it
should always need to be deterministic; otherwise, the system may lead to a
certain inconsistent state or may have many forks in the system. One particular
user executes the contract and gets one result or one order of result compared
to another user executes and gets another result. So if we are getting two
different ordering of results, it may be difficult for the system to ensure the
longest chain in the blockchain.
We execute the smart contract to all nodes and propagate the state to others;
that way, it reaches a consensus. To ensure consensus, the question is, do we
have a sufficient number of trusted nodes to validate the execution of the smart
contracts. If the number of trusted nodes is less than the number of malicious
nodes, they may control the entire environment. However, it can be prevented
by going to a permissionless setting and use a Proof of Work-based consensus
mechanism. But the major problem is like we may be stuck to a particular block
or a kind of starvation scenario where a contract is taking a long time to execute,
and all the contracts are getting backlog. So that is why we want to move from
the challenge response-based method to the traditional distributed system-
based consensus algorithm in this permission setting. But in that case, we have
to ensure that you have a sufficient number of trusted nodes in the system.
Do we really need to execute contracts at each node?
Indeed it is not necessary, and we need state synchronization across all the
nodes. So, we execute the contract in one node and propagate the state of the
contract to the neighboring node, and those nodes will propagate it further. That
way, every node in the system gets the same states of the contract.
But a typical question comes that what if the node that executes the contract
becomes faulty. The system gets down, and it will not be able to make any
progress further. In this scenario, the idea is to use state machine replication
and execute the contract at a subset of nodes to ensure that the same state is
propagated to all the nodes. This way, we can ensure that every node that is
there is the part of the smart contract they are on the same page. They know
that list of contracts gets executed, and the remaining part needs to be
executed.
Permissioned
Parameters Permissionless
Open Network allowing anyone to interaction Closed Network with limited Decentralization and designated
Overview consensus validation and ful decentralized parties for participation in Consensus Validation
Also Known
As Public, Trustless Private, Permissioned Sandbox
1. P2P 1. B2B
Market 2. B2C 2. B2C
Traction 3. Government to Citizens 3. Government to Organizations
Understanding Cryptocurrency to Blockchain,
The world is continuously undergoing revolutionary technological innovations, and the concepts of
cryptocurrency and Blockchain have become an integral part of this advancement. Both
cryptocurrency and Blockchain, work together in providing us with a new future. There are multiple
types of cryptocurrencies competing in the market today, such as Bitcoin, Ethereum, Namecoin,
Ripple, etc., which, when empowered by Blockchain, operate without the need for a central authority.
However, not everything is good with these concepts, and many governments across the world have
come forward, against cryptocurrency and Blockchain. Many have gone ahead further in banning the
entire process and making it illegal for anyone to be related to them.
This paper aims to introduce the concepts of cryptocurrency and Blockchain, along with providing
information on their working and relation to each other. The paper also analyses the controversial
nature of cryptocurrencies and Blockchain.
Introduction
Cryptography evolved in the digital era to become a system to secure information, communications,
and money online while it was born way back during World War II as a way to secure communications.
During the 90’s technological advancements, many attempted to create a digital currency with the
help of emerging markets such as Flooz, Beena, and Digi Cash but inevitably failed. Eventually, in 2009,
Satoshi Nakamoto with a group of his programmers introduced ‘Bitcoin’ as a peer-to-peer electronic
cash system. There has been a proliferation of cryptocurrencies since then, and currently, there are
around 2000 cryptocurrencies available in the market.
Cryptocurrencies allow users to make secure payments and store money using decentralised
technology while being anonymous about the user’s identity and without going through the
centralised banking procedures. They run on Blockchain, which is a distributed public ledger.
Cryptocurrency units are made through a process called mining. Mining involves solving complicated
math problems using computers that generate coins. The currencies can also be bought from brokers
and can be stored and spent by using cryptographic wallets. Cryptographic wallets are digital wallets
that allow the currency to move from one owner to the next.
In cryptography, every transaction is recorded when the amount is transferred by the sender to the
receiver, and then a hash of previous transactions and the public keys (wallet address) of the next
owner is signed with individual private keys of both the parties in the transaction. Finally, the
transaction is confirmed and then broadcasted in the network, adding the transaction to the end of
the cryptocurrency. Thus, every transaction is recorded and a public ledger is maintained which
contains the record of all previous owners. Thus, by maintaining a public ledger, everyone in the
network can scan everyone’s account balance.
This decentralised network of maintaining a public ledger through Blockchain was introduced by
bitcoin. This process also eliminates the problem of double spending. Double spending is a fraudulent
technique in which the same amount is spent twice. It very important monetary issue faced by digital
payment networks around the globe. In traditional ways, it was solved by a third-party involvement,
a central server, which helps in maintaining the records of the transactions, which entails an authority
in control of funds and personal details. However, with bitcoin it is not an issue anymore as there is a
record of every bitcoin transaction ever made.
All the legitimate transactions can only be marked by the miners and transported across the network
because only miners can solve a cryptographic puzzle to confirm the transaction. Once the transaction
is marked legitimate and spread across the network, every network connection is added to its
database, which is further confirmed by the miners. After the confirmation, the data becomes un-
forge-able and irreversible. Thus, by doing so, the miners receive a transaction fee as a reward. Strong
cryptography ensures consensus-keeping processes in cryptocurrencies.
Types of Cryptocurrencies
(a) Bitcoin:
It is the first and most commonly traded cryptocurrency to date. Started by Satoshi Nakamoto, it sets
and serves as a digital gold standard in the entire cryptocurrency market and is used as a global means
of exchange. Currently, it is limited to 21 million coins.
(b) Ethereum:
This cryptocurrency has ascended to second place in the hierarchy of cryptocurrency. Ethereum can
not only process transactions but can process complex contracts and programs. It is the perfect
instrument for Blockchain, launched in 2015. With a turbulent past journey, it is proved to be a hugely
popular cryptocurrency launchpad in 2017, which provide a base for decentralised cryptocurrency
applications (more like an app store for cryptocurrency).
(c) Ripple:
Founded in 2012, Ripple is used by large companies instead of individual users because it allows the
movement of money in larger amounts across the globe. It is not a Blockchain based system, therefore
it allows variety of transactions, and not just cryptocurrency. As a lot of banks have joined Ripple, it
has immense value in the financial world. Unlike other cryptocurrencies, it has pre-mined coins which
require no mining thereafter.
(d) Litecoin:
Litecoin currency was the first cryptocurrency after bitcoin. Famous for its innovations, including faster
payments and processes to allow many more transactions, it is tagged as the silver to the digital gold
bitcoin.
(e) Namecoin:
Mined with bitcoin software as a bonus, Namecoin is a cryptocurrency. Based on the code of bitcoin
which uses a similar proof-of-work algorithm. As similar to the bitcoin, it is also limited to 21 million
coins. However, unlike bitcoin, Namecoin has its Blockchain transaction database storage.
Cryptocurrency and Blockchain are often confused to being synonymous with each other. While they
both are intertwined in multiple ways, it is important to note that the two are different technologies.
Cryptocurrency, as discussed above, is a digitised currency that is either used as a store of value or
used as an exchange of value which falls under the umbrella of Blockchain. The cryptocurrency was
the first use case of Blockchain. Blockchain can be defined as any system which keeps “records by
cryptographic-ally linking ‘blocks’ of transaction data together into a ledger” (Braun, 2018). It writes
accounts in a specific sequence and makes it impossible for the accounts to be put out of that
sequence.
Every transaction in Blockchain technology is endorsed through a “consensus algorithm”, and involves
three parties, namely: the sender, the receipt, and the miner (Kulkarni, 2018). While senders and
recipients are the participants of the Blockchain transaction, the miners are the people that validate
such transactions and make the next block in the Blockchain. In return, such members are given
compensation through the different types of cryptocurrencies, like bitcoin, etc.
Bitcoin is the first example of Blockchain, and it is not difficult to say that without Blockchain, there
would have been no existence of bitcoin. In bitcoin’s Blockchain database, the ledger is stored and
revised collectively with the use of multiple computers attached to the original bitcoin network. As
this is a collective process, no one computer or institution is in charge of the process, as a result even
if one of the many computers is hacked or face technical issues, the other computers are capable of
going on without it.
However, bitcoin is not all that Blockchain is tied to. After the successful operation of bitcoin for a few
years, many programmers and developers replicated the concept of bitcoin, and after adding new
features, created other kinds of ledgers for storing data securely. After bitcoin, ether is the most
valuable virtual currency in existence. Ether runs on the concept of ‘Ethereum Blockchain’, where in
addition to recording the virtual currency transactions, the program can execute simple programs as
well. For example, it has become possible to move the virtual currency of ether between different
wallets, after an event through the Ethereum Blockchain.
One of the several limitations of the old way of storing data was the maintenance being handled by a
single authority. If the database is being maintained by a single authority, it becomes more prone to
cyber-attacks, and it becomes easier for people to lose their access to the data provided. However,
with the introduction of Blockchain, people can now maintain and update their own individual copy
of the data. Through Blockchain, it has become easier for people to separate and maintain their own
records, which makes the process more efficient and less time-consuming.
Limitations to Blockchain
It would not be correct to say that Blockchain is completely safe, as there have been virtual currency
thefts in existence. Most theft cases are a result of hacking or stolen passwords or private keys, that
make the currency accessible to the users. This is where Blockchain gets problematic, as once the
currency is moved out of the virtual wallet, it is not possible for the currency to be moved back due to
the absence of any central authority. Therefore, for virtual wallets, the burden lies on the user to keep
his passwords safe and be as cyber-secure as possible.
Moreover, Blockchain experiences limitations in the quantity of data that it is capable to process. As
all the computers record every transaction, it is not possible for any of the computers to store more
or less, as compared to the others, which puts a limit on the quantity. This situation often makes
Blockchain technology unattractive and prone to questions and challenges.
Conclusion
According to the International Data Corp., it has been predicted that the worldwide annual spending
on Blockchain and Cryptocurrency would reach $11.7 billion by the year 2022 (Seth, 2019). The figures
clearly indicate that these concepts are expected to be our future and something that would keep
evolving and expanding in the long run. Therefore, it has become important for people to understand
the concepts with both its pros and cons and to make the correct choice.
In the permissioned blockchain architecture, the users have to register and authenticate themself to
use the system. In this system, the users know each other. However, users may not trust each other,
assuming that certain users in the blockchain network may behave maliciously. Although, they got
authenticated to use the system. The objective is to run the blockchain among this known and
identified set of participants, but security and consensus are still required for the smooth functioning
of the entire ecosystem.
The permissioned environment consists of a closed environment, and the individual users knew each
other. They try to come to a common platform with no centralized database or data server rather a
completely decentralized architecture. Having a set of users known each other a priory, but they may
not trust each other. So in this particular setting, users cannot join the blockchain network anytime.
Rather, they have to go through the authentication mechanism to authenticate themselves before
accessing the permissioned blockchain network.
Provenance Tracking of Assets (Supply Chain System)
To ensure that whenever a certain asset moves from one particular supplier to the distributors,
distributor to the vendors, and at the end, to the market via retailers. At every stage, tracking
information must be maintained by different authoritative domains. Every authoritative domain has
complete control over the tracking information that they are providing. However, other authoritative
domains can verify the tracking information but can’t tamper. Here authoritative domains represent
Supplier, Distributor, and Vendor as these are independent organizations with different policies to
work. In this type of use case, we can use premissioned blockchain architecture.
The interesting fact is that why not use a centralized server to have these tracking entries? And anyone
can look into that centralized tracking entries and verify indeed. The problem is who will maintain the
centralized server. Suppose if a party, say Distributor, maintains a centralized server, then why Vendor
or Supplier trust the data uploaded by the distributor. In the other case, suppose they are using a
third-party solution—having high maintenance charges and difficulty building a trust relationship
among individuals.
The single-party setup, such as sending or receiving goods within the same country and the same
service provider, is easy, and a centralized system solves this problem. They can maintain tracking
information in their centralized server, and with tracking IDs, the users can easily track the status of
consignments.
Maintaining the tracking information for international goods services is difficult. For example, A typical
use case can be like sending postal mail from India to the USA. The India Post is the one authoritative
domain, and basically, they transfer the post up to their border gateway, and from there, they will
send it to some international agency. Who will take the courier to USA post, and then USA post will
take it and transfer it internally.
The first problem is that whenever we have multiple authorities, it is difficult, or there is a kind of trust
issue whenever they rely on a centralized server. So the question comes who will host that server? If
India post will host the server, then the question comes that why the USA post will trust or believe the
data which is there in the India Post server and vice versa.
The second problem is that if none of the India or USA posts will host that particular service, they may
purchase the service from some third-party agent. It is like take the service of a third-party cloud. They
have to pay a significant amount of money for that third-party cloud. As there are multiple
authoritative domains, they require a certain kind of access to that central server, and the question
comes that system provides a guarantee that the data which is entered by the USA post is not getting
tampered with by the data which is being entered by India post or vice versa.
Whenever there are multiple authoritative domains in the loop, there is a trust relationship problem.
That is why people do not go for any centralized server.
For this kind of provenance tracking of assets, it is more beneficial to use the permissioned blockchain
environment and the beauty of the permissioned blockchain environment is that it does not require
to host any centralized server. The individual would maintain the data, but everyone will be able to
validate other’s data.
The first typical use case was from the Supply Chain System, where goods are transferred between
the suppliers and distributors, distributors and vendors, and vendors and retailers. In this scenario, we
have multiple suppliers, distributors, and vendors. Like every individual supplier, distributor, and the
vendor has its individual authoritative domain and follows its own policy of entering data. Still, a third-
party auditor should have access to this entire data. They should reliably verify the correctness of data
that is being passed through supplier distributor vendor and the final in the market.
The second typical use case was from Postal services, where we know that the posts/goods/couriers
will either go from India to USA post or vise versa. So we have a closed set of participants who are
participating in the entire blockchain environment. But still, the trust relationship is not there. To
maintain a certain kind of security or ensure that the data is not getting tampered with while
transferring from one authoritative domain to another authoritative domain.
However, why not permissionless architecture? We can also use the permissionless model, but there
are certain disadvantages of using the permissionless model because we are going for an open
environment. Whenever we are going for an open environment, the network or system becomes more
complex. It has to handle many things all together, which is why we want to move from a
permissionless to a permissioned model.
Summary
We have seen permissioned blockchain architecture and different use cases from Supply Chain System
and another from International Postal Service. Studies permissionless blockchain architecture is not
.
suitable for these use cases
where and are integers and is the modular (remainder after division
by ) operations. can be of any arbitrary length integer, but is within the
range . However, this does not qualify for cryptographically secured
hash functions and these are mainly used in Blockchain Technology to verify
the integrity of data.
According to the pigeonhole principle, the major problem with a hash function
is to avoid collision as we are mapping something from the arbitrary length to
the fixed length.
Suppose N items are put into M containers, where N < M than at least one
container must contain more than one item. Thus, the collision must be there,
but it can be minimized if the cryptographer well designs the hash function.
Let us first understand what a collision is in the hash function. Given the two
distinct messages, M1 & M2 to the hash function H(*), which produce the hash
value H(M1) & H(M2) where H(M1) == H(M2) are the same.
Everything is done online in the digital world era: Suppose there is a contract
between two parties, and signing is done on the hash value of the agreement
paper. If collision exists then, the malicious party can modify the contract
agreement paper and force the other party to accept it in the future as the
signature is valid for a forged agreement too.
In the above diagram, we are securing four documents D1, D2, D3, & D4
together and the root hash value will be propagated and any change in the
document effectively reflect the change in the root hash value.
This way we can collectively secure the number of documents together by using
the concept of Merkle Tree.
In 1992, Bayer, Harber, and Stornetta used Merkle Tree for timestamping and
verifying a digital document. This technique improved the efficiency by
combining timestamping of several documents into one block.
In case of Bitcoin, if you ever lose the private key to your Bitcoin wallet, the entire
contents of your wallets would be instantly vulnerable to theft and before you know it,
all your money (the contents of your wallet) would be gone with no mechanism in the
system to trace out who stole it - that is the anonymity in the system that I mentioned
earlier.
The PKI accomplice’s two functions - authentication and the message privacy through
encryption/decryption mechanism. I will now explain both these functions –
Authentication
When the two parties exchange messages, it is important to establish a trust between the sender
and the receiver. Especially, the receiver must trust the source of message. Going to our earlier
scenario (depicted in Figure 1) of Bob sending some money to Lisa for purchasing of some goods
from her, let us see how the PKI builds this trust between Bob and Lisa. Look at below image −
In the first place, if Bob wants to send some money to Lisa, he has to create a private/public key of its own.
Note that both keys are always paired together and you can not mix the private and public keys of different
individuals or different instances.
Now, Bob says that he is sending $10 to Lisa. So he creates a message (a plain-text message) containing Bob’s
(sender) public key, Lisa’s (receiver) public key, and the amount ($10).
The purpose of this remittance such as “I want to buy pumpkin from you” is also added into the message. The
entire message is now signed using Bob’s private key. When Lisa receives this message, she will use the
signature verification algorithm of PKI and Bob’s public key to ensure that the message indeed originated from
Bob. How the PKI works is beyond the scope of this tutorial. The interested reader is referred to this site for a
more detailed discussion on PKI. This establishes the authenticity of the message originator. Now, let us look at
the message privacy.
Message Privacy
Now, as Lisa has received her payment, she wants to send the link to her ebook which Bob wants to buy. So
Lisa would create a message and send it to Bob as shown in image –
The Lisa creates a message such as “Here is the link to my ebook which you had requested”, signs it with Bob’s
public key that she has received in Bob’s request message and also encrypts the message using some secret
key which is shared between the two during HTTPS handshake.
Now, Lisa is sure that only Bob can decode the message using the private key that is held by Bob alone. Also,
somebody intercepting the message would not be able to recover its contents because the contents are
encrypted by a secret key held only by Bob and Alice. This guarantees to Lisa that access to her ebook is
granted only to Bob.
Having seen both the features, Authentication and Message Privacy, implied by PKI, let us move ahead to see
how Bitcoin makes use of PKI to secure the public ledger that I mentioned in the chapter “What is Bitcoin?”.
For your knowledge − The most popular PKI algorithms are RSA and ECDSA, Bitcoin uses the latter one.
Digital signatures,
A digital signature is a set of algorithms for determining the authenticity and integrity of
digital messages or documents. It assures the recipient that the message was indeed created
by the expected sender and that the message was not altered during transmission. The sender
cannot deny having sent the message.
When Alice sends a document to Bob, she will follow certain steps to digitally sign the
document, as shown in the following diagram:
Zero-knowledge systems
Zero-knowledge proof is defined as an encryption scheme in which a party who is a prover can
prove their case of truth concerning specific data to the other party who is a verifier without
Although the zero-knowledge proof is used to elevate the functionality of the blockchain
platform, this encryption scheme has preceded the innovation of the decentralized blockchain
ecosystem by almost 40 years. The ZKP method was formerly brought in by the renowned
researcher and the founder of Algorand Silvio Micali, along with Charles Rackoff and Shafi
Interactive ZKP
Interactive zero-knowledge proof indulges a constant series of actions or tasks that concerns
the prover’s completion to satisfy the verifier about their specificity of information. The
majority of the tasks performed under the Interactive zero-knowledge proof generally indulge
Non-Interactive ZKP
There is no need for any interaction between the verifier and prover in the Non-Interactive
ZKP, or the verification can also be shifted to a later stage. These kinds ZKPs need software or
Irrespective of the differences between the various kinds of zero-knowledge proof, all the
Soundness
Soundness implies that the statement cannot be neglected and falsified, and the situation is
that the verifier cannot be convinced. The prover has the needed input, which they otherwise
cannot have.
Completeness
If the given statement is true on all grounds, the verifier is entitled to certify that they possess
Zero-knowledge
The verifier is not entitled to know anything beyond the statement being false or true. Specifics
of the information and the private data of other parties remain anonymous.
Applications of zero-knowledge proofs in blockchain technology
Users are seeking control and autonomy over their information benefit from ZKPs since they
give flexibility and choice. As a result, it makes sense that when blockchain and ZKPs are
develop ZKP and blockchain solutions. EY launched Nightfall, a public ZKP protocol in 2019 that
enables businesses to maintain anonymity while performing private and secure transactions
on public blockchains.
EY will work on Starlight, a ZKP prototype compiler, as part of their $100 million investment in
agreements where business logic must be shared between parties at the network level while
maintaining privacy from competitors. Both Nightfall and Starlight seek to increase consumers’
Encryption from end to end has been critical in enabling messages to be sent secretly.
Traditional messaging apps, on the other hand, require users to authenticate their identity
with a server. Individuals can establish their identification using ZKPs without disclosing further
personal information.
Documentation is extensive
By combining ZKPs with blockchain, users may securely communicate complicated documents.
ZKPs offer the ability to segment data, enabling users to manage certain blocks and the
accessibility of the information contained inside them, granting access to some users while
Maintenance/Points of Failure
The goal was to maintain a list of timestamps when the document has been first
created, followed by when the document was edited in a subsequent but secure
way such that no one will be able to make a change in the timestamp value.
To solve this particular problem, Harber and Stornetta have used this concept
of a chain of blocks. However, they have not claimed this as a Blockchain, but
the concept is similar to Blockchain.
This way, the concept of chain of blocks by connecting them by the hash
function, that was used to cryptographically securing the timestamp value of a
digital document, so this particular architecture looks like something similar to
Blockchain where we have multiple blocks of data, and a hash value connects
these blocks of data.
Blockchain – Essence of Bitcoin
Bitcoin is a completely decentralized, peer-to-peer, permissionless
cryptocurrency designed by leveraging the underlying technology
called Blockchain.
• Completely Decentralized:
• No central party for ordering or recording, or controlling
anything such as currencies.
• Compare to the Banking system, which is centralized and
compliant to Government institutions’ rules and
regulations.
• Peer-to-Peer:
• Software that runs on machines of all stakeholders to
form the system.
• We do not have a central system with which all the peers
are connected. Rather, we have a complete
decentralized system where individual peers are
connected, and they share the information among
themselves.
• Permissionless:
• No identity; no need to signup anywhere to use; no
access control – anyone can participate in any role.
• Anyone can join the bitcoin network and performs the
transaction.
• How can we ensure the system’s security, as the persons
who are joining the network are not authenticated? They
can be malicious or perform malicious activity. The
system should have the mechanism to sustain and
preserve integrity in the presence of such kinds of
malicious attacks.
This was the interesting concept that has been put forward in this Bitcoin
architecture.
Bitcoin Value Proposition
Bitcoin
size as per Feb 2021 – Growing exponentially
• Block 1: A = 100₹
• Block 2: A -> B 50₹
• Block 3: B -> J 30₹
However, in actual Bitcoin blocks contain multiple transactions. Indeed it may
contain more than 1000 transactions in a single block.
All these blocks are connected using the concept of a hash chain. The
advantage of hash chaining is that it requires re-generation and updation of all
the subsequent transaction hash values to alter a single transaction record from
a block. The blockchain copy is available to every individual party, such
as Alice, Bob, Eve, and Jane. The case of a fraudulent transaction by an
individual can easily detect by others by verifying the old records that existed in
the blockchain.
• Alice wants to send some money to Bob. Alice opens her Bitcoin
wallet, provides Bob’s address, the amount to transfer, and
sends.
• Once they received included Bob. Bob’s wallet software looks into
the updated blockchain and updates the wallet if any legitimate
transaction exists by his name.
Cryptographic Primitives in Blockchain
.
Introduction
Blockchain is a decentralized, distributed ledger that comprises blocks. The Blocks are connected to
form a long chain. Each block comprises an address to the previous block and some information. The
address part is done with the help of hashing. The information comprises data such as transactions
and is encrypted. Blockchain was first implemented in the year 2008 by a group of people named
Satoshi Nakamoto. Blockchain uses strong cryptographic methods to manage the whole network.
Before diving deep into more, let us be familiar with the five most important things: Block, miner,
node, Block Reward and Cryptography.
Block: A block is the unit of blockchain that contains information in encrypted form. The blocks are
connected. It is also called an immutable record as it cannot be reverted once created. There are three
types of Blocks: Genesis Block, Valid Block and Orphan Blocks. Genesis Block is the first block that is
created at the start of the blockchain. Valid Blocks are the blocks validated by miners and added to
the blockchain. Orphan Blocks, as the name suggests, they are not added to any blockchain.
Node: Nodes are devices in which blocks are stored. The nodes also have a database that stores the
history of transactions and is connected.
Block Reward: A block reward is an incentive that is given to miners when they participate in the
validation of the blocking process. It has two parts: block subsidy and transaction fees.
Cryptography: It is a practice used in this technology to encode and decode data. The aim is to protect
data with the help of codes. The techniques used are a part of security protocols to prevent
unauthorized access from third parties. The word is made up of two terms ‘Krypto’ means ‘hidden’
and ‘Graphy’ means ‘written’.
Cryptographic Primitives
Structure of Blockchain
Working of Blockchain
The working is a multistep process, but it involves four phases: the creation of the block, verification
of the block, the addition of the block and updation of the database. The steps are as follows:
The block is circulated all over the network. Blockchain protocols do this.
Miners verify the block. Upon successful verification, the miners get incentives.
Cryptographic Primitives
Cryptographic Primitives are the tools used to build security protocols, which comprise low-level
algorithms. Security protocols are nothing but algorithms that are developed by Cryptographic
designers using Cryptographic Primitives as tools, and these protocols are executed when certain
conditions are met. Since Blockchain is highly decentralized in nature, the security of data is of utmost
importance. For example: Suppose two users want to exchange information on a public Blockchain. In
Public Blockchain, everybody can see the transaction process. To secure the data, encryption
algorithms are used. For decrypting, the data decryption algorithms are used. These cryptographic
primitives are used to develop these high-level secured algorithms.
Cryptographic Protocols
On Internet, protocols are a set of rules that are used to govern the network. Cryptographic Protocols
are the same. They are the rules that secure the whole blockchain network. The rules are made using
cryptographic primitives as the base. They are transparent as they are programmed. The goal of these
protocols is to provide data integrity, secure the exchange of data, and maintain the security of the
whole network. Hence they are often known as security protocols. Commonly used cryptographic
protocols are Bitcoin, Hyperledger, Ethereum, Corda etc.
As we all know, each cryptographic primitive is highly specific, and they are the building blocks of any
crypto protocols. So each crypto protocol performs a single task. The primitives are limited, and
developing them is a tedious task. This is because they are low-level programs and requires complex
mathematical analysis. So designers usually combine one or more cryptographic primitives to establish
strong crypto protocols so that the protocols can at least tackle the other small problems besides the
main problem. For instance, hashing and encryption methods can be combined.
Commonly used Cryptographic Primitives
There are many cryptographic primitives, but we will discuss the most commonly used ones. They are
as follows:
One-way hash function: It is a mathematical function which converts an input of any length to a binary
sequence of fixed length. It cannot be reverted, which means the original string cannot be retrieved
back from the hash. It is to be noted that even a small change in the input can change the meaning of
the whole output. For example, SHA256 is a hash function. It generates 32-byte strings for any input.
Symmetric Key Cryptography: It is a popular encryption algorithm and is also known as symmetric
encryption. The principle of this algorithm is a shared key. For example, a person wants to send some
confidential data. He/She encrypts the data and ‘locks’ it with a key. The same key is used to decrypt
or ‘unlock’ the data when the message is received. This algorithm is mostly used when large amounts
of data are sent. The problem is sharing the key. The sender and receiver parties should have the same
key. Examples of Symmetric key Cryptography are AES, DES, and 3DES.
Asymmetric key cryptography: It is also known as public key cryptography. This method has been
developed to cope with the disadvantage of Symmetric Key Cryptography. Two types of keys are used:
Public key and private key. The public key is used to encrypt the message, whereas the private key
decrypts the message. Examples are: Diffie-Hellman, DSA and RSA
Digital Signature: This is used in blockchains to authenticate transactions or other data. Whenever a
digital signature is used, it establishes that the rightful owner has sent it and the message has not been
altered. The here private key is used as a digital signature by the user, and once it has been sent to
the receivers, the receivers validate the message using the public key.
Private Information Retrieval: This protocol allows users to retrieve information from the database
without other users knowing about it. Here the user can anonymously retrieve the information from
another server.
Conclusion
Cryptographic Primitives are building blocks of Blockchain security. They form the baseline of
the security protocols.
Although complex, these are highly reliable and can be used to develop any security protocols
with certain changes.
The crypto designers must choose and combine the primitives so that there are no flaws and
the whole tech is completely safe and secure.
OR
Blockchain: Common Cryptographic Primitives
There are several key concepts that are crucial to the underlying mechanisms that make up a
blockchain implementation. Those concepts are encryption, asymmetric encryption, public key
signing, hash functions, entropy, and the elliptical curve digital signing algorithm (ECDSA) and
its domain parameters that sometimes differ between blockchain solutions. Those and other
Encryption (Symmetric)
algorithm used and a secret key. An encryption key is a random piece of data of varying length
(typically from 128 to 4096 bits), used by encryption algorithms to obfuscate or encrypt
messages. Without possession of the key you cannot decrypt a piece of encrypted data. The
image below depicts symmetric encryption, where the same secret value (a key), is used to
Encrypting “Hello!” with a key to create an encrypted message, “f7#E+r”, which is then
decrypted with the same key back to “Hello!”.
Asymmetric Encryption
Symmetric encryption, as shown above, is a cryptographic mechanism where the same secret
key is used both to encrypt and decrypt data. Asymmetric encryption is a mechanism where
there are two keys, a public key and a private key, commonly referred to as a key pair. The
public key is used to encrypt, and the private key is used to decrypt as shown in the image
below. Compromise, or exposure of the private key means that anyone in possession of the
private key will be able to decrypt messages intended for the private key holder. Asymmetric
Public key signing is known as a digital signature. The process of signing a digital message is
meant to guarantee the integrity of the message itself. A signature is generated by using a
private key against the data to be signed (or usually a hash thereof). This signature is then sent
along with the message where the receiving party will verify the signature by using the public
key that corresponds to the private key that signed the original message. If the signatures
match, then it is safe to assume that the data that was signed by the private key has not been
changed.
The below image illustrates a bank transaction request from Alice, wishing to send $100 from
account ‘558877’ to account ‘998321’. This message is then signed using Alice’s private key to
generate a signature. The signature and the message are then sent to a bank. The bank verifies
the signature by using Alice’s public key. If the signature verification succeeds, then it is safe
to commit the transaction. If the signature fails then the message must be rejected since it was
corrupted or tampered with by a malicious actor (for example someone could have changed
Public key signing is one of the main fundamental features utilized by blockchain
blockchain.
Hash Function
A hash function takes data as an input and creates an output, a digest, that was derived in a
deterministic way. The input data can be of an arbitrary length up to a pre-defined limit and
the hash function output is typically a fixed size. SHA1 for example takes data of size up to 264
bits in length and creates a message digest with a fixed size of 20 bytes (160 bits).
`6367c48dd193d56ea7b0baad25b19455e529f5ee`
The digest should be indistinguishable from random data; therefore, the digest should not
provide any clues as to any information regarding the source data provided to the hashing
algorithm.
Proof of Work(PoW)
Proof of Work(PoW) is the original consensus algorithm in a blockchain network. The algorithm is
used to confirm the transaction and creates a new block to the chain. In this algorithm, minors (a
group of people) compete against each other to complete the transaction on the network. The process
of competing against each other is called mining. As soon as miners successfully created a valid block,
he gets rewarded. The most famous application of Proof of Work(PoW) is Bitcoin.
Producing proof of work can be a random process with low probability. In this, a lot of trial and error is
required before a valid proof of work is generated. The main working principle of proof of work is a
mathematical puzzle which can easily prove the solution. Proof of work can be implemented in
a blockchain
In the below image, you can see that this block is composed of a block number, data field,
cryptographic hash associated with it and a nonce. The nonce is responsible for making the block valid.
software creates a challenge, and there is a game begins. This game involves all miners
competing against each other to solve the challenges, and this challenge will take
approximately 10 minutes to be completed. Every single miner starts trying to find the
solution to that one Nonce that will satisfy the hash for the block. At some specific
point, one of those miners in the global community with higher speed and great
hardware specs will solve the cryptography challenge and be the winner of the game.
Now, the rest of the community will start verifying that block which is mined by the
winner. If the nonce is correct, it will end up with the new block that will be added to
the blockchain. The concept of generating a block provides a clear explanation of proof
of work(PoW).
s