0% found this document useful (0 votes)
332 views34 pages

Blockchain Notes-Unit IV

This document discusses cryptocurrency and how it works. It defines cryptocurrency as a digital payment system that does not rely on banks to verify transactions. Cryptocurrency transactions are recorded in a public ledger. Cryptocurrencies use encryption to verify and protect transactions. Examples of popular cryptocurrencies include Bitcoin, Ether, Litecoin, and Stablecoins. The document compares how transactions work differently in cryptocurrency versus fiat currency. It also outlines the key steps to buy, store, and invest in cryptocurrencies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
332 views34 pages

Blockchain Notes-Unit IV

This document discusses cryptocurrency and how it works. It defines cryptocurrency as a digital payment system that does not rely on banks to verify transactions. Cryptocurrency transactions are recorded in a public ledger. Cryptocurrencies use encryption to verify and protect transactions. Examples of popular cryptocurrencies include Bitcoin, Ether, Litecoin, and Stablecoins. The document compares how transactions work differently in cryptocurrency versus fiat currency. It also outlines the key steps to buy, store, and invest in cryptocurrencies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

310916: Elective-I

Block Chain
MCA I YEAR – SEM(II)
(2022-23)

Department of MCA

GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING,


Balewadi-Baner, Pune- 411 045

1 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

A cryptocurrency is not a type of currency that can be used in the real world. It can
be used to perform transactions only in the digital world. So in order to buy/sell
using a cryptocurrency, it has to be converted from a digital form to some existing
currency that is used in the real world. For example, Dollars, Rupees, etc.
Cryptocurrencies don’t have a central issuing authority instead using a decentralized
system to record transactions and issue new units.

What is Cryptocurrency?

Cryptocurrency is a digital payment system that does not rely on banks to verify
transactions. Cryptocurrency payments exist purely as digital entries to an online
database. When cryptocurrency funds are transferred, the transactions are recorded
in a public ledger.
 In cryptocurrency, “coins” (which are publicly agreed on records of ownership)
are generated or produced by “miners”.
 These miners are people who run programs on ASIC (Application Specific
Integrated Circuit) devices made specifically to solve proof-of-work puzzles.
 The work behind mining coins gives them value, while the scarcity of coins and
demand for them causes their value to fluctuate.
 Cryptocurrencies can be used for buying goods just like fiat currency.
 Cryptocurrencies use encryption to verify and protect transactions.
 It does not exist in physical form and is not typically issued by any central
authority.
 They use decentralized control in contrast to central bank digital currency.

Cryptocurrency Examples

Some of the best-known cryptocurrencies are:


1. Bitcoin: Bitcoin is the most widely accepted cryptocurrency. Founded in 2009 by
Satoshi Nakamoto, it is still the most commonly traded. It is a decentralized
digital currency that can be transferred on a peer-to-peer bitcoin network.
2. Ether: Ether is the native cryptocurrency of the Ethereum blockchain network.
Each Ethereum account has an ETH balance and may send ETH to any other
account. The smallest subunit of Ether is known as Wei.
3. Litecoin: Litecoin is a peer-to-peer cryptocurrency and in technical terms,
Litecoin is nearly identical to Bitcoin. It uses scrypt in its proof-of-work
algorithm. It is an adaptation of Bitcoin that is intended to make payment easier.

2 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

4. Stablecoins: These are the class of cryptocurrencies whose values are designed
to stay stable relative to real-world assets like the U.S. Dollar.
5. Solana: Solana is a competitor of Ethereum whose main emphasis is on speed
and cost-effectiveness.

Cryptocurrency Working vs Fiat Currency Working

Let’s understand the difference between the working of a cryptocurrency and fiat
currency like the U.S. Dollar while purchasing goods.
There are two things that make cryptocurrency working and fiat currency working
different: Transactions and the Consensus protocol. A block in a Blockchain has the
following structure:

As we can see, a block contains multiple transactions at a time in the transaction’s


id_list.
1. Transactions: The transactions performed in the crypto world are very different
than those that of which are performed in the real world. Let’s consider that Alice
wants to buy a Bicycle.
 Real-world: In the real world Alice can pay in any available currency. The seller
will return the change if any to Alice.
 Crypto world: Suppose the bicycle costs 0.6 BTC and Alice has 0.7 BTC in the
Bitcoin Wallet. Alice has to consider the whole amount i.e 0.7 BTC
3 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Transaction 1: Transfer only 0.6 BTC from Bitcoin wallet to the


seller’s wallet. Now, Alice has already exhausted 0.6 out of 0.7 BTC.
The remaining 0.1 BTC has to be transferred back to Alice’s wallet.
There is no change in BTC being offered by the seller to Alice.
 Transaction 2: Alice offers 0.1 BTC back to herself. So 0.1 BTC is an
unspent transaction amount in Alice’s wallet.
2. Consensus protocol: Consensus decision-making is a group decision-making
process in which group members develop, and agree to support a decision in the best
interest of the whole. Basically, it states that the longest valid chain in the
Blockchain network should exist on every node in the Network.

How Does Cryptocurrency Works?

Cryptocurrencies are not regulated or controlled by any central authority hence


cryptocurrency works outside the banking system using different types of coins.
1. Mining: Cryptocurrencies are generated through the process called Mining. In
this process, the miners are required to solve a mathematical puzzle over a specially
equipped computer system to be rewarded with bitcoins in exchange.
2. Buying, selling, and storing: Users can buy cryptocurrencies from central
exchanges, brokers, or individual currency owners and sell crypto to them.
Cryptocurrencies can be stored in wallets.
3. Investing: Cryptocurrencies can be transferred from one digital wallet to another.
Cryptocurrencies can be used for the following purposes:
 Buying goods and services.
 Trade-in them.
 Exchange them for cash.

How To Buy Cryptocurrency?

There are three steps involved in buying a cryptocurrency:


1. Choosing a platform: There are two platforms available to choose from:
 Traditional Brokers: There are online brokers who offer to buy and sell
cryptocurrencies along with stocks, bonds, etc, but they offer lower trading costs
and fewer crypto features.
 Cryptocurrency exchanges: Different types of cryptocurrency exchanges are
available to choose from with different cryptocurrencies, wallet storage, etc.
2. Funding your account: After choosing the platform, the next step is to fund the
account. Most crypto exchanges allow users to purchase cryptocurrencies using fiat

4 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

currency like U.S. Dollar, the Euro, or using Credit and Debit cards, but this varies
from platform to platform. An important factor to consider here is the fees that
include the potential deposit and withdrawal transaction fees plus the trading fees.
3. Placing an order: The order can be placed via exchanges or broker’s web or
mobile platform.
 Select the Buy option.
 Choose the order type.
 Enter the amount of cryptocurrencies.
 Confirm the order.
A similar process needs to be followed for selling cryptocurrencies.

How To Store Cryptocurrency

Once the cryptocurrency is purchased, it needs to be stored safely to protect it from


hackers. The usual place to store cryptocurrency is crypto wallets which can be
physical devices or online software. Not all exchanges or brokers provide crypto
wallet services. The cryptocurrencies can be stored in these four places:
1. Custodial Wallet: In this approach, a third party such as a crypto exchange
stores the cryptocurrency either through cold storage or hot storage, or a
combination of the two. This is the most simplest and convenient method for the
users as it requires less work on the user part.
2. Cold Wallet: These are also known as Hardware wallets. It is an offline wallet in
which hardware connects to the computer and stores the cryptocurrency. The
device connects to the internet at the time of sending and receiving
cryptocurrency but other than that the cryptos are safely stored offline.
3. Hot Wallet: These are the applications that store cryptocurrencies online. These
are available as desktop or mobile apps.
4. Paper Wallet: This is also known as a physical wallet. It is a printout of the
public and private keys available as a string of characters or scannable QR codes.
To send crypto scan the public and private keys and crypto will be received using
the public keys.
Custodial Paper
Wallet Cold Wallet Hot Wallet Wallet

Definition Third-party The hardware Applications Physical

5 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Custodial Paper
Wallet Cold Wallet Hot Wallet Wallet

such as the connects to the that store storage of


crypto computer and cryptocurrencies public and
exchange store stores the online private keys.
the cryptocurrency.
cryptocurrency.

 Simple and
convenient
 Gives
method.  Maximum
control over
 Easy to  Highest security at
crypto.
access. level of the lowest
 Almost
 No worry security. possible
always free.
about losing cost.
 Easy to use.
your crypto
Advantage wallet.

 The process
is slower
The security compared to  Less user-
risk of leaving when friendly.
Risk of being
crypto in third- storing  Risk of
hacked.
party’s crypto losing a
possession. online. wallet.
 Cost of
Disadvantage device.

What Can You Do With Cryptocurrency

Here are some of the examples:


 Shopping: Some luxury retailers like Rolex and Patek Philippe accept
cryptocurrency as a form of payment.
 Insurance: Some insurance companies like Premier Shield insurance accept
Bitcoin for premium payments.
 Gift: Cryptocurrency can be a great gift for persons who want to learn and invest
in new technology.
6 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Travel: As crypto is not tied to a specific country, thus traveling with crypto can
save a lot on money exchange fees.

Advantages of Cryptocurrencies

The following are some of the advantages of cryptocurrencies:


1. Private and Secure: Blockchain technology ensures user anonymity and at the
same time the use of cryptography in blockchain makes the network secure for
working with cryptocurrencies.
2. Decentralized, Immutable, and Transparent: The entire blockchain network
works on the principle of shared ownership where there is no single regulating
authority and the data is available to all the permissioned members on the
network and is tamper-proof.
3. Inflation Hedge: Cryptocurrencies are a good means of investing in times of
inflation as they are limited in supply and there is a cap on mining any type of
cryptocurrency.
4. Faster Settlement: Payments for most cryptocurrencies settle in seconds or
minutes. Wire transfers at banks can cost more and often take three to five
business days to settle.
5. Easy Transactions: Crypto transactions can be done more easily, in a private
manner in comparison to bank transactions. using a simple smartphone and a
cryptocurrency wallet, anyone can send or receive a variety of cryptocurrencies.

Disadvantages of Cryptocurrencies

The following are some of the drawbacks of cryptocurrencies:


1. Cybersecurity issues: Cryptocurrencies will be subject to cyber security
breaches and may fall into the hands of hackers. Mitigating this will require
continuous maintenance of security infrastructure.
2. Price Volatility: Cryptocurrencies are highly volatile in terms of price as they
have no underlying value and there is a supply-demand-like equation that is used
to determine the price of cryptocurrencies.
3. Scalability: Scalability is one of the major concerns with cryptocurrencies.
Digital coins and tokens adoption is increasing rapidly but owing to the sluggish
nature of the blockchain makes cryptocurrencies prone to transaction delays.

7 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Cryptocurrencies cannot compete with the number of transactions that payment


giants like VISA, and Mastercard processes in a day.
4. Less awareness: Cryptocurrency is still a new concept for the people and the
long-term sustainability of cryptocurrencies remains to be seen.

Future scope

The future of most cryptocurrencies is uncertain, as it is still controversial and not


authorized by many Governments, institutions, etc. However, in the near future, it
may be used on a large scale and accepted more. Because every development of new
technologies includes the financial market to ease the user to the bottom level. The
ICO (Initial Offers of Cryptocurrency) is the fundamental part of an independent
project that is still in the development phase. In this process, shares are not sold; the
organization offers tokens, also known as cryptocurrency. Therefore, with time and
the development of these projects, cryptocurrency can offer multiple benefits for
these projects, and also for investors too. Cryptocurrency is the most independent
currency in the financial world. Therefore, the fact of prohibiting its dissemination
and/or use could cause a partial delay with respect to economic trends. Only the
future can show us how crypto influences our lifestyle.

Features of cryptocurrencies:

Decentralization: Cryptocurrencies are decentralized, meaning they operate on a


peer-to-peer network and are not controlled by a central authority or government.
Security: Cryptocurrencies use cryptographic techniques to ensure the security and
integrity of transactions and to protect against fraud and hacking.
Transparency: Most cryptocurrencies operate on a public ledger called a
blockchain, which allows anyone to see all transactions that have occurred on the
network.
Anonymity: While most cryptocurrencies are not completely anonymous, they do
offer a high degree of privacy and can allow users to transact without revealing their
identity.
Limited Supply: Cryptocurrencies are designed with a limited supply to maintain
their value and prevent inflation.
Global Accessibility: Cryptocurrencies can be accessed and used from anywhere in
the world, as long as there is an internet connection.
Low Transaction Fees: Compared to traditional banking and financial institutions,
cryptocurrencies generally have lower transaction fees, making them an attractive
option for international transactions.
8 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Programmability: Some cryptocurrencies allow for programmable transactions,


meaning that they can be programmed to execute automatically based on certain
conditions.

However, there are also some potential drawbacks to cryptocurrencies,


including:

Volatility: Cryptocurrencies can be highly volatile, with prices fluctuating rapidly


and unpredictably.
Lack of Regulation: Cryptocurrencies are not yet fully regulated by governments,
which can lead to uncertainty and potential risk for users.
Limited Acceptance: While the number of merchants accepting cryptocurrencies is
growing, they are still not widely accepted as a form of payment.
Hacking and Fraud: Cryptocurrencies are vulnerable to hacking and fraud, and
there have been numerous high-profile incidents of theft and scams in the
cryptocurrency world.
Overall, cryptocurrencies offer a range of features that make them a unique and
innovative form of digital currency. However, they also come with potential risks
and challenges that users must be aware of before investing in or using them.

Distributed Ledger Technology (DLT):

Distributed Ledger Technology (DLT) is centered around an encoded and distributed


database where records regarding transactions are stored. A distributed ledger is a database
that is spread across various computers, nodes, institutions, or countries accessible by
multiple people around the globe.
Features:
1. Decentralized: It is a decentralized technology and every node will maintain the ledger,
and if any data changes happen, the ledger will get updated. The process of updating
takes place independently at each node. Even small updates or changes made to the
ledger are reflected and the history of that change is sent to all participants in a matter
of seconds.
2. Immutable: Distributed ledger uses cryptography to create a secure database in which
data once stored cannot be altered or changed.
3. Append only: Distributed ledgers are append-only in comparison to the traditional
database where data can be altered.
4. Distributed: In this technology, there is no central server or authority managing the
database, which makes the technology transparent. To counter the weaknesses of having
one ledger to rule all, So that there is no one authoritative copy and have specific rules
around changing them. This would make the system much more transparent and will
make it a more decentralized authority. In this process, every node or contributor of the
9 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

ledger will try to verify the transactions with the various consensus algorithms or
voting. the voting or participation of all the nodes depends on the rules of that ledger. In
the case of bitcoin, the Proof of Work consensus mechanism is used for the
participation of each node.
5. Shared: The distributed ledger is not associated with any single entity. It is shared
among the nodes on the network where some nodes have a full copy of the ledger while
some nodes have only the necessary information that is required to make them
functional and efficient.
6. Smart Contracts: Distributed ledgers can be programmed to execute smart contracts,
which are self-executing contracts with the terms of the agreement between buyer and
seller being directly written into lines of code. This allows for transactions to be
automated, secure, and transparent.
7. Fault Tolerance: Distributed ledgers are highly fault-tolerant because of their
decentralized nature. If one node or participant fails, the data remains available on other
nodes.
8. Transparency: Distributed ledgers are transparent because every participant can see
the transactions that occur on the ledger. This transparency helps in creating trust
among the participants.
9. Efficiency: The distributed nature of ledgers makes them highly efficient. Transactions
can be processed and settled in a matter of seconds, making them much faster than
traditional methods.
10. Security: Distributed ledgers are highly secure because of their cryptographic nature.
Every transaction is recorded with a cryptographic signature that ensures that it cannot
be altered. This makes the technology highly secure and resistant to fraud.

How DLT Can Replace Traditional Book-Keeping Methods?

Distributed ledger technology has the potential to effectively improve these traditional
methods of bookkeeping by updating and modifying fundamental methods of how data is
collected, shared, and managed in the ledger. To understand this, traditionally paper-based
and conventional electronic ledgers were used to manage data that had a centralized point
of control. This types of system require high computing resource and labor to maintain
ledgers and also had many points of failure. Points of failure like:
1. Mistakes made during data entry.
2. Manipulation of data could happen which increases the risk of errors.
3. Other participants contributing data to the central ledger will not able to verify the
legitimacy of data coming from other sources.
However, DLT allows real-time sharing of data with transparency which gives trust that
data in the ledger is up to date and legitimate. Also Distributed Ledger Technology
eliminates the single point of failure which prevents data in the ledger from being
manipulations and errors. In DLT, there is no need for a central authority to validate
transactions here different consensus mechanisms are used to validate transactions which

10 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

eventually makes this process very fast and real-time. Similarly, DLT can reduce the cost of
transactions because of this process.

Types of Distributed Ledger Technology

The Distributed Ledgers can be categorized into three categories:


1. Permissioned DLT: Nodes have to take permission from a central authority to access
or make any changes in the network. Mostly these types of permissions include identity
verification.
2. Permissionless DLT: There is no central authority to validate transactions, rather
existing nodes are collectively responsible for validating the transactions. Various
consensus mechanisms are used to validate transactions based on predefined algorithms.
In the case of bitcoin proof of work consensus mechanism is used.
3. Hybrid DLT: It is combined with both permissionless and permissioned DLTs and can
benefit from both of them.
Below are some of the types of DLT:
1. Blockchain: In this type of DLT, transactions are stored in the form chain of blocks and
each block produces a unique hash that can be used as proof of valid transactions. Each
node has a copy of the ledger which makes it more transparent.
2. Directed Acyclic Graphs (DAG): This uses a different data structure to organize the
data that brings more consensus. In this type of DLT, validation of transactions mostly
requires the majority of support from the nodes in the network. Every node on the
network has to provide proof of transactions on the ledger and then can initiate
transactions. In this nodes have to verify at least two of the previous transactions on the
ledger to confirm their transaction.
3. Hashgraph: In this type of DLT, records are stored in the form of a directed acyclic
graph. It uses a different consensus mechanism, using virtual voting as the form
consensus mechanism for gaining network consensus. Hence nodes do not have to
validate each transaction on the network.
4. Holochain: Holochain is termed as the next level of blockchain by some people
because it is much more decentralized than blockchain. It is a type of DLT that simply
proposes that each node will run on a chain of its own. Therefore nodes or miners have
the freedom to operate autonomously. It basically moves to the agent-centric structure.
Here agent means computer, node, miner,etc.
5. Tempo or Radix: Tempo uses the method of making a partition of the ledger this is
termed sharding and then all the events that happened in the network are ordered
properly. Basically, transactions are added to the ledger on basis of the order of events
than the timestamp.

11 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Advantages Of Distributed Ledger Technology

1. High Transparency: Distributed ledger presents a high level of transparency because


all the transaction records are visible to everyone. The addition of data needs to be
validated by nodes by using various consensus mechanisms. and if anyone tries to alter
or change data in the ledger then it is immediately reflected across all nodes of the
network which prevents invalid transactions.
2. Decentralized: In a centralized network, there may be a single point of failure and it
can disrupt the whole network because of mistakes at the central authority level. But in
the case of distributed networks, there is no risk of a single point of failure. because of
the decentralized structure trust factor also increases in participating nodes. This
decentralized nature of validation reduces the cost of transactions drastically.
3. Time Efficient: As this network is decentralized so there is no need for a central
authority to validate transactions every time. Hence this time for validation of each
transaction reduces drastically. In the case of DLT, transactions can be validated by
members of the network itself by using various consensus mechanisms.
4. Scalable: Distributed ledger technology is more scalable because many different types
of consensus mechanisms can be used to make it more reliant, fast, and updated.
Because these many advanced DLT technologies are introduced in the last few years.
Such as Holochain, hashgraph are considered to be advanced and more secure versions
of Blockchain DLT. Blockchain itself is advanced and secure but DLT provides a way
to more advanced technologies.

Uses of Distributed Ledger Technology

12 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Because of all these benefits of distributed ledger technology and this technology has the
potential to revolutionize many sectors like Financial, energy, healthcare, governance,
supply chain management, real estate, cloud computing, etc.

1. Banking: In the banking sector right now transfer of money can be both expensive and
time-consuming. Also sending money overseas becomes even more complex due to
exchange rates and other hidden fees included. Here DLT can provide a decentralized
secure network that will help to reduce the time, complexity, and costs required to
transfer money. This decentralized network will eliminate the need for third parties
which makes this system more complex and time-consuming.
2. Cyber Security: Nowadays cyber security has been emerging as a big threat to
governments, enterprises, and individual people also. So it is essential to find an
effective solution to secure our data and privacy against unauthorized access. In DLT,
all information is authorized and securely encrypted by various cryptographic
algorithms. This provides a transparent and secure environment and none of the data
can be tempered by any entity.
3. Supply chain management: Supply chain is one of the complex structures itself. In this
structure, it is hard to trace where the fault happened. So here Distributed ledger
technology comes into the picture, Using DLT, you can easily trace the supply chain
from the beginning to the end and can easily find out where a mistake or fault has
happened. All the data added to the DLT is validated and permanent and can not be
altered. This transparency of data enables us to trace from the beginning to the end of
the ledger.
4. Healthcare: Distributed Ledger eliminates central authority and ensures rapid access to
secured and untempered data. Here important medical can be stored securely and no one
can change this data, even if someone tries to change it will be reflected everyone
immediately. DLT can be used in the insurance sector to trace false claims because of
its decentralized system.

13 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

5. Governance: DLT can be used in the government system to make it transparent among
citizens. Many governments have adopted blockchain in the governance system because
of the robustness of this system. It can be used as a voting system too. The traditional
voting system has many flaws and sometimes it is found that there are many false
voting and illegal activities that happen during voting. Online voting systems can be
used to vote and with security and fake votes can be easily checked. everyone will have
their own identity. So that any person sitting anywhere in the world can cast his vote.

How are Blockchain And Distributed Ledger Different?

In general blockchain and Distributed Ledger Technology are considered as same, but there
are some differences between these two technologies. Blockchain can be classified as a
type of Distributed Ledger Technology. We can say that Blockchain is a type of DLT, but
every Distributed Ledger can not be called a blockchain.
Blockchain is the parent technology of DLT. But the idea behind them is the same.
Blockchain technology has the potential to solve many problems in the banking and
financial industry. Here, blockchain is the advanced version of Distributed Ledger
Technology with many useful functionalities. Developers have many other variants of
DLTs in the technology world. However, they do not have the many real-life
implementations and applications that blockchain has been able to do.

Basis Distributed Ledger Blockchain Technology

In DLT, blocks can be organized In Blockchain, blocks are added


Block Structure in different forms. in the form of a chain.

It is more scalable because it


It is a subset of DLT, the power
does not need the power of a
of the work consensus
work consensus mechanism for
mechanism adds more
the validation of each
functionalities and security.
Power of Work transaction.

It does not require any tokens or In it, tokens must be considered


Tokens digital currency. while working with Blockchain.

It does not require any specific All blocks are arranged in a


Sequence sequence of data. particular series.

14 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Basis Distributed Ledger Blockchain Technology

Trust among participating nodes


Trust among participating nodes is less than DLT. Decision-
is high. making powers can be on one
Trustability hand because everyone can mine.

Advantages of Using Distributed Ledger Technology In Blockchain

1. Security: All records of every transaction are securely encrypted. Once the transaction
is validated, it is completely secure and no one can update or change it. It is a
permanent process.
2. Decentralization: All network members or nodes have a copy of the ledger for
complete transparency. A decentralized private distributed network improves the
reliability of the system and gives assurance of continuous operations without any
interruption. It gives control of information and data in the hand of the user.
3. Anonymity: The identity of each participant is anonymous and does not possibly reveal
their identity.
4. Immutable: Any validated transactions can not be changed as they are irreversible.
5. Transparency: Distributed technologies offer a high level of transparency. Which is
necessary for the sectors like finance, medical science, banking, etc.
6. Speed: Distributed Ledger Technology can handle large transactions faster than
traditional methods.
7. Smart Contracts: Distributed Ledger Technology supports smart contracts which are
self-executing contracts with the terms of the agreement between buyer and seller being
directly written into lines of code. Smart contracts reduce the need for intermediaries
and offer transparency and automation in the execution of the contract terms.
8. Lower Costs: Distributed Ledger Technology eliminates intermediaries and reduces the
costs associated with intermediaries, which makes the system more cost-effective.
9. Improved Efficiency: Distributed Ledger Technology reduces the time and costs
associated with traditional transaction methods. It offers faster settlement times,
reduced paperwork, and increased efficiency.
10. Auditing: Distributed Ledger Technology makes auditing easier as every transaction is
recorded and the ledger cannot be altered. This improves the transparency and accuracy
of financial audits.
11. Resilience: Distributed Ledger Technology is more resilient than traditional databases
as it is spread across multiple nodes. This means that even if one node goes down, the
network can still function as the rest of the nodes can continue to validate transactions.
12. Traceability: Distributed Ledger Technology offers complete traceability of assets,
from their creation to their current ownership. This improves accountability and reduces
the risks of fraud and theft.

15 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Disadvantages Of Distributed Ledger Technology

1. 51% Attack: The 51% attack is a bit concerning part of this distributed ledger
technology that is to be checked routinely.
2. Costs of Transaction: The connected nodes are expected to validate the transaction of
a given Distributed Ledger Technology which gives high transaction cost as the other
nodes are paid incentives to validate the transaction.
3. Slow Transaction Speed: The major disadvantage of this DLT is the slow speed of
transactions as multiple nodes are attached to this network and it takes time to validate
the transaction by all the other nodes.
4. Scalability Issues: Due to low speed and high transaction costs DLT faces very
difficulties to expand on a large scale.
5. Lack of Regulation: As DLT is a decentralized technology, it operates outside the
control of any centralized authority which can lead to a lack of regulation, making it
difficult to hold accountable any wrongdoings or fraudulent activities on the network.
6. Energy Consumption: Distributed Ledger Technology requires a significant amount of
energy to maintain the network and validate transactions, especially in the case of Proof
of Work consensus mechanisms, which can lead to a negative impact on the
environment.
7. Complexity: Implementing and managing Distributed Ledger Technology can be
complex and requires a high level of technical expertise, which can be a barrier to entry
for many organizations and individuals.
8. Privacy Concerns: While the anonymity of participants on the network is considered
an advantage, it can also be a disadvantage as it can lead to privacy concerns and illicit
activities on the network.
9. Lack of Interoperability: Different Distributed Ledger Technologies may use different
protocols, which can lead to interoperability issues, making it difficult for different
networks to communicate and transact with each other.

Future of Distributed Ledger Technology

1. Experts in this area promote DLT as a solution for many problems that are present on
the internet and will drastically be able to solve all these problems. Distributed Ledger
Technology is termed the “Internet of Value”. Transactions and processes will occur in
real-time with the help of the internet.
2. Distributed Ledger Technology has the potential to impact problems in financial or
banking, cyber security, healthcare, government, data security, etc. sectors with
effective solutions.
3. Enterprises and visionaries are now faced with the challenge of establishing networks of
entities that together can take advantage of DLT to radically change how they share and
keep records, and innovate where DLT can enable entirely new processes and business
models.

16 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Blockchain technology gained public notice with the advent of bitcoin in 2009. Bitcoin is
a cryptocurrency that runs on blockchain technology and is by far, the most popular and
most ranked cryptocurrency. Ethereum was initially released in 2015. Within two years of
its release, it was ranked the second best blockchain network, Bitcoin is the first. The
Ethereum network acquired more global interest when china stated that it is the best
blockchain network ever created.

What is Ethereum?

Ethereum is a Blockchain network that introduced a built-in Turing-complete programming


language that can be used for creating various decentralized applications(also called
Dapps). The Ethereum network is fueled by its own cryptocurrency called ‘ether’.

 The Ethereum network is currently famous for allowing the implementation of smart
contracts. Smart contracts can be thought of as ‘cryptographic bank lockers’ which
contain certain values.
 These cryptographic lockers can only be unlocked when certain conditions are met.
 Unlike bitcoin, Ethereum is a network that can be applied to various other sectors.
 Ethereum is often called Blockchain 2.0 since it proved the potential of blockchain
technology beyond the financial sector.
 The consensus mechanism used in Ethereum is Proof of Stakes(PoS), which is more
energy efficient when compared to that used in the Bitcoin network, that is, Proof of
Work(PoW). PoS depends on the amount of stake a node holds.

History of Ethereum

 2013: Ethereum was first described in Vitalik Buterin’s white paper in 2013 with the
goal of developing decentralized applications.
 2014: In 2014, EVM was specified in a paper by Gavin Wood, and the formal
development of the software also began.
 2015: In 2015, Ethereum created its genesis block marking the official launch of the
platform.
 2018: In 2018, Ethereum took second place in Bitcoin in terms of market capitalization.
 2021: In 2021, a major network upgrade named London included Ethereum
improvement proposal 1559 and introduced a mechanism for reducing transaction fee
volatility.
 2022: In 2022, Ethereum has shifted from PoW( Proof-of-Work ) to PoS( Proof-of-
State ) consensus mechanism, which is also known as Ethereum Merge. It has reduced
Ethereum’s energy consumption by ~ 99.95%.

Features of Ethereum
17 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

1. Smart contracts: Ethereum allows the creation and deployment of smart contracts.
Smart contracts are created mainly using a programming language called solidity.
Solidity is an Object Oriented Programming language that is comparatively easy to
learn.
2. Ethereum Virtual Machine (EVM): It is designed to operate as a runtime
environment for compiling and deploying Ethereum-based smart contracts.
3. Ether: Ether is the cryptocurrency of the Ethereum network. It is the only acceptable
form of payment for transaction fees on the Ethereum network.
4. Decentralized applications (Daaps): Dapp has its backend code running on a
decentralized peer-to-peer network. It can have a frontend and user interface written in
any language to make calls and query data from its backend. They operate on Ethereum
and perform the same function irrespective of the environment in which they get
executed.
5. Decentralized autonomous organizations (DAOs): It is a decentralized organization
that works in a democratic and decentralized fashion. DAO relies on smart contracts for
decision-making or decentralized voting systems within the organization.

Type of Ethereum Accounts

Ethereum has two types of accounts: An externally owned account (EOA), and a Contract
account. These are explained as following below:
 Externally owned account (EOA): Externally owned accounts are controlled by
private keys. Each EOA has a public-private key pair. The users can send messages by
creating and signing transactions.
 Contract Account: Contract accounts are controlled by contract codes. These codes are
stored with the account. Each contract account has an ether balance associated with it.
The contract code of these accounts gets activated every time a transaction from an
EOA or a message from another contract is received by it. When the contract code
activates, it allows to read/write the message to the local storage, send messages and
create contracts.

How Does Ethereum Work?

Ethereum implements an execution environment called Ethereum Virtual Machine (EVM).


 When a transaction triggers a smart contract all the nodes of the network will execute
every instruction.
 All the nodes will run The EVM as part of the block verification, where the nodes will
go through the transactions listed in the block and runs the code as triggered by the
transaction in the EVM.
18 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 All the nodes on the network must perform the same calculations for keeping their
ledgers in sync.
 Every transaction must include:
 Gas limit.
 Transaction Fee that the sender is willing to pay for the transaction.
 If the total amount of gas needed to process the transaction is less than or equal to the
gas limit then the transaction will be processed and if the total amount of the gas needed
is more than the gas limit then the transaction will not be processed the fees are still
lost.
 Thus it is safe to send transactions with the gas limit above the estimate to increase the
chances of getting it processed.

Real-World Applications of Ethereum

 Voting: Voting systems are adopting Ethereum. The results of polls are available
publicly, ensuring a transparent fair system thus eliminating voting malpractices.
 Agreements: With Ethereum smart contracts, agreements and contracts can be
maintained and executed without any alteration. Ethereum can be used for creating
smart contracts and for digitally recording transactions based on them.
 Banking systems: Due to the decentralized nature of the Ethereum blockchain it
becomes challenging for hackers to gain unauthorized access to the network. It also
makes payments on the Ethereum network secure, so banks are using Ethereum as a
channel for making payments.
 Shipping: Ethereum provides a tracking framework that helps with the tracking of
cargo and prevents goods from being misplaced.
 Crowdfunding: Applying Ethereum smart contracts to blockchain-based crowdfunding
platforms helps to increase trust and information symmetry. It creates many possibilities
for startups by raising funds to create their own digital cryptocurrency.
 Domain names: Ethereum name service allows crypto users to buy and manage their
own domain names on Ethereum, thus simplifying decentralized transactions without
putting users to remember long, machine-readable addresses.

Benefits of Ethereum

 Availability: As the Ethereum network is decentralized so there is no downtime. Even


if one node goes down other computing nodes are available.
 Privacy: Users don’t need to enter their personal credentials while using the network
for exchanges, thus allowing them to remain anonymous.
 Security: Ethereum is designed to be unhackable, as the hackers have to get control of
the majority of the network nodes to exploit the network.
 Less ambiguity: The smart contracts that are used as a basis for trade and agreement on
Ethereum ensure stronger contracts that differ from the normal traditional contracts
which require follow-through and interpretation.
19 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Rapid deployment: On Ethereum decentralized networks, enterprises can easily deploy


and manage private blockchain networks instead of coding blockchain implementation
from scratch.
 Network size: Ethereum network can work with hundreds of nodes and millions of
users.
 Data coordination: Ethereum decentralized architecture better allocates information so
that the network participants don’t have to rely on a central entity to manage the system
and mediate transactions.

Drawbacks of Ethereum

 Complicated programming language: Learning solidity from programming smart


contracts on Ethereum can be challenging and one of the main concerns is the scarcity
of beginner-friendly classes.
 Volatile cryptocurrency: Ethereum investing can be risky as the price of Ether is very
volatile, resulting in significant gains as well as a significant loss.
 Low transaction rate: Bitcoin has an average transaction rate of 7TPS and Ethereum
has an average speed of 15 TPS which is almost double that of bitcoin but it is still not
enough.

Decentralized Autonomous Organization:


DAO stands for Decentralized Autonomous Organization. The concept of a DAO was first
proposed by Bit Shares, Steemit, and EOS (Block. one) founder Dan Larimer in the year
2015, and was further refined in the year 2016 by Ethereum’s Vitalik Buterin. A
decentralized autonomous organization is decentralized, autonomous, and an organization-
as the name already suggests. It is a whole organization that is automated. It stores rules
and processes in code. DAOs are often stateless and distributed over millions of computers.
No single government could decide to take it down.
Components of DAO:
1. No central legal entity: In DAO, there is no central legal entity, this means that no
single entity is responsible for regulating the project.
2. Self-enforcing code: Smart contracts are created and extensively tested to make sure
important details are not overlooked.
3. Token acts as an incentive for validators: Tokens are used in DAO for validators to
motivate them and to ensure active, fair, and quick participation.

Need of DAO

Beginning an association with somebody that includes financing and cash requires a great
deal of confidence in the individuals you’re working with. Yet, it’s difficult to believe
somebody you’ve just at any point associated with on the web. With DAOs you do not
20 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

need to trust the other individual within the gathering, simply the DAO’s code, which is
100% straightforward and evident by anybody. This opens up countless new freedoms for
worldwide joint effort and coordination.

Traditional Organization Vs DAO

S
DAO Traditional Organizations
No.

Casting a ballot is needed by Depending on the structure, changes can be


1. individuals for any progressions to be requested from the sole party, or casting a
implemented. ballot might be advertised.

Votes were counted, and results were If casting a ballot is permitted, votes are
2. carried out consequently without a counted inside, and the result of casting a
believed intermediary. ballot should be taken care of physically.

3. Completely democratized. Usually progressive.

Administrations offered are taken care Requires human taking care of, or halfway
4. of consequently in a decentralized controlled mechanization, inclined to
way. control.

Steps For Launching a DAO

There are three major steps for launching a DAO:


1. Smart Contract Creation: In this step, a developer or a group of developers create
a smart contract behind the DAO. It is very important for the developer to extensively
test the smart contracts before launching to make sure that they do not overlook
important details. After launch, only the rules set can be changed through the
governance system.
2. Funding: After smart contracts are created and launched, the DAO needs to determine
a way to receive funding. Sometimes, the tokens are sold to raise funds. These tokens
give holders voting rights.
3. Deployment: Once everything is set up and on track, the DAO needs to be deployed on
the blockchain. From this point onwards, stakeholders decide the future of the
organization. The developers who created the smart contracts, no longer influence the
project.

21 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

DAO Examples

Here are some examples illustrating how DAO can be utilized:


1. DASH: The well-known computerized money Dash is an illustration of a decentralized
independent association in light of the manner in which it is represented and the manner
in which its planning framework is organized.
2. A cause: One can acknowledge enrollment and gifts from anybody on the planet and
the gathering can choose how they to spend gifts.
3. A consultant organization: One can make an organization of workers for hire who
pool their assets for office spaces and programming memberships.
4. Adventures and awards: It is possible to make an endeavor store that pools
speculation capital and decisions on dares to back. Reimbursed cash could later be
rearranged among DAO individuals.

How Do DAOs Work?

So far we are using people to “store” information instead. In order to know how much
hiring a new person would cost? – There is a person answerable in the human resources
department. Similarly, to get movement costs repaid?- There is a separate person
responsible for this in the accounting.
 In a DAO, there is a code for that. Computers will take over much of the decision-
making and operations we see nowadays. The final control, however, is still with
humans, the shareholders. Shareholders have voting rights just like in regular
corporations. They dictate the general direction and accept or decline initiatives.
 The general idea is to bring the benefits of blockchain technology to management.
 The blockchain is immutable, precise, and consistent. It is also transparent and open so
that anyone could review companies. Strong consistency makes DAOs reliable business
partners.

22 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Such an organization is also harder to put under pressure. It will be difficult to ban it
from operating somewhere. As it is controlled by the organization members and not
influenced by a central government authority to put under pressure.

DAO Membership

There are various models for DAO membership. Membership can decide how casting ballot
functions and other key pieces of the DAO.
1. Token-based membership: Normally completely permissionless, contingent upon the
token utilized. For the most part, these administration tokens can be exchanged for
permissionless on a decentralized trade. Others should be procured by giving liquidity or
another ‘evidence of work’. In any case, just holding the symbolic awards admittance to
casting a ballot. Ordinarily used to administer expansive decentralized conventions as well
as tokens themselves.
Example: MakerDAO’s token MKR is generally accessible on decentralized trades. So
anybody can become tied up with having cast a ballot power on the Maker convention’s
future.
2. Share-based membership: Offer-based DAOs are more allowed, yet at the same time
very open. Any imminent individuals can present a proposition to join the DAO, typically
offering recognition of some worth as tokens or work. Offers to address direct democratic
force and possession. Individuals can exit whenever with their proportionate portion of the
depository. Regularly utilized for all the nearer sew, human-driven associations like
foundations, laborer assemblages, and venture clubs. Can administer conventions and
tokens too.
Example: MolochDAO is centered around financing Ethereum projects. They require a
proposition for enrollment so the gathering can evaluate whether you have the important
mastery and funding to make educated decisions about possible grantees. You can’t simply
purchase admittance to the DAO on the open market.

Ethereum and DAOs

Ethereum is the ideal establishment for DAOs for various reasons:


 Ethereum’s own agreement is conveyed and set up enough for associations to trust the
organization.
 The agreement code can’t be changed once live, even by its proprietors. This permits
the DAO to run by the principles it was modified with.
 Agreements can send/get reserves. Without this, there is a need for a believed delegate
to oversee a bunch of reserves.
 The Ethereum people group has demonstrated to be more synergistic than cutthroat,
taking into consideration best practices and emotionally supportive networks to arise
rapidly.

23 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Advantages of DAO

1. Decentralization: DAO emphasizes being driven by a collective rather than an


individual. With DAO, participants have a much stronger say in the organization’s
direction.
2. Community Driven: DAOs make it easy for communities worldwide to connect and
build a prospering vision together. DAO is accessible to Individuals who may have had
the opportunity in the past to connect and work together.
3. Principle-agent dilemma: One of the main advantages of DAO is that it provides a
solution for the principle-agent dilemma. This dilemma is a conflict in priorities
between a person (principle) and the entities making decisions on their behalf (agent).
One of the common examples of this is problems between Stakeholders and CEOs.
DAO solves this problem through community governance. Here, principles don’t have
to trust agents who work on their behalf instead they work as a part of a group whose
incentives are aligned.

Disadvantages of DAO

This section lists some of the disadvantages of DAO:


1. Security: DAO can be launched with just a few lines of code and given the immense
tech stack a well-run DAO requires to operate effectively thus security remains a
vulnerability as it requires significant technical expertise and it is expensive to keep
best security practices implemented.
2. Slow Decision Making: With DAO scaling there comes an issue of getting everyone to
vote on proposals in a timely manner and with different time zones and investor
priorities, keeping DAO participants up to date can be challenging.
3. The Bikeshedding Effect: Parkinson’s Law of Triviality states that the amount of time
spent discussing an issue in an organization is inversely related to its importance in the
scheme of things. This is also known as bike-shedding. It can have a negative impact on
personal productivity as it causes inefficient management of time.
4. No legitimate structure for circulating DAOs: DAOs can be circulated across
different locales, and there’s no legitimate structure for them. Any lawful issues that
might emerge will probably require those required to manage various territorial laws in
a convoluted fight in court. In July 2017, for instance, the United States Securities and
Exchange Commission gave a report not really settled that the DAO sold protections as
tokens on the Ethereum blockchain without approval, disregarding bits of protection
law in the country.

Future of DAO

The DAO as initially imagined had not returned as of mid-2020. Regardless, interest in
decentralized independent associations as a more extensive gathering keeps on developing.
24 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

While there are many waiting concerns and potential issues with respect to lawfulness,
security, and construction, a few investigators and financial backers accept that this kind of
association will ultimately come to conspicuousness, maybe in any event, supplanting
customarily organized organizations.

Criticism of DAO

There are likewise a couple of drawbacks to DAO:


1. One significant issue of being open-source is that securing business insider facts will
end up being more troublesome.
2. Additionally, potential hackers can more easily detect weak spots in the system as they
can openly access the source code. In rare cases, they could even slip their pieces of
code into the software without being detected by the community. That way they could
create their own loopholes.

DAOs are an exciting idea, and they come with their pros and cons. The well-known DAO
is called … “the DAO”. It was a form of investor-directed venture capital fund founded in
2016 that got famous for its failure. In its ICO the DAO collected a staggering $ 150
million. More than 18.000 investors participated. Shortly after that, the account of the DAO
was hacked. Unknown attackers stole $ 50 million worth of Ethereum. As a result,
Ethereum had to execute a hard fork to restore the funds. That is why we now have
Ethereum and Ethereum Classic. Ethereum is the version where the hack was erased.
Investor support subsided after the incident. The event has been a famous example of how
fragile DAOs can be to certain attacks.

Smart contracts:

Smart contracts are blocks of code that reside on the blockchain. It is like an Ethereum
account but there is a critical difference between an external account and a smart contract.
Unlike a smart contract, an external account can connect to multiple Ethereum networks
(Goerli testnet, mainnet, etc.) whereas a smart contract is only specific to one individual
network (the network it is deployed on). When a smart contract is deployed, it creates an
instance (contract account) on the network. One can create multiple instances of a smart
contract on the network or multiple networks. Deployment of a smart contract is done by
sending a transaction to the network with bytecode.

25 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Deploying To A Local Network

An emulator can be used to deploy a smart contract on a local network eg. Ganache-cli. It
takes care of everything and the user doesn’t have to worry about the security and the gas
amount required for transactions since everything is happening on a local test network. All
one has to do is pass the ganache provider as an argument to the web3 instance(web3
facilitates the connection between the blockchain network and the js application).

Deploying To Actual Ethereum Network

Before deploying a smart contract to an actual Ethereum network make sure the account
has some ether in it. Deploying a contract is like sending a transaction and it needs some
gas amount to process. Unlike deploying on a local network, transactions will take some
time to complete (anywhere between 15 seconds to 5 minutes). Web3 is used to interact
with the network the same way it is done in local deployment except customize the provider
that will be passed into the web3 instance. Instead of creating our own node that connects
to the Ethereum network, one can use a developer platform with RPC endpoints
like Infura or Alchemy. With one of these accounts, you have an API key that gives access
to their Infura / Alchemy blockchain nodes that are already hosted on the Ethereum
network. Simply sign-up for Infura and get an endpoint that will be used in the code to
deploy the smart contract. The below tutorial shows a smart contract being deployed with
Infura. For a smart contract tutorial using tools like Alchemy (ethers.js, Hardhat, Solidity,
and Metamask), refer to this basic tutorial – “Hello World Smart Contract“.

example.sol- Below is the sample solidity code used for testing. All it does is set a public
variable as the address of the sender.

26 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

// Solidity program to implement


// the above approach
pragma solidity ^0.8.4;

// Creating a contract named Example


contract Example
{
// Public variable of type address
address public manager;

// Constructor function to set manager


// as address of sender
constructor()
{
manager = msg.sender;
}
}

Step 1- Install the required dependencies by running the following commands-


npm i [email protected] [email protected] [email protected]
Make sure to install the same versions for the following scripts to run successfully.
Step 2- Sign up for Infura and create a project on a particular Ethereum network to get
access to the endpoint. The endpoint will be required to deploy the smart contract on the
infura node that is already hosted on the Ethereum network. To create a project on infura-
 Click on create a new project.
 Give it a name.
 Select the network to deploy the smart contract on.
 A maximum of 3 projects can be created on infura for free.

Step 3 – Get access to Bytecode and ABI (Compile the smart contract). Solidity compiler
gives a huge piece of code as output, one can print the output to console if required. Only
the relevant part (relevant for deployment) i.e., bytecode and interface are extracted from
the output in the following script.
27 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Compile.js- Below is the javascript file.

Step 4 – Add the Metamask extension to google chrome from the Chrome web store.

Step 5 – Once have access to the bytecode and interface, all that is required is to
create a provider with own mnemonic phrase and infura endpoint using the
truffle-hdwallet-provider that was installed earlier. Create a web3 instance and
pass the provider as an argument. Finally, use the deploy method with bytecode
as an argument to deploy the smart contract.

const HDWalletProvider = require("truffle-hdwallet-provider");

// Web3 constructor function.

const Web3 = require("web3");

// Get bytecode and ABI after compiling

// solidity code.

const { interface, bytecode } = require("file-path");

const provider = new HDWalletProvider(

"mnemonic phrase",

// Remember to change this to your own phrase!

"-"

// Remember to change this to your own endpoint!

);

// Create an instance of Web3 and pass the

// provider as an argument.

28 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

const web3 = new Web3(provider);

const deploy = async () => {

// Get access to all accounts linked to mnemonic

// Make sure you have metamask installed.

const accounts = await web3.eth.getAccounts();

console.log("Attempting to deploy from account", accounts[0]);

// Pass initial gas and account to use in the send function

const result = await new web3.eth.Contract(interface)

.deploy({ data: bytecode })

.send({ gas: "1000000", from: accounts[0]});

console.log("Contract deployed to", result.options.address);

};

deploy();

// The purpose of creating a function and

// calling it at the end -

// so that we can use async await instead

// of using promises

Output:
29 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Contract is deployed to 0x8716443863c87ee791C1ee15289e61503Ad4443c


Now the contract is deployed on the network, its functionality can be tested using remix
IDE or one can create an interface to interact with the smart contract on the network.

GHOST:

Blockchain technology is the talk of the town and many people are starting to explore it
because of its numerous benefits. One such benefit, or pro as it’s called in blockchain, is
GHOST Protocol.

What is GHOST Protocol?

The Ghost Protocol is a development in the cryptographic protocol behind Bitcoin that
allows for transactions to be processed without broadcasting them. It is an end-to-end
encryption protocol that provides authentication without having to rely on centralized trust
authorities. It can be either symmetric or asymmetric, depending on how it’s used. The
principle of GHOST is that the sender only sends a ghost (or dummy) packet to the
receiver, which can then reply with as many packets as it needs.
 The sender creates a digital signature by encrypting the packet with the receiver’s
public key.
 The receiver decrypts it using his private key (the public key is used to encrypt).
 If the decryption was done correctly, the sender is assumed to be who he claims to be,
and the transaction is accepted.
 He may also send this ghost packet to other receivers (i.e., the transaction is
broadcasted) using the same procedure.
 Since there may be more than one receiver, this protocol is called “GHOST”, which
stands for ” Greedy Heaviest Observed Sub-Tree”, as a reference to how it routes
packets through other nodes in addition to its direct route between sender and receiver.

Need For GHOST Protocol

The transactions in blockchain can be published from anywhere. In PoW blockchains like
Bitcoin, Ethereum, etc due to the random nature of hashing two miners can be working on
the same transaction producing two blocks.
30 Prof. Dhanashree R.Kolpe
GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Only one of these transactions can be added to the main blockchain.


 This means that all the work done by the second miner on verifying the second block is
lost (orphaned).
 The miner does not get rewarded. These blocks are called uncle blocks in Ethereum.
GHOST protocol is a chain selection rule that makes use of previously orphaned blocks and
adds them to the main blockchain and partially rewards the miner also. This increases the
difficulty of an attack on the network as now winning miner is not the only one who owns
the computing power. More nodes retain the power and discourage the need for centralized
mining pools on larger chains.

Implementation of GHOST Protocol

Bitcore, a bitcoin development team implemented the GHOST Protocol. This is also the
first public implementation of the GHOST protocol.

GHOST Protocol and Bitcoin:


The two are complementary, not mutually exclusive.
 They can be used together in various ways to maximize their effectiveness.
 For example, a GHOST channel can be used to exchange coins or other digital assets
that do not benefit from the benefits of Bitcoin’s block verification times and consensus
process (e.g., coins that require trustless processing such as stablecoins).

How Does the GHOST Protocol Work?


 GHOST works by sending dummy/empty packets or ‘ghosts’ to the receiver.
 A sender sends a ghost packet with a header and encrypted payload, but no block
reward (i.e., no transactions), and waits for an empty packet from the receiver.
 If an empty packet is received, then it means that the receiver received the ghost, so he
can send up to 2*pendingtxns to the network without broadcasting them.
 When more than one node has a pending transaction in the queue, then there must be
some sort of protocol in place for deciding which node will broadcast its block (i.e.,
which node will win).

Pros of GHOST Protocol:

 Scalability: GHOST protocol was designed and built with scalability and security in
mind so that it can easily handle thousands.

31 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

 Easy transactions: In a world where cryptocurrency transactions can be completed


within seconds from anywhere in the world, GHOST Protocol allows individuals to
make transactions with ease through efficient use of computing power.
 Freedom to developers: If a developer doesn’t want to take on the responsibility of
maintaining their own infrastructure, they can utilize GHOST-powered smart contracts
which run on top of it instead.
 Saves time and effort: It saves them time and effort. Smart contracts are much quicker
and easier than writing applications from scratch. It allows for more people to get
involved in the dApp space. This is a great thing for new developers and entrepreneurs
to get involved in.
 Better transparency: It provides better transparency than Ethereum’s ERC20 standard
(which platforms like MyEtherWallet and MetaMask still use). It allows developers to
accept payments while being completely anonymous. A non-anonymous or
pseudonymous payment system is much preferred by hackers and online phishers,
preventing them from either targeting you or stealing your funds.

Cons of GHOST Protocol

 Hampers adoption growth: It hampers adoption growth.


 When not in use over-complicated: If no one wants to use the GHOST protocol, it
will remain an over-complicated means of paying users in their tokens or Ether.
 Not viable option: It’s not a viable option for certain platforms. Blockchain-based
games are the first thing that comes to mind.
 Makes dApps expensive: It makes dApps more expensive.
 Gas costs for all transactions: dApps utilizing this protocol need to pay the gas costs
of all transactions, even those that don’t involve them.
Side chain:

Sidechains are independent blockchains that are compatible with Ethereum to help
with scaling. They do this by offering a faster and cheaper blockchain for
transactions. When users finish their transactions, they can easily move their tokens
back to the main Ethereum network.

What Is Namecoin (NMC)?


Namecoin is "a peer-to-peer naming system based on Bitcoin."1 It's a token for a blockchain
initially forked from Bitcoin's blockchain. A fork is a change in a blockchain that makes the
new branch noncompatible to the original branch. Namecoin was developed as a blockchain
and token for a decentralized domain name system (DNS).

32 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

DNS translates human-readable domain names (for example, www.investopedia.com) to


machine-readable IP addresses (for example, 000.0.0.00). DNS is the mechanism by which
domain identities are linked with numerical IP addresses worldwide. The decentralization of
this system was intended to end internet censorship and enhance Internet-related security
and privacy.

The makers of Namecoin describe it as "an experimental open-source technology which


improves decentralization, security, censorship resistance, privacy, and speed of certain
components of the internet infrastructure such as DNS and identities.

 Namecoin is a blockchain with a token forked initially from Bitcoin software, used to
represent ownership of a domain name.
 It was developed to decentralize the internet infrastructure, reduce censorship, and
increase privacy and security.
 Namecoin attempts to replace existing domain name server technology with
blockchain technology.

Understanding Namecoin (NMC)


Namecoin uses the concept of data name/value pairs attached to a coin. A name/value pair is
a data value and a name used to identify the value in a database.3 In this case, the
name/value pair is a computer-readable numeric address with a human-readable name. A
token for the name/value pair is created, and the token holder owns the name/value pair.
Thus, a Namecoin is used to establish ownership of a domain name.

Namecoin History

The idea for developing a tokenized domain name system was first introduced in 2010 in an
Internet Relay Chat (IRC) room, #bitcoin-dev, where users discussed the merits of a bitcoin-
like DNS system that came to be known as bitdns. Namecoin was introduced in April 2011,
by Vincent Durham (an anonymous name) on the same Bitcoin Forum used to announce
Bitcoin

Namecoin features several Bitcoin similarities, currently the top digital currency by market
capitalization. Namecoin's fork was initiated to create a new way to establish ownership of
the human-readable addresses assigned to the machine-readable addresses used on the
web—domain names.

The main difference between Bitcoin and Namecoin is the purpose of the technology.
Bitcoin creators wanted a viable alternative currency; Namecoin creators wanted a domain
naming system. Because of this, there are different consensus and protocol rules that exist
within each project. Certain features are necessary when conducting financial transactions
that are not necessary when completing name registrations for new internet domains.

33 Prof. Dhanashree R.Kolpe


GENBA SOPANRAO MOZE COLLEGE OF ENGINEERING, Balewadi-Baner, Pune- 411 045

MCA-FY (SEM-II)

Unit IV Cryptocurrency

Because Namecoin utilizes the same proof-of-work (PoW) algorithm as Bitcoin, you can
merge-mine Namecoins without additional hardware (and without any extra electricity) if
you are already mining Bitcoin. Both Bitcoin and Namecoin are limited to a total of 21
million coins. The critical difference in Namecoin is that tokens are used up as domain
names are registered. The cost of one domain name to Namecoin's usable supply is .01
NMC. This means there are 2.1 billion domain names (or other uses) available using
Namecoin.

Goals of Namecoin
Namecoin's developers indicated several potential uses and applications for this
experimental token. First and foremost, the developers hope to protect free speech rights
online by making the web more resistant to censorship.

There are myriad ways that Namecoin attempts to do this. For example, it can be used to
attach identifying information—such as email addresses, cryptocurrency public addresses, or
specific keys—to various identities as determined by the user. It can also be used as a means
of providing decentralized website certificate validation.

Namecoin can be used in Tor and other anonymizing web platforms to generate human-
meaningful Tor .onion domains. In the future, the token and its underlying technology could
also be used for file signatures, securing voting procedures, notary services, and establishing
proof of existence for individuals and entities.

Because of their links with the Namecoin network, these names are difficult to censor or
seize, meaning they are resistant to outside influence. Additionally, the makers of Namecoin
specify that lookups do not generate network traffic. The result of this is that Namecoin
offers improved privacy capabilities as well.

__________________________________________________________________________

34 Prof. Dhanashree R.Kolpe

You might also like