KEMBAR78
Intro to Blockchain Slides | PDF
carbonfive.com
Intro to Blockchain
What This Is For and Why It Matters
Shannon E. Wells
Basic understanding
Functioning toy blockchain network
Uses for blockchain
Encouraging your participation
Qs - please write down your Qs for the end!
Goals of This Talk
“I spend every single day full time, trying to keep up with Bitcoin -
just one currency - and it’s almost impossible.”
-- Andreas Antonopoulos
Blockchain >> Cryptocurrency
Cryptocurrency >> Bitcoin
“It’s HUGE. TREMENDOUS!”
-- Not Donald Trump
When I think of blockchain, I think of...
Trust
Ledger
Transparency
Distributed
Private?
Borderless
Encryption
Decentralized?
Cryptocurrency
Smart Contracts
We define an electronic coin as a chain of digital signatures.
-- Satoshi Nakamoto,
“Bitcoin: A Peer-to-Peer Electronic Cash System”
Origin of Blockchain
What’s a transaction?
● Exchange of value
● Cryptographically signed
● Input = ref. to output
● Output = address, or H(public key)
● Payload
The Transaction Sausage
em = SHA256( )MESSAGE:
Give 0.008BTC
to Jane
(r,s) = ECDSA(em,k)
Where:
r = public key
s = signature
k = “random” number
The Transaction Sausage
Where:
r = public key
s = signature
k = “random” number
z = left n bits of em
Private key = sk - z(em)
r
Blockchain address = RIPEMD-160(r)
MUST be unique / message,
and either
● random, or
● derived securely,
or you will be very sad.
Private and Public Keys
Private key
● Generated using random seed.
● To generate public key.
● To sign data.
● Allows you to spend cryptocurrency.
Public key
● To verify signature.
● To derive address (for receiving).
● To create input for a subsequent transaction
What’s in a block?
Txn
No.
To/From Addr Signature Amount Timestamp
0 0x5c0ffee5 bf800d5f7fed483fb4773
2eaea52d6
-0.006 2018-01-01
00:00:00
1 0xdeadbeef 1347736ee88b4f7881e91
f0c32726
0.002 2018-01-01
00:00:01
2 0xba5eba11 e13747454e5c4869adcb0
7698b4d
0.003 2018-01-01
00:00:10
3 0x1d00dle5 b17ad4ef874f4db4991b1
84b1c568
0.001 2018-01-01
00:01:23
total: 0.00
● H(n-1)
● Block ID
● Node ID
● ...
Any computing device which:
● Has been granted access to a blockchain network
● Processes transactions & smart contracts, mines, etc.
What is a node?
● Peer-to-peer group of blockchain nodes
● Using a specific chain/tree of blocks
● Builds consensus
● Confirms transactions
● Distributes blockchain apps, blocks, etc.
The network?
● Assembled by one node
● Posted to network
● Accepted (or not) by others
How is a Block Added?
● Creation of a new coin
● Input: coinbase parameter
● N outputs
● Hash function result must obey certain requirements
E.g. Bitcoin uses a derivative of hashcash, a Proof of Work algorithm. Not all blockchains use Proof of Work.
Constructing a Blockchain
What is Mining?
● Digest
● Authentication
● Digital signature
● Identification
Drilling down:
Cryptographic Hash Functions
Extremely simple hash function:
str = "Blockchain is pretty awesome!"
"%0x" % str.codepoints.reduce(:+)
=> "ae4"
...but this won’t do at all for crypto.
Cryptographic Hash Functions
Cryptographic Hash Functions
For general usability:
● Deterministic
● Quick to compute
For usability in cryptography:
● Collision-free (or practically so)
● Hiding
● Puzzle-friendly
● Sensitive to initial conditions
Cryptographic Hash Functions
Collision-free: really “collision resistant”
Given hash function H, message m1,
Effectively impossible to find a message
m2 != m1 s.t. H(m1) = H(m2)
Examples: SHA256 (Bitcoin), Scrypt (Litecoin), Cuckoo hash cycles
So... blockchain == chain of blocks?
Not really.
● Linked list
OR (more typically)
● Merkle tree -- binary hash tree
...Block 0 B1 B2 Bn-1 Bn
Merkle (Hash) Tree*
* Wikipedia https://en.wikipedia.org/wiki/Merkle_tree
nn-1 data
H(nn-1)
nn data
Tamper Detection
n0 data
H(n0) H(nn)
n1 data
H(n1) H(nn-1)
. . .
✓
A payee can verify the signatures to verify the chain of ownership.
-- Satoshi Nakamoto,
“Bitcoin: A Peer-to-Peer Electronic Cash System”
✓ ✓ X
Consensus Models
Make honesty rewarding and cheating expensive.
● Assign nodes unique IDs
Honest nodes:
● Validate transactions
● Extend only the longest valid blockchain
● Acceptance: include new block in chain when proposing a
new block
● Are rewarded with cryptocurrency
● Txns can “tip” nodes with transaction fees
● Distributed app
● Free to read
● Cost to write
● Permanent
What’s a Smart Contract?
Working blockchain: Ethereum
geth CLI:
● Run local Ethereum network
● Showing balances
● Sending money
● Mining
Solidity language:
● Toy smart contract
● Posting contract to the network
● Posting update to contract
● Proof of Work system
○ Rewards computational power
○ Has centralized mining power
○ Power hog
○ Slow transaction processing*
● Consensus model
○ Can also slow transaction processing*
* Visa: 65k transaction messages / SECOND (capacity as of Aug 2016)
* Bitcoin: < 500k/day
Problems with Blockchain
● What if we lighten computational load, or make use of ASICs* not
beneficial?
■ Scrypt (Litecoin)
■ Cuckoo hash cycles
■ X11: concat different H()
■ Moving target - change H() regularly
* Application-Specific Integrated Circuit, other types include MP3 encoding/decoding, Ethernet, Bluetooth
Proof of Work Alternatives
● Proof of stake
○ Time held
○ Amount held
○ Transactions processed
● “Proof of Love” - reward evangelizers and developers
Proof of Work Alternatives
● What if we made mining do useful work?
○ SETI
○ Protein folding
○ Machine learning
○ Data preservation - Permacoin - storage based
puzzle, distributed storage (Microsoft)
○ Renewables-only mining + use waste heat
○ [ Your great idea here ]
Mining Alternatives
○ Buggy smart contracts (Ethereum DAO, $60M loss)
○ No Kill switch?
○ Gaming the consensus model
○ Malicious nodes (51% attack)
○ Quantum computing?
Other Vulnerabilities
● Digital ID (SelfKey, Ethereum, Metaverse, NameCoin, Rohingya
Project)
● Manufacturing tracking and management (Metaverse + RFID)
● Targeted ads (Basic Attention Token)
● Rewarding content creators (MUSIC, Steem)
● “Smart Economy” - Contracts + ID + Digitized Assets (NEO)
● Enabling international payments (Stellar)
● Secure, socketless distributed OS (ElastOS)
● Gaming/gambling (KittehCoin, BattleCoin)
● Quantum resistant cryptography (IOTA, QRL)
● Proof of ownership/authorship
Blockchain: Not Just About Money
Worst-case scenarios
○ Smart contracts + implants
○ Critical Infrastructure failures
■ Food/bev, fuel, pharmaceutical manufacturing & distribution
■ Power grid, transit grid, communications networks
■ Self-driving vehicles
The Dark Future
What are some situations where trust is lacking, or eroded?
Could blockchain help here?
● Government corruption
● Health care
● Policing
● Campaign funding
● Behavioral economics
● Lending
● Voting
● [Your Great Idea Here]
The Bright Future
Question Time
carbonfive.com
Credits and Resources
Bitcoin White Paper Satoshi Nakamoto bitcoin.org/bitcoin.pdf
Newline: Cryptocurrency for
Web Developers
Nate Murray www.coursera.org/learn/cryptocurrency
Bitcoin and Cryptocurrency
Technologies
Coursera www.coursera.org/learn/cryptocurrency
Cryptographic Hash Function Wikipedia en.wikipedia.org/wiki/Cryptographic_hash_function
Solidity for Ethereum solidity.readthedocs.io
Geth for Ethereum Github github.com/ethereum/go-ethereum/wiki/Geth
carbonfive.com
Credits and Resources, cont.
Visa Facts and Figures, Jan
2017
Visa https://usa.visa.com/dam/VCOM/global/about-visa/d
ocuments/visa-facts-figures-jan-2017.pdf
Bitcoin Wiki https://en.bitcoin.it/wiki/Main_Page
Blockchain 101 Coindesk https://www.coindesk.com/information
Blockchain: Simple
Explanation
Oleg Mazonka, 2016 http://jrxv.net/x/16/blockchain-gentle-introduction.pdf
“Ethereum’s DAO Hacking
Shows that Coders Are Not
Infallible” *
Forbes https://www.forbes.com/sites/francescoppola/2016/0
6/20/the-dao-hacking-shows-that-coders-are-not-infal
lible/#3cf168713983
* Duh.
carbonfive.com
Credits and Resources, cont.
SelfKey selfkey.org
Finnish Immigration Service To Help Unbanked Refugees
www.ccn.com/finns-turn-to-blockchain-to-help-unbanked-refugees-enter-the-digital-economy
Canada in 2018 https://cointelegraph.com/news/blockchain-digital-identification-in-canada-coming-in-2018
Swiss town of Zug Issuing Digital IDs
https://bitcoinmagazine.com/articles/swiss-crypto-valley-create-digital-identities-its-citizens-ethereum-blockchain/
Rohingya Project to Give Stateless Rohingyas Digital IDs
http://techwireasia.com/2017/12/humanitarian-group-uses-blockchain-tech-give-rohingyas-digital-id-cards
NSA Quantum Computing Guidance
www.iad.gov/iad/library/ia-guidance/ia-solutions-for-classified/algorithm-guidance/cnsa-suite-and-quantum
-computing-faq.cfm
Permacoin White Paper | Microsoft
www.microsoft.com/en-us/research/publication/permacoin-repurposing-bitcoin-work-for-data-preservation
carbonfive.com
Credits and Resources, cont.
Blockchain transactions graph | Blockchain.info https://blockchain.info/charts/n-transactions
carbonfive.com
Maneki-neko Beckoning Cat Cinemagraph | gfycat.com https://gfycat.com/gifs/detail/BlandPinkDrever
Corned Beef Hash | Simply Recipes http://www.simplyrecipes.com/recipes/corned_beef_hash/
Merkle Trees + Diagram | Wikipedia https://en.wikipedia.org/wiki/Merkle_tree
Blockchain Tamper Detection | modified from Blockchain: Simple Explanation, by Oleg Mazonka, 2016,
http://jrxv.net/x/16/blockchain-gentle-introduction.pdf
Image Credits
carbonfive.com
Thanks!
And please fill out the session survey!
Shannon E. Wells | shannon@carbonfive.com | shannonwells
San Francisco, California USA

Intro to Blockchain Slides

  • 1.
    carbonfive.com Intro to Blockchain WhatThis Is For and Why It Matters Shannon E. Wells
  • 2.
    Basic understanding Functioning toyblockchain network Uses for blockchain Encouraging your participation Qs - please write down your Qs for the end! Goals of This Talk
  • 3.
    “I spend everysingle day full time, trying to keep up with Bitcoin - just one currency - and it’s almost impossible.” -- Andreas Antonopoulos Blockchain >> Cryptocurrency Cryptocurrency >> Bitcoin “It’s HUGE. TREMENDOUS!” -- Not Donald Trump
  • 4.
    When I thinkof blockchain, I think of... Trust Ledger Transparency Distributed Private? Borderless Encryption Decentralized? Cryptocurrency Smart Contracts
  • 5.
    We define anelectronic coin as a chain of digital signatures. -- Satoshi Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System” Origin of Blockchain
  • 6.
    What’s a transaction? ●Exchange of value ● Cryptographically signed ● Input = ref. to output ● Output = address, or H(public key) ● Payload
  • 7.
    The Transaction Sausage em= SHA256( )MESSAGE: Give 0.008BTC to Jane (r,s) = ECDSA(em,k) Where: r = public key s = signature k = “random” number
  • 8.
    The Transaction Sausage Where: r= public key s = signature k = “random” number z = left n bits of em Private key = sk - z(em) r Blockchain address = RIPEMD-160(r) MUST be unique / message, and either ● random, or ● derived securely, or you will be very sad.
  • 9.
    Private and PublicKeys Private key ● Generated using random seed. ● To generate public key. ● To sign data. ● Allows you to spend cryptocurrency. Public key ● To verify signature. ● To derive address (for receiving). ● To create input for a subsequent transaction
  • 10.
    What’s in ablock? Txn No. To/From Addr Signature Amount Timestamp 0 0x5c0ffee5 bf800d5f7fed483fb4773 2eaea52d6 -0.006 2018-01-01 00:00:00 1 0xdeadbeef 1347736ee88b4f7881e91 f0c32726 0.002 2018-01-01 00:00:01 2 0xba5eba11 e13747454e5c4869adcb0 7698b4d 0.003 2018-01-01 00:00:10 3 0x1d00dle5 b17ad4ef874f4db4991b1 84b1c568 0.001 2018-01-01 00:01:23 total: 0.00 ● H(n-1) ● Block ID ● Node ID ● ...
  • 11.
    Any computing devicewhich: ● Has been granted access to a blockchain network ● Processes transactions & smart contracts, mines, etc. What is a node?
  • 12.
    ● Peer-to-peer groupof blockchain nodes ● Using a specific chain/tree of blocks ● Builds consensus ● Confirms transactions ● Distributes blockchain apps, blocks, etc. The network?
  • 13.
    ● Assembled byone node ● Posted to network ● Accepted (or not) by others How is a Block Added?
  • 14.
    ● Creation ofa new coin ● Input: coinbase parameter ● N outputs ● Hash function result must obey certain requirements E.g. Bitcoin uses a derivative of hashcash, a Proof of Work algorithm. Not all blockchains use Proof of Work. Constructing a Blockchain What is Mining?
  • 15.
    ● Digest ● Authentication ●Digital signature ● Identification Drilling down: Cryptographic Hash Functions
  • 16.
    Extremely simple hashfunction: str = "Blockchain is pretty awesome!" "%0x" % str.codepoints.reduce(:+) => "ae4" ...but this won’t do at all for crypto. Cryptographic Hash Functions
  • 17.
    Cryptographic Hash Functions Forgeneral usability: ● Deterministic ● Quick to compute For usability in cryptography: ● Collision-free (or practically so) ● Hiding ● Puzzle-friendly ● Sensitive to initial conditions
  • 18.
    Cryptographic Hash Functions Collision-free:really “collision resistant” Given hash function H, message m1, Effectively impossible to find a message m2 != m1 s.t. H(m1) = H(m2) Examples: SHA256 (Bitcoin), Scrypt (Litecoin), Cuckoo hash cycles
  • 19.
    So... blockchain ==chain of blocks? Not really. ● Linked list OR (more typically) ● Merkle tree -- binary hash tree ...Block 0 B1 B2 Bn-1 Bn
  • 20.
    Merkle (Hash) Tree* *Wikipedia https://en.wikipedia.org/wiki/Merkle_tree
  • 21.
    nn-1 data H(nn-1) nn data TamperDetection n0 data H(n0) H(nn) n1 data H(n1) H(nn-1) . . . ✓ A payee can verify the signatures to verify the chain of ownership. -- Satoshi Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System” ✓ ✓ X
  • 22.
    Consensus Models Make honestyrewarding and cheating expensive. ● Assign nodes unique IDs Honest nodes: ● Validate transactions ● Extend only the longest valid blockchain ● Acceptance: include new block in chain when proposing a new block ● Are rewarded with cryptocurrency ● Txns can “tip” nodes with transaction fees
  • 23.
    ● Distributed app ●Free to read ● Cost to write ● Permanent What’s a Smart Contract?
  • 24.
    Working blockchain: Ethereum gethCLI: ● Run local Ethereum network ● Showing balances ● Sending money ● Mining Solidity language: ● Toy smart contract ● Posting contract to the network ● Posting update to contract
  • 25.
    ● Proof ofWork system ○ Rewards computational power ○ Has centralized mining power ○ Power hog ○ Slow transaction processing* ● Consensus model ○ Can also slow transaction processing* * Visa: 65k transaction messages / SECOND (capacity as of Aug 2016) * Bitcoin: < 500k/day Problems with Blockchain
  • 26.
    ● What ifwe lighten computational load, or make use of ASICs* not beneficial? ■ Scrypt (Litecoin) ■ Cuckoo hash cycles ■ X11: concat different H() ■ Moving target - change H() regularly * Application-Specific Integrated Circuit, other types include MP3 encoding/decoding, Ethernet, Bluetooth Proof of Work Alternatives
  • 27.
    ● Proof ofstake ○ Time held ○ Amount held ○ Transactions processed ● “Proof of Love” - reward evangelizers and developers Proof of Work Alternatives
  • 28.
    ● What ifwe made mining do useful work? ○ SETI ○ Protein folding ○ Machine learning ○ Data preservation - Permacoin - storage based puzzle, distributed storage (Microsoft) ○ Renewables-only mining + use waste heat ○ [ Your great idea here ] Mining Alternatives
  • 29.
    ○ Buggy smartcontracts (Ethereum DAO, $60M loss) ○ No Kill switch? ○ Gaming the consensus model ○ Malicious nodes (51% attack) ○ Quantum computing? Other Vulnerabilities
  • 30.
    ● Digital ID(SelfKey, Ethereum, Metaverse, NameCoin, Rohingya Project) ● Manufacturing tracking and management (Metaverse + RFID) ● Targeted ads (Basic Attention Token) ● Rewarding content creators (MUSIC, Steem) ● “Smart Economy” - Contracts + ID + Digitized Assets (NEO) ● Enabling international payments (Stellar) ● Secure, socketless distributed OS (ElastOS) ● Gaming/gambling (KittehCoin, BattleCoin) ● Quantum resistant cryptography (IOTA, QRL) ● Proof of ownership/authorship Blockchain: Not Just About Money
  • 31.
    Worst-case scenarios ○ Smartcontracts + implants ○ Critical Infrastructure failures ■ Food/bev, fuel, pharmaceutical manufacturing & distribution ■ Power grid, transit grid, communications networks ■ Self-driving vehicles The Dark Future
  • 32.
    What are somesituations where trust is lacking, or eroded? Could blockchain help here? ● Government corruption ● Health care ● Policing ● Campaign funding ● Behavioral economics ● Lending ● Voting ● [Your Great Idea Here] The Bright Future
  • 33.
  • 34.
    carbonfive.com Credits and Resources BitcoinWhite Paper Satoshi Nakamoto bitcoin.org/bitcoin.pdf Newline: Cryptocurrency for Web Developers Nate Murray www.coursera.org/learn/cryptocurrency Bitcoin and Cryptocurrency Technologies Coursera www.coursera.org/learn/cryptocurrency Cryptographic Hash Function Wikipedia en.wikipedia.org/wiki/Cryptographic_hash_function Solidity for Ethereum solidity.readthedocs.io Geth for Ethereum Github github.com/ethereum/go-ethereum/wiki/Geth
  • 35.
    carbonfive.com Credits and Resources,cont. Visa Facts and Figures, Jan 2017 Visa https://usa.visa.com/dam/VCOM/global/about-visa/d ocuments/visa-facts-figures-jan-2017.pdf Bitcoin Wiki https://en.bitcoin.it/wiki/Main_Page Blockchain 101 Coindesk https://www.coindesk.com/information Blockchain: Simple Explanation Oleg Mazonka, 2016 http://jrxv.net/x/16/blockchain-gentle-introduction.pdf “Ethereum’s DAO Hacking Shows that Coders Are Not Infallible” * Forbes https://www.forbes.com/sites/francescoppola/2016/0 6/20/the-dao-hacking-shows-that-coders-are-not-infal lible/#3cf168713983 * Duh.
  • 36.
    carbonfive.com Credits and Resources,cont. SelfKey selfkey.org Finnish Immigration Service To Help Unbanked Refugees www.ccn.com/finns-turn-to-blockchain-to-help-unbanked-refugees-enter-the-digital-economy Canada in 2018 https://cointelegraph.com/news/blockchain-digital-identification-in-canada-coming-in-2018 Swiss town of Zug Issuing Digital IDs https://bitcoinmagazine.com/articles/swiss-crypto-valley-create-digital-identities-its-citizens-ethereum-blockchain/ Rohingya Project to Give Stateless Rohingyas Digital IDs http://techwireasia.com/2017/12/humanitarian-group-uses-blockchain-tech-give-rohingyas-digital-id-cards NSA Quantum Computing Guidance www.iad.gov/iad/library/ia-guidance/ia-solutions-for-classified/algorithm-guidance/cnsa-suite-and-quantum -computing-faq.cfm Permacoin White Paper | Microsoft www.microsoft.com/en-us/research/publication/permacoin-repurposing-bitcoin-work-for-data-preservation
  • 37.
    carbonfive.com Credits and Resources,cont. Blockchain transactions graph | Blockchain.info https://blockchain.info/charts/n-transactions
  • 38.
    carbonfive.com Maneki-neko Beckoning CatCinemagraph | gfycat.com https://gfycat.com/gifs/detail/BlandPinkDrever Corned Beef Hash | Simply Recipes http://www.simplyrecipes.com/recipes/corned_beef_hash/ Merkle Trees + Diagram | Wikipedia https://en.wikipedia.org/wiki/Merkle_tree Blockchain Tamper Detection | modified from Blockchain: Simple Explanation, by Oleg Mazonka, 2016, http://jrxv.net/x/16/blockchain-gentle-introduction.pdf Image Credits
  • 39.
    carbonfive.com Thanks! And please fillout the session survey! Shannon E. Wells | shannon@carbonfive.com | shannonwells San Francisco, California USA