Distributed 10
Distributed 10
2019-2020
http://www.cslab.ece.ntua.gr/courses/distrib
Blockchain Defined
Simply defined a Blockchain is little more than a:
• Distributed
• Secure
• Ledger (logfile)
* Halloween
Features of Bitcoin
• Essentially it’s “deflationary” – the reward is cut in half every four
years
• Nearly infinitely divisible currency units supporting eight decimal
places 0.00000001 (known as a Satoshi)
• Nominal transaction fee’s paid to the network
– Same cost to send $.01 as $1,000,000
• Consensus driven – no central authority
• Counterfeit resilient
– Cannot add coins arbitrarily
– Cannot be double-spent
• Non-repudiation – aka “gone baby gone” – no recourse and no
5
one to appeal to return sent tokens
When did it start?
• “Satoshi Nakamoto” created the reference implementation that
began with a Genesis Block of 50 coins
• 2008
– August 18 Domain name "bitcoin.org" registered[1].
– October 31 Bitcoin design paper published
– November 09 Bitcoin project registered at SourceForge.net
• 2009
– January 3 Genesis block established at 18:15:05 GMT
– January 9 Bitcoin v0.1 released and announced on the cryptography
mailing list
– January 12 First Bitcoin transaction, in block 170 from Satoshi to Hal Finney
https://en.bitcoin.it/wiki/History 6
Why does it have value?
7
Why does it matter?
http://coinmarketcap.com
BitCoin: Challenges
• All virtual currency must address the following challenges:
– Creation of a virtual coin/note
• How is it created in the first place?
• How do you prevent inflation? (What prevents anyone from creating
lots of coins?)
– Validation
• Is the coin legit?
• How do you prevent a coin from double-spending?
• Bitcoin takes a infrastructure-less approach
– Rely on proof instead of trust
– No central bank or clearing house
Bitcoin: Motivation
Rely on proof instead of trust
– Current online transactions rely on a trusted party (e.g, VISA)
– They take some risk, manage fraud, and get paid a fee.
• Buyer and Seller protection in online transcations
– Buyer pays, but the seller doesn’t deliver Solved by using an
escrow (Buyer protection)
– Seller delivers, buyer pays, but the buyer makes a claim. VISA
refunds; the payment is reversed. Either the seller is penalized
and/or VISA charges more fee to handle these cases. Some
behaviors are fraudulent.
• BitCoin gets rid of this trusted middleman, by being able to directly
show the cryptographic proof that the money is transferred.
Four components in secure
communication
• Authentication
• Confidentiality
• Integrity
• Availability
What do we want to secure?
• Authentication (Who am I talking to?)
– Identification and assurance of the origin of
information
• Confidentiality (Is my data hidden?)
– Concealment of information
• Integrity (Has my data been modified?)
– Prevent improper and unauthorized changes
• Availability (Can I use the resources?)
– The ability to use the information or resource desired
From the perspective of BitCoin
• Authentication
– Am I paying the right person? Not some other
impersonator?
• Integrity
– Is the coin double-spent?
– Can an attacker reverse or change transactions?
• Availability
– Can I make a transaction anytime I want?
• Confidentiality
– Not very relevant. But privacy is important.
From the perspective of BitCoin
• Authentication Public Key Crypto: Digital Signatures
– Am I paying the right person? Not some other
impersonator?
• Integrity Digital Signatures and Cryptographic Hash
– Is the coin double-spent?
– Can an attacker reverse or change transactions?
• Availability
– Can I make a transaction anytime I want?
• Confidentiality
– Not very relevant. But privacy is important.
Cryptographic Hash Functions
• Consistent: H(X) always yields same result
• One-way: given Y, hard to find X s.t. H(X) = Y
• Collision resistant: given H(W) = Z, hard to find X
such that H(X) = Z
Bob
Alice Alice
(Public) (Secret)
Alice
Digital Signature
Key Generation Signing Verification
Alice Alice
(Public) (Secret)
Bob Alice
Goal: Bob should be sure
Digital Signature that the message
originates from Alice.
Alice
(Public)
Bob
Message
Alice Alice
(Public) (Secret)
Alice A
Digital Signature
Key Generation
Secret
Message
Secret Key
Public Key
Key
Signing
A
Message Public Key A
Verification
Security (informal): You cannot
produce valid signatures without the
secret key.
Back to BitCoins
• Validation
– Is the coin legit? (proof-of-work) Use of
Cryptographic Hashes
– How do you prevent a coin from double-spending?
Broadcast to all nodes
• Creation of a virtual coin/note
– How is it created in the first place? Provide
incentives for miners
– How do you prevent inflation? (What prevents
anyone from creating lots of coins?) Limit the
creation rate of the BitCoins
ATTEMPT #1
Charlie
We will need: all (Public) 17 BTC
computers have the same Dora
0.001 BTC
table. (Public)
Eliza
(Public)
2 BTC
Remark: The public keys
are just bit strings.
Sending Bitcoins
To send money, we use transactions. These are
messages like this:
Alice
from (Public)
Bob
In “short”, transactions
to (Public) look like this: $ F T
A
Sending Bitcoins
I’LL send 0.1
Bitcoin to Bob.
$ F T
Alice
Protocol: sending BTC Protocol: participating
1. Craft a transaction. On valid transactions:
2. Give it to your 1. Update ledger
computer. 2. Relay transaction
Double Spending Thanks
!
I can exploit this!
Bob
These transactions
spend previously Thanks
Black Hat spent bitcoins! !
0000031105830
A block contains
for another block ,
a list of transactions,
“nonce”. 8046465385222
… and so on.
A Tree of Blocks
In general, we can build a tree
of blocks like this.
Two different
block chains
(or blocks)
may satisfy
the required
proof-of-work.
The Protocol for Finding Blocks
A real lot!
Every transaction
Transfer 0.1 BTC specifies a fee. It goes
Alice
to the person who
from (Public) puts the transaction
Bob into a valid block.
to (Public)
A
A
Fee: 0.001 BTC
Recap: The Bitcoin Protocol
Protocol: participate
Relay valid transactions.
Relay valid blocks in the longest chain.
Work with the longest chain.
Protocol: miners
Collect valid transactions.
Publish valid blocks which extend the longest
chain.
Step 1: How does the protocol look like?
BITCOIN’S CONSENSUS PROTOCOL
Step 2: What happens if people cheat?
Double SpendsI found a valid block!
I can exploit this!
Bob
Black Hat
• Ideas:
– Multiparty computation protocols based on the
blockchain.
– Timestamping
– Crowdfunding
– Have your shares in the blockchain
– Smart payments
– etc…
References
• Bitcoin and Cryptocurrency Technologies,
Arvind Narayanan, Joseph Bonneau, Edward
Felten, Andrew Miller, Steven Goldfeder
• Bitcoin: A primer by François R. Velde, senior
economist FRB
• Bitcoin: A Peer-to-Peer Electronic Cash
System, Satoshi Nakamoto
• http://bitcoinbook.cs.princeton.edu/