Professional Documents
Culture Documents
M.Tech CSE 3rd Sem Introduction To Block Chain Unit 1 Lecture Notes
M.Tech CSE 3rd Sem Introduction To Block Chain Unit 1 Lecture Notes
UNIT I
Introduction
Blockchain is the technology of the year 2018. We may thank bitcoin, altcoins
(cryptocurrency),and ICOs (Initial Coin Offering) for the rise of blockchain. Thousands of
blockchains have already been created and available publicly on GitHub and other open-source
platforms.
According to a survey, 58% of large enterprises are thinking of a way to implement blockchain
in their projects.
Why now?
The blockchain concept was first introduced by Stuart Haber and W. Scott Stornetta in 1991 as
“a cryptographically secured chain of blocks,” which means a chain or blocks that are linked and
cryptographically secured. Each block is a combination of three items;
A hash pointer to the previous block.
A timestamp.
And transaction data.
By design, blockchains are secure and difficult to modify.
There are three key reasons why blockchain is becoming mainstream today:
Increased digital processing power
Rapid growth in cybercrimes
Rise of bitcoin and cryptocurrency
Blockchain, by design, requires higher processing power than normal data computing. It is all
because of the redundancy of data, distributed storage, and cryptography. Data encryption and
decryption is a costly affair by nature. Today, computers have more processing power .
Fundamental problem
Today, blockchain is “the blockchain” because of Bitcoin. And if you look at the reason why
Bitcoin was created, there is one word that can describe it better than anything else, i.e.,
TRUST. Bitcoin was created to overcome the mistrust and non-transparency of financial
institutions.
Blockchain brings trust to a transactional system.
In our system (current or new) missing the trust factor. Do we need to prove to your
customers that the transactions are verified and validated by unbiased third-parties?
Definition of blockchain:
Blockchain is a technology to create and maintain a cryptographically secure, shared, and
distributed ledger (a database) for transactions. Blockchain brings trust, accountability, and
transparency to digital transactions.
All transactions that exist on a blockchain are shared and distributed among a network of
peer-to-peer computers. Transactions are encrypted before they are stored and shared
Challenges
Blockchain technology fundamentally has a problem and it’s not for everyone. Saving
redundant data on thousands of computers, getting approval from them, encrypting is a lot of
work. Not only that, the blockchains based on Proof of Work (PoW) consensus sich as
Bitcoin can also be energy inefficient and bad for the environment. Blockchain is not for new
system.
Here are some of the key points to consider when deciding to build a blockchain.
Complicated
As we’ve seen in our earlier definition, blockchain is not easy to implement and some of the
concepts are still new and evolving. Data is redundant on thousands of distributed computers
and all these computers must agree and validate. All users on a blockchain are public but
anonymous and can be anywhere in the world. It’s not something where you can pick up a
phone and make a call. Blockchain technology isn’t easy to understand by non-technical
people and requires an expert level of understanding of technology.
Public and Transparent
Not all systems need to be public and transparent. A blockchain-based system requires
approval from all participating nodes. While the blockchain process is public and
transparent, it could easily lead to some disagreement among participating parties and delay
the processing.
Performance and Time
Performance is a major concern in a blockchain transaction. Each transaction is distributed
and peer-to-peer and requires all involved parties to validate and approve the changes. Not
only does the process lead to a transaction performance but the time of completion is high.
Transaction cost
Distributing data and cryptographical operations are time- and resource-consuming and lead
to higher transaction costs. Blockchain transactions require a special kind of hardware and
have a high demand for electricity. Normal computers aren’t sufficient to participate as
blockchain nodes. You will need to spend thousands of dollars on new computers that can
support blockchain transaction processing.
Open Source
Public blockchain software is open source and usually available in Github to download and
contribute to the public.
Blockchain Technology has witnessed phenomenal growth in the last few years and appears
to stay on track in gaining enterprise adoption. But while it has covered an appreciable curve
of general acceptance, it continues to baffle people conceptually.
Striking similarities between Blockchain and databases makes people wonder “is Blockchain
just a database?” Yes, Blockchain technology is a database that comes with several
distinguishable traits. These traits are what lead to the debate of Blockchains versus
traditional databases.
What is a Traditional Database?
Data structures are defined as a storage format for efficient management of data. A traditional
database is nothing but a data structure, that helps in storing and working with data. Each
organization, from a startup to a Government entity, uses databases depending upon the scale and
size of their operations. The aspect that makes databases utilitarian, is they allow users to fetch
the data. In technical terms, this is referred to as requesting or querying data that is achieved by
Structured Query Language, SQL.
Databases are no rocket science, in that they are simple tables. Tables are fields (columns) that
contain the details regarding the nature of data. Rows are called records.
Blockchains versus Traditional Databases
To understand the difference between a blockchain and a traditional database, it is worth
considering how each of these is designed and maintained.
Traditional Databases
Traditional databases use client-server network architecture. Here, a user (known as a client)
can modify data, which is stored on a centralized server. Control of the database remains
with a designated authority, which authenticates a client’s credentials before providing
access to the database. Since this authority is responsible for administration of the database,
if the security of the authority is compromised, the data can be altered, or even deleted.
Blockchain Databases
Blockchain databases consist of several decentralized nodes. Each node participates in
administration: all nodes verify new additions to the blockchain, and are capable of entering
new data into the database. For an addition to be made to the blockchain, the majority of
nodes must reach consensus. This consensus mechanism guarantees the security of the
network, making it difficult to tamper with.
In Bitcoin, consensus is reached by mining (solving complex hashing puzzles), while
Ethereum seeks to use proof of stake as its consensus mechanism.
Integrity and Transparency
A key property of blockchain technology, which distinguishes it from traditional database
technology, is public verifiability, which is enabled by integrity and transparency.
Integrity: every user can be sure that the data they are retrieving is uncorrupted and unaltered
since the moment it was recorded
Transparency: every user can verify how the blockchain has been appended over timeA map
of Dashcoin masternodes distributed across the world.
CRUD vs Read & Write Operations
In a traditional database, a client can perform four functions on data: Create, Read, Update,
and Delete (collectively known as the CRUD commands).
The blockchain is designed to be an append only structure. A user can only add more data, in
the form of additional blocks. All previous data is permanently stored and cannot be altered.
Therefore, the only operations associated with blockchains are:
Read Operations: these query and retrieve data from the blockchain
Write Operations: these add more data onto the blockchain
Validating and Writing
The blockchain allows for two functions: validation of a transaction, and writing of a new
transaction. A transaction is an operation that changes the state of data that lives on the
blockchain. While past entries on the blockchain must always remain the same, a new entry
can change the state of the data in the past entries. For example, if the blockchain has
recorded that my Bitcoin wallet has 1 million BTC, that figure is permanently stored in the
blockchain. When I spend 200,000 BTC, that transaction is recorded onto the blockchain,
bringing my balance to 800,000 BTC. However, since the blockchain can only be appended,
my pre-transaction balance of 1 million BTC also remains on the blockchain permanently,
for those who care to look. This is why the blockchain is often referred to as an immutable
and distributed ledger.
In short, the difference is Decentralized Control
Decentralized control eliminates the risks of centralized control. Anybody with sufficient
access to a centralized database can destroy or corrupt the data within it. Users are therefore
reliant on the security infrastructure of the database administrator.
Blockchain technology uses decentralized data storage to sidestep this issue, thereby building
security into its very structure.
Though blockchain technology is well-suited to record certain kinds of information,
traditional databases are better suited for other kinds of information. It is crucial for every
organization to understand what it wants from a database, and gauge this against the
strengths and vulnerabilities of each kind of database, before selecting one.
What is Blockchain?
Blockchain is a decentral database that acts as a storage for chunks of bundled information called
blocks. The reason the blocks are referred to as chains is that each block carries the hashed data
of the block added to the ledger before it. This goes back to Genesis, the first-ever block that was
mined for bitcoin. A hash is a code that encrypts the transactions in a given block. This code is,
essentially, a pointer, a name of sorts, that uniquely identifies a block.
The bitcoin protocol makes it mandatory for every new block to contain the hash of the previous
block plus the hash of the block that contains information for newly processed transactions.
Milestones on the development of Bitcoin
As the 21st century has started people have started using the internet more and more. People
have started trusting the internet upto an extent that they are ready to invest in it too.
Although a number of attempts have already been made before the year 2008, none of them
succeeded. People tried many times but didn’t make it to the end. For example B-Money and
Bit-Gold never made to the market.This was in 2008, when the Bitcoin digital currency was
introduced.
As soon as Bitcoin was launched it started gaining a huge fame and popularity.
The year 2009 was pretty dope for the development and success of the Bitcoin
cryptocurrency.
Though Bitcoin's whitepaper was published in 2008, Nakamoto did not release Bitcoin's
software until January 2009. That release allowed Bitcoin miners to start the Bitcoin
network, generate Bitcoin, and confirm transactions for the first time.
2010: Nakamoto Leaves Bitcoin
In 2010, Nakamoto went offline. He passed control of Bitcoin's codebase to Gavin Andresen,
who became one of the most significant early Bitcoin developers. Nakamoto's departure also
led to division within the cryptocurrency community, as no single developer had Nakamoto's
level of authority.
2010 also marked the launch of the first Bitcoin exchanges: BitcoinMarket.com and Mt.
Gox. The first "real world" Bitcoin transaction also occurred in 2010 when Laszlo
Hanyecz purchased two pizzas from Papa John's via a middleman on bitcointalk.org.
In the 2010 currency started gaining more attention. As we mentioned that Bitcoin
cryptocurrency was mined in the year 2009. However the first trading at the Bitcoin
cryptocurrency was made in 2010 after the Bitcoin cryptocurrency was valued for the very
first time. Back then people were not aware of the value and the upcoming future of the
Bitcoin cryptocurrency. That’s why they swap the Bitcoin cryptocurrency without knowing
the actual future of it.
If they had the Bitcoins right now they could easily make $100000000 out of it pretty easily.
Well we all know that this is the part of every product and its journey.
2011-Rivals
In the year 2011 many other digital currencies started emerging as a competition with the
Bitcoin cryptocurrency. The examples include Namecoin, Litecoin etc. Although there are
many hundreds of digital currencies that are being circulated in the trading market right now
but none of them gain as much popularity as the Bitcoin cryptocurrency.
2011: Black Markets & BitPay
In 2011, the dark net market Silk Road opened and allowed Bitcoin as a payment option.
Though the FBI shut down the site and seized its Bitcoin in 2013, the Silk Road inspired
other dark net markets to make use of Bitcoin.
The same year also brought legitimate Bitcoin payments. BitPay launched its payment
processor in May 2011, and within one year, it attracted over 1100 merchants.
2012: Bitcoin's First Halving
In 2012, Bitcoin underwent its first "halving." This event cut block rewards in half (from 50
BTC to 25 BTC) in order to discourage Bitcoin mining and reduce inflation. The halving
seemingly worked as intended: the price of BTC rose from $12 to $650 over the four-year
period that followed the halving. However, this price increase may have been partly due to
general demand for Bitcoin, not strictly due to the halving itself.
2013: First Bitcoin ATMs
In October 2013, the world's first Bitcoin ATM was installed in Vancouver, BC, Canada.
Other early ATMs were installed in Bratislava, Slovakia in October 2013, and in
Albuquerque, New Mexico in February 2014. As of October 2020, there are over 3.5 million
Bitcoin ATMs in operation across the world.
2014: Mt. Gox Shuts Down
In 2014, crypto exchange Mt. Gox declared insolvency and indicated that it had lost over
744,000 BTC in a series of thefts dating back to 2011. The bankruptcy marked the end of
what was once the largest Bitcoin exchange; it also made way for major crypto
exchanges such as Coinbase and Kraken that are still popular today.
2015: NYDFS' BitLicense
In 2015, the New York State Department of Financial Services (NYDFS)
introduced BitLicense, which became a requirement for crypto companies operating in the
state. The license quickly earned a reputation as one of the most selective credentials. Five
years later, just over a dozen companies have been awarded a BitLicense, and many critics
consider it an obstacle that prevents innovation and inhibits new startups.
2016: Bitcoin's Second Halving
Bitcoin underwent its second halving in 2012 and reduced its block reward from 25 BTC to
12.5 BTC. Once again, reduced inflation had its intended effect: BTC prices rose from $650
to roughly $8000 over the four years between halvings.
2017: SegWit & BCH Fork
In 2017, Bitcoin developers entered a dispute over SegWit, a scaling mechanism meant to
make Bitcoin more efficient. Opposition to SegWit led parts of the community to
create Bitcoin Cash, activated via a chain fork in September 2017.
Blockchain technology will also protect users legally when, in the event of a dispute, the
smart contract technology can provide arbitration. For example, if a person owns an
autonomous car and wants to rent it out for extra income, the smart contract technology
would ensure that those who hire the car make payments as required without needing a third
party to oversee the transaction. Also, in the event of a dispute, the technology would
analyze its rich and highly accurate data and could offer a transparent and just settlement.
Likewise, if the car were co-owned by two or more people, the same smart contract
technology would ensure that the parties would each automatically get their fair share of
income and would settle disputes as well.
As blockchain technology continues to gain mainstream acceptance, there is a high
likelihood that more innovative solutions combining the solution with real-world use cases
are yet to come. The sharing economy has a long way to go before becoming a fully secure
and user-friendly space, but with all the innovation in the space, it's possible that the kinks
will be straightened out sooner rather than later.
Smart Contracts
Smart contracts can be described as scripts that are stored on the blockchain . These scripts are
executed automatically when addressing a transaction to it. The given transaction data is then
processed according to the protocol defined for the smart contract. This mechanism can be
illustrated by the example of renting a bike:
Alice wants to rent a bike from a stranger called Bob. Bob creates a smart contract, which mainly
has two functions: rent and return. In the smart contract, it is defined that when renting the bike,
Alice has to transfer a deposit of 0.01 Bitcoin to the smart contract. The costs for the rental are
0.001 Bitcoin per 24 hours. When Alice returns the bike, she gets back the difference between
her deposit and the actual rental price. So, Alice transfers the deposit of 0.01 Bitcoin, and the
rent function of the smart contract is triggered. It registers the date and time of the rental on the
blockchain and Alice may now use the bike. She returns the bike after four days, and Bob
triggers the return function of the smart contract, which returns 0.006 Bitcoin back to Alice’s
wallet and sends 0.004 Bitcoin to Bob’s wallet. This was a rather simple scenario, but smart
contracts have the potential to automatize even complex organizations. These so-called
Decentralized Autonomous Organizations (DAO) are entirely run by its members, and all
proposals to change something within the organization have to be approved by the members .
This offers a great chance to democratize organizations and abolish hierarchies. However, there
are some drawbacks to smart contracts. As data on a blockchain is immutable and smart
contracts are stored on a blockchain, smart contracts are also immutable. Thus, a smart contract
either needs to be written correctly at once, or there needs to be a function included to edit or
delete the smart contract . Another limitation is that smart contracts are not self-executing and
therefore always need to be triggered by a (possibly artificial) person . Also, the legal status of
smart contracts is still uncertain .
Sharing Economy
As sharing economy is an umbrella construct, there is considerable variation in definitions for it .
Hamari et al.define the sharing economy as “the peer-to-peer-based activity of obtaining, giving,
or sharing the access to goods and services, coordinated through community-based online
services”. PwC emphasizes the commercial character of sharing economies, as they “allow
individuals and groups to make money from underused assets”. Sundararajan [45] describes the
sharing economy as an economic system with “blurring lines between the personal and the
professional” as well as “blurring lines between fully employed and casual labor”.
The current centralized sharing economy businesses all offer certain characteristic services.
Killeen names three of them:
1. aggregated supply and/or demand,
2.customer relationship management tools, and
3.payment processing”.
According to Killeen, these services lead to the users’ willingness to pay for the systems. Also,
sharing economy businesses typically offer certain technical features to their users. Narasimhan
defines these “technology-enabled features” as the offering of a mobile app and cashless
transactions, a rating system, and dynamic pricing. It is clear that the sharing economy is a
successful business model, with Airbnb being valued at 31 billion USD in 2017 . There are
various reasons why people use sharing platforms. According to a PwC survey, participants’
motivations are mainly affordability, convenience and efficiency, sustainability, as well as social
aspects. However, these motivations cannot explain the success of the sharing economy
businesses completely. An important factor that led to wide adoption is the establishment of a
“digital trust infrastructure”. By providing a review system, insurances, and identity verification,
the sharing economy businesses succeeded in gaining people’s trust . This trust in the brand of a
sharing economy business is of major importance because it makes it more likely that users also
have trust in the providers on that platform . Also, the success of peer-to-peer marketplaces is
influenced by network effects. The platforms directly benefit from an increase in users as that
makes the platform more valuable for all users. For instance, an increase in providers increases
the supply and therefore makes the marketplace more attractive to users, and an increase in users
increases the value for providers. According to Bhatt, these dynamics are strengthened if peers of
an individual use a certain platform, as that makes it more likely that the individual will also use
that platform.
The Internet of Value (IoV) is a concept proposed by Ripple which envisions an internet where
value is transferred as easily, cheaply and reliably as data is transferred now. Blockchain
technology supports this vision by facilitating access to value transfer infrastructure.
The Internet of Value, described in simple terms, is an online space where people can instantly
transfer value between each other, eliminating the need for the middlemen and most costs.
Theoretically, anything of monetary or social value can be transferred between parties, including
currency, assets, stocks, securities, intellectual property rights, scientific discoveries, and even a
vote in an election.
Transferring value is already supported by legacy financial rails like SWIFT, blockchain like
Bitcoin or Ethereum and new and emerging technologies or solutions
like Interledger (ILP), PayID and many, many apps that make transferring value easier with
existing infrastructure. All of these need to be connected somehow to achieve the vision and
there are likely still a lot of unknowns.
The Internet of Value sounds similar to the Internet of Things (IoT), which is a different concept
but they do not necessarily exclude each other. On the Internet of Things any device can
communicate with other devices, which forms a complex network that can produce more diverse
results than human-human or human-computer interaction. IoT is interesting in this respect as the
devices in this network might potentially want to exchange value too and that is why these two
will likely evolve in parallel.
Through analysis of the top five uses of blockchain, ranked by their potential to generate
economic value, the report gauges the technology’s potential to create value across industry,
from healthcare, government and public services, to manufacturing, finance, logistics and retail.
“Blockchain technology has long been associated with cryptocurrencies such as Bitcoin, but
there is so much more that it has to offer, particularly in how public and private organizations
secure, share and use data,” comments Steve Davies, Global Leader, Blockchain and
Partner, PwC UK.
“As organizations grapple with the impacts of the COVID-19 pandemic, many disruptive trends
have been accelerated. The analysis shows the potential for blockchain to support organizations
in how they rebuild and reconfigure their operations underpinned by improvements in trust,
transparency and efficiency across organizations and society.”
Key takeaways
The report identifies five key application areas of blockchain and assesses their
potential to generate economic value using economic analysis and industry research.
The analysis suggests a tipping point in 2025 as blockchain technologies are expected
to be adopted at scale across the global economy.
Tracking and tracing of products and services – or provenance – which emerged as a
new priority for many companies’ supply chains during the COVID-19 pandemic, has
the largest economic potential ($962bn). Blockchain’s application can be wide
ranging and support companies ranging from heavy industries, including mining
through to fashion labels, responding to the rise in public and investor scrutiny around
sustainable and ethical sourcing.
Payments and financial services, including use of digital currencies, or supporting
financial inclusion through cross border and remittance payments ($433bn).
Identity management ($224bn) including personal IDs, professional credentials and
certificates to help curb fraud and identity theft.
Application of blockchain in contracts and dispute resolution ($73bn), and customer
engagement ($54bn) including blockchain’s use in loyalty programmes further
extends blockchain’s potential into a much wider range of public and private industry
sectors.
In the context of cryptocurrencies like Bitcoin, the blockchain uses this cryptographic hash function's properties in
its consensus mechanism. A cryptographic hash is a digest or digital fingerprints of a certain amount of data. In
cryptographic hash functions, the transactions are taken as an input and run through a hashing algorithm which gives
an output of a fixed size.
SHA-256
A Bitcoin's blockchain uses SHA-256 (Secure Hash Algorithm) hashing algorithm. In 2001, SHA-256 Hashing
algorithm was developed by the National Security Agency (NSA) in the USA.
CS-607 B Introduction to Block Chain Technology
PPT
2