SlideShare a Scribd company logo
1 of 31
Download to read offline
Bitcoin's Moving Parts
— Coins
— Digital signatures
— Chain of blocks
— Proof of work
— Censorship resistance
— Anatomy of a Transaction
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 1
The Problem
Alice emails Bob: "I give you 2 BTC"
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 2
The Problem
Alice emails Bob: "I give you 2 BTC"
1. Why is it worth anything?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 2
The Problem
Alice emails Bob: "I give you 2 BTC"
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 2
Coins
— Alice has two 1.5 BTC coins1
— Alice emails Bob:
I spend my coins, and create:
- 2 BTC coin for Bob; and
- 1 BTC coin for Alice
1
UTXO: Unspent Transaction (tx) Output
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 3
The Problem
Alice emails Bob: "I give you 2 BTC"
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
3. How does Alice prove she owned the coin?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 4
Digital signatures
— Private key: big random number
— Public key: point on curve2
— private key can encrypt or sign message
2
secp256k1
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 5
Digital signatures
— Coin is signed message: "Only Alice can spend me" 3
— Who's Alice?
— Bitcoin address derived from public key 4
— Alice is whoever can reveal public key and sign a
message with private key
4
Q&A tip: why not just use the public key as a Bitcoin address?
3
The new coins say "Only Bob can spend me" and the change says "Only Alice can spend me".
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 6
The Problem
Alice emails Bob: "I give you 2 BTC"
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
3. How does Alice prove she owned the coin?
4. What if Alice sends Carol the same coins?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 7
The Blockchain
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 8
A Blockchain is a chain of blocks
— Peter Todd
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 9
A Blockchain is a database with
virtue
— Chris DeRose
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 10
The Blockchain
Things we care about to solve
problem (4):
— Publish all transactions, and in
which order
— Ensure everyone can see all
transactions
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 11
The Problem
Alice publishes: "I give Bob my 2 BTC"
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
3. How does Alice prove she owned the coin?
4. What if Alice sends Carol the same coins?
— it's on the blockchain so everyone can see it
— what if there's many different blockchains?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 12
The Problem
Alice publishes: "I give Bob my 2 BTC"
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
3. How does Alice prove she owned the coin?
4. What if Alice sends Carol the same coins?
— it's on the blockchain so everyone can see it
— what if there's many different blockchains?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 13
Solution 1: use a regulator
— declare existence of conflicting blockchains fraud
— give regulator(s) access to your database
— add additional crypto magic
— brand it "blockchain inspired technology"
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 14
Solution 2: Proof-of-Work
Convince someone to:
— do useless work
— which uniquely commits to transaction data
— in exchange for coins.
Throw dice on a piece of paper with the transaction list.
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 15
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 16
Proof-of-Work
— sha("000001 | Alice sends Bob 2 BTC, etc") = 0fed9a90
— sha("000002 | Alice sends Bob 2 BTC, etc") = e7c54529
— sha("000003 | Alice sends Bob 2 BTC, etc") = 6c48ab21
— sha("855453 | Alice sends Bob 2 BTC, etc") = 000005e6
— N leading zeros -> X kWh * £0.10 -> £... per block 5
— Miner creates coin out of thin air which Alice & Bob
consider valid
5
Any scarce resource will do, but the simplest known combination with the right properties is
electricity + specialized chips + hashing.
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 17
The Problem
Alice publishes: "I give Bob my 2 BTC", miner burns
electricity to attest this.
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
3. How does Alice prove she owned the coin?
4. What if Alice sends Carol the same coins?
— it's on the blockchain so everyone can see it
— what if there's many different blockchains?
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 18
The Problem
Alice publishes: "I give Bob my 2 BTC", miner burns
electricity to attest this.
1. Why is it worth anything?
2. What did Bob get that Alice gave up?
3. How does Alice prove she owned the coin?
4. What if Alice sends Carol the same coins?
5. What if someone doesn't like Bob?6
6
i.e. wants to stop the transaction
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 19
Censorship resistance
— Miners compete, fees offer extra incentive
— P2P: transactions and blocks route around censorship
— Fungability: all transacions (should) look the same
— Lot's of problems left to solve
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 20
Anatomy of a Bitcoin Transaction
Alice publishes: "I give Bob my 2 BTC"
— Bob is whoever can reveal public key corresponding to
Bob's address and sign a message with private key:
Alice publishes:
OP_DUP OP_HASH160 <Bob's address> OP_EQUALVERIFY
OP_CHECKSIG
Bob spends:
<Bob's signature><Bob's pubkey>
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 21
Anatomy of a Bitcoin Transaction
Alice publishes: "I give Bob my 2 BTC"
— Bob is whoever can reveal public key corresponding to
Bob's address and sign a message with private key:
Alice publishes:
OP_DUP OP_HASH160 <Bob's address> OP_EQUALVERIFY
OP_CHECKSIG
Bob spends:
<Bob's signature><Bob's pubkey>
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 22
Script stack
— <Bob's signature>
— <Bob's pubkey>
— OP_DUP
— OP_HASH160
— <Bob's address>
— OP_EQUALVERIFY
— OP_CHECKSIG
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 23
Script stack
— <Bob's signature>
— <Bob's pubkey>
— <Bob's pubkey>
— OP_HASH160
— <Bob's address>
— OP_EQUALVERIFY
— OP_CHECKSIG
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 24
Script stack
— <Bob's signature>
— <Bob's pubkey>
— <Bob's address>
— <Bob's address>
— OP_EQUALVERIFY
— OP_CHECKSIG
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 25
Script stack
— <Bob's signature>
— <Bob's pubkey>
— OP_CHECKSIG
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 26
Script stack
— true
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 27
Other opcodes
— OP_CHECKMULTISIG : N of M sigs
— OP_CHECKLOCKTIMEVERIFY: HODL
— OP_IF / OP_ELSE
— OP_RETURN: 80 bytes spam 8
— OP_NOP: does nothing (yet!)
8
e.g. Rare Pepe trades: CryptoKitties, but with frogs
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 28
Thanks
Slides: slideshare.net/provoost
Blog: medium.com/provoost-on-crypto
PGP:
ED9B DF7A D6A5 5E23 2E84 5242 57FF 9BDB CC30 1009
2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 29

More Related Content

Similar to Anatomy of a Bitcoin transaction

Ebay without Ebay - Bitcoin smart contracts presentation by Oleg Andreev
Ebay without Ebay - Bitcoin smart contracts presentation by Oleg AndreevEbay without Ebay - Bitcoin smart contracts presentation by Oleg Andreev
Ebay without Ebay - Bitcoin smart contracts presentation by Oleg AndreevBitcoinomie
 
Introduction to Blockchains
Introduction to BlockchainsIntroduction to Blockchains
Introduction to BlockchainsRamesh Nair
 
Replay Protection - Bitcoin Devs HK 2017-11-01
Replay Protection - Bitcoin Devs HK 2017-11-01Replay Protection - Bitcoin Devs HK 2017-11-01
Replay Protection - Bitcoin Devs HK 2017-11-01Sjors Provoost
 
Bitcoin & blockchain for ordinary people
Bitcoin & blockchain for ordinary peopleBitcoin & blockchain for ordinary people
Bitcoin & blockchain for ordinary peopleKent Tong
 
EXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGY
EXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGYEXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGY
EXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGYSteven Rhyner
 
PRESENTATION.pptx
PRESENTATION.pptxPRESENTATION.pptx
PRESENTATION.pptxFaiZiTricks
 
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz
 

Similar to Anatomy of a Bitcoin transaction (8)

Ebay without Ebay - Bitcoin smart contracts presentation by Oleg Andreev
Ebay without Ebay - Bitcoin smart contracts presentation by Oleg AndreevEbay without Ebay - Bitcoin smart contracts presentation by Oleg Andreev
Ebay without Ebay - Bitcoin smart contracts presentation by Oleg Andreev
 
Introduction to Blockchains
Introduction to BlockchainsIntroduction to Blockchains
Introduction to Blockchains
 
Replay Protection - Bitcoin Devs HK 2017-11-01
Replay Protection - Bitcoin Devs HK 2017-11-01Replay Protection - Bitcoin Devs HK 2017-11-01
Replay Protection - Bitcoin Devs HK 2017-11-01
 
Bitcoin & blockchain for ordinary people
Bitcoin & blockchain for ordinary peopleBitcoin & blockchain for ordinary people
Bitcoin & blockchain for ordinary people
 
EXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGY
EXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGYEXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGY
EXPLAINING BITCOIN TO THE MASSES: A GLASS BOX ANALOGY
 
PRESENTATION.pptx
PRESENTATION.pptxPRESENTATION.pptx
PRESENTATION.pptx
 
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
 
notes.pdf
notes.pdfnotes.pdf
notes.pdf
 

Recently uploaded

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

Anatomy of a Bitcoin transaction

  • 1. Bitcoin's Moving Parts — Coins — Digital signatures — Chain of blocks — Proof of work — Censorship resistance — Anatomy of a Transaction 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 1
  • 2. The Problem Alice emails Bob: "I give you 2 BTC" 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 2
  • 3. The Problem Alice emails Bob: "I give you 2 BTC" 1. Why is it worth anything? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 2
  • 4. The Problem Alice emails Bob: "I give you 2 BTC" 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 2
  • 5. Coins — Alice has two 1.5 BTC coins1 — Alice emails Bob: I spend my coins, and create: - 2 BTC coin for Bob; and - 1 BTC coin for Alice 1 UTXO: Unspent Transaction (tx) Output 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 3
  • 6. The Problem Alice emails Bob: "I give you 2 BTC" 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 3. How does Alice prove she owned the coin? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 4
  • 7. Digital signatures — Private key: big random number — Public key: point on curve2 — private key can encrypt or sign message 2 secp256k1 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 5
  • 8. Digital signatures — Coin is signed message: "Only Alice can spend me" 3 — Who's Alice? — Bitcoin address derived from public key 4 — Alice is whoever can reveal public key and sign a message with private key 4 Q&A tip: why not just use the public key as a Bitcoin address? 3 The new coins say "Only Bob can spend me" and the change says "Only Alice can spend me". 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 6
  • 9. The Problem Alice emails Bob: "I give you 2 BTC" 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 3. How does Alice prove she owned the coin? 4. What if Alice sends Carol the same coins? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 7
  • 10. The Blockchain 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 8
  • 11. A Blockchain is a chain of blocks — Peter Todd 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 9
  • 12. A Blockchain is a database with virtue — Chris DeRose 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 10
  • 13. The Blockchain Things we care about to solve problem (4): — Publish all transactions, and in which order — Ensure everyone can see all transactions 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 11
  • 14. The Problem Alice publishes: "I give Bob my 2 BTC" 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 3. How does Alice prove she owned the coin? 4. What if Alice sends Carol the same coins? — it's on the blockchain so everyone can see it — what if there's many different blockchains? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 12
  • 15. The Problem Alice publishes: "I give Bob my 2 BTC" 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 3. How does Alice prove she owned the coin? 4. What if Alice sends Carol the same coins? — it's on the blockchain so everyone can see it — what if there's many different blockchains? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 13
  • 16. Solution 1: use a regulator — declare existence of conflicting blockchains fraud — give regulator(s) access to your database — add additional crypto magic — brand it "blockchain inspired technology" 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 14
  • 17. Solution 2: Proof-of-Work Convince someone to: — do useless work — which uniquely commits to transaction data — in exchange for coins. Throw dice on a piece of paper with the transaction list. 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 15
  • 18. 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 16
  • 19. Proof-of-Work — sha("000001 | Alice sends Bob 2 BTC, etc") = 0fed9a90 — sha("000002 | Alice sends Bob 2 BTC, etc") = e7c54529 — sha("000003 | Alice sends Bob 2 BTC, etc") = 6c48ab21 — sha("855453 | Alice sends Bob 2 BTC, etc") = 000005e6 — N leading zeros -> X kWh * £0.10 -> £... per block 5 — Miner creates coin out of thin air which Alice & Bob consider valid 5 Any scarce resource will do, but the simplest known combination with the right properties is electricity + specialized chips + hashing. 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 17
  • 20. The Problem Alice publishes: "I give Bob my 2 BTC", miner burns electricity to attest this. 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 3. How does Alice prove she owned the coin? 4. What if Alice sends Carol the same coins? — it's on the blockchain so everyone can see it — what if there's many different blockchains? 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 18
  • 21. The Problem Alice publishes: "I give Bob my 2 BTC", miner burns electricity to attest this. 1. Why is it worth anything? 2. What did Bob get that Alice gave up? 3. How does Alice prove she owned the coin? 4. What if Alice sends Carol the same coins? 5. What if someone doesn't like Bob?6 6 i.e. wants to stop the transaction 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 19
  • 22. Censorship resistance — Miners compete, fees offer extra incentive — P2P: transactions and blocks route around censorship — Fungability: all transacions (should) look the same — Lot's of problems left to solve 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 20
  • 23. Anatomy of a Bitcoin Transaction Alice publishes: "I give Bob my 2 BTC" — Bob is whoever can reveal public key corresponding to Bob's address and sign a message with private key: Alice publishes: OP_DUP OP_HASH160 <Bob's address> OP_EQUALVERIFY OP_CHECKSIG Bob spends: <Bob's signature><Bob's pubkey> 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 21
  • 24. Anatomy of a Bitcoin Transaction Alice publishes: "I give Bob my 2 BTC" — Bob is whoever can reveal public key corresponding to Bob's address and sign a message with private key: Alice publishes: OP_DUP OP_HASH160 <Bob's address> OP_EQUALVERIFY OP_CHECKSIG Bob spends: <Bob's signature><Bob's pubkey> 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 22
  • 25. Script stack — <Bob's signature> — <Bob's pubkey> — OP_DUP — OP_HASH160 — <Bob's address> — OP_EQUALVERIFY — OP_CHECKSIG 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 23
  • 26. Script stack — <Bob's signature> — <Bob's pubkey> — <Bob's pubkey> — OP_HASH160 — <Bob's address> — OP_EQUALVERIFY — OP_CHECKSIG 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 24
  • 27. Script stack — <Bob's signature> — <Bob's pubkey> — <Bob's address> — <Bob's address> — OP_EQUALVERIFY — OP_CHECKSIG 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 25
  • 28. Script stack — <Bob's signature> — <Bob's pubkey> — OP_CHECKSIG 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 26
  • 29. Script stack — true 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 27
  • 30. Other opcodes — OP_CHECKMULTISIG : N of M sigs — OP_CHECKLOCKTIMEVERIFY: HODL — OP_IF / OP_ELSE — OP_RETURN: 80 bytes spam 8 — OP_NOP: does nothing (yet!) 8 e.g. Rare Pepe trades: CryptoKitties, but with frogs 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 28
  • 31. Thanks Slides: slideshare.net/provoost Blog: medium.com/provoost-on-crypto PGP: ED9B DF7A D6A5 5E23 2E84 5242 57FF 9BDB CC30 1009 2018-03-24 - Code Block London - sjors@sprovoost.nl - @provoost on Twitter 29