PDF Unit II
PDF Unit II
What is Bitcoin?
A peer-to-peer internet currency that allows decentralized transfers of
value
between individuals and businesses.
Before Bitcoin
• DigiCash (1989): The 1st Electronic Cash System
• David Chaum’s company, featuring ecash (1983)
• Ecash notes backed by fiat from bank
• Relied on blind signatures
Transaction security
• Bitcoin is the official first cryptocurrency that had been released in 2009. It
is basically a digital currency and only exists electronically.
• Bitcoin is the first successful electronic cash system and coincidentally, the first
instance of a successful Blockchain.
• Secure, trustless, borderless
• No bank needed to authorize/process transactions
• Transactions are stored on a distributed ledger
• Bitcoin introduced the concept of cryptocurrency;
• decentralized digital money secured by cryptography, used to create
valuable digital assets that cannot be counterfeited.
Bitcoin transactions are authorized in a
peer- to-peer network.
• Each node stores the history of the chain of blocks, containing
validated transactions
• Counterfeiting is impossible because if one node’s history is corrupted the others
stay the same, and no central authority (i.e. bank) needs to confirm; this is
called decentralization
• Unlike previous P2P network models, members of the Bitcoin network
are incentivized to participate through cryptocurrency
• Specifically, the incentive is for the people who mint (create) Bitcoin,
called
miners.
Before and After
bitcoin
Bitcoin Properties
• Your wallet converts that private key to a Bitcoin address using a well-
known function.
• This function is very straightforward for a computer to perform.
• It uses elliptic curve cryptography to generate Bitcoin addresses
• Ifanyone knows your private key, they could easily convert it to
a Bitcoin address, too.
• If someone knows only your Bitcoin address, it’s virtually impossible
to figure out what the private key was.
How Are Transactions Authorized
• InBitcoin, a valid
digital
signature serves as proof that
the transaction
was
authorized by the
address’s
owner.
• Just as a private key
was
required to generate
that
address, the same private key
is required, once again,
to
generate a valid
digital
signature.
• A digital signature is
only
valid if a specific equation is
The Bitcoin lifecycle
• Sender wants to send 1 Bitcoin to Receiver. This is what is going to happen:
• The process of mining can get really complex and a regular desktop or
PC can’t cut it.
• It requires a unique set of hardware and software that works well for
the user.
• It helps to have a custom set specific to mining certain blocks.
• The mining process undertaking can be divided into three
categories:
1. Individual Mining
2. Pool Mining
3. Cloud Mining
Individual Mining
• In Individual Mining, the user has to register itself as a miner.
• As soon as a transaction occurs, all the single users in the blockchain
network will receive a mathematical problem.
• The first one to solve the complex mathematical problem gets
rewarded.
• The solution comes after rigorously using the hardware and software
properties of the computer, which is being used by the miner.
• With the solution onboard, all the other network miners will validate
the decrypted value and then add the same to the blockchain.
• Thus, verifying the transaction that just occurred.
Pool Mining
• Another type of mining is Pool Mining, where several users operate
together to approve the transaction
• Numerous transactions occur every second.
• Sometimes, due to the complexity of the data encrypted in the blocks,
a single user can’t decrypt the data encoded.
• Then the entire team of miners in the network operate together to solve
the complex numerical and computational problem.
• After the result is validated, the reward is then also split between all
users.
Cloud Mining
• Eliminating the use of multiple computer hardware and software, another way in
which you can mine blockchain is through cloud mining.
• Without juggling with the hardware and software parameters, electricity, or power
usage and the connectivity or bandwidth issues, you can extract the blocks
hassle- free with this method.
• Cloud mining allows the users to operate in peace, not having to worry about
the heating of the equipment or ventilation issues in managing the hardware.
• The constant worry to deal with handling all the machinery and worrying about
its order timings or selling profits is eliminated altogether.
• It seems profitable, according to the mining hardware parameters, but has its
own set of disadvantages.
• These include limiting operational functionality with the limitations on bitcoin
hashing.
• Lowering the reward profits results in the operational expenses to increase
with cloud mining.
• The software up-gradation gets restricted with this type of mining, and so does
the
verification process involved.
Tasks of the
miners
• Synching up with the network:
• Once a new node joins the bitcoin network, it downloads the blockchain
by requesting historical blocks from other nodes.
• This is not necessarily a task only for a miner.
• Transaction validation:
• Transactions broadcasted on the network are validated by full nodes
by verifying and validating signatures and outputs.
• Block validation:
• Miners and full nodes can start validating blocks received by them
by evaluating them against certain rules.
• This includes the verification of each transaction in the block along
with verification of the nonce value.
Tasks of the
• Create a new block:
miners
• Miners propose a new block by combining transactions broadcasted on the network
after validating them.
• Perform Proof of Work:
• This task is the core of the mining process
• This is where miners find a valid block by solving a computational puzzle.
• The block header contains a 32-bit nonce field
• Miners are required to repeatedly vary the nonce until the resultant hash is less than
a predetermined target.
• Fetch reward:
• Once a node solves the hash puzzle, it immediately broadcasts the results, and other
nodes verify it and accept the block.
• There is a slight chance that the newly minted block will not be accepted by other miners
on the network due to a clash with another block found at roughly the same time,
• but once accepted, the miner is rewarded with 12.5 bitcoins and any associated transaction
fees.
The mining algorithm
The mining algorithm consists of the following steps.
• The previous block's header is retrieved from the bitcoin
network.
• Assemble a set of transactions broadcasted on the network
into a block to be proposed.
• with a noncethe
Compute anddouble
the newly proposed
hash of block using the SHA-
the previousblock'sheader
algorithm.
256
combined
• Check if the resultant hash is lower than
the current difficulty level (target) then PoW is
solved.
• As a result of successful PoW the discovered block is
broadcasted to the network and miners fetch the reward.
• If the resultant hash is not less than the current difficulty
level (target), then repeat the process after incrementing the
nonce.
Bitcoin Address
Example
• Bitcoin addresses are 26-35 characters long, consist of alphabetic and
numeric characters, and either begin with “1”, “3”, or “bc1”.
• Currently, there are three Bitcoin address formats in use:
• Behind every transaction, there are underlying codes working behind the scene.
This scripting language is known as the Bitcoin Scripting Language.
P2PKH
• To get a Bitcoin address, you first need to download a Bitcoin wallet, which is
software that allows you to securely send, receive, and store Bitcoin funds in
the Bitcoin network.
• Bitcoin wallets also store your private key, which is essentially your Bitcoin
password.
• The software will generate a brand new Bitcoin address for you every time you
create an invoice or receive a payment request for Bitcoins too.
• There are four types of Bitcoin wallets that you can use: mobile, web,
desktop, and hardware.
• Source: https://blog.hubspot.com/marketing/bitcoin-address
The Bitcoin network
• There are different types of nodes on the network.
• There are two main types of nodes,
• full nodes and SPV nodes.
• Full nodes, as the name implies, are implementations of Bitcoin core
clients performing the wallet, miner, full blockchain storage, and
network routing functions.
• It is not necessary to perform all these functions. Simple Payment
Verification (SPV) nodes or lightweight clients perform only wallet
and network routing functionality.
• Another type is solo miner nodes that can perform mining, store full
blockchain, and act as a Bitcoin network routing node.
The Bitcoin network is identified by its different magic values