An overview of bitcoin and the blockchain with a more in-depth description of proof of work (POW). Conde samples used to demonstrate the concepts behind POW are available at http://jamespflynn.com.
3. About Jim Flynn
●
Started built & sold tech companies
●
Jobs:
– Software engineer
– Hardware engineer
– Sales executive, CEO, etc.
●
More at jamespflynn.com
●
www.linkedin.com/in/jamespeterf
7. Enter Satoshi Nakamoto
J
?
“A purely peer-to-peer version of electronic cash would
allow online payments to be sent directly from one party
to another without going through a financial institution.”
8. Satoshi’s Crypto-Currency Commandments
Thou Shalt NOT: Thou Shalt:
1. worship centralized authorities
2. covet they neighbor’s bitcoin
(except with the right private key)
3. alter completed transaction
4. inflate
5. double spend
1. govern thyselves by cons
2. rely’th on incentives
3. have faith in cryptograph
for the geeks shall inherit th
earth
9. Blockchain Defined
●
Distributed database
●
Good for time-ordered data
●
Not owned or controlled by one entity (bitcoin’s case)
●
Each block connected to previous block
●
Anyone can validate the ledger, which contains a
record of every transaction.
13. Blockchain = Shared Distributed Truth
My database
says X.
My database
says Y.
14. Blockchain = Shared Distributed Truth
My database
says X.
My database
says Y.
The blockchain says Z.
15. What does “hash” mean to you?
●
Creates a “fingerprint” of data
– Ex: Hash(“123”) = c74b6bd9a2f7648a
●
SHA256 (used in bitcoin)
– Easily-verified from data
– Cannot recreate the data
19. Bitcoin Identity
●
You get paid to your public key
– 02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc
●
You pay with your private key
●
No issuing authority
22. Adding Blocks in Bitcoin
●
Uses “proof-of-work”
●
“Miners” compete to add blocks
– More hash power = higher probability to win
– Reward: 12.5 bitcoins and transaction fees
– Puzzle solved (new block) about every 10 minutes
– Puzzle difficulty adjusted ever two weeks
●
Nodes recognize the longest valid chain
27. “On a high-end desktop...it would take you several hundred
thousand years on average at the early-2015 difficulty level (267
)
to find a valid block.”
Don’t try this at home.
Bitcoin and Cryptocurrency Technologies
Princeton University Press, 2016
Page 112
28. What the fork?
●
Forks happen when nodes disagree about the longest valid chain.
●
Forks can cause havoc.
●
Built-in incentives to discourage forks.
30. Simplified Smart Contract Example
parentState = SSA.lookupState(‘055051805’)
kidMaried = MA.lookupMarriageLic(‘055051805’)
publicKey = ‘02a1633cafcc01ebfb6d78e39f6’
If parentState = “Dead” then
If kidMarried = “True” then
Pay(kid.publicKey)
Marriage
Licenses
Death
Records
33. Ready to dive in?
Proof of Work
(POW)
●
Look at some code
●
Run some tests
34. POW = Solve a Puzzle
Find a number that, when combined with
the transaction data, hashes to a value
that’s less than a given tolerance.
35. 1 10 trillion
Probability that a hash will be any one number
on continuum that is within the tolerance is 50%
of 1/10 trillion.
50% change of winning in one try.
Tolerance = 5T
Losing
hashes
Winning
hashes
Half the Time You’re a Winner!
Range of possible hash values
36. 10% change of winning in one try.
10% of the Time You’re a Winner.
1 10 trillion
Losing
hashes
Winning
hashes
Range of possible hash values
Tolerance = 1T
38. Loop through nonce values from 1 to the max times you want to try
End Loop
Solving the Puzzle in Pseudo Code
Compute hash of transaction text concatenated with the nonce
If the hash starts with the minimum number of zeros then
Display a success message
Stop