Unit-2 Cryptocurrency

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

1

Blockchain
UNIT - 2
2
What is cryptocurrency?

► A cryptocurrency is a digital currency, which is an alternative form of payment created using


encryption algorithms.
► The use of encryption technologies means that cryptocurrencies function both as a currency
and as a virtual accounting system.
► To use cryptocurrencies, you need a cryptocurrency wallet. These wallets can be software that is
a cloud-based service or is stored on your computer or on your mobile device.
► The wallets are the tool through which you store your encryption keys that confirm your identity
and link to your cryptocurrency.
3
What is cryptocurrency?

► A cryptocurrency is a form of digital asset based on a network that is distributed across a large
number of computers. This decentralized structure allows them to exist outside the control of
governments and central authorities.
► The advantages of cryptocurrencies include cheaper and faster money transfers and
decentralized systems that do not collapse at a single point of failure.
► The disadvantages of cryptocurrencies include their price volatility, high energy consumption for
mining activities, and use in criminal activities.
4
Bitcoin

► Bitcoin is a cryptocurrency, a virtual currency designed to act as money and a form of payment
outside the control of any one person, group, or entity, and thus removing the need for third-party
involvement in financial transactions.
► It is rewarded to blockchain miners for the work done to verify transactions and can be purchased on
several exchanges.
► Bitcoin was introduced to the public in 2009 by an anonymous developer or group of developers using
the name Satoshi Nakamoto.
► Cryptocurrencies are part of a blockchain and the network required to power it. A blockchain is a
distributed ledger, a shared database that stores data. Data within the blockchain are secured by
encryption methods.
► When a transaction takes place on the blockchain, information from the previous block is copied to a
new block with the new data, encrypted, and the transaction is verified by validators—called miners—
in the network. When a transaction is verified, a new block is opened, and a Bitcoin is created and
given as a reward to the miner(s) who verified the data within the block—they are then free to use it,
hold it, or sell it.
5
Bitcoin

► Bitcoin uses the SHA-256 hashing algorithm to encrypt the data stored in the blocks on the
blockchain. Simply put, transaction data stored in a block is encrypted into a 256-bit
hexadecimal number. That number contains all of the transaction data and information linked to
the blocks before that block.
► Miners in the Bitcoin blockchain network all attempt to verify the same transaction
simultaneously. The mining software and hardware work to solve the nonce, a four-byte number
included in the block header that miners are attempting to solve. The block header is hashed, or
randomly regenerated by a miner repeatedly until it meets a target number specified by the
blockchain. The block header is "solved," and a new block is created for more transactions to be
encrypted and verified.
6
How to Mine Bitcoin

► A variety of hardware and software can be used to mine Bitcoin. When Bitcoin was first released,
it was possible to mine it competitively on a personal computer. However, as it became more
popular, more miners joined the network, which lowered the chances of being the one to solve
the hash.
► This is because you're competing with a network of miners that generate around 220 quintillion
hashes (220 exa hashes) per second.6 Machines, called Application Specific Integrated Circuits
(ASICs), have been built specifically for mining—can generate around 255 trillion hashes per
second.
7
How Do You Buy Bitcoin?

► If you don't want to mine bitcoin, it can be bought using a cryptocurrency exchange. Most
people will not be able to purchase an entire BTC because of its price, but you can buy portions
of BTC on these exchanges in fiat currency like U.S. dollars. For example, you can buy bitcoin on
Coinbase by creating an account and funding it. You can fund your account using your bank
account, credit card, or debit card.
8
Altcoin

► Altcoins are generally defined as all cryptocurrencies other than Bitcoin (BTC). However, some
people consider altcoins to be all crytocurrencies other than Bitcoin and Ethereum (ETH)
because most cryptocurrencies are forked from one of the two. Some altcoins use different
consensus mechanisms to validate transactions and open new blocks, or attempt to distinguish
themselves from Bitcoin and Ethereum by providing new or additional capabilities or purposes.
► Most altcoins are designed and released by developers who have a different vision or use for
their tokens or cryptocurrency.
► Altcoins belong to the blockchains they were explicitly designed for. Many are forks—a splitting
of a blockchain that is not compatible with the original chain—from Bitcoin and Ethereum. These
forks generally have more than one reason for occurring. Most of the time, a group of
developers disagree with others and leave to make their own coin.
9
Altcoin

► Many altcoins are used within their respective blockchains to accomplish something, such as
ether, which is used in Ethereum to pay transaction fees. Some developers have created forks of
Bitcoin and re-emerged as an attempt to compete with Bitcoin as a payment method, such
as Bitcoin Cash.
► The first altcoin was Litecoin, forked from the Bitcoin blockchain in 2011. Litecoin uses a different
proof-of-work (PoW) consensus mechanism than Bitcoin, called Scrypt, which is less energy-
intensive and quicker than Bitcoin's SHA-256 PoW consensus mechanism.

1st altcoin was Litecoin --> 2011 --> Diff POW called Scrypt
10
Tokens

► A crypto token is a virtual currency token or a denomination of a cryptocurrency. It represents a


tradable asset or utility that resides on its own blockchain and allows the holder to use it for
investment or economic purposes.
► Crypto tokens can represent an investor's stake in the company or they can serve an economic
purpose, just like legal tender. This means token holders can use them to make purchases or they
can trade tokens just like other securities to make a profit.
Crypto tokens are a digital representation of an asset or interest in something and are built on a blockchain ,DONT HAVE OWN
BLOCKCHAIN.
► Security Tokens:
► Security tokens are tokenized assets offered on stock markets. Tokenization is the transfer of value
from an asset to a token, which is then made available to investors. Any asset can be tokenized,
such as real estate or stocks. For this to work, the asset must be secured and held. Otherwise, the
tokens are worthless because they wouldn't represent anything. Security tokens are regulated by
the Securities and Exchange Commission because they are designed to act as securities.
11
Tokens

► Utility Tokens
► Utility tokens are used to provide services within a network. For example, they might be used to
purchase services, pay network fees, or redeem rewards. Filecoin, which is used to buy storage
space on a network and secure the information, is an example of a utility token.
► Ether (ETH) is also a utility token. It is designed to be used in the Ethereum blockchain and virtual
machine to pay for transactions.
Security Token
Objective of security tokens is to be the crypto equivalent of conventional financial securities like stocks, bonds, etc.
These tokens are often issued through security token offerings (STOs),
Tokenization is transfer of value from ASSET to TOKEN.
Any Asset can be Tokenized and asset are secured and Held
security tokens are subject to securities laws and regulations.
Utility Token
Provide Services within a n/w
Used to purchase services, pay n/w fees or redeem rewards
Eg. Flipcoin is used to buy storage and space on n/w and secure info
Ether is Utlity Token
12
Cryptocurrency Wallets

► A cryptocurrency wallet is a software that enables to send and receive cryptocurrencies such as
Bitcoin, Ethereum etc. It stores the record of transactions and also public and private keys which
are used to perform transactions.
A public key is similar to an account number. If A wants to send some money to B using BitCoin,
then A send the public key address to B. Anyone can send BitCoin using the public key. A private
key is similar to an account password. Only account holder know the private key. The private key
is used to send money. Public-Private keys are always present in pairs.
► Now, what is the difference between a traditional wallet and a cryptocurrency wallet? A
traditional wallet stores the currency. While a cryptocurrency wallet never stores any
cryptocurrencies. It contains the record of transactions performed by the users. It also stores the
public and private keys of the user.

Crypto Wallet - DONT HAVE CRYPTOCURRENCY but Have records of transaction perform by user AND
PUBLIC and PRIVATE keys
13
Cryptocurrency Wallets

► Methods of storing cryptocurrencies:


► Hot Storage: Hot storage refers to the type of storage which is connected to the Internet. Hot
storage, being connected to the Internet, allows the user easy and quick access to funds. It is
helpful in daily transactions. But, it also has some disadvantages. It is more vulnerable to hacking
and cybercrime. If the private key is lost then no longer to access coins. Also, if the private key is
stolen by someone then it causes to lose coins.
► The different types of hot storage wallets are: Online(Cloud), Desktop and Mobile wallets.
► Online(Cloud) Wallets: These types of wallets are the most convenient but at the same time,
least secure. It is used to store the private keys and transaction record online (on another server).
This makes keys vulnerable to hacking as they are being stored by a third party. Online wallets
should be used to store less amount of money which is going to be used for short-term storage
i.e. daily transactions in exchange services. Examples: Exchanges like Bittrex or QuadrigaCX, and
Online wallets like Coins.ph and GreenAddress.
14
Cryptocurrency Wallets

► Desktop Wallets: Desktop wallets provide a better level of security than online wallets as they are
downloaded and installed on a single computer. The funds related to an account can only be
accessed through that device which makes it a bit secure at the cost of convenience. However,
it also vulnerable to hacking if the computer gets compromised. Examples: Exodus, Multibit,
Armory, and Bitcoin Core.
► Mobile Wallets: Mobile wallets are similar to desktop wallets in terms of providing better security
than online wallets at the cost of convenience. However, it is the bit easier to use than desktop
wallets as they are used by installing an app on a mobile phone which is smaller and simpler
than desktop wallets. But, if the phone will damage then it will not be able to access funds, as in
desktop wallets. Examples: Jaxx, BreadWallet, Mycelium and CoPay.

Hot Wallet --> connected to internet, SHORT TERM STORAGE --> AS Prone to ATTACK
a. Online Wallet - Store private key and transaction on other server--> less secure
b. Desktop Wallet - funds related to account can only be accessed through that device--> if device damage fund lost
c. Mobile Wallet - Mobile App--> more secure than Online wallet --> but if mobile damage --> no access to funds
15
Cryptocurrency Wallets

► Cold Storage: Cold storage refers to the type of storage which is not connected to the Internet. It
is also known as offline storage. Cold storage provides a higher level of security than hot storage.
It is useful for long-term storage, unlike hot wallets. However, the higher level of security is
provided at the cost of convenience. It is not ideal for daily transactions. Although it is secure, it is
vulnerable to external damage and loss.
► The different types of cold storage wallets are Hardware wallets and Paper wallets.
► Hardware Wallets: Hardware wallets are used to store coins/funds on a hardware device. The
private keys are stored in an offline device, unlike hot wallets, but transactions do require the
Internet connection to execute. It provides the higher level of security than the hot wallets as
they are stored offline in a physical device. However, the problem with these wallets is to trust
the company from which buy the devices. It can log private keys and compromise account.
Also, one should take extra care of not using second-hand hardware wallets. Examples: Ledger,
Trezor and KeepKey.
16
Cryptocurrency Wallets

► Paper Wallets: Paper wallets provide the highest level of security than all the other types of
wallets. The private keys are stored on paper and then kept in a secure location which is known
only by the people that are trusted. Paper wallets are well protected against any type of
hacking and malware. However, things to consider when using paper wallets are that paper can
be worn out with time. If they are printed, the printer ink can leak in case of contact with water
or increased temperature. Examples: BitAddress.org and Bitcoin Armory allows you to print your
paper wallet.

Cold Wallet --> Not connected to internet --> High Security


a. H/W Wallet - Private key store on offline device --> should trust company from which they buy --> Company can log and hack it.
b. Paper wallet - Private key on Paper and kept hidden--> but paper might get damage --> ink may get vanished in contact with water
17
Transactions in Blockchain
18
Transactions in Blockchain

► Authentication
► The original blockchain was designed to operate without a central authority (i.e. with no bank or
regulator controlling who transacts), but transactions still have to be authenticated.
► This is done using cryptographic keys, a string of data (like a password) that identifies a user and gives
access to their “account” or “wallet” of value on the system.
► Each user has their own private key and a public key that everyone can see. Using them both creates
a secure digital identity to authenticate the user via digital signatures and to ‘unlock’ the transaction
they want to perform.

► Authorisation
► Once the transaction is agreed between the users, it needs to be approved, or authorised, before it is
added to a block in the chain.
► For a public blockchain, the decision to add a transaction to the chain is made by consensus. This
means that the majority of “nodes” (or computers in the network) must agree that the transaction is
valid. The people who own the computers in the network are incentivised to verify transactions
through rewards. This process is known as ‘proof of work’.
19
Transactions in Blockchain

► Proof of Work
► Proof of Work requires the people who own the computers in the network to solve a complex
mathematical problem to be able to add a block to the chain. Solving the problem is known as
mining, and ‘miners’ are usually rewarded for their work in cryptocurrency.

► Proof of Stake
► Later blockchain networks have adopted “Proof of Stake” validation consensus protocols,
where participants must have a stake in the blockchain - usually by owning some of the
cryptocurrency - to be in with a chance of selecting, verifying & validating transactions. This
saves substantial computing power resources because no mining is required.
► In addition, blockchain technologies have evolved to include “Smart Contracts” which
automatically execute transactions when certain conditions have been met.
20
Transactions in Blockchain

► Peeling down a single transaction reveals several different structures in a transaction that have
different semantic meanings
► Transaction version number: It is a version number specifying the type of transaction to the network.
Through the transaction number, a node can determine the set of rules to be used to verify this
particular transaction.
► Output: Transaction output consists of a cryptographic lock and time.
► Input: Transaction input consists of a pointer and an unlocking key. The pointer points to the previous
transaction output. The unlocking key is used to unlock the previous output the input points to. Every
time output is unlocked by an input, it is marked in the blockchain database as spent.
► Lock Time: It specifies whether a transaction can be included in the blockchain right away or after
some specified time.
► UTXO is all those outputs that are yet to be unlocked by an input.
► Once an output is unlocked, they are removed from the circulating supply. The new outputs take their
place.
21
UTXO

► What is a UTXO?
► In bitcoin, the transaction lives until it has been executed till the time another transaction is done
out of that UTXO. UTXO stands for Unspent Transaction Output.
► It is the amount of digital currency someone has left remaining after executing a transaction.
► When a transaction is completed, the unspent output is deposited back into the database as
input which can be used later for another transaction.

► How is a UTXO created?


► UTXOs are created through the consumption of existing UTXOs. Every Bitcoin transaction is
composed of inputs and outputs. Inputs consume an existing UTXO, while outputs create a new
UTXO.
22
UTXO

► UTXO Model
► The UTXO model does not incorporate wallets at the protocol level. It is based on individual
transactions that are grouped in blocks. The UTXO model is a design common to many
cryptocurrencies, most notably Bitcoin.
► Cryptocurrencies that use the UTXO model do not use accounts or balances. Instead, UTXOs are
transferred between users much like physical cash.
► Each transaction in the UTXO model can transition the system to a new state, but transitioning to
a new state with each transaction is infeasible.
► The network participants must stay in sync with the current state.
23
UTXO

► Transaction is stored inside a block, also it is one of four factors that changes the hash of a block.
This means if a miner chooses a different transaction keeping the other 4 factors the same, the
hash will be different.
► The factors that determine the hash of a block
► Timestamp
► Block Number: It is the serial number of the current block in the chain.
► Data: The transactions stored on the block.
► Nonce
► If any one of these four factors changes even by 1 bit, the hash changes completely, this is due
to the avalanche effect.
Alice Bob
Alice --> Bob - NO BTC ---> 1 BTC (NEW) 15 BTC
10 BTC 4 BTC
6 BTC Alice want to send 15 BTC to Bob
4 BTC 10 + 6 BTC --> 16 BTC --> 15 BTC + 1 BTC Unspent
24
UTXO

► UTXO Set
► The total UTXOs present in a blockchain represents a set and is being constantly maintained by every
bitcoin node.
► Each transaction consumes elements from this set and creates new ones that get added to the set.
► Thus, the set represents all of the coins in a particular cryptocurrency system.
► UTXO set is updated every time a new block is accepted in the blockchain.
► Every Bitcoin node in the network will have the exact copy of the UTXO set in their local storage.
► The complete UTXO set can be summed to calculate the total supply of a cryptocurrency at a given
point in time.
► In the case of a valid blockchain transaction, only unspent outputs can be used to fund further
transactions.
► The condition that only unspent outputs may be used in further transactions is necessary to prevent
double-spending and fraud.
25
Double spending problem

► In a physical currency, the double-spending problem can never arise. But in digital cash-like
bitcoin, the double-spending problem can arise. Hence, bitcoin transactions have a possibility of
being copied and rebroadcasted. It opens up the possibility that the same BTC could be spent
twice by its owner.
► Double-spending is the risk that a cryptocurrency can be used twice or more. Transaction
information within a blockchain can be altered if specific conditions are met. The conditions
allow modified blocks to enter the blockchain; if this happens, the person that initiated the
alteration can reclaim spent coins.
26
Double spending problem

► How Bitcoin handles the Double Spending Problem?


► Bitcoin handles the double-spending problem by implementing a confirmation mechanism and
maintaining a universal ledger called blockchain.
► Let us suppose you have 1 BTC and try to spend it twice. You made the 1 BTC transaction to
Alice. Again, you sign and send the same 1 BTC transaction to Bob. Both transactions go into the
pool of unconfirmed transactions where many unconfirmed transactions are stored already. The
unconfirmed transactions are transactions which do not pick by anyone. Now, whichever
transaction first got confirmations and was verified by miners, will be valid. Another transaction
which could not get enough confirmations will be pulled out from the network.

If A send 1 BTC to B. And A again try to send that 1 BTC to B. then both trans go to unconform trans pool. and which
ever verifies by miners will be valid. and Another PULLED OUT out n/w
27
Double spending problem
28
Double spending problem

► What happened if both the transactions are taken simultaneously by the miners?
► Suppose two different miners will pick both transactions at the same time and start creating a
block. Now, when the block is confirmed, both Alice and Bob will wait for confirmation on their
transaction. Whichever transaction first got confirmations will be validated first, and another
transaction will be pulled out from the network.
► Now suppose if both Alice and Bob received the first confirmation at the same time, then there
is a race will be started between Alice and Bob. So, whichever transaction gets the maximum
number of confirmations from the network will be included in the blockchain, and the other one
will be discarded.
IF BOTH TRANSACTION TAKEN AT A TIME
if two diff trans are being verified by miners then One with MORE NUMBER of CONFIRMATION get VALID
29
Consensus Mechanisms

► Consensus for blockchain is a procedure in which the peers of a Blockchain network reach
agreement about the present state of the data in the network. Through this, consensus
algorithms establish reliability and trust in the Blockchain network.
► A consensus mechanism is a fault-tolerant mechanism that is used in computer and blockchain
systems to achieve the necessary agreement on a single data value or a single state of the
network among distributed processes or multi-agent systems, such as with cryptocurrencies. It is
useful in record-keeping, among other things.
► On the Bitcoin blockchain, for instance, the consensus mechanism is known as Proof-of-Work
(PoW), which requires high computational power in order to solve a difficult but arbitrary puzzle
in order to keep all nodes in the network honest.
30
Proof of Work (PoW)

► Bitcoin’s Proof-of-Work system:


► Proof of Work(PoW) is the original consensus algorithm in a blockchain network. The algorithm is
used to confirm the transaction and creates a new block to the chain. In this
algorithm, minors (a group of people) compete against each other to complete the transaction
on the network. The process of competing against each other is called mining. As soon as miners
successfully created a valid block, he gets rewarded. The most famous application of Proof of
Work(PoW) is Bitcoin.
► Producing proof of work can be a random process with low probability. In this, a lot of trial and
error is required before a valid proof of work is generated. The main working principle of proof of
work is a mathematical puzzle which can easily prove the solution. Proof of work can be
implemented in a blockchain by the Hashcash proof of work system.
31
Proof of Work (PoW)

► In the below image, you can see that this block is composed of a block number, data field,
cryptographic hash associated with it and a nonce. The nonce is responsible for making the
block valid.
32
Proof of Work (PoW)

► In the puzzle game, bitcoin software creates a challenge, and there is a game begins. This
game involves all miners competing against each other to solve the challenges, and this
challenge will take approximately 10 minutes to be completed.
► Every single miner starts trying to find the solution to that one Nonce that will satisfy the hash for
the block. At some specific point, one of those miners in the global community with higher
speed and great hardware specs will solve the cryptography challenge and be the winner of
the game.
► Now, the rest of the community will start verifying that block which is mined by the winner. If the
nonce is correct, it will end up with the new block that will be added to the blockchain. The
concept of generating a block provides a clear explanation of proof of work(PoW).
33
Proof of Work (PoW)

► Common cryptographic protocols used in Proof of Work systems:


The most widely used proof-of-work consensus is based on SHA-256 and was introduced as a
part of Bitcoin.
► Features of Proof of Work system:
There are mainly two features that have contributed to the wide popularity of this consensus
protocol and they are:
► It is hard to find a solution for the mathematical problem
► It is easy to verify the correctness of that solution BY OTHER MINERS
34
Proof of Work (PoW)
ISSUES
51% Risk - if anyone own 51% in n/w--> can corrupt the BC
► Main issues with the Proof-of-Work consensus: Time Consuming --> to find right NONCE
HIGH POWER --> for verify transactions
The Proof-of-Work consensus mechanism has some issues which are as follows:
► The 51% risk: If a controlling entity owns 51% or more than 51% of nodes in the network, the
entity can corrupt the blockchain by gaining the majority of the network.
► Time consuming: Miners have to check over many nonce values to find the right solution to the
puzzle that must be solved to mine the block, which is a time consuming process.
► Resource consumption: Miners consume high amounts of computing power in order to find the
solution to the hard mathematical puzzle. It leads to a waste of precious resources(money,
energy, space, hardware). It is expected that the 0.3% of the world’s electricity will be spent to
verify transactions by the end of 2018.
► Transaction confirmation takes about 10–60 minutes. So, it is not an instantaneous transaction;
because it takes some time to mine the transaction and add it to the blockchain thus
committing the transaction.
35
Proof of Burn (PoB)

► With PoB, instead of investing in expensive hardware equipment, the validators follow the
Validators burn coin to irretrivable address
following approach: Short term loss for long term commitment
EARN PRIVILAGE
► They burn coins by sending them to an address from where they are irretrievable.
► By committing the coins to an unreachable address, validators earn a privilege to mine on the
system based on a random selection process.
► Thus, burning coins means that validators have a long-term commitment in exchange for their
short-term loss.
► Depending on how the PoB is implemented, miners may burn the native currency of the
Blockchain application or the currency of an alternative chain, such as bitcoin.
► The more coins validators burn, the better are their chances of being selected to mine the next
block.
36
Proof of Burn (PoB)

► How PoB Works?


► Here as we are talking in the context of virtual currency so it’s obvious that in PoB virtual
currency is burned. The more the currencies are burned by miners the more they have the
power to create blocks.
► It means not using that coin. This may be done if it is sent to somewhere where it can’t be
spent. So miners send these coins to such addresses from where they can’t be used. It is sent to
a public verifiable address where it cannot be accessed and thus can not be used.
► When the coin is burnt its availability decreases leading to a potential increase in the value of
the coin.
37
Proof of Burn (PoB)

► How PoB Works?


► Now the question is why do we need to burn the coin? The basic explanation for this is that by
destroying the currency, the consumer is displaying a big commitment to the currency by
foregoing a narrow profit in exchange for a long-term profit.
► To avoid any undue advantages for early adopters, the PoB has devised a method that allows
for the periodic burning of crypto coins in order to maintain mining capacity. Any time a fresh
block is mined, the energy of burned coins decreases slightly.
► It is a deflationary idea in which the quantity of currencies reduces over time, increasing
deficiency and, as a result, the currency holders’ value. Coins that grow their quantity over
time, on the other hand, tend to lose value.
38
Proof of Burn (PoB)

► Advantages of PoB:
► It required very little power compared to PoW.
► It reduces energy consumption by wasting insignificant resources when coins are burned.
► It encourages long-term involvement in a project as a consumer is displaying a big
commitment to the currency by foregoing a narrow profit in exchange for a long-term profit.
► The coin distribution is more fair compared to all other consensuses.

Adv -
Less Power
Long Term Involvement
39
Proof of Stake (PoS)

Validators are choosen based on STAKE and COIN AGE


► What is Proof-of-Stake:
As understandable from the name, nodes on a network stake an amount of cryptocurrency to
become candidates to validate the new block and earn the fee from it. Then, an algorithm
chooses from the pool of candidates the node which will validate the new block. This selection
algorithm combines the quantity of stake (amount of cryptocurrency) with other factors (like
coin-age based selection, randomization process) to make the selection fair to everyone on
the network.
► Coin-age based selection:
The algorithm tracks the time every validator candidate node stays a validator. The older the
node becomes, the higher the chances of it becoming the new validator.
► Random Block selection:
The validator is chosen with a combination of ‘lowest hash value’ and ‘highest stake’. The node
having the best weighted-combination of these becomes the new validator.
40
Proof of Stake (PoS)

► Nodes make transactions. The PoS algorithm puts all these transactions in a pool.
► All the nodes contending to become validator for the next block raise a stake. This stake is
combined with other factors like ‘coin-age’ or ‘randomized block selection’ to select the
validator.
► The validator verifies all the transactions and publishes the block. His stake still remains locked
and the forging reward is also not granted yet. This is so that the nodes on the network can
‘OK’ the new block.
► If the block is ‘OK’-ed, the validator gets the stake back and the reward too. If the algorithm is
using a coin-age based mechanism to select validators, the validator for the current block’s
has its coin-age reset to 0. This puts him in a low-priority for the next validator election.
► If the block is not verified by other nodes on the network, the validator loses its stake and is
marked as ‘bad’ by the algorithm. The process again starts from step 1 to forge the new block
41
Proof of Stake (PoS)

► Features:
► Fixed coins in existence:
There is only a finite number of coins that always circulate in the network. There is no existence
of bringing new coins into existence
► Transaction fee as reward to minters/forgers:
Every transaction is charged some amount of fee. This is accumulated and given to the entity
who forges the new block.
► Impracticality of the 51% attack:
To conduct a 51% attack, the attacker will have to own 51% of the total cryptocurrency in the
network which is quite expensive. This deems doing the attack too tedious, expensive and not
so profitable
42
Proof of Elapsed Time (PoET)

► Proof of elapsed time (PoET) is a blockchain network consensus mechanism that prevents high
resource utilization and energy consumption; it keeps the process more efficient by following a
fair lottery system.
► The algorithm uses a randomly generated elapsed time to decide mining rights and block
winners on a blockchain network. By running a trusted code within a secure environment, the
PoET algorithm also enhances transparency by ensuring lottery results are verifiable by external
participants.
► Proof of elapsed time (PoET) is a consensus algorithm developed by Intel Corporation that
enables permissioned blockchain networks to determine who creates the next block.
► PoET follows a lottery system that spreads the chances of winning equally across network
participants, giving every node the same chance.
► The PoET algorithm generates a random wait time for each node in the blockchain network;
each node must sleep for that duration.
43
Proof of Elapsed Time (PoET)

► How Does PoET Work?


► Based on the principle of a fair lottery system where every node is equally likely to be chosen,
the PoET mechanism spreads the chances of winning across the largest possible number of
network participants.
► Under PoET, each participating node in the network must wait for a randomly chosen period;
the first to complete the designated waiting time wins the new block. Each node in the
blockchain network generates a random wait time and sleeps for that specified duration.
► The one to wake up first—that is, the one with the shortest wait time—wakes up and commits a
new block to the blockchain, broadcasting the necessary information to the whole peer
network. The same process then repeats for the discovery of the next block.

Nodes in system get wait time


Node with minimum wait time get chance to add block
44
Proof of Elapsed Time (PoET)

► The mechanism of running trusted code within a secure environment also takes care of many
other network necessities. It ensures that the trusted code runs within the secure environment
and is not alterable by any participant. It also ensures that the results are verifiable by
participants or other permissioned entities, thereby enhancing the transparency of the network
consensus.
► PoET controls the cost of the consensus process and keeps it nimble so that it remains
proportional to the value derived from the process, an essential requirement for
the cryptocurrency
45
Mining difficulty

► What is mining difficulty?


► One of the terms you will often come across in bitcoin mining literature is mining difficulty.
Mining difficulty refers to the difficulty of solving the math puzzle and generating bitcoin. Mining
difficulty influences the rate at which bitcoins are generated.

► Mining difficulty changes every 2,016 blocks or approximately every two weeks. The
succeeding difficulty level depends on how efficient miners were in the preceding cycle. It is
also affected by the number of new miners that have joined Bitcoin's network because it
increases the hash rate or the amount of computing power deployed to mine the
cryptocurrency. In 2013 and 2014, as the price of bitcoin rose, more miners joined its network,
and the average time to discover a block of transactions fell to nine minutes from 10 minutes.
Refer to solving maths puzzle and generate the BTC
Difficulty changes every 2016 block or two weeks
New difficulty depend on Efficiency of Miners in prev cycle
More miner join n/w --> mining time increases
46
Mining difficulty

► But the opposite can also be true. That is, the more miners there are competing for a solution,
the more difficult the problem will become. If computational power is taken off the network,
the difficulty adjusts downward to make mining easier.

► The difficulty level for mining in March 2022 was 27.55 trillion. That is, the chances of a computer
producing a hash below the target is 1 in 27.55 trillion. To put that in perspective, you are about
91,655 times more likely to win the Powerball jackpot with a single lottery ticket than you are to
pick the correct hash on a single try.
47
Mining pool and its methods

► Cryptocurrency mining involves two functions – releasing new cryptocurrency into the system,
and verifying and adding transactions to the blockchain public ledger.
► It is performed using an internet-connected computer which is often equipped with special
mining hardware devices and software programs to control and manage the mining process.
► Crypto mining is a calculation-intensive, puzzle-solving-like computation process that
requires high processing power along with high electricity consumption. The miner who first
solves the puzzle gets to place the next block on the blockchain and claim the rewards.
► The cryptocurrency discovery process is configured in such a way that if more miners are
working, the difficulty level goes up, while a decline in the number of miners eases the difficulty
level.
48
Mining pool and its methods

► Enter the mining pool, which is a collection/group of miners working together to increase
their chances of finding a block at the group level, compared to that at the individual level.
Through such pools, miners combine their individual computational resources with those of the
other members which enhances their joint processing power, and helps to achieve the desired
output faster.
► However, this pooled work with better output and higher chances, comes at a cost. The reward
earned through combined mining is split among the various pool members, as compared to
sole ownership on the reward earned through individual mining.

Group of miners combine their resources to solve problem and share reward among
themselves
49
Mining pool and its methods

► Functions of a Mining Pool


► A mining pool essentially works as a coordinator for the pool members. The functions involve
► managing the pool members’ hashes,
► looking for rewards through pooled efforts of available processing power,
► recording work performed by each pool member, and
► assigning reward shares to each pool member in proportion to the work performed after
suitable verification.
50
Mining pool and its methods

► Work to each pool member can be assigned in two ways.


► The traditional method involves assigning members a work unit comprised of a particular range
of nonce, the number that blockchain miners are computing for. Once the pool member
completes the work on the assigned range, they place a request for a new work unit to be
assigned.
► A second mining method allows pool members the liberty to pick and choose as much work as
they like without any assignment coming from the pool. The methodology ensures that no two
members take the same range, just like no two gold diggers should explore the same piece of
land.
51
Mining pool and its methods

► Based on the accepted shares, members get rewarded using different methods, which include
the following:
► Pay-per share (PPS): Allows instant payout solely based on accepted shares contributed by the
pool member, who are allowed to withdraw their earnings instantly from the pool’s existing
balance.
► Proportional (PROP): At the end of a mining round, a reward that is proportional to the number
of the member’s shares with respect to total shares in the pool, is offered.
► Shared Maximum Pay Per Share (SMPPS): A method similar to PPS but limits the payout to the
maximum that the pool has earned.
► Equalized Shared Maximum Pay Per Share (ESMPPS): A method similar to SMPPS, but distributes
payments equally among all miners in the bitcoin mining pool.

You might also like