Professional Documents
Culture Documents
Spring 2023
Cryptocurrency
Contents – Module B
What is Bitcoin? Nonce Transactions
• In addition to ETH, Ethereum also allows the creation and use of tokens on its platform.
Tokens are digital assets that can represent anything from a digital currency to a specific
asset or utility within a particular application. These tokens are created using smart contracts
on the Ethereum platform, and they can be traded on various cryptocurrency exchanges.
However, it's important to note that tokens are not the same as ETH, and they are not the
native currency of the Ethereum network.
Birth of Bitcoin
• The 2008 USA crisis destroyed people trust on central authorities like banks
• A new model and a class of asset was required, independent of central
authorities
• In 2008, the Founder of the Bitcoin published a paper regarding Bitcoin
based on Blockchain.
• As Blockchain removes the need of central authority, and people interact
with each other directly.
• Bitcoin became popular and today it is the most popular Cryptocurrency
Bitcoin Network
Bitcoin Ecosystem
Node:
Bitcoin
• A computer that runs a Bitcoin software, and is Ecosystem
Mining Pool:
• Coordinate mining activity from groups of miners
• The reward is distributed to miners proportionate
to their number of resources
• Provide a steady stream of revenue for
small scale miner Miner Node Large Mines Mining Pool
Bitcoin's
Monetary
Policy
Bitcoin Monetary Policy
• Every country has central authorities like banks etc. that control the amount
of money in a system
• Monetary Policy is used to maintain the supply of a currency (money)
• Bitcoin has its own monetary policy developed by Satoshi Nakamoto
Bitcoin's Monetary Policy
that appears in the block details you provided likely indicates that the block was created using version 2 of the Bitcoin protocol. )
Details
• Merkle Root: A unique identifier generated through a cryptographic algorithm that
ensures the integrity of the transactions within the block.
• Difficulty: The current level of difficulty for mining new blocks on the Bitcoin
network, which is adjusted periodically to maintain a consistent rate of new blocks.
• Nonce: A random value added to the block's contents during the mining process to
generate a valid hash.
• Bits: A representation of the block's target hash, used by miners to verify that a
valid hash has been found.
• Weight: A metric used to account for the size of transactions and the SegWit
protocol, which is used to calculate fees.
Details
• Minted: The amount of new Bitcoin created through the mining process for the
block.
• Reward: The total value of the new Bitcoin created and the fees collected by the
miner who confirms the block.
• Mined on: The date and time at which the block was confirmed by the miner.
• Height: The block's position within the blockchain, represented by a unique
number.
• Confirmations: The number of blocks added to the blockchain after the current
block, indicating the level of security and immutability of the transactions within
the block.
Details
• Fee Range: The range of fees paid by the transactions within the block, represented
in satoshis per byte of transaction data.
• Average Fee: The average fee per transaction within the block.
• Median Fee: The median fee per transaction within the block.
• Miner: The mining pool or individual miner who confirmed the block. In this case,
the block was confirmed by AntPool.
How Mining Works ?
Nonce
Target
How Mining Works ?
Nonce:
• The nonce is the number that Blockchain miners are solving for.
• demoblockchain.org/block
How Mining Works ?
Target
• 0000005432d9f64f6e05c019f9302162100163b6cdba06bd72eee35cd19aebf
Nonce:512
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: 0000b6aa
Smallest
Bitcoin's
Target
History
Bitcoin's Target History
Bitcoin Genesis Block
Block# 0
Hash: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
This is the Bitcoin genesis block it marks the birth of the Bitcoin network and was mined by the project’s
mysterious creator 'Satoshi Nakamoto'. Its 50 bitcoin coinbase reward is unspendable as it was omitted
from the transaction database so any attempt to spend it would be rejected by the network. Whether this
was intentional or not is unknown.
This block was mined on 1/03/2009, 23:15:05 by Satoshi.
A total of 0.00 BTC ($0.00) were sent in the block with the average transaction being 0.0000 BTC
($0.00). Satoshi earned a total reward of 50.00 BTC $0.00. The reward consisted of a base reward of 50.00
BTC $0.00 with an additional 0.0000 BTC ($0.00) reward paid as fees for the 1 transaction which were
included in the block.
Bitcoin's Target History
Bitcoin Block
Block# 754,406
Hash: 000000000000000000074ba534a31b3bc67ccb0b4193fab88b88f0afd1b15d3d
This block was mined on 9/17/2022, 05:22:37 by Unknown. A total of 14,538.41 BTC ($289,334,787) were
sent in the block with the average transaction being 8.7845 BTC ($174,823). Unknown earned a total
reward of 6.25 BTC $124,383. The reward consisted of a base reward of 6.25 BTC for $124,383 with an
additional 0.2087 BTC ($4,153.42) reward paid as fees for the 1,655 transactions which were included in
the block.
Bitcoin's Target History
Block# 0
Mined on (1/03/2009, 23:15:05)
Hash: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
Target: 10 Zeros at the beginning
Block# 754,406
Mined on (9/17/2022, 05:22:37)
Hash: 000000000000000000074ba534a31b3bc67ccb0b4193fab88b88f0afd1b15d3d
Target: 19 Zeros at the beginning.
Bitcoin's
Target
Difficulty
Understanding Mining Difficulty
Let's take a five-digit number= XXXXX
Current Target:
0000000000000000000b3ce90000000000000000000000000000000000000000
19 leading 0's
Understanding Mining Difficulty
Total Possible 64-digits hexadecimal numbers = 16^64 ≃ 10^77
OR
The probability that a randomly picked hash is valid = (1/16)^19 ≃ 10^-23
Understanding Mining Difficulty
Q) Who adjusts the difficulty?
Nonce:100
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: cd19aebf
Smallest
How Mining Works ?
All Possible Hashes
Nonce:76
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: 1da81a0e
Smallest
How Mining Works ?
All Possible Hashes
Nonce: 201
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: b474e220
Smallest
How Mining Works ?
All Possible Hashes
Nonce:512
Data:
Kshitij->Rakesh 500 coins
Raj->Bella 200 coins
Prev Hash: 0000AB23 Target('0000')
Hash: 0000b6aa
Smallest
CPUs Vs GPUs Vs ASCIs
• If one miner generates 5H/s and the second generates 10H/s
• The second miner has higher chances to generate the hashes quickly and win the reward
• Miner uses different technologies that generate different hashes per second
• At the start, people used CPUs (General purposes) for mining
• Then GPUs were used, as GPUs generate hashes much faster than CPUs
• GPU not specialized in generating hashes i.e., GPU can be used for gaming, etc.
• ASIC was introduced, specialized in generating hashes, and is capable of generating hashes
much faster than GPUs
• The latest Bitcoin ASIC miner (S19 Pro version) can generate 110 TH/s
CPUs Vs GPUs Vs ASCIs
Data
SHA 256
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
=> That there are not enough nonce to generate the valid hash.
Nonce Range
• Total Nonces ≃ 4 x10^9 on the left side Hashes
Nonces
• Total hashes ≃ 10^77 on the right side
• Some parts of the hashes can be generated by
a nonce
• A modest miner generates 10^8 H/s, then 4
billion nonces will be covered in 40 seconds.
• How to check the remaining hashes?
Nonce Range
A modest mines does 10^8 hashes/sec.
4 x 10^9 nonce will be covered in = (4 x 10^9)/(10^8)= 40 seconds.
Q) So what the miners do when all the nonce get exhausted and miners
have not hit the target ?
Timestamp
Timestamp
• The timestamp field is introduced to generate the remaining hashes.
• Timestamp is a Unix time, Unix time represents time in seconds, and it started
when Unix was introduced.
• The hash is calculated for all the block fields including a timestamp
• Miner exhaust 0.1 billion nonces in 1 second, while meantime the timestamp
changes and due to avalanche effect, the new hashes will be drastically
changed.
Timestamp
Block No.-1
Nonce:
Data
Prev Hash:000000000
Hash:
Timestamp
Block No.-1
Nonce:
Timestamp: 1622186555
SHA 256
Data
Prev Hash:000000000
Hash:
Timestamp
Block No.-1
Nonce:
Prev Hash:000000000
Hash:
Timestamp
Block No.-1
Nonce:
Timestamp: 1622186556
Data
Prev Hash:000000000
Hash:
Timestamp
Block No.-1
Nonce:
Timestamp: 1622186557
Data
Prev Hash:000000000
Hash:
Timestamp
Block No.-1
Nonce:
Timestamp: 1622186558
Data
Prev Hash:000000000
Hash:
Timestamp
The current hashing rate is 320.88 EH/s equal to 320 million trillion H/s
Hash rate demonstration
https://www.blockchain.com/charts/hash-rate
320 ignored
4 x 10^9 nonce will be covered in = (4 x 10^9)/( 10^6 x10^12) = 1.25 x 10^-8
seconds 1.25 x 10^-8 sec <<<<< 1 sec
Now at this rate, before the timestamp changes, all the nonce will be exhausted
New complication arises
Q)What should the miners do in idle time? Should they wait for
timestamp to change?
Mempool
Mempool
• Mempool is a place where all the unconfirmed transaction resides
• Mempool resides on every node just like blockchain resided on every node
(Will be covered in detail later)
• Mempool will be used to handle utilize miners’ resources effectively
• Mempool has thousands of unconfirmed transactions, miners get transactions
from the pool
• After adding transactions, the miner starts mining to solve the mathematical
problem
Mempool
• Miner exhausted all nonces in less than a second
• Timestamp is also not changed
• Still valid hash not computed
• Then, the Mempool transaction will be used for changing the hash
• If nonces are exhausted and the timestamp is not changed, the transaction
picked will be changed
• Thus, using different transactions, the miner can reuse the nonce from the start
Mempool
Block No.-1
Nonce:
Timestamp:
Transactions:
Prev Hash:000000000
Hash:
Mempool
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
A21ADC Fees:0.002
Timestamp:
B24ABE Fees:0.006
Transactions:
43AFBC Fees:0.007
E23AB2 Fees:0.004
Prev Hash:000000000
F23A6C Fees:0.005 Hash:
Mempool
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
A21ADC Fees:0.002
Timestamp:
B24ABE Fees:0.006
Transactions:
43AFBC Fees:0.007
E23AB2 Fees:0.004
Prev Hash:000000000
F23A6C Fees:0.005 Hash:
Mempool
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
A21ADC Fees:0.002
Timestamp:
B24ABE Fees:0.006
Transactions:
43AFBC Fees:0.007
E23AB2 Fees:0.004
Prev Hash:000000000
F23A6C Fees:0.005 Hash:
Mempool
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
A21ADC Fees:0.002
Timestamp:
B24ABE Fees:0.006
Transactions:
43AFBC Fees:0.007
E23AB2 Fees:0.004
Prev Hash:000000000
F23A6C Fees:0.005 Hash:
Mempool
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
A21ADC Fees:0.002
Timestamp:
B24ABE Fees:0.006
Transactions:
43AFBC Fees:0.007
E23AB2 Fees:0.004
Prev Hash:000000000
F23A6C Fees:0.005 Hash:
Mempool
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
<1s Transactions:
B24ABE Fees:0.006 43AFBC Fees:0.007
B24ABE Fees:0.006
F23A6C Fees:0.007
F23A6C Fees:0.005
E23AB2 Fees:0.004 A21ADC Fees:0.002
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
<1s Transactions:
B24ABE Fees:0.006 43AFBC Fees:0.007
B24ABE Fees:0.006
F23A6C Fees:0.007
F23A6C Fees:0.005
E23AB2 Fees:0.004 D23ABC Fees:0.001
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.001
Nonce:
Mempool Hash:
How actually mining of transaction
takes place?
FF3ABC Fees:0.0008
Block No.-1
D23ABC Fees:0.0001
Nonce:
Mempool Hash:
Mempool
• Generally, the miners pick transactions with high fees
• If a transaction is assigned minimum fees, then there is a chance that the
transaction will not be picked by any miners
• A transaction is removed from the pool after 72 hours
How
Mempool
works?
How does a Mempool work?
• Mempool is a place where all unconfirmed transactions saved
• Mempool is distributed, thus every node has its own Mempool
• When transactions are done, they are saved into a Mempool across the network
• Miner adds some transactions to a block and mines it, the information is sent to
other nodes, the block is verified, and the transactions are removed from the pool
DF123
How does a Mempool work? (Behind the scenes)
DF123
How does a Mempool work? (Behind the scenes)
DF123
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123 DF123
DF123
DF123 DF123
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123 DF123
DF123
DF123 DF123
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
DF123
DF123 DF123
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
DF123
DF123 DF123 ABC56
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
DF123
DF123 DF123 ABC56
DF123
DF123 DF123
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56
DF123
DF123 DF123 ABC56
ABC56
DF123
DF123 DF123
ABC56
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56
DF123
DF123 DF123 ABC56
ABC56
DF123
DF123 DF123
ABC56
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
DF123 DF123
ABC56 ABC56
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
DF123 DF123
ABC56 ABC56
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
How does a Mempool work? (Behind the scenes)
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123 EF123
BBC66 BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123 EF123
BBC66 BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123 EF123
BBC66 BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123 EF123
BBC66 BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123 EF123
BBC66 BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123
BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123
BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
EF123 EF123 BBC66
BBC66 BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66 EF123
BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123 EF123 EF123
BBC66 BBC66 BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
EF123
BBC66
DF123
ABC56 DF123 DF123
EF123 ABC56 ABC56
BBC66
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123
BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123
BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
EF123 EF123
BBC66 BBC66
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
DF123 DF123 DF123 DF123
ABC56 ABC56 ABC56 ABC56
DF123
DF123 DF123 ABC56
ABC56 ABC56
DF123
ABC56 DF123 DF123
ABC56 ABC56
Orphaned Blocks
• It does not matter who minded the block first. The only thing that
matters is who has the longest chain.
• Ideally wait for 6 confirmations before considering the
transaction to be successful.
6 confirmations
The 51% Attack
• The 51% attack is not about 51% of the network conspiracy against a single node
as it is practically impossible.
• The 51% attack is about having the control over the hashing power.
The 51% Attack
The 51% Attack
The 51% Attack
The 51% Attack
The 51% Attack
Broadcast
The 51% Attack
Broadcast
The 51% Attack
Broadcast
The 51% Attack
Broadcast
The 51% Attack
Broadcast
Transaction
and UTXOs
Transaction and UTXOs
• Transactions of Cryptocurrency are different from normal transactions
• A UTXO (Unspent transaction output) is the amount of digital currency remaining
after a cryptocurrency transaction
• To carry out transactions a cryptocurrency wallet is needed
• A wallet (device or program) stores cryptocurrency keys and allows to access coins.
a public key is a wallet address, and a private key is needed to sign transactions.
• In Blockchain, transactions once added never changed, and history remains forever
• The unspent transactions are chosen for further transactions
Transaction and UTXOs
Arjun-> Me 0.4 BTC
Raj -> Me 0.3 BTC
UTXOs Let say I buy coffee for 0.5 BTC.
Alice -> Me 0.7 BTC
Bob -> Me 0.1 BTC
Transaction :
Input: Output:
0.5 BTC to the coffee shop.
0.7 BTC from Alice
0.2 BTC back to me.
Transaction and UTXOs
Arjun-> Me 0.4 BTC
Raj -> Me 0.3 BTC
UTXOs Let say I buy coffee for 0.5 BTC.
Alice -> Me 0.7 BTC
Bob -> Me 0.1 BTC
UTXO for the coffee
Transaction : shop.
Input: Output:
0.5 BTC to the coffee shop.
0.7 BTC from Alice
0.2 BTC back to me.
Transaction and UTXOs
Input: Output:
Arjun-> Me 0.4 BTC
Raj -> Me 0.3 BTC 1.4 BTC to the noodles shop.
Alice -> Me 0.7 BTC
Transaction and UTXOs
Get Noodles
Updated UTXOs
Transaction
Fee
Transaction Fee
Arjun-> Me 0.4 BTC
Raj -> Me 0.3 BTC
UTXOs Let say I buy coffee for 0.5 BTC.
Alice -> Me 0.7 BTC
Bob -> Me 0.3 BTC
Transaction :
Input: Output:
0.5 BTC to the coffee shop.
Transaction :
Input: Output:
0.5 BTC to the coffee shop.
Transaction :
Input: Output:
0.5 BTC to the coffee shop.
Block 3
Block 3
Message
Verification
Function
Signature
Yes/No
Public Key vs
Bitcoin Address
Public Key vs. Bitcoin Address
• Public key and Bitcoin address are not the same
• A transaction is made to others using public, whereas a bitcoin address is used
for getting transactions
• To handle a Bitcoin the Bitcoin addresses are used to make it more secure
• An extra layer of security is added to the bitcoin address.
• If a hacker tries to get a private key, he must find out a public key from a Bitcoin
address, and then using the public key he will try for the private key.
Private and Public Key
Private Key Public Key
Message
Verification
Function
Signature
Yes/No
Private and Public Key
Bitcoin
Private Key Public Key
Address
Message
Verification
Function
Signature
Yes/No
Segregated
Witness
Segregated Witness
• The current block size of Bitcoin is 1 MB
• Increasing the block size will decrease the transaction time
• A big block needs more bandwidth, thus, will slow down the blockchain system
• 60-65% of the transaction space is given to signature and public key
• Now as the transactions are increased, 1 MB block size is no more sufficient
• The blockchain community separates the signature and public key from the
transaction and will be sent separately.
• Now, 1 MB block can store more transactions, as transactions take less space
Segregated Witness
Block No.-1
xxx
6f1d6254d28efe436a89e74d51556
Transactions:
85fec8c76a43e8122e0d15fab5dcc4 From: X
1 MB
6f1d6254d28efe436a89e74d51556 To: Y
6f1d6254d28efe436a89e74d51556
Amount: 0.3 BTC
Message
Verification
Function
Signature
Yes/No
Hierarchically Deterministic (HD) Wallets
Master Private
Private Key 1 Public Key 1 Address 1
Key
Hierarchically Deterministic (HD) Wallets
Master Private
Private Key 1 Public Key 1 Address 1
Key
+1
Private Key 2 Public Key 2 Address 2
Hierarchically Deterministic (HD) Wallets
Master Private
Private Key 1 Public Key 1 Address 1
Key
+1
Private Key 2 Public Key 2 Address 2
+2
Private Key 3 Public Key 3 Address 3
Hierarchically Deterministic (HD) Wallets
Master Private
Private Key 1 Public Key 1 Address 1
Key
+1
Private Key 2 Public Key 2 Address 2
+2
Private Key 3 Public Key 3 Address 3
+3
Private Key 4 Public Key 4 Address 4
Hierarchically Deterministic (HD) Wallets
Master Private
Private Key 1 Public Key 1 Address 1
Key
+1
Private Key 2 Public Key 2 Address 2
+2
Private Key 3 Public Key 3 Address 3
+3
Private Key 4 Public Key 4 Address 4