Module2
Module2
What is cryptocurrency?
• Cryptocurrency is a digital payment system
that doesn't rely on banks to verify
transactions.
• It's a peer-to-peer system that can enable
anyone anywhere to send and receive
payments.
• Cryptocurrency is stored in digital wallets.
Cryptocurrency received its name because it
uses encryption to verify transactions.
• In cryptoworld there are three layers. Each protocol has coins which facilitates the
interaction amongst the players. Tokens they rely on smart contracts which are built on top
of different protocol.
TECHNOLOGY BLOCKCHAIN
TOKEN
Bitcoin and Ripple does not create smart contracts so does not have tokens
• coinmarketcap.com
Coin vs Token
• The two most common blockchain-based digital assets are
cryptocurrencies and tokens. The biggest differentiation between the
two is that cryptocurrencies have their own blockchains, whereas crypto
tokens are built on an existing blockchain.
• Cryptocurrencies are the native asset of a specific blockchain protocol,
whereas tokens are created by platforms that build on top of those
blockchains.
• For instance, the Ethereum blockchain’s native token is ether (ETH).
• While ether is the cryptocurrency native to the Ethereum blockchain,
there are many other different tokens that also utilize the Ethereum
blockchain.
• Crypto tokens built using Ethereum include DAI, LINK, COMP, and
CryptoKitties, among others.
• These tokens can serve a multitude of functions on the platforms for
which they are built, including participating in decentralized finance (DeFi)
mechanisms, accessing platform-specific services, and even playing
games.
Mining
• Blockchain "mining" is a metaphor for the
computational work that nodes in the
network undertake in hopes of earning new
tokens.
• In reality, miners are essentially getting paid
for their work. They are doing the work of
verifying the legitimacy of Bitcoin
transactions.
• XXXXX (0-99999)= 100,000 options
• 0XXXX(0-9999)= 10,000 options
• By including one 0 pool size is reduced by 10.
• So by including 0, we are reducing pool size.
Calculating mining Difficulty
Mining Difficulties
• Solving the mathematical puzzles for valid block creation requires
huge amounts of computational power.
• The mining difficulty of a cryptocurrency such as Bitcoin indicates
how difficult and time-consuming it is to find the right hash for each
block.
• Mining difficulty is a measurement unit used in the process of
Bitcoin mining
• Difficulty indicates how difficult it is to solve a complex
cryptographic puzzle
• The difficulty of mining new units increases or decreases over time,
depending on the number of miners in the network
• Increases in difficulty are necessary in order to keep the target
block time
Mining Difficulties
Mining equipment has evolved considerably since the beginnings of
Bitcoin :
• In the early days, the first miners used the CPUs of their PCs to
mine Bitcoin.
• Miners eventually realised that graphics cards are better suited for
mining Bitcoin. However, graphics cards also need more energy.
• In recent years, special “ASICs” (application-specific integrated
circuit chips) have been developed specifically for Bitcoin mining.
• Presently, Bitcoin and other digital
currencies are mined via mining pools,
where lots of miners join forces and
combine their hash rates in the quest
for block rewards.
Mining Pool
• In the context of cryptocurrency
mining, a mining pool is the pooling
of resources by miners, who share their processing power over a
network, to split the reward equally, according to the amount of work
they contributed to the probability of finding a block.
• A "share" is awarded to members of the mining pool who present a
valid partial proof-of-work.
• Mining in pools began when the difficulty for mining increased to
the point where it could take centuries for slower miners to
generate a block.
• The solution to this problem was for miners to pool their resources
so they could generate blocks more quickly and therefore receive a
portion of the block reward on a consistent basis, rather than
randomly once every few years.
Website
• https://www.blockchain.com/
https://time.is/Unix
The value that you get is no of seconds crossed
since 1st January 1970.
This value is used in computers
as its universal.This value is used
as timestamp
Nonce
• Nonce is not infinite value.
• It is an integer with a value. Maximum 32 bit=
4billion
MemPool
• A mempool (a contraction of memory and pool) is a cryptocurrency node's
mechanism for storing information on unconfirmed transactions. It acts as
a sort of waiting room for transactions that have not yet been included in
a block.
• Mempool has transaction id and value that the miner is going to get. SO
the miner will choose one with highest value.
How mempool works?
• We have network of nodes(people who wants
to transact)
• Now we have some miners and mempool with
each participants.
• Suppose she wants to perform a transaction.
It gets added to her mempool
• The transaction then gets relayed to all the
nodes.
• Happens for all the transactions
• Suppose this miner solves the puzzle and
block is added to the blockchain.
• The transaction concerned gets deleted and the blocks gets
relayed across the network and corresponding transaction
across all the nodes gets deleted.
Orphaned Block
• Block Chain is the most important component of any
crypto currency network. Cryptocurrency is based on
distributed, transparent public ledger where all the
transactions ever made on a cryptocurrency are
noted in the blocks and added to the block chain.
Miners get attractive rewards to verify and create a
new block and add it successfully to the Block Chain.
• There will be some blocks which are created, but not accepted by the
block chain network. There are called Orphan Blocks. Orphan blocks are
verified and valid blocks, but not accepted by the block chain network due
to a time lag in the acceptance of the block. Orphan Blocks are the
rejected blocks which are very much valid. They will remain as detached
blocks in the cryptocurrency network.
• Now a situation comes where two miners produce a similar block at the
same time. This can happen because to complete the process of creating
every block will take time. Acceptance of the blocks into the Block Chain
won’t happen instantaneously. In the meantime, another miner may come
up with the exact same block. Now there will be some confusion in the
Block Chain Network, as to which of these two identical blocks should be
added to the block chain.
• When such tie arises, the block with the larger share of Proof of Work will
be added to the Block Chain. The left over block which has comparatively
smaller proof of work will be orphaned or detached.
51% Attack
• A 51% attack happens when a malicious user in a network acquires control of a
given blockchain’s mining capabilities. It implies that the attackers will have more
than 50% mining power and can mine faster than everyone else.
• The attackers can stop the confirmation and order of new transactions. The
malicious agents can then rewrite parts of a blockchain and reverse the
transactions. A 51% attack usually bypasses the blockchain’s security protocols.
The attack’s impact can be mild or severe, depending on the mining power of the
attacker.
The impacts of 51% attack
•
• 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.
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. In this
example, transaction T1 is valid, and Alice will receive the bitcoin.
What is a UTXO?