view.php
view.php
September, 2021
Contents
◦ What is Bitcoin?
◦ Which Bitcoin networks to transact on?
◦ Where to keep your bitcoins?
◦ Ways to pay more securely
◦ How to buy and sell bitcoins?
◦ Transaction fees are optional but …
◦ What does Bitcoin have to do with
blockchain?
◦ How is consensus reached?
◦ What is Bitcoin mining?
https://en.bitcoin.it/w/images/en/4/42/Controlled_supply-supply_over_block_height.png
September, 2021 Bitcoin in a Nutshell 5
Needs & Goals of Beneficiaries & Stakeholders
Insurers
a chain of blocks
https://btc.com/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
▪ The coinbase message
“04ffff001d0104455468652054696d657320
30332f4a616e2f32303039204368616e6365
6c6c6f72206f6e206272696e6b206f662073
65636f6e64206261696c6f757420666f7220
62616e6b73” captures the heading “The
Times 03/Jan/2009 Chancellor on brink of
second bailout for banks” in The Times
▪ This was probably intended as proof that
the block was created on or after January 3,
2009
September, 2021 Bitcoin in a Nutshell 11
Users can pay for
their bookings
with more than 30
cryptocurrencies,
including bitcoin,
in addition to
traditional
payments
https://news.bitcoin.com/700000-expedia-travala-hotels-cryptocurrencies/
September, 2021 Bitcoin in a Nutshell 12
Which Bitcoin networks to
transact on?
▪ Coins for the Testnet are given out for free from what are called Faucet
Websites (e.g. http://bitcoinfaucet.uo1.net/, https://testnet-
faucet.mempool.co/)
▪ These websites are set up by miners or other users with a surplus of Testnet
coins
▪ They send coins to anyone who requests them and kindly asks for their return
when the user is finished with them What is total supply of
▪ Testnet requires no separate installation bitcoin on a testnet?
▪ Bitcoin wallets that have the ability to connect to the Testnet can be started
with a special flag that will direct the software to connect to the Testnet
blockchain instead of the main network blockchain
September, 2021 Bitcoin in a Nutshell 15
September, 2021 Bitcoin in a Nutshell 16
http://bitcoinfaucet.uo1.net/ https://testnet-faucet.mempool.co/
Where to keep your bitcoins?
▪ A bitcoin wallet is a
program / app / device /
way that helps send and
receive bitcoin payments
▪ It keeps history of
transactions made
through all wallet
addresses
▪ It reveals the balance of
the wallet containing
bitcoins associated to one
or more bitcoin addresses
September, 2021 Bitcoin in a Nutshell 18
What is kept in a wallet?
▪ Multiple addresses
▪ Multiple private & public keys
▪ Does not store any currency nor wallet balance
▪ In fact, currencies do not get stored in any single location or exist anywhere in any
physical form
▪ All that exists are records of transactions stored on the blockchain
https://bitcoin.org/en/choose-your-wallet
September, 2021 Bitcoin in a Nutshell 21
Creating a Desktop Wallet
▪ Open www.bitcoin.com
▪ Create a new “Personal Wallet”
▪ Enable “testnet” within “advanced options”
if you want to play with simulated currency;
otherwise, do not enable it
Mobile Wallets
▪ The private key is not stored anywhere by digital means, meaning that they are not prone to hardware
failure or cyber attacks
September, 2021 Bitcoin in a Nutshell 28
Paper Wallets
https://www.youtube.com/watch?reload=9&time_continue=237&v=35k3PONYTlg&feature=emb_logo
Let's try
downloading &
installing it to you
laptop & mobile EXODUS WALLET
phone, and discuss
in the next class.
https://www.blockchain.com/charts/market-price?timespan=all
https://coinatmradar.com/country/96/bitcoin-atm-hong-kong/ https://coinmap.org/#/world/33.72433966/14.94140625/2/atm
September, 2021 Bitcoin in a Nutshell 39
Exchange Trades – Using Bitcoin ATMs
▪ bitcoinfees.earn.com provides a
useful statistic: the median byte
size is the most commonly seen
byte size of transactions in the
last several blocks
▪ Also provided in the same page is
a recommended fee for fast
confirmation
▪ Multiplying these two values will
https://www.buybitcoinworldwide.com/fee-calculator/ get the total fee to pay
September, 2021 Bitcoin in a Nutshell 48
What does Bitcoin have to do
with blockchain?
▪ Must have the sender’s private key and receiver’s wallet address
▪ The private key is used to sign the transaction which has the input, the
amount, and the output
▪ The “involved” bitcoins are sent from the bitcoin wallet to the bitcoin
network
▪ Bitcoin miners then verify the transaction, put it into a transaction block,
and finally solve the computational puzzle against the block
▪ Solved puzzle must be verified by other miners through confirmation
and this is why sometimes one may have to wait for them to finish
September, 2021 Bitcoin in a Nutshell 54
Transaction Confirmation
▪ The bitcoin blockchain is designed in such a way that each block takes
on average about 10 minutes to mine
▪ Some merchants will make you wait for the transaction to be confirmed
▪ Meaning that it may take some time before you are allowed to download the
digital goods or enjoy using the paid service
▪ Some merchants will not make you wait for the transaction to be confirmed
▪ This is mostly in cases where the value of a transaction is low, meaning that the risk
of fraud is low
▪ The main chain at any time is ▪ Under most circumstances this is also the chain
whichever valid chain of blocks with the most blocks in it, unless there are two
has the most cumulative Proof-of- equal-length chains and one has more Proof-of-
Work associated with it Work
https://www.coindesk.com/bitcoin-halving-arrives-mining-rewards-drop-for-third-time-in-history
September, 2021 Bitcoin in a Nutshell 71
Block height is at 650,490 as of 29th Sept, 2020
https://www.blockchain.com/btc/blocks
https://www.statista.com/chart/18632/estimated-annual-electricity-consumption-of-bitcoin/
September, 2021 Bitcoin in a Nutshell 79
Power of Work (PoW)
Previous Block Header Hash (32) 0000… assigned to the nonce field
Merkle Root Hash (32) d7c3….
Timestamp (4) 2010-11-08 15:34:22 ….
00000001….
Difficulty Target (4) 1.00000000
….
Nonce (4) What value to assign?
Nonce
000000004ff..
….
✓ Block header hash values are valid
Transaction Counter (1-9) 3 only if they are below the specified
= 2063568441 ….
000000002….
difficulty target, often interpreted as
Transactions (< 1,000,000) 1Htz....(50) the number of leading zeros required
1K3d….(50) > 1Lgs….(50) 000000001….
1E7o….(50) > 12Qy….(10), …. 000000000….
In the case of the 500th block, the winning miner assigned 2063568441 to the nonce field.
September, 2021 Bitcoin in a Nutshell 81
Mining makes Bitcoin special, a decentralized security
mechanism that is the basis for P2P digital cash
▪ The primary purpose of mining is neither the reward for the
miners nor the generation of new coins
▪ Mining is the mechanism that underpins the decentralized
clearing house, by which transactions are validated and
cleared
▪ Mining secures the bitcoin system and enables the
emergence of network-wide consensus without a central
authority
▪ The reward of newly minted coins and transaction fees is
an incentive scheme that aligns actions of the miners with
the security of the network, while simultaneously
implementing the monetary supply
invention
References