Introductory lesson for the Bitcoin and Blockchain Technology course of Milano Bicocca University (2017)
Video (in Italian) available at https://goo.gl/tbB4Pu
Injustice - Developers Among Us (SciFiDevCon 2024)
Â
Bitcoin and Blockchain Technology: An Introduction
1. Bitcoin and Blockchain Technology
An Introduction
ferdinando@ametrano.net
https://github.com/fametrano
https://twitter.com/Ferdinando1970
https://speakerdeck.com/nando1970
https://www.reddit.com/user/Nando1970/
https://www.slideshare.net/Ferdinando1970
https://it.linkedin.com/in/ferdinandoametrano
https://www.youtube.com/c/FerdinandoMAmetrano
2. Table of Contents
1. Introduction
2. A Short History
3. Protocol and Currency
4. Money and Gold
5. Blockchain Without Bitcoin
Ferdinando Ametrano 2017 2/68
3. Understanding Lags Well Behind the Hype
Understanding of the technology however lags well
behind the hype, amongst practitioners, policy makers
and industry commentators alike. âBlockchainâ
technology seems to promise major change for capital
markets and other financial services â some say it may
ultimately prove to be as important an innovation as
the internet itself â but few can say exactly how or why.
Michael Mainelli, Alistair Milne (2016)
The Impact and Potential of Blockchain on the Securities Transaction Lifecycle
http://ssrn.com/abstract=2777404
Ferdinando Ametrano 2017 3/68
4. Why Bitcoin Is Hard to Understand
At the crossroads of:
1. Cryptography
2. Computer networking and data transmission
3. Game theory
4. Economic and monetary theory
Mainly not a technology,
a cultural paradigm shift instead
Ferdinando Ametrano 2017 4/68
5. ⢠Decentralized digital currency
⢠Not backed by any government or organization
⢠Instantaneous peer-to-peer transactions
⢠No need for trusted third party
⢠Cryptographic security
⢠Synergic economic incentives
⢠Efficient low-cost banking for everybody everywhere
https://bitcoin.org/en/faq
http://www.coindesk.com/information/
Ferdinando Ametrano 2017 5/68
6. The Information Economy
⢠Data is transferred with zero marginal cost
⢠Why pay a fee to move bytes representing wealth?
⢠Why only 9-5, Monday-Friday, two days settlement?
⢠Who (and when) will gift humanity with a global
instantaneous free p2p payment network?
BANK
Ferdinando Ametrano 2017 6/68
7. Bitcoin
⢠Decentralized: no central authority, no intermediaries
⢠Permissionless: no regulator
⢠Censorship resistant: no frozen funds
⢠Open-access: no discrimination, no amount limits, 24/7, 365 days
⢠Free: negligible transaction costs
⢠Borderless: no geographic limits
⢠Transnational: no specific jurisdiction applies
⢠Secure: non falsifiable, non repudiable transactions
⢠Resilient: nothing has been able to stop it or break it
Ferdinando Ametrano 2017 7/68
10. December 2013: China Crackdown
⢠Peopleâs Bank of China crackdown:
â prohibits financial institutions from trading, underwriting, or
offering insurance in bitcoins or any other digital currency
â Bitcoin is not to be considered a currency
â owning bitcoins is not outlawed or prohibited
⢠As of December 2013 BTC China was world's largest Bitcoin
exchange by volume
⢠Alibaba, China's top Internet retailer, stopped using bitcoins
as of January 19 2014
Ferdinando Ametrano 2017 10/68
11. February 2014: Mt Gox Bankruptcy
⢠As of January 2014 Mt Gox was world's largest Bitcoin
exchange by volume
⢠In February 2014 it filed for bankruptcy protection
from creditors
⢠It announced that around 850,000 bitcoins belonging
to customers and the company were missing and likely
stolen, an amount valued at more than $450 million at
the time
⢠Fraud or theft?
Ferdinando Ametrano 2017 11/68
12. Silk Road
⢠Online market, operated as a Tor hidden service
⢠Online users were able to buy illicit goodies using bitcoins,
while browsing it anonymously and securely without
potential traffic monitoring
⢠Launched in February 2011, shut down in October 2013
⢠Ross William Ulbricht, alleged to be the owner of Silk Road,
arrested in San Francisco, sentenced to life in prison
⢠Other black markets have filled in as successors
Ferdinando Ametrano 2017 12/68
13. Bitcoin Resilience
⢠Is there anything else in financial world:
⢠Just 8 years old
⢠Without government or corporation backing
⢠That can lose its main (China) market
⢠Fraud/theft at its main reference exchange (Mt Gox)
⢠With such a bad reputation (Silk Road)
⢠That could be still alive and kicking?
Ferdinando Ametrano 2017 13/68
14. Bitcoin Used by Terrorists
Europol:
⢠Despite third party reporting suggesting the
use of anonymous currencies like Bitcoin by
terrorists to finance their activities, this has
not been confirmed by law enforcement
https://www.europol.europa.eu/sites/default/files/publications/changes_in_modus_operandi_of_is_in_terrorist_attacks.pdf
Ferdinando Ametrano 2017 14/68
15. Bitcoin for
Money Laundering
UK HM Treasury: The money
laundering risk associated
with digital currencies is low,
though if the use of digital
currencies was to become
more prevalent in the UK
this risk could rise
https://www.gov.uk/government/publications/uk-
national-risk-assessment-of-money-laundering-and-
terrorist-financing
Ferdinando Ametrano 2017 15/68
16. Ransomware
⢠A malware propagated via infected email
attachments and botnets
⢠when activated, it encrypts files stored on
local and mounted network drives
⢠then it displays a message which offers to
decrypt the data if a bitcoin payment is made
Ferdinando Ametrano 2017 16/68
18. Table of Contents
1. Introduction
2. A Short History
3. Protocol and Currency
4. Money and Gold
5. Blockchain Without Bitcoin
Ferdinando Ametrano 2017 18/68
19. Private Monies
⢠A widely accepted medium of exchange or payment
â issued by a non-governmental body
â without legal privileges
⢠Private monies do not have to be generally acceptable; they merely have
to be accepted in a given economic community
⢠Public demand for private currencies:
â hold them in the expectation that they will not diminish in purchasing power
as state money has
â wish to be part of a movement against increasing state control of economic
and personal behavior
â conduct illegal activity
â just want better money
Ferdinando Ametrano 2017 19/68
20. Liberty Dollar: 1998-2009
⢠Private mint that issued gold and silver coins; also issued notes
redeemable in precious metals
⢠Periodically revalued against USD: the value of the latter fell over time
against precious metals
⢠Specifically designed to function in parallel with and in competition to USD
⢠Never marketed or represented as official US currency
⢠Highly successful: it became the second most popular currency in the US
⢠Its use declared a federal crime by the US government
⢠Its founders convicted for counterfeiting, fraud and conspiracy against the
United States
Ferdinando Ametrano 2017 20/68
21. E-gold: 1996-2007
⢠Digital payment system with gold as unit of account
⢠User accounts backed by gold reserves
⢠By 2005, e-gold had grown to be second only to PayPal in the online
payments industry: 1.2M accounts and $1.5B transactions
⢠Indicted in April 2007 by US law enforcement services
⢠Charges: unlicensed money-transmitting entity and a means of moving the
proceeds of illegal activities
⢠Never proven and even the judge expressed major doubts
⢠âOffshoreâ payment system rather than a money transmitter or bank as
defined under then-existing regulations, not least because gold was not
legally âmoneyâ
Ferdinando Ametrano 2017 21/68
22. Double Spending Problem
⢠To securely transfer value using digital means
has been possible for decades
⢠In digital cash schemes, a single digital token,
being just a file that can be duplicated, can be
spent twice
⢠A centralized trusted party has always been
required to prevent double spending
Ferdinando Ametrano 2017 22/68
23. Precursors
⢠Ecash, David Chaum, 1982 (blind signature)
⢠Hashcash, Adam Back, 1997 (Proof-of-Work)
⢠B-money, Wei Dau, 1988 (distributed database)
⢠Bit gold, Nick Szabo, 1998 (distributed database,
sequential money creation)
⢠Anonymous Electronic Cash, Tomas Sander and Amnon
Ta-Shma, 1999 (anonymity)
⢠Reusable P-o-W, Hal Finney, 2004
Ferdinando Ametrano 2017 23/68
24. The Announcement
From: Satoshi Nakamoto <satoshi <at> vistomail.com>
Subject: Bitcoin P2P e-cash paper
Newsgroups: gmane.comp.encryption.general
Date: 2008-10-31 18:10:00 GMT
I've been working on a new electronic cash system that's fully peer-to-peer, with no trusted third party.
The paper is available at: http://www.bitcoin.org/bitcoin.pdf
The main properties:
Double-spending is prevented with a peer-to-peer network.
No mint or other trusted parties.
Participants can be anonymous.
New coins are made from Hashcash style proof-of-work.
The proof-of-work for new coin generation also powers the network to prevent double-spending.
Bitcoin: A Peer-to-Peer Electronic Cash System
Abstract. A purely peer-to-peer version of electronic cash [âŚ]
Satoshi Nakamoto
---------------------------------------
The Cryptography Mailing List
Ferdinando Ametrano 2017 24/68
25. Satoshi Nakamoto
⢠Worked on Bitcoin since probably 2007
⢠Published the paper in 2008
⢠Released the code in January 2009
⢠Stopped involvement mid-2010
⢠Entrusted the project and a copy of the alert key to Gavin Andresen,
effectively his successor
⢠Unknown identity: pseudonymous person or group?
⢠He owns about 1M bitcoins, never spent
http://mag.newsweek.com/2014/03/14/bitcoin-satoshi-nakamoto.html
https://www.wired.com/2016/05/craig-wright-privately-proved-hes-bitcoins-creator/
http://www.bbc.com/news/technology-36168863
Ferdinando Ametrano 2017 25/68
26. Nakamoto's Political Motivations
⢠"Yes, [we will not find a solution to political problems in
cryptography,] but we can win a major battle in the arms race and
gain a new territory of freedom for several years. Governments are
good at cutting off the heads of a centrally controlled networks like
Napster, but pure P2P networks like Gnutella and Tor seem to be
holding their own."
⢠"[Bitcoin is] very attractive to the libertarian viewpoint if we can
explain it properly. I'm better with code than with words though."
⢠In the Bitcoin's transaction database, the first entry has a note by
Nakamoto: "The Times 03/Jan/2009 Chancellor on brink of second
bailout for banks"
Ferdinando Ametrano 2017 26/68
27. Source Code License
Bitcoin was released under the MIT license, so it is:
⢠open source; cryptographic softwareâs source code
must be available to allows public inspection (absence
of backdoor and security vulnerabilities)
⢠free software; the user the right to use, copy, modify,
and redistribute the software
⢠Instead, proprietary software is often close source and
it only grants the right to use
Ferdinando Ametrano 2017 27/68
28. Table of Contents
1. Introduction
2. A Short History
3. Protocol and Currency
4. Money and Gold
5. Blockchain Without Bitcoin
Ferdinando Ametrano 2017 28/68
29. Bitcoin: A Protocol and a Currency
⢠Bitcoin: protocol, software, and community
⢠bitcoins: units of the currency
bitcoins are sent using Bitcoin
⢠bitcoins are the first powerful Bitcoin protocol
application: a native digital asset created inside
the protocol
Ferdinando Ametrano 2017 29/68
30. Bitcoin: The Protocol
⢠Distributed public ledger of transactions
⢠shared with peer-to-peer technology
⢠allowing the ownership transfer of a native digital scriptural asset
⢠a âdigital tokenâ that can be exchanged, but not duplicated
⢠keeps records of each and every transaction forever
⢠It could replace any processing central authority
⢠with decentralized peer-to-peer cryptographically secure equivalent
Ferdinando Ametrano 2017 30/68
31. Bitcoins: The Currency
⢠Only exist as public ledger documented transactions
⢠Are associated to public address(es) like
1FEz167JCVgBvhJBahpzmrsTNewhiwgWVG
⢠the bitcoin distributed public ledger certifies for everybody how many
bitcoins are associated to any address
http://blockexplorer.com/address/1FEz167JCVgBvhJBahpzmrsTNewhiwgWVG
It is mine; you are
REALLY
encouraged to tip
Ferdinando Ametrano 2017 31/68
32. Pseudonymity, Anonymity
⢠Bitcoin is really pseudonymous, not anonymous:
⢠The bitcoin address does not provide direct information
about the bitcoin owner
⢠All transactions are transparent to everybodyâs inspection.
⢠Perfect persistent public account history: the public ledger
is forever
https://blockchain.info/
http://blockexplorer.com/
Ferdinando Ametrano 2017 32/68
33. Asymmetric Cryptography:
Public/Private Key Pair
Two mathematically linked keys perform opposite digital
signature functions:
⢠the private (secret) key used to generate the signature
⢠the public key used by anyone to verify the signature
⢠The public key derives from the private key, but the private
key cannot be derived from the public one
Ferdinando Ametrano 2017 33/68
34. Asymmetric Cryptography:
Public/Private Key Pair
⢠A bitcoin address is derived from a public key, but the public
key cannot be derived from the address
⢠Private key -> public key -> bitcoin address
⢠The corresponding private key allows spending from that
address
Try at https://www.bitaddress.org
Ferdinando Ametrano 2017
https://www.bitaddress.org
34/68
35. A Bitcoin Transaction:
From Address to Address
⢠Transaction: amount + receiverâs address
⢠The senderâs private key signs the transaction
⢠The transaction is broadcasted to the network
⢠With senderâs public key any network node can verify that:
1. The private key has been used, signature has not been forged,
transaction has not been tampered or modified
2. The amount is at senderâs address disposal
⢠The transaction is published to the public ledger
⢠Everybody knows that the receiverâs address has received the
transacted amount
Ferdinando Ametrano 2017 35/68
36. Transactions Cannot Be Altered,
They Could Be Censored
⢠Transactions cannot be altered
⢠Bitcoins cannot be redirected
⢠Transactions could only be censored, as if they
never happened
Ferdinando Ametrano 2017 36/68
37. Bitcoin Safe Custody
⢠Bitcoins are effectively owned by whoever can
spend them
⢠Securing private keys is crucial for safe storage
⢠Wallets can be used to manage keys and
addresses:
â PC client: Bitcoin Core, Armory, Electrum
â Mobile client: greenaddress.it, Copay
â Cold storage: never exposed to Internet, stored away
Ferdinando Ametrano 2017 37/68
38. Bitcoin's Public Ledger: A Chain of Blocks
⢠Transactions are bundled in blocks, sequentially chained, about one
block every 10 minutes
⢠The cryptographic link between blocks requires computing power
to be created
⢠The computing power required to replace or rewrite a block
increases exponentially with the number of blocks chained after it
⢠The blockchain is a history of transactions resilient to network
attackers because it cannot be altered without huge resources
⢠Computing power is measured in hash/s, hash being the basic
operation needed for validation
Ferdinando Ametrano 2017 38/68
40. Hashing With ASICs
⢠Application-Specific Integrated Circuit
⢠Designed and manufactured for a specific
purpose, introduced in 2013 for Bitcoin
⢠Less power consumption, higher hashing
power. Outpaced CPU, GPU, and FPGA
Ferdinando Ametrano 2017 40/68
41. Hash Function
⢠A function that maps input data of arbitrary length to a
hash value, i.e. a output data of a fixed length
â Non-invertible (one-way: input data can not be regenerated from the
hash value)
â Collision-resistant: computationally unfeasible to find 2 inputs that
produce the same output (hash value reliably unique for input data)
⢠The resulting hash value can be considered the unique
digital fingerprint of the input data and it does not reveal
the input data
⢠Bitcoin uses the (Secure Hash Algorithm) SHA-256 that
generates a fixed size 256-bit (32-byte) hash value output
Ferdinando Ametrano 2017 41/68
43. Proof-of-Work
⢠A new block is added with a mathematical proof-of-work based on
SHA-256 hashing. Find a nonce for a given block such that:
⢠SHA-256(previous block hash, transactions, nonce) <= target
⢠The longer chain (actually the one with more proof-of-work) is the
consensus chain
Ferdinando Ametrano 2017 43/68
44. Mining
⢠The network nodes providing hashing power are called mining
nodes or miners.
⢠Miners compete to validate a new block of transactions: the winner
providing proof-of-work is rewarded with the issue of new bitcoins
in a special coinbase transaction included in the block
⢠Miners solve the double spending problem:
â conflicting transactions spending the same coins would invalidate the block
â an invalid block would be rejected from the network
â the bitcoin reward would be removed from transaction history
â miner would have wasted his work
Ferdinando Ametrano 2017 44/68
45. Distributed Consensus
⢠How do miners reach consensus on the
transaction history?
⢠Consensus in an asynchronous network with
faulty (or malicious) nodes is proved to be
impossible
⢠a very hard problem known as Byzantine
General Problem
Ferdinando Ametrano 2017 45/68
46. The Byzantine Generals' Problem
⢠Generals can communicate using messengers,
cannot have a summit
⢠There are traitors amongst them
⢠Must decide unanimously whether to attack
⢠Success (i.e. fault tolerance) is achieved if the
loyal generals can agree on their strategy,
whatever it might be
Ferdinando Ametrano 2017 46/68
47. Nakamoto Consensus
⢠Nakamoto achieves Byzantine Fault Tolerant Consensus
using (game theory) economic incentive for the mining
nodes to be honest. Bitcoin
â solves double spending without a central trusted party
â can resist attacks of malicious agents, as long as they do not
control network majority
⢠Miners are compensated for their proof-of-work using
seigniorage revenues, i.e. with issuance of new bitcoins
⢠Seigniorage revenues subsidize the network, making
transaction almost free
Ferdinando Ametrano 2017 47/68
48. Network Costs Covered By Seigniorage Revenues
⢠144 blocks per day, 365 days per year
⢠12.5 BTC per block, $3,000 per BTC
Currently about $2 billions per year (as of June 2017)
Ferdinando Ametrano 2017 48/68
50. Validation Process: Block Generation
The proof-of-work difficulty is adapted to the overall available computing
power to ensure an average of one block every ten minutes
Ferdinando Ametrano 2017 50/68
51. Bitcoin Monetary Rule
⢠2009: 50BTC per block, every 10 minutes
â halving every 4Y
⢠This is the only way new bitcoins are released
⢠It is called mining because of its similarity with
the progressive scarcity of gold extraction
⢠Supply free of discretionary intervention
Ferdinando Ametrano 2017 51/68
52. Bitcoin Inelastic Supply:
Deterministic Decreasing Rate
chart
Ferdinando Ametrano 2017
2029: 96.88% of
all BTC issued
2141: last satoshi
(0.00000001 BTC)
will be issued
52/68
53. What after 2141?
⢠We are all dead ;-)
⢠Switch over to a fee-based system: as block
space is limited, market is already requiring a
growing satoshi/byte fee to be included into a
block
⢠Switch to a different paradigm?
Ferdinando Ametrano 2017 53/68
54. Table of Contents
1. Introduction
2. A Short History
3. Protocol and Currency
4. Money and Gold
5. Blockchain Without Bitcoin
Ferdinando Ametrano 2017 54/68
55. What Makes Bitcoin Special?
⢠Digital and scriptural: it only exists as validated transaction
⢠Asset, not liability
⢠Bearer instrument
⢠It can be transferred but not duplicated
(i.e. it can be spent, but not double-spent)
⢠Scarce in digital realm, as nothing else before
⢠Mimicking gold monetary policy
⢠More a crypto-commodity then a cryptocurrency
Bitcoin is digital gold
this is the brilliant groundbreaking achievement by Satoshi Nakamoto
Ferdinando Ametrano 2017 55/68
56. Trade Economy
From Gold Standard to Fiat Money
⢠Gold: the commodity money standard
â scarce
â pleasant color, i.e. resistant to corrosion and oxidation
â high malleability
â relative easiness of its purity assessment
⢠Gold purity certification
⢠Representative money
⢠Fractional receipt money
⢠Fiat money and legal tender
Ferdinando Ametrano 2017 56/68
57. Money As A Social Relation Instrument
1. Human beings are born into a gift economy
2. Enlarged relationship circle requires exchange
economy
3. Barter economy: coincidence of wants
4. Trade economy: money as medium of exchange
5. Global information economy: supranational digital
money
Ferdinando Ametrano 2017 57/68
58. Friedrich August von Hayek
Denationalisation of Money
⢠history of coinage is an almost uninterrupted story of debasements; history is
largely a history of inflation engineered by governments for their gain
⢠why government monopoly of the provision of money is regarded as
indispensable? It deprived public of the opportunity to discover and use a better
reliable money
Blessed will be the day when it will no longer be from the benevolence of the
government that we expect good money but from the regard of the banks for their
own interest
A Free-Market Monetary System, Gold and Monetary Conference, New Orleans, Nov. 1977, https://mises.org/daily/3204
Hayek, F. A., Denationalisation of Money, The Institute of Economic Affairs, http://www.mises.org/books/denationalisation.pdf
Ferdinando Ametrano 2017 58/68
59. Permissionless Innovation
Fast and Effective
⢠No centralized security mechanism, no barrier to
enter, no editorial control
â Email has not been designed by a consortium of postal
agencies
â Internet has not been developed by a consortium of telcos
⢠Will a decentralized transactional economy be
shaped by a consortium of banks?
Ferdinando Ametrano 2017 59/68
60. Explain Money to an Alien
fiat money
⢠No intrinsic value (legal
tender, social contract)
⢠Currency based on
paper/ink security
⢠Discretionary governance
⢠Wicksellian interest-rate
approach
bitcoin
⢠No intrinsic value (digital
gold)
⢠Currency based on
math/cryptographic security
⢠Algorithmic governance
⢠Deterministic supply
Ferdinando Ametrano 2017 60/68
61. Bitcoin as (Digital) Gold
in the History of (Crypto)Money
gold
⢠Its adoption was not centrally
planned
⢠For centuries it has been the
most successful form of money
⢠It has bootstrapped all monetary
systems we know of
⢠It has been surpassed by other
kind of money without becoming
obsolete
bitcoin
⢠Its adoption has not been centrally
planned
⢠It is the most successful form of
cryptocurrency
⢠It will bootstrap new monetary
systems
⢠It might be surpassed by more
advanced type of cryptocurrencies
without becoming obsolete
Ferdinando Ametrano 2017 61/68
63. Table of Contents
1. Introduction
2. A Short History
3. Protocol and Currency
4. Money and Gold
5. Blockchain Without Bitcoin
Ferdinando Ametrano 2017 63/68
64. âBlockchain â
not bitcoin â
will prove
revolutionary
in bankingâ
http://www.economist.com/news/leaders/21677198-technology-behind-bitcoin-could-transform-how-economy-works-trust-machine
Ferdinando Ametrano 2017 64/68
65. Bitcoin in 2014 Is Like Internet in 1994: Weird and Scary
Marc Andreessen: American entrepreneur, investor, and software engineer.
Coauthor of Mosaic, cofounder of Netscape
https://twitter.com/pmarca/status/677658844504436737
Ferdinando Ametrano 2017 65/68
66. The Walled Garden Model
⢠Controlled access to web content and services
⢠Offered in the late â90s and early â00s by
Compuserve, AOL (and to some extent MSN)
⢠Corporates wanted to go online, but not in the
wild unregulated internet, populated by
anonymous agents
⢠They eventually realized that perceived risks,
which are real, are outweighed by benefits
Ferdinando Ametrano 2017 66/68
67. Confucius, The Moon, and The Finger
âWhen a wise man points at the moon the imbecile
examines the finger.â (Confucius)
âWhen a wise man points at the bitcoin the imbecile
examines the blockchain.â (Ametrano)
To the Moon!
Ferdinando Ametrano 2017 67/68
68. Bibliography
⢠Satoshi Nakamoto,
Bitcoin: A Peer-to-Peer Electronic Cash System (2008)
https://bitcoin.org/bitcoin.pdf
⢠Ferdinando Ametrano,
Bitcoin, Blockchain and Distributed Ledger
Technology: Hype or Reality? (2017)
https://goo.gl/Z9OeHt
Ferdinando Ametrano 2017 68/68