UNIT - 3 Notes
UNIT - 3 Notes
DEPARTMENTOFCOMPUTERSCIENCEANDENGINEERING
UNIT– III-CRYPTOCURRENCY TECHNOLOGIES –SCSA 3059
UNIT- 3
CRYPTO:
Cryptocurrency, sometimes called crypto-currency or crypto, is any
form of currency that exists digitally or virtually and uses cryptography to secure
transactions. Cryptocurrencies don't have a central issuing or regulating authority,
instead using a decentralized system to record transactions and issue new units.
A cryptocurrency is a coded string of data representing a currency
unit. Peer-to-peer networks called blockchains monitor and organize
cryptocurrency transactions, such as buying, selling, and transferring, and also
serve as secure ledgers of transactions. By utilizing encryption technology,
cryptocurrencies can serve as both a currency and an accounting system.
A cryptocurrency is a digital or virtual currency that is meant to be a
medium of exchange. It is quite similar to real-world currency, except it does not
have any physical embodiment, and it uses cryptography to work.
Because cryptocurrencies operate independently and in a
decentralized manner, without a bank or a central authority, new units can be
added only after certain conditions are met.
For example, with Bitcoin, only after a block has been added to the
blockchain will the miner be rewarded with bitcoins, and this is the only way new
bitcoins can be generated. The limit for bitcoins is 21 million; after this, no more
bitcoins will be produced.
Benefits of Cryptocurrency
With cryptocurrency, the transaction cost is low to nothing at
all—unlike, for example, the fee for transferring money from a
digital wallet to a bank account.
You can make transactions at any time of the day or night, and
there are no limits on purchases and withdrawals.
And anyone is free to use cryptocurrency, unlike setting up a
bank account, which requires documentation and other paperwork.
International cryptocurrency transactions are faster than wire
transfers too. Wire transfers take about half a day for the money
to be moved from one place to another.
With cryptocurrencies, transactions take only a matter of
minutes or even seconds.
Primitives of Crypto:
Primitives refer to the fundamental building blocks or basic operations
used to construct secure cryptographic systems. These primitives are essential
components in various cryptographic algorithms and protocols.
Cryptocurrency is built on a set of foundational elements or primitives
that make it functional and secure. These primitives are the fundamental
components that enable the creation, transfer, and verification of digital assets in a
decentralized manner.
Some of the key primitives of cryptocurrency are:
1. Blockchain: The blockchain is a distributed and immutable ledger that
records all transactions and activities within a cryptocurrency network. It is a
chain of blocks, where each block contains a list of transactions and a
reference to the previous block. The blockchain ensures transparency and
security by making it extremely difficult to alter past transaction records.
2. Cryptography: Cryptography is used to secure transactions and control the
creation of new units of cryptocurrency. Public-key cryptography allows
users to have a public address (a cryptographic public key) to receive funds
and a private key to sign transactions and access their holdings.
3. Consensus Mechanism: To maintain a shared and synchronized version of
the blockchain across the network without relying on a central authority,
cryptocurrencies use various consensus mechanisms. The most well-known
is Proof of Work (PoW) used by Bitcoin, but there are also other consensus
algorithms like Proof of Stake (PoS), Delegated Proof of Stake (DPoS), and
Practical Byzantine Fault Tolerance (PBFT).
4. Mining: Mining is the process by which new cryptocurrency units are
created and transactions are added to the blockchain. Miners use
computational power to solve complex mathematical problems, and the first
miner to solve the problem gets to add the next block to the blockchain and
is rewarded with newly minted coins and transaction fees.
5. Wallets: Cryptocurrency wallets store the user's public and private keys and
interact with the blockchain to send and receive funds. Wallets can be
software-based (online, desktop, or mobile) or hardware-based (physical
devices).
6. Transactions: Transactions are the essential units of operation on the
blockchain. They involve the transfer of cryptocurrency between different
addresses on the network. Transactions are cryptographically signed to
ensure their authenticity and security.
7. Double Spending Prevention: Cryptocurrencies prevent the double-
spending problem, where the same digital asset is spent more than once. The
decentralized nature of the blockchain, along with consensus mechanisms,
ensures that double-spending is not possible.
8. Smart Contracts: Smart contracts are self-executing contracts with the
terms of the agreement directly written into code. They enable
programmable actions and are executed automatically when specific
conditions are met. Ethereum is a well-known platform that supports smart
contracts.
These primitives collectively create the foundation for the
operation and security of cryptocurrencies, allowing them to function as digital
assets with unique properties like decentralization, transparency, and censorship
resistance.
Bitcoin :
Bitcoin is a decentralized digital currency that was invented in 2008 by
an unknown person or group using the pseudonym Satoshi Nakamoto. It was
introduced as an open-source software in 2009, and since then, it has become the
first and most well-known cryptocurrency. Bitcoin is a form of digital currency
that aims to eliminate the need for central authorities such as banks or
governments. Bitcoin operates on a peer-to-peer network, utilizing blockchain
technology to record and verify transactions.
Bitcoin pros
Cost-efficient transactions and fast speeds. Once you own Bitcoin, you
can make transfers anytime, anywhere, reducing the time and potential
expense of any transaction.
Privacy. Transactions don’t contain personal information, such as a name or
credit card number. While it’s still possible to link a certain person to a
certain wallet, transactions are generally more private than credit card
transactions, for example.
Decentralization. After the financial crisis and the Great Recession, some
investors are eager to embrace an alternative, decentralized currency — one
that is essentially outside the control of regular banks, governing authorities
or other third parties.
Growth potential. Some investors who buy and hold the currency are
betting that once Bitcoin matures, greater trust and more widespread use will
follow, and therefore Bitcoin’s value will grow.
Bitcoin cons
Price volatility. While Bitcoin's value has risen dramatically over the years,
buyers' fortunes have varied widely depending on the timing of their
investment. Those who bought in 2017 when Bitcoin’s price was racing
toward $20,000, for example, had to wait until December 2020 to recover
their losses. More recently, Bitcoin’s price began 2022 slightly over $47,000
per coin. After a tough year for cryptocurrency in general, Bitcoin has
slumped to its current price of just under $17,000.
Hacking concerns. While backers say the blockchain technology behind
Bitcoin is even more secure than traditional electronic money transfers, there
have been a number of high-profile hacks. In May 2019, for instance, more
than $40 million in Bitcoin was stolen from several high-net-worth accounts
on the cryptocurrency exchange Binance. (The company covered the losses.)
Not protected by SIPC. The Securities Investor Protection Corporation
insures investors up to $500,000 if a brokerage fails or funds are stolen, but
that insurance doesn’t cover cryptocurrency
Bitcoin Decentralization :
Bitcoin is decentralized thus:
Bitcoin does not have a central authority.
The bitcoin network is peer-to-peer, without central servers.
The network also has no central storage; the bitcoin ledger is distributed.
The ledger is public; anybody can store it on a computer.
There is no single administrator; the ledger is maintained by a network of
equally privileged miners.
Anyone can become a miner.
The additions to the ledger are maintained through competition. Until a new
block is added to the ledger, it is not known which miner will create the
block
The issuance of bitcoins is decentralized. They are issued as a reward for the
creation of a new block.
Anybody can create a new bitcoin address (a bitcoin counterpart of a bank
account) without needing any approval.
Anybody can send a transaction to the network without needing any
approval; the network merely confirms that the transaction is legitimate.
Bitcoin Storage
Once the bitcoin is purchased, two keys are given to the owner who
bought the bitcoin —one is your public key, the other is private. The public key
is used to encrypt information and create your wallet address, and the private key
allows you to decrypt the information, or access your bitcoin. This is the key used
for storing and safeguarding.
Bitcoin ownership is safely recorded, stored, validated, and
encrypted on the blockchain. To date, no cryptocurrency has been stolen by
altering the information on a blockchain because of the encryption methods used.
With current technology, it would take centuries, if not millennia, to brute force
hack a blockchain.
Types of Storage :
There are generally two types of storage, custodial and non-
custodial. There are hot and cold wallets for each type.
1. Custodial Wallet :
A custodial wallet is managed by a third party, such as an
exchange like Coinbase. In this arrangement, the custodian stores your private keys
for you, guaranteeing their safety and sometimes providing insurance on holdings
up to a certain amount. Custodial wallets like these have been the target of many
attacks since users began using their services; exchanges have taken measures to
harden their services, such as moving users' keys into enterprise-level cold storage
so that they cannot be accessed.
Custodial wallets can either be hot or cold.
2. Non-Custodial Wallets
Non-custodial wallets are those you use to store your keys with no
one else involved. Non-custodial wallets can also be either hot or cold.
Hot Wallet
Hot wallets are software that stores your keys and have
connections to the internet. These wallets create vulnerability because they
generate the private and public keys needed to access crypto. While a hot wallet is
how most users access and make transactions in bitcoin, they are vulnerable and
can be hacked.
It's estimated that about 17% of the bitcoin that will ever be in circulation has been
lost—as in misplaced, keys forgotten, and so on.3
Cold Wallet
A cold wallet (also called cold storage) is a wallet that is not
connected to the internet; therefore, it holds far less risk of being compromised.
These wallets are also called offline wallets or hardware wallets.
Bitcoin Mining :
Mining is a record-keeping service done through the use of
computer processing power.
Miners keep the blockchain consistent, complete, and unalterable by
repeatedly grouping newly broadcast transactions into a block, which is then
broadcast to the network and verified by recipient nodes. Each block contains
a SHA-256 cryptographic hash of the previous block, thus linking it to the previous
block and giving the blockchain its name.
To be accepted by the rest of the network, a new block must contain
a proof-of-work (PoW). The PoW requires miners to find a number called
a nonce (a number used just once), such that when the block content
is hashed along with the nonce, the result is numerically smaller than the
network's difficulty target. This PoW is easy for any node in the network to verify,
but extremely time-consuming to generate. Miners must try many different nonce
values (usually the sequence of tested values is the ascending natural numbers: 0,
1, 2, 3, ...) before a result happens to be less than the difficulty target. Because the
difficulty target is extremely small compared to a typical SHA-256 hash, block
hashes have many leading zeros as can be seen in this example block hash:
0000000000000000000590fc0f3eba193a278534220b2b37e9849e1a770ca959
By adjusting this difficulty target, the amount of work needed to generate a block
can be changed. Every 2,016 blocks (approximately 14 days given roughly 10
minutes per block), nodes deterministically adjust the difficulty target based on the
recent rate of block generation, with the aim of keeping the average time between
new blocks at ten minutes. In this way the system automatically adapts to the total
amount of mining power on the network.
The proof-of-work system, alongside the chaining of blocks, makes
modifications to the blockchain extremely hard, as an attacker must modify all
subsequent blocks in order for the modifications of one block to be accepted. As
new blocks are being generated continuously, the difficulty of modifying an old
block increases as time passes and the number of subsequent blocks (also
called confirmations of the given block) increases.
The vast majority of mining power is grouped together in mining pools to
reduce variance in miner income. Independent miners may have to work for
several years to mine a single block of transactions and receive payment. In a
mining pool, all participating miners get paid every time any participant generates
a block. This payment is proportionate to the amount of work an individual miner
contributed to the pool.
Bitcoin Predecessors:
Bitcoin is the first and most well-known cryptocurrency, but it was not
the first attempt at creating a digital or cryptographic currency.
Several predecessors to Bitcoin laid the groundwork for the
development of cryptocurrencies and blockchain technology.
Some notable predecessors include:
1. B-Money: Proposed by computer scientist Wei Dai in 1998, B-Money was
one of the earliest concepts for a decentralized digital currency. It aimed to
create a system that allowed individuals to conduct anonymous transactions
with a digital currency.
2. Bit Gold: Proposed by computer scientist Nick Szabo in 2005, Bit Gold was
a precursor to Bitcoin. It was a cryptographic currency that involved solving
proof-of-work puzzles to create new coins and secure the network. Although
it was never fully implemented, its ideas heavily influenced the creation of
Bitcoin.
3. Hashcash: Introduced by Adam Back in 1997, Hashcash was not a currency
itself but a proof-of-work system used to deter email spam and denial-of-
service attacks. Bitcoin's proof-of-work concept was inspired by Hashcash.
4. eCash: Developed by cryptographer David Chaum in the 1980s and '90s,
eCash was one of the earliest attempts to create a digital currency that
provided privacy and anonymity for users. It was a centralized digital
currency that allowed users to withdraw coins from a bank and spend them
anonymously.
5. Digicash: Also created by David Chaum in the 1990s, Digicash was an
electronic cash system that allowed users to make secure and private
electronic payments. It used cryptographic techniques to protect transactions
and user identities.
Ethereum Ecosystem :
The Ethereum ecosystem is a vast and dynamic network of projects, applications,
and developers built around the Ethereum blockchain. Ethereum, launched in 2015
by Vitalik Buterin and others, is a decentralized, open-source platform that enables
the creation of smart contracts and decentralized applications (DApps).
The Ethereum ecosystem can be broadly categorized into several key components:
1. Ethereum Blockchain: At the core of the ecosystem is the Ethereum
blockchain, a distributed ledger that maintains a record of all transactions
and smart contracts. It uses the consensus mechanism called Proof of Work
(PoW), but Ethereum is in the process of transitioning to Proof of Stake
(PoS) through Ethereum 2.0 upgrade to improve scalability and energy
efficiency.
2. Smart Contracts: Ethereum's defining feature is its ability to execute smart
contracts, which are self-executing code that run on the blockchain. Smart
contracts enable the creation of decentralized applications, allowing
developers to build a wide range of applications, from decentralized finance
(DeFi) protocols to non-fungible tokens (NFTs) marketplaces.
3. Decentralized Finance (DeFi): DeFi is a prominent part of the Ethereum
ecosystem, representing a wide range of financial services and applications
built on smart contracts. DeFi protocols provide lending, borrowing,
decentralized exchanges, stablecoins, yield farming, and other financial
services without intermediaries.
4. Non-Fungible Tokens (NFTs): NFTs are unique digital assets that
represent ownership or proof of authenticity for digital and real-world items.
Ethereum's support for ERC-721 and ERC-1155 standards has led to the
explosion of NFT marketplaces, where users can buy, sell, and trade digital
art, collectibles, and virtual assets.
5. Layer-2 Solutions: As Ethereum's scalability faces challenges, various
Layer-2 solutions have emerged to address network congestion and high gas
fees. Solutions like zk-Rollups, Optimistic Rollups, and sidechains aim to
increase throughput and reduce transaction costs.
6. Ethereum Improvement Proposals (EIPs): Ethereum's protocol upgrades
and improvements are proposed through Ethereum Improvement Proposals.
These proposals govern changes to the network, including the transition to
Ethereum 2.0 and other protocol upgrades.
7. Developer Tools and Infrastructure: The Ethereum ecosystem has a
vibrant developer community that contributes to various tools, libraries, and
frameworks to facilitate DApp development. These include Truffle, Hardhat,
Remix, Web3.js, and others.
8. Ethereum Wallets: Numerous wallets provide users with a secure and user-
friendly interface to interact with the Ethereum blockchain and manage their
cryptocurrencies and tokens.
9. Ethereum Governance: Ethereum has a decentralized governance model
where stakeholders can participate in decision-making through Ethereum
Improvement Proposals (EIPs) and consensus mechanisms.