Block Chain Technology Unit-I
Block Chain Technology Unit-I
UNIT-I
History of Blockchain:
The first work on a cryptographically secured chain of blocks was described in 1991 by
Stuart Haber and W. Scott Stornetta. They wanted to implement a system where document
timestamps could not be tampered with. In 1992, Bayer, Haber and Stornetta incorporated
Merkle trees to the design, which improved its efficiency by allowing several document
certificates to be collected into one block. In 2004, computer scientist and cryptographic
activist, Hal Finney introduced a system called Reusable Proof of Work (RPoW). RPow
solved the double spending problem.
The first blockchain was conceptualized by a person (or group of people) known as Satoshi
Nakamoto in 2008. Nakamoto improved the design in an important way using a Hashcash-
like method to timestamp blocks without requiring them to be signed by a trusted party and to
reduce speed with which blocks are added to the chain. The design was implemented the
following year by Nakamoto as a core component of the cryptocurrency bitcoin, where it
serves as the public ledger for all transactions on the network. On 3rd January 2009 Bitcoin
came into existence, on 12th January 2009, Hal Finney received 10 Bitcoins from Satoshi
Nakamoto as First Bitcoin Transaction.
In August 2014, the bitcoin’s, Blockchain file size, containing records of all transactions that
have occurred on the network, reached 20 GB (gigabytes). In January 2015, the size had
grown to almost 30 GB, and from January 2016 to January 2017, the bitcoin blockchain grew
from 50 GB to 100 GB in size.
The words block and chain were used separately in Satoshi Nakamoto's original paper, but
were eventually popularized as a single word, blockchain, by 2016.
Many smart contracts are running on a Blockchain. Blockchains are being adopted in
financial services.
Blockchain:
Blockchain is simply a data structure where each block is linked to another block in a
time-stamped chronological order
It is a distributed digital ledger of an immutable public record of digital transactions
Every new record is validated across the distributed network before it is stored in a block
All information once stored in the ledger is verifiable and auditable but not editable
Each block is identified by its cryptographic signature
The first block of the Blockchain is known as the Genesis block
Block Chain is Use of Mathematics to create secure distributed ledger which enables
transactions without need for third parties.
Type of Blockchain:
Public Blockchain: They are fully decentralized and allow anyone to participate as users,
miners, developers, or community members. All transactions that take place on public
blockchains are fully transparent, meaning that anyone can examine the transaction details.
Blocks are validated one after another cannot be modified. Network is open to any new
participants. All participants can be involved in validating data. All participants can read data
contained in blocks. Some of the largest, most known public blockchains are the Bitcoin
blockchain and the Ethereum blockchain, Dash, Factom.
Private Blockchain: Transactions are private and are only available to ecosystem
participants that have been given permission to join the network. Private blockchains are
more centralized than public blockchains. Blocks are validated by an authority and can be
subsequently modified. Nodes chosen by the authority. New nodes are accepted by the
central authority. Blocks are validated by the central authority. Read rights may be limited by
the central authority.
Examples- Multichain, Blockstack
Federated or Consortium Blockchain: Consortium blockchains are sometimes considered
a separate designation from private blockchains. The main difference between them is that
consortium blockchains are governed by a group rather than a single entity. This approach
has all the same benefits of a private blockchain and could be considered a sub-category of
private blockchains. Blocks are validated one after another and cannot be modified. Network
nodes. Network nodes allowed to participate in the consensus. New nodes are accepted based
Blockchain Applications
Blockchain has the potential to revolutionize the way things are authenticated in any system.
1. Land Registry
Blockchain real estate market is building up new business models of connecting potential
buyers and sellers. In Blockchain solution, there is no need of third-party, lawyers and
brokers. Ubiquity joined with the real estate register office in Brazil and developed the
project which aims to reduce cost while improving, security and transparency. Ubiquity
seeks to great immutability to property ownership data handled by the land records office.
It is an effort to move away from paper-based records towards 100% computer-based
solution. Records stored on Blockchain are immutable. Also, Sweden government
partners with ChromaWay to test the possibility of a Blockchain based land registry.
2. Insurance
The first thing which comes to my mind when I think about insurance claim is increasing
fraudulent claims. Existing claims processes potentially have high complexity, extended
timeframes, and inconvenience, which can create customer friction and a gap of trust
between different parties. Everledger has come up with a delivering breakthrough
Blockchain solution to industries where transparency, trust, and provenance valued most.
3. Voting
There are always doubts about the voting system ability to secure data and defend against
potential attacks. Every single vote has a big impact on a country. Agora provided a
Blockchain voting platform to ensure transparent and verifiable elections around the
world. Agora’s partnership with the Sierra Leone election was a proof-of-concept
experiment. And the interesting part is, both results from government officials and
experiment had the same results.
4. Ride Sharing
Nowadays, sharing a ride is common. Passengers pay driver with either cash or credit.
How about digital currency? LaZooz is a real-time ridesharing service, powered by
Blockchain. It synchronizes vacant seats with passengers in real time, based on their
location. By using cryptocurrency technology La`Zooz works with a “Fair Share”
rewarding mechanism for driver and passengers.
5. Food
Ever wondered about the integrity of the food you are eating, where it comes from and
how it’s made? With Provenance, you can track the journey of fresh produce from source
to the shop in real time. As such, you can know if the chicken chop is infected since you
know the origin. Provenance equips physical products with a unique ID that enables the
tracking of each item. With that ID, you can check the secure digital history, along with
verified claims made by a company, enriched with content from along the supply chain.
7. Drug Traceability
You wouldn’t tell if the medicine is genuine until you put it inside your stomach.
Blockverify provides a Blockchain solution to track pharmaceuticals throughout the
supply chain to ensure, consumers receive an authentic product. Blockverify offers a
transparent environment where it is not possible to duplicate products and it can track
fraudulent transactions of any type throughout the system. The system creates immutable
records to ensure data integrity, also, by using smart contracts it automates processes
leading to significant cost savings for its customers.
8. Commercial Financing
The current lending industry is inefficient, especially with lots of documents to fill up.
Now, both borrowers and lenders are connected all over the world through Blockchain.
Lendoit is disrupting the traditional lending industry, all without giving the bank their cut.
As lenders, you can remain completely anonymous without being required to register
anywhere. Select your preferred loan from the marketplace. Next is to initiate from your
wallets. Borrowers connected to the platform will pay the loan in a low- interest
environment.
9. Trade Financing
As of now, trade finance is a complex process. Various parties from exporters, importers,
banks, transporters, shippers, customs agents, and regulators all require checks and
verifications at various points of the process. Each interlocking part of the process
depends on the successful completion of the previous phase and on reliable information.
Creating a blockchain trade finance ecosystem means combining all the different stages
of a trade, from production to end-delivery including on-boarding other banks, regulators,
customs and all parts of the trade cycle.
Batavia has used a Blockchain based solution and designed to support more efficient,
transparent, secure and cost-effective transactions with the idea to simplify the trade
finance process by moving away from the trade finance sector’s reliance on paper-based
records. It eliminates the necessity to handle and compare documents, allowing buyers,
sellers, and the banks to execute transactions with efficiency and transparency. Recently,
Notably, all of those systems utilized a Trusted Third Party approach, meaning that the
companies behind them verified and facilitated the transactions. Due to the failures of these
companies, the creation of a digital cash system was seen as a lost cause for a long while.
Cryptocurrency uses cryptography to make their transactions extremely secure. One of the
most important cryptographical tools that are used in cryptocurrency is the concept of Digital
signatures
Encryption is one of the most critical tools used in cryptography. It is a means by which a
message can be made unreadable for an unintended reader and can be read only by the sender
and the recipient. In modern technology, there are three forms of encryption that are widely
used, symmetric cryptography, asymmetric cryptography, and hashing.
Symmetric Cryptography:
Symmetric cryptography is the earliest known cryptographic method known to man. The
concept is very simple and if we were to break it down to steps, this is what it will look like:
You have a message M that you want to send over to your friend.
You encrypt the message with a Key and get a cipher text C.
Problem #1: The shared key : The fact that the encryption and decryption is done with one
single key is a huge problem. First and foremost, the sharing of the key needs to be done in a
very secured manner, if anyone gets hold the of key then all your data will be compromised.
Problem #2: It is not scalable: Another huge problem with symmetric cryptography is that it
is not scalable at all. Suppose Alice runs an information center and sends data via symmetric
key cryptography. It’s ok if she is only dealing with 3-4 clients. But the most clients she gets,
the more unique public keys she will have to handle and take care of. Eventually, it will
become too much to handle.
Alice chooses a random value “a” from the field n and determines a message M1 such that:
M1 = g^a mod n.
Similarly, Bob chooses a random value “b” from the field n and creates message M2 such
that:
M2 = g^b mod n.
Both Alice and Bob can now relay the message to each other.
There are two real world use of asymmetric cryptography that we will look into in this guide
and both are important for their own reasons:
m ^ e ^ d mod N = m.
OR
m ^ ed mod N = m
So, in the above equations:
Suppose the message that you have to send is 42. In other words, m=42.
e = 17.
N = 3233.
d = 2753
The encryption process
c = m^e mod N.
Now, remember when we talked about trapdoor functions we came to the conclusion that
private and public key needs to be mathematical derivatives of each other in a way that:
It should be difficult for anyone to determine the private key from the public key. In fact, it
should be so difficult that it will take the world’s most powerful computer decades upon
decades to derive one from the other.
To answer this conundrum, we go back centuries and meet our next genius, Euclid.
Euclid found out centuries ago that any number > 1 can be written as a product of prime
numbers.
C= m^e mod N.
Here, N is the key in the trapdoor function. While N maybe publicly known it should be hard
to determine prime factors that make up the number N. If you know the prime factors, then it
is child’s play to discover the product N.
Eg. You can use your web browser to multiply two huge numbers and find the product in less
than a second:
This is the trapdoor function that cryptographers used to determine the value of N. This is
basically, the heart of the trick.
In 1760, Swiss mathematician Leonhard Euler did some path breaking studies. He studied the
nature of numbers and more specifically the breakability of the numbers which he called the
phi function.
Basically given phi(N) where N is a random integer, the value of N will be the number of
numbers between 1 and N which do not share any common factors with N.
So, if N is 8 then:
Among these numbers, only 1,3,5 and 7 don’t share any factors with 8 except 1.
Meaning, phi(8) = 4.
Now, calculating the phi function is difficult except for one case. To know this, check out the
following graph. The graph tracks the distribution of phi values over integers upto 1000.
The only number that shares a factor with 7 in this series is…7!
So the phi(7) = 6.
Similarly, if you were to find the phi of a large prime number say 541 then:
It becomes very simple to calculate the phi for a prime number. And this gains, even more,
significance when you consider the multiplicative nature of phi functions. What is the
multiplicative nature of phi functions?
Now, let’s go back to algorithms. Alice has determined two large prime numbers P1 and P2
and has determined a number N by doing P1 * P2.
OR
Phi(N) = (P1-1)*(P2-1).
And just like that, we have discovered the trapdoor function for phi. If we know the prime
factors of N then it is easy to calculate the phi(N).
m ^ phi(n) ≡ 1 mod n
Meaning, for any two numbers m and n, as long as they don’t share a factor, m raised to the
phi(n) divided by n will always leave a remainder of 1. Let’s see this in an example.
Suppose, m= 8 and n = 5.
Phi(5) = 4
So, 8 ^ 4 = 4096.
4096 ≡ 1 mod 5 holds true because 4096 on being divided by 5 leaves a remainder of 1.
Now, the equation: m ^ phi(n) ≡ 1 mod n needs to be modified a little bit before we get our
final solution.
Modification #1
So, keeping this in mind, if in m ^ phi(n) ≡ 1 mod n we multiply the exponent phi(n) with any
number k, the final solution will be 1^k which is still 1.
m ^ k*phi(n) ≡ 1 mod n
Modification #2
Which becomes:
m ^ k*phi(n)+1 ≡ m mod n
Before we proceed, let’s bring back the old equations to refresh our memory:
c = m^e mod N.
m = c^d mod N
m ^ e*d mod N = m
Now, checkout the last equation doesn’t that look similar to our new modified equation:
m ^ k*phi(n)+1 ≡ m mod n
e*d = k*phi(n) + 1
Now, since we already know the value of e, it is easy to calculate d, the private key, ONLY if
the factorization of N is known (which is a secret that Alice has kept to herself).
This is the trapdoor that will undo the encryption done by her private keys e and n.
P2 = 59.
N = P1 * P2 = 53 * 59 = 3127.
Now, she needs to generate a value e which will have no factors with the value of phi(N).
d = (k*phi(N) + 1)/e
Taking k = 2 we get:
Now, she will lock up all the values except N and e which are her public key and make the
knowledge of these two global.
Now, Bob needs to send message M, which is 89, and he needs to calculate the cipher text c
such that:
c = M^e mod N.
Y^2 = x^3 + ax + b
Since then the game theory has found a life of its own and has seen widespread
implementations in various other technologies and fields.
Take a public blockchain for example. To make it work, enough participants in the
blockchain must agree on the history of validation and permanent registration of transactions
on the blockchain ledger up until that point. If we could rely on everybody to be honest, there
would be little or no problem — but we can’t. The temptation to register fraudulent
transactions or illicitly reverse genuine transactions, while hanging onto their ill-gotten gains
is simply too much for some users to resist.
Public blockchain protocols must deal with this issue autonomously. No single participant
can step in and unilaterally declare transactions to be valid or invalid. That would make
nonsense of the principle of decentralization. But to understand how a blockchain protocol
can handle such a challenge, we first need to know more about the problem.
Let’s allow the Byzantine Generals step forward and tell us all about it. The Byzantine
Generals Problem was given its name by Leslie Lamport, one of the three authors of a pivotal
paper on the subject in 1982. He reasoned that ‘the best way to attract attention to a problem
is to present it in terms of a story’, meaning the Byzantine Generals didn’t actually have a
problem with achieving decentralized consensus — it’s just an effective way of helping
people understand the problem.
Imagine a military operation in the East Roman Empire (aka Byzantium), more than 1,000
years ago. Several Byzantine generals and their armies are positioned around a rebel city.
Each general and army is in a separate camp. Communication between the generals is only
possible by messengers who must cross the open terrain from one camp to another.
For the generals and their armies to successfully attack the city or retreat safely from it, they
must all act together. Failure to coordinate their actions by even one of the generals will mean
that all the armies will be individually massacred by the forces of the rebel city. To act
together and take over the rebel city, they must agree on when to attack and at what time —
but here’s the catch:
They could send messengers on horseback, but what if one is captured or killed before
delivering the message?
It’s a tough problem to crack, but one that Satoshi Nakamoto managed to solve through the
Bitcoin blockchain.
Distributed systems with mechanisms to overcome this problem are said to have Byzantine
Fault Tolerance or BFT. Bitcoin has BFT built into its protocol. Its proof of work consensus
mechanism is designed to produce new blocks every 10 minutes, using the total available
computing power in the Bitcoin network and rewarding the first node to mine the next valid
block.
What is Proof-of-Work (PoW)?
All the other Bitcoin nodes in the network can easily and individually check that a new block
of transactions proposed by one of the nodes has been correctly mined. In this way they can
then reach agreement on whether to add the new block to the existing blockchain.
And so, unlike the Byzantine generals who — rumour has it, are still stationed around the
rebel city to this day — users of public blockchain systems can safely and securely run their
operations.