SlideShare a Scribd company logo
1 of 47
Intro to Blockchain
And, by the way, what the
heck is proof-of-work?
By Jim Flynn
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
Agenda
Blockchain Overview1 Blockchain/bitcoin Overview1
Blockchain Overview1 Understanding Proof of Work2
Blockchain Overview1 Proof of Work Demo3
In the beginning...
..or rather
2008
Bitcoin’s Techno-Libertarian Roots
●
Skeptical of authority
●
Dislike centralized power
●
Protective of privacy
●
Alarmed about surveillance
●
Oh yeah, hates taxes
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.”
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
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.
Traditional Way
Our
Business
Our
DB
We did pay!
Your
Business
Your
DB
They didn’t pay!
Bank
Bank
DB
Did they pay?
Blockchain Way
Our
Business
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
N
Blockchain - Distributed Ledger
Transaction Block
shows if they paid.
Your
Business
Blockchain Way
Our
Business
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
N
Your
Business
Business
1
Business
2
Business
3
Business
4
Business
5
Business
5
Business
6
Business
7
Business
8
Business
9
Business
10
Business
3 Business
Business
Business
Business
Business
Business
Business
Business
Business
Business
Business
Business
Business
Business
Business
Blockchain = Shared Distributed Truth
My database
says X.
My database
says Y.
Blockchain = Shared Distributed Truth
My database
says X.
My database
says Y.
The blockchain says Z.
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
Hashes Ensure Blockchain Integrity
TX
Block
0
hash
TX
Block
1
hash
TX
Block
2
hash ...
TX
Block
N
hash
2009 2017
hash hash hash
Hashes Ensure Blockchain Integrity
TX
Block
0
hash
TX
Block
1
hash
TX
Block
2
hash ...
TX
Block
N
hash
2009 2017
hash hash hash
Hashes Ensure Blockchain Integrity
TX
Block
0
hash
TX
Block
1
hash
TX
Block
2
hash ...
TX
Block
N
hash
2009 2017
hash hash hash
Bitcoin Identity
●
You get paid to your public key
– 02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc
●
You pay with your private key
●
No issuing authority
Is Bitcoin Anonymous?
Dread Pirate Roberts
NobDeath from Above
French Maid
Flush
Number13
Is Bitcoin Anonymous?
Dread Pirate Roberts
NobDeath from Above
French Maid
Flush
Number13
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
Mining
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
Miner 1 Miner 2
Prop.
TX
Block
7
Prop.
TX
Block
7
1. Miners race to solve puzzle.
2. Whoever wins, gets to set the next
block & gets a reward.
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
Mining
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
Miner 1 Miner 2
Prop.
TX
Block
7
Prop.
TX
Block
7
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
Mining
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
Miner 1 Miner 2
Prop.
TX
Block
7
TX
Block
7
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
TX
Block
0
TX
Block
1
TX
Block
2
TX
Block
3
TX
Block
5
TX
Block
6
TX
Block
7
TX
Block
7
ASIC
Application Specific Integrated Circuit
Mining Pools
Bitcoin Mining Now
“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
What the fork?
●
Forks happen when nodes disagree about the longest valid chain.
●
Forks can cause havoc.
●
Built-in incentives to discourage forks.
Scripting
●
Very basic in bitcoin
●
Far more advanced in Ethereum
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
Beyond Cryptocurrency
●
Supply chains
●
Decentralized organizations
●
Tracking physical assets
●
eVoting
●
Sharing economy – IoT & micropayments
Crypto-coins Galore
Bitcoin Ether Litecoin
Dogecoin
Dash
NEMPeercoin Primecoin Gridcoin
MoneroRipple
Ready to dive in?
Proof of Work
(POW)
●
Look at some code
●
Run some tests
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.
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
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
for ( $nonce = 1; $nonce <= $maxTries; $nonce++ )
{
$hash = hash('sha256', $transaction . $nonce);
$start = substr($hash, 0, $zeros);
if ( $start === $lead )
{
echo "<br/>Success! Puzzle solved with nonce = $nonce $end";
echo "Try #" . number_format($nonce) . ": Hash("$transaction.09$nonce")=$hash $end";
break;
}
elseif ($details == "yes") echo "Try #" . number_format($nonce) . ": Hash("$transaction.$nonce")=$hash $end";
}
Solving the Puzzle in Php Code
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
Let’s play!
POW Alternative: Proof of Stake
●
Does not waste as much electricity
●
Vulnerable to a “rewriting history” attack
●
e.g., Peercoin
POW Alternative: Proof of Burn
●
Prove the you made coins unspendable
●
Sometimes used to transfer to new currency
https://assets.kpmg.com/content/dam/kpmg/pdf/2016/06/kpmg-blockchain-consensus-mechanism.pdf
Google: kpmg blockchain consensus
Thanks!
Don’t forget to check my blog
for code and this presentation.
http://jamespflynn.com

More Related Content

What's hot

What's hot (20)

Boolberry reduces blockchain bloat
Boolberry reduces blockchain bloatBoolberry reduces blockchain bloat
Boolberry reduces blockchain bloat
 
Pi network
Pi networkPi network
Pi network
 
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
 
Overview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus MechanismsOverview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus Mechanisms
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchain
 
The Blockchain and JavaScript
The Blockchain and JavaScriptThe Blockchain and JavaScript
The Blockchain and JavaScript
 
Blockchain overview, use cases, implementations and challenges
Blockchain overview, use cases, implementations and challengesBlockchain overview, use cases, implementations and challenges
Blockchain overview, use cases, implementations and challenges
 
Intro into blockchain
Intro into blockchainIntro into blockchain
Intro into blockchain
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchain
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chain
 
CBGTBT - Part 2 - Blockchains 101
CBGTBT - Part 2 - Blockchains 101CBGTBT - Part 2 - Blockchains 101
CBGTBT - Part 2 - Blockchains 101
 
Blockchains 101
Blockchains 101Blockchains 101
Blockchains 101
 
Ethereum Blockchain explained
Ethereum Blockchain explainedEthereum Blockchain explained
Ethereum Blockchain explained
 
Bitcoin, Blockchain and the Crypto Contracts - Part 2
Bitcoin, Blockchain and the Crypto Contracts - Part 2Bitcoin, Blockchain and the Crypto Contracts - Part 2
Bitcoin, Blockchain and the Crypto Contracts - Part 2
 
Blockchain Corporate Style
Blockchain Corporate StyleBlockchain Corporate Style
Blockchain Corporate Style
 
CBGTBT - Part 3 - Transactions 101
CBGTBT - Part 3 - Transactions 101CBGTBT - Part 3 - Transactions 101
CBGTBT - Part 3 - Transactions 101
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang client
 
以比特幣為例的區塊鏈技術介紹 ( Intro to Blockchain using Bitcoin as an example)
以比特幣為例的區塊鏈技術介紹 ( Intro to Blockchain using Bitcoin as an example)以比特幣為例的區塊鏈技術介紹 ( Intro to Blockchain using Bitcoin as an example)
以比特幣為例的區塊鏈技術介紹 ( Intro to Blockchain using Bitcoin as an example)
 
Metadata in the Blockchain: The OP_RETURN Explosion
Metadata in the Blockchain: The OP_RETURN ExplosionMetadata in the Blockchain: The OP_RETURN Explosion
Metadata in the Blockchain: The OP_RETURN Explosion
 
Blockchain and bitcoin fundamentals (usages and applications)
Blockchain and bitcoin fundamentals (usages and applications)Blockchain and bitcoin fundamentals (usages and applications)
Blockchain and bitcoin fundamentals (usages and applications)
 

Similar to Intro to Blockchain - And, by the way, what the heck is proof-of-work?

CRYPTO CURRENCY-2022OD205.pdf
CRYPTO CURRENCY-2022OD205.pdfCRYPTO CURRENCY-2022OD205.pdf
CRYPTO CURRENCY-2022OD205.pdf
JESUNPK
 

Similar to Intro to Blockchain - And, by the way, what the heck is proof-of-work? (20)

Bitcoin story of programable currency
Bitcoin story of programable currencyBitcoin story of programable currency
Bitcoin story of programable currency
 
Privacy Coins
Privacy CoinsPrivacy Coins
Privacy Coins
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Encode x Tezos: Intro to Blockchain
Encode x Tezos: Intro to BlockchainEncode x Tezos: Intro to Blockchain
Encode x Tezos: Intro to Blockchain
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)
 
Blockchain mechanics
Blockchain mechanicsBlockchain mechanics
Blockchain mechanics
 
Blockchain mechanics
Blockchain mechanicsBlockchain mechanics
Blockchain mechanics
 
01 what is blockchain
01 what is blockchain01 what is blockchain
01 what is blockchain
 
MythsandMisnomers
MythsandMisnomersMythsandMisnomers
MythsandMisnomers
 
Ethereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonderEthereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonder
 
Blockchain and Formal verification (English)
Blockchain and Formal verification (English)Blockchain and Formal verification (English)
Blockchain and Formal verification (English)
 
The Future of Money: Decentralized Finance
The Future of Money: Decentralized FinanceThe Future of Money: Decentralized Finance
The Future of Money: Decentralized Finance
 
CRYPTO CURRENCY-2022OD205.pdf
CRYPTO CURRENCY-2022OD205.pdfCRYPTO CURRENCY-2022OD205.pdf
CRYPTO CURRENCY-2022OD205.pdf
 
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
Cryptocurrencies for Everyone (Dmytro Pershyn Technology Stream)
 
bitcoin
bitcoinbitcoin
bitcoin
 
15-Bitcoin.pptx
15-Bitcoin.pptx15-Bitcoin.pptx
15-Bitcoin.pptx
 
Blockchain and Bitcoin.pptx
Blockchain and Bitcoin.pptxBlockchain and Bitcoin.pptx
Blockchain and Bitcoin.pptx
 
An Introduction to Blockchain, Bitcoin, and CryptoEconomics.
An Introduction to Blockchain, Bitcoin, and CryptoEconomics.An Introduction to Blockchain, Bitcoin, and CryptoEconomics.
An Introduction to Blockchain, Bitcoin, and CryptoEconomics.
 
Introduction to blockchain and cryptocurrency technologies
Introduction to blockchain and cryptocurrency technologiesIntroduction to blockchain and cryptocurrency technologies
Introduction to blockchain and cryptocurrency technologies
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Intro to Blockchain - And, by the way, what the heck is proof-of-work?