SlideShare una empresa de Scribd logo
1 de 61
Descargar para leer sin conexión
BITCOIN ANDBITCOIN AND
BLOCKCHAINBLOCKCHAIN
:Robin Ye
"At this moment, just like in 2000,
software development into the Internet
age, programmers either continue
learning or be weeded out. Now the
Internet age is over, welcome to the age
of AI and blockchain."
WHAT WE ARE GOING TO TALK ABOUT?WHAT WE ARE GOING TO TALK ABOUT?
Evolution of Currency
What is Bitcoin
History of Bitcoin
Transactions
Blockchain
Mining and Consensus
User Security Best Practices
Blockchain Applications
WHAT WE ARE NOT GOING TO TALK ABOUT?WHAT WE ARE NOT GOING TO TALK ABOUT?
Alternative Coins
Ethereum
Elliptic Curves Cryptography
Digital Signatures (ECDSA)
EVOLUTION OF CURRENCYEVOLUTION OF CURRENCY
BARTER ECONOMYBARTER ECONOMY
MATERIAL CURRENCYMATERIAL CURRENCY
TOKEN MONEYTOKEN MONEY
CASHLESS SOCIETYCASHLESS SOCIETY
WHAT IS BITCOIN?WHAT IS BITCOIN?
Bitcoin consists of:
A decentralized P2P network (the bitcoin protocol)
A public transaction ledger (the blockchain)
A set of rules for independent transaction validation and currency issuance
(consensus rules)
A mechanism for reaching global decentralized consensus on the valid
blockchain (Proof-of-Work algorithm)
HISTORY OF BITCOINHISTORY OF BITCOIN
Bitcoin was invented in 2008 with the publication of
a paper titled
written under the alias of Satoshi
Nakamoto
"Bitcoin: A Peer-to-Peer Electronic
Cash System"
HISTORY OF BITCOINHISTORY OF BITCOIN
The bitcoin network started in 2009, based on a
reference implementation published by Nakamoto
and since revised by many other programmers
HISTORY OF BITCOINHISTORY OF BITCOIN
Satoshi Nakamoto withdrew from the public in April
2011, leaving the responsibility of developing the
code and network to a thriving group of volunteers
BITCOIN PRICE 2013 - 2018BITCOIN PRICE 2013 - 2018
BITCOIN TRANSACTIONBITCOIN TRANSACTION
KEYS, ADDRESSES, AND WALLETSKEYS, ADDRESSES, AND WALLETS
Ownership of bitcoin is established through digital
keys, bitcoin addresses, and digital signatures
The digital keys created and stored by users in a le,
or simple database, called a wallet
TRANSACTION INPUTS AND OUTPUTSTRANSACTION INPUTS AND OUTPUTS
A CHAIN OF TRANSACTIONSA CHAIN OF TRANSACTIONS
COMMON TRANSACTION FORMSCOMMON TRANSACTION FORMS
THE BLOCK EXPLORER APPLICATIONTHE BLOCK EXPLORER APPLICATION
blockchain.info
UTXOUTXO
UTXO means "Unspent Transaction Outputs"
UTXO can be spent as an Input in a transaction
Every transaction represents a change in the UTXO
set
Bitcoin "balance" is the sum of all UTXO that user’s
wallet can spend and which may be scattered among
hundreds of transactions and hundreds of blocks
TRANSACTION FEESTRANSACTION FEES
Calculated based on the size of the transaction in
Kbytes, not the value of the transaction in bitcoin
Transaction fees affect the processing priority
Most wallets calculate and include transaction fees
automatically
Fees = Sum(Inputs) – Sum(Outputs)
FEE ESTIMATIONFEE ESTIMATION
https://bitcoinfees.21.co/
TRANSACTION SCRIPTSTRANSACTION SCRIPTS
Bitcoin’s scripting language is a stack-based, turing
completeness, and stateless veri cation language
Bitcoin’s transaction validation relies on two types of
scripts: a locking script and an unlocking script
EVALUATING A SCRIPT FOR A P2PKH TRANSACTIONEVALUATING A SCRIPT FOR A P2PKH TRANSACTION
The vast majority of transactions processed on the
bitcoin network spend outputs locked with a Pay-to-
Public-Key-Hash or "P2PKH" script
BLOCKCHAINBLOCKCHAIN
BLOCK AND BLOCKCHAINBLOCK AND BLOCKCHAIN
Block is a container data structure that aggregates
transactions
The blockchain data structure is an ordered, back-
linked list of blocks, serves as the public ledger for all
transactions
STRUCTURE OF A BLOCKSTRUCTURE OF A BLOCK
Size Field Description
4 bytes Block Size The size of the block, in bytes, following this eld
80 bytes Block Header Several elds form the block header
VarInt Transaction Counter How many transactions follow
Variable Transactions The transactions recorded in this block
BLOCK HEADERBLOCK HEADER
Size Field Description
4 bytes Version A version number to track software/protocol upgrades
32 bytes Previous Block Hash A reference to the hash of the previous block in the chain
32 bytes Merkle Root A hash of the root of the merkle tree of this block’s transactions
4 bytes Timestamp The approximate creation time of this block
4 bytes Dif culty The Proof-of-Work algorithm dif culty target for this block
4 bytes Nonce A counter used for the Proof-of-Work algorithm
LINKING BLOCKSLINKING BLOCKS
THE GENESIS BLOCKTHE GENESIS BLOCK
The rst block in the blockchain is called the genesis
block and was created in 2009. The genesis block
contains a hidden message within it. The coinbase
transaction input contains the text "The Times
03/Jan/2009 Chancellor on brink of second bailout for
banks," by referencing the headline of the British
newspaper The Times.
MERKLE TREEMERKLE TREE
MERKLE TREEMERKLE TREE
Even number of nodes
MERKLE PATHMERKLE PATH
MERKLE TREE EFFICIENCYMERKLE TREE EFFICIENCY
Number of
Txs
Approx. size of
block
Path size
(hashes)
Path size
(bytes)
16 txs 4 KB 4 hashes 128 bytes
512 txs 128 KB 9 hashes 288 bytes
2048 txs 512 KB 11 hashes 352 bytes
65535 txs 16 MB 16 hashes 512 bytes
MINING AND CONSENSUSMINING AND CONSENSUS
MINERMINER
Miners validate new transactions and record them
on the global ledger
Miners receive two types of rewards by mining: new
coins created with each new block, and transaction
fees from all the transactions included in the block
BITCOIN ECONOMICS AND CURRENCY CREATIONBITCOIN ECONOMICS AND CURRENCY CREATION
Each block, generated on average every 10 minutes,
contains entirely new bitcoin, created from nothing
BITCOIN MONEY SUPPLYBITCOIN MONEY SUPPLY
Every 210,000 blocks, or approximately every 4 years, the
currency issuance rate is decreased by 50%
Finally, in approximately 2140, almost 21 million bitcoin will be
issued. Thereafter, blocks will contain no new bitcoin, and
miners will be rewarded solely through the transaction fees
THE COINBASE TRANSACTIONTHE COINBASE TRANSACTION
The rst transaction in any block is a special
transaction, called a coinbase transaction
Coinbase transaction does not consume UTXO as
inputs. Instead, it has only one input, called the
"coinbase", which creates bitcoin from nothing
PROOF OF WORKPROOF OF WORK
The Dif culty target and Nonce in block header
Size Field Description
4 bytes Dif culty The Proof-of-Work algorithm dif culty target for this block
4 bytes Nonce A counter used for the Proof-of-Work algorithm
PROOF OF WORKPROOF OF WORK
The Proof-of-Work must produce a hash (Nonce) that
is less than the dif culty target
# example of proof-of-work algorithm
max_nonce = 2 ** 32 # 4 billion
def proof_of_work(header, difficulty_bits):
difficulty_target = 2 ** (256-difficulty_bits)
for nonce in xrange(max_nonce):
block_hash = hashlib.sha256(str(header)+str(nonce)).hexdigest()
if long(block_hash, 16) < difficulty_target:
print "Success with nonce %d" % nonce
return (block_hash, nonce)
RETARGETING TO ADJUST DIFFICULTYRETARGETING TO ADJUST DIFFICULTY
Blocks are generated every 10 minutes, on average.
This is bitcoin’s heartbeat and underpins the
frequency of currency issuance and the speed of
transaction settlement
Retargeting occurs automatically and on every node
independently
New Difficulty = Old Difficulty *
(Actual Time of Last 2016 Blocks / 20160 minutes)
MINER COMPETITIONMINER COMPETITION
When one miner solves and transmits a block, other
miners receive, validate, and then propagate the new
block, they abandon their efforts to nd a block at the
same height and immediately start computing the next
block in the chain
TOTAL HASHING POWERTOTAL HASHING POWER
MINING DIFFICULTYMINING DIFFICULTY
DECENTRALIZED CONSENSUSDECENTRALIZED CONSENSUS
Bitcoin’s decentralized consensus emerges from the
interplay of four processes that occur independently on
nodes across the network:
Independent veri cation of each transaction, by every full node, based
on a comprehensive list of criteria
Independent aggregation of those transactions into new blocks by
mining nodes, coupled with demonstrated computation through a
Proof-of-Work algorithm
Independent veri cation of the new blocks by every node and assembly
into a chain
Independent selection, by every node, of the chain with the most
cumulative computation demonstrated through Proof-of-Work
BLOCKCHAIN FORKSBLOCKCHAIN FORKS
Because the blockchain is a decentralized data
structure, different copies of it are not always
consistent
As long as all nodes select the greatest-cumulative-
work chain, the global bitcoin network eventually
converges to a consistent state
HARD FORKHARD FORK
A permanent divergence in the blockchain, commonly
occurs when non-upgraded nodes can’t validate blocks
created by upgraded nodes that follow newer
consensus rules
51% CONSENSUS ATTACKS51% CONSENSUS ATTACKS
If we controlled a majority (51%) of the total network’s
hashing power, we can:
Cause deliberate "forks" in the blockchain and
double-spend transactions
Execute DoS attacks against speci c transactions or
addresses
IS IT TOO LATE TO START MINING?IS IT TOO LATE TO START MINING?
GPU MINERGPU MINER
Nvidia GTX1080 GPU = 2.83GH/s for 200w
ASIC: Application-Speci c Integrated Circuit
AntMiner S2 ASIC = 1000GH/s for 120w
RETURN ON INVESTMENTRETURN ON INVESTMENT
ROI = Miner costs / (Income per day - Power costs)
YOUR COMPETITORS:YOUR COMPETITORS:
In this highly competitive environment, miners
collaborate to form mining pools
INSIDE A SECRET CHINESE BITCOIN MINEINSIDE A SECRET CHINESE BITCOIN MINE
USER SECURITY BEST PRACTICESUSER SECURITY BEST PRACTICES
Physical Bitcoin Storage
Hardware Wallets
Balancing Risk
Diversifying Risk
Multisig and Governance
Survivability
BLOCKCHAIN APPLICATIONSBLOCKCHAIN APPLICATIONS
Digital Identity
Proof-of-Existence (Digital Notary)
Kickstarter
Smart Contracts
Distributed Cloud Storage
REFERENCESREFERENCES
Mastering Bitcoin
CoinDesk
THE ENDTHE END
Q&AQ&A

Más contenido relacionado

La actualidad más candente

Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?Jim Flynn
 
Bitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysBitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysShun Shiku
 
Intro to smart contract on blockchain en
Intro to smart contract on blockchain enIntro to smart contract on blockchain en
Intro to smart contract on blockchain enNicholas Lin
 
"How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201...
"How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201..."How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201...
"How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201...Equal Experts
 
Roman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and Forks
Roman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and ForksRoman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and Forks
Roman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and ForksTimetogrowup
 
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 clientSathish VJ
 
Weaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DBWeaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DBInterledger
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodGalin Dinkov
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Zvi Avraham
 
Ethereum wallet Intro 以太坊錢包介紹
Ethereum wallet Intro 以太坊錢包介紹Ethereum wallet Intro 以太坊錢包介紹
Ethereum wallet Intro 以太坊錢包介紹Nicholas Lin
 
BitCoin explained
BitCoin explainedBitCoin explained
BitCoin explainedHarelc
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.jsFelix Crisan
 
Meta X Blockchain Bootcamp
Meta X Blockchain BootcampMeta X Blockchain Bootcamp
Meta X Blockchain BootcampMetaX
 
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 2Prithwis Mukerjee
 

La actualidad más candente (20)

BitCoin Protocol
BitCoin ProtocolBitCoin Protocol
BitCoin Protocol
 
Blockchain and bitcoin
Blockchain and bitcoinBlockchain and bitcoin
Blockchain and bitcoin
 
Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?
 
Bitcoins Math
Bitcoins MathBitcoins Math
Bitcoins Math
 
Bitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysBitcoin Wallet &amp Keys
Bitcoin Wallet &amp Keys
 
Blockchain Corporate Style
Blockchain Corporate StyleBlockchain Corporate Style
Blockchain Corporate Style
 
Intro to smart contract on blockchain en
Intro to smart contract on blockchain enIntro to smart contract on blockchain en
Intro to smart contract on blockchain en
 
Blockchain - a basic overview
Blockchain - a basic overviewBlockchain - a basic overview
Blockchain - a basic overview
 
"How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201...
"How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201..."How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201...
"How Blockchains and Bitcoins work" by Ricardo Águas @ Pizza Talks Lisbon 201...
 
Roman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and Forks
Roman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and ForksRoman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and Forks
Roman Oliynykov - Bitcoin and Blockchain: Technologies, Scaling and Forks
 
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
 
Lightning Network
Lightning  NetworkLightning  Network
Lightning Network
 
Weaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DBWeaving the ILP Fabric into Bigchain DB
Weaving the ILP Fabric into Bigchain DB
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
 
Ethereum wallet Intro 以太坊錢包介紹
Ethereum wallet Intro 以太坊錢包介紹Ethereum wallet Intro 以太坊錢包介紹
Ethereum wallet Intro 以太坊錢包介紹
 
BitCoin explained
BitCoin explainedBitCoin explained
BitCoin explained
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.js
 
Meta X Blockchain Bootcamp
Meta X Blockchain BootcampMeta X Blockchain Bootcamp
Meta X Blockchain Bootcamp
 
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
 

Similar a Bitcoin and Blockchain

Bitcoin and blockchain engineering
Bitcoin and blockchain engineeringBitcoin and blockchain engineering
Bitcoin and blockchain engineeringGregory Bataille
 
BLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxBLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxSohanaAmreen
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionDSCIITPatna
 
Blockchain Demystified
Blockchain DemystifiedBlockchain Demystified
Blockchain DemystifiedMahesh M Reddy
 
Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...
Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...
Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...Richard Givens
 
Tutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssTutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssHoward Anglin
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin Jérôme Kehrli
 
Wallets and Transactions #2
Wallets and Transactions #2Wallets and Transactions #2
Wallets and Transactions #2BCWorkspace
 
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad SarangNinad Sarang
 
Architecture and operations.pptx
Architecture and operations.pptxArchitecture and operations.pptx
Architecture and operations.pptxharshitmittal737363
 
Block chain by harsh biltu agarwal
Block chain by harsh biltu agarwalBlock chain by harsh biltu agarwal
Block chain by harsh biltu agarwalN V Jagadeesh Kumar
 
Through the looking glass (of the blockchain)
Through the looking glass (of the blockchain)Through the looking glass (of the blockchain)
Through the looking glass (of the blockchain)Alessandro Confetti
 
Webinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro ConfettiWebinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro ConfettiCodemotion
 
blockchain class 3.pdf
blockchain class 3.pdfblockchain class 3.pdf
blockchain class 3.pdfGopalSB
 
Blockchain - Presentacion Betabeers Galicia 10/12/2014
Blockchain - Presentacion Betabeers Galicia 10/12/2014Blockchain - Presentacion Betabeers Galicia 10/12/2014
Blockchain - Presentacion Betabeers Galicia 10/12/2014WeKCo Coworking
 
Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies
Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies
Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies anupriti
 

Similar a Bitcoin and Blockchain (20)

Bitcoin
BitcoinBitcoin
Bitcoin
 
Bitcoin and blockchain engineering
Bitcoin and blockchain engineeringBitcoin and blockchain engineering
Bitcoin and blockchain engineering
 
BLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxBLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptx
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 Session
 
Blockchain Demystified
Blockchain DemystifiedBlockchain Demystified
Blockchain Demystified
 
Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...
Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...
Bits, Blocks, and Chains: A Concise Examination of Bitcoin and Cryptocurrency...
 
Tutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssTutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ss
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin
 
Wallets and Transactions #2
Wallets and Transactions #2Wallets and Transactions #2
Wallets and Transactions #2
 
Basics of Block Chain
Basics of Block ChainBasics of Block Chain
Basics of Block Chain
 
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
 
Architecture and operations.pptx
Architecture and operations.pptxArchitecture and operations.pptx
Architecture and operations.pptx
 
Day 1.pptx
Day 1.pptxDay 1.pptx
Day 1.pptx
 
Block chain by harsh biltu agarwal
Block chain by harsh biltu agarwalBlock chain by harsh biltu agarwal
Block chain by harsh biltu agarwal
 
Through the looking glass (of the blockchain)
Through the looking glass (of the blockchain)Through the looking glass (of the blockchain)
Through the looking glass (of the blockchain)
 
Webinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro ConfettiWebinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro Confetti
 
Blockchain technology
Blockchain technologyBlockchain technology
Blockchain technology
 
blockchain class 3.pdf
blockchain class 3.pdfblockchain class 3.pdf
blockchain class 3.pdf
 
Blockchain - Presentacion Betabeers Galicia 10/12/2014
Blockchain - Presentacion Betabeers Galicia 10/12/2014Blockchain - Presentacion Betabeers Galicia 10/12/2014
Blockchain - Presentacion Betabeers Galicia 10/12/2014
 
Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies
Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies
Symposium on Legal Regulation of Bitcoin, Blockchain & Cryptocurrencies
 

Último

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Último (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

Bitcoin and Blockchain

  • 2. :Robin Ye "At this moment, just like in 2000, software development into the Internet age, programmers either continue learning or be weeded out. Now the Internet age is over, welcome to the age of AI and blockchain."
  • 3. WHAT WE ARE GOING TO TALK ABOUT?WHAT WE ARE GOING TO TALK ABOUT? Evolution of Currency What is Bitcoin History of Bitcoin Transactions Blockchain Mining and Consensus User Security Best Practices Blockchain Applications
  • 4. WHAT WE ARE NOT GOING TO TALK ABOUT?WHAT WE ARE NOT GOING TO TALK ABOUT? Alternative Coins Ethereum Elliptic Curves Cryptography Digital Signatures (ECDSA)
  • 10. WHAT IS BITCOIN?WHAT IS BITCOIN? Bitcoin consists of: A decentralized P2P network (the bitcoin protocol) A public transaction ledger (the blockchain) A set of rules for independent transaction validation and currency issuance (consensus rules) A mechanism for reaching global decentralized consensus on the valid blockchain (Proof-of-Work algorithm)
  • 11. HISTORY OF BITCOINHISTORY OF BITCOIN Bitcoin was invented in 2008 with the publication of a paper titled written under the alias of Satoshi Nakamoto "Bitcoin: A Peer-to-Peer Electronic Cash System"
  • 12. HISTORY OF BITCOINHISTORY OF BITCOIN The bitcoin network started in 2009, based on a reference implementation published by Nakamoto and since revised by many other programmers
  • 13. HISTORY OF BITCOINHISTORY OF BITCOIN Satoshi Nakamoto withdrew from the public in April 2011, leaving the responsibility of developing the code and network to a thriving group of volunteers
  • 14. BITCOIN PRICE 2013 - 2018BITCOIN PRICE 2013 - 2018
  • 16. KEYS, ADDRESSES, AND WALLETSKEYS, ADDRESSES, AND WALLETS Ownership of bitcoin is established through digital keys, bitcoin addresses, and digital signatures The digital keys created and stored by users in a le, or simple database, called a wallet
  • 17. TRANSACTION INPUTS AND OUTPUTSTRANSACTION INPUTS AND OUTPUTS
  • 18. A CHAIN OF TRANSACTIONSA CHAIN OF TRANSACTIONS
  • 19. COMMON TRANSACTION FORMSCOMMON TRANSACTION FORMS
  • 20. THE BLOCK EXPLORER APPLICATIONTHE BLOCK EXPLORER APPLICATION blockchain.info
  • 21. UTXOUTXO UTXO means "Unspent Transaction Outputs" UTXO can be spent as an Input in a transaction Every transaction represents a change in the UTXO set Bitcoin "balance" is the sum of all UTXO that user’s wallet can spend and which may be scattered among hundreds of transactions and hundreds of blocks
  • 22. TRANSACTION FEESTRANSACTION FEES Calculated based on the size of the transaction in Kbytes, not the value of the transaction in bitcoin Transaction fees affect the processing priority Most wallets calculate and include transaction fees automatically Fees = Sum(Inputs) – Sum(Outputs)
  • 24. TRANSACTION SCRIPTSTRANSACTION SCRIPTS Bitcoin’s scripting language is a stack-based, turing completeness, and stateless veri cation language Bitcoin’s transaction validation relies on two types of scripts: a locking script and an unlocking script
  • 25. EVALUATING A SCRIPT FOR A P2PKH TRANSACTIONEVALUATING A SCRIPT FOR A P2PKH TRANSACTION The vast majority of transactions processed on the bitcoin network spend outputs locked with a Pay-to- Public-Key-Hash or "P2PKH" script
  • 26.
  • 27.
  • 29. BLOCK AND BLOCKCHAINBLOCK AND BLOCKCHAIN Block is a container data structure that aggregates transactions The blockchain data structure is an ordered, back- linked list of blocks, serves as the public ledger for all transactions
  • 30. STRUCTURE OF A BLOCKSTRUCTURE OF A BLOCK Size Field Description 4 bytes Block Size The size of the block, in bytes, following this eld 80 bytes Block Header Several elds form the block header VarInt Transaction Counter How many transactions follow Variable Transactions The transactions recorded in this block
  • 31. BLOCK HEADERBLOCK HEADER Size Field Description 4 bytes Version A version number to track software/protocol upgrades 32 bytes Previous Block Hash A reference to the hash of the previous block in the chain 32 bytes Merkle Root A hash of the root of the merkle tree of this block’s transactions 4 bytes Timestamp The approximate creation time of this block 4 bytes Dif culty The Proof-of-Work algorithm dif culty target for this block 4 bytes Nonce A counter used for the Proof-of-Work algorithm
  • 33. THE GENESIS BLOCKTHE GENESIS BLOCK The rst block in the blockchain is called the genesis block and was created in 2009. The genesis block contains a hidden message within it. The coinbase transaction input contains the text "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks," by referencing the headline of the British newspaper The Times.
  • 35. MERKLE TREEMERKLE TREE Even number of nodes
  • 37. MERKLE TREE EFFICIENCYMERKLE TREE EFFICIENCY Number of Txs Approx. size of block Path size (hashes) Path size (bytes) 16 txs 4 KB 4 hashes 128 bytes 512 txs 128 KB 9 hashes 288 bytes 2048 txs 512 KB 11 hashes 352 bytes 65535 txs 16 MB 16 hashes 512 bytes
  • 38. MINING AND CONSENSUSMINING AND CONSENSUS
  • 39. MINERMINER Miners validate new transactions and record them on the global ledger Miners receive two types of rewards by mining: new coins created with each new block, and transaction fees from all the transactions included in the block
  • 40. BITCOIN ECONOMICS AND CURRENCY CREATIONBITCOIN ECONOMICS AND CURRENCY CREATION Each block, generated on average every 10 minutes, contains entirely new bitcoin, created from nothing
  • 41. BITCOIN MONEY SUPPLYBITCOIN MONEY SUPPLY Every 210,000 blocks, or approximately every 4 years, the currency issuance rate is decreased by 50% Finally, in approximately 2140, almost 21 million bitcoin will be issued. Thereafter, blocks will contain no new bitcoin, and miners will be rewarded solely through the transaction fees
  • 42. THE COINBASE TRANSACTIONTHE COINBASE TRANSACTION The rst transaction in any block is a special transaction, called a coinbase transaction Coinbase transaction does not consume UTXO as inputs. Instead, it has only one input, called the "coinbase", which creates bitcoin from nothing
  • 43. PROOF OF WORKPROOF OF WORK The Dif culty target and Nonce in block header Size Field Description 4 bytes Dif culty The Proof-of-Work algorithm dif culty target for this block 4 bytes Nonce A counter used for the Proof-of-Work algorithm
  • 44. PROOF OF WORKPROOF OF WORK The Proof-of-Work must produce a hash (Nonce) that is less than the dif culty target # example of proof-of-work algorithm max_nonce = 2 ** 32 # 4 billion def proof_of_work(header, difficulty_bits): difficulty_target = 2 ** (256-difficulty_bits) for nonce in xrange(max_nonce): block_hash = hashlib.sha256(str(header)+str(nonce)).hexdigest() if long(block_hash, 16) < difficulty_target: print "Success with nonce %d" % nonce return (block_hash, nonce)
  • 45. RETARGETING TO ADJUST DIFFICULTYRETARGETING TO ADJUST DIFFICULTY Blocks are generated every 10 minutes, on average. This is bitcoin’s heartbeat and underpins the frequency of currency issuance and the speed of transaction settlement Retargeting occurs automatically and on every node independently New Difficulty = Old Difficulty * (Actual Time of Last 2016 Blocks / 20160 minutes)
  • 46. MINER COMPETITIONMINER COMPETITION When one miner solves and transmits a block, other miners receive, validate, and then propagate the new block, they abandon their efforts to nd a block at the same height and immediately start computing the next block in the chain
  • 47. TOTAL HASHING POWERTOTAL HASHING POWER
  • 49. DECENTRALIZED CONSENSUSDECENTRALIZED CONSENSUS Bitcoin’s decentralized consensus emerges from the interplay of four processes that occur independently on nodes across the network: Independent veri cation of each transaction, by every full node, based on a comprehensive list of criteria Independent aggregation of those transactions into new blocks by mining nodes, coupled with demonstrated computation through a Proof-of-Work algorithm Independent veri cation of the new blocks by every node and assembly into a chain Independent selection, by every node, of the chain with the most cumulative computation demonstrated through Proof-of-Work
  • 50. BLOCKCHAIN FORKSBLOCKCHAIN FORKS Because the blockchain is a decentralized data structure, different copies of it are not always consistent As long as all nodes select the greatest-cumulative- work chain, the global bitcoin network eventually converges to a consistent state
  • 51. HARD FORKHARD FORK A permanent divergence in the blockchain, commonly occurs when non-upgraded nodes can’t validate blocks created by upgraded nodes that follow newer consensus rules
  • 52. 51% CONSENSUS ATTACKS51% CONSENSUS ATTACKS If we controlled a majority (51%) of the total network’s hashing power, we can: Cause deliberate "forks" in the blockchain and double-spend transactions Execute DoS attacks against speci c transactions or addresses
  • 53. IS IT TOO LATE TO START MINING?IS IT TOO LATE TO START MINING?
  • 54. GPU MINERGPU MINER Nvidia GTX1080 GPU = 2.83GH/s for 200w
  • 55. ASIC: Application-Speci c Integrated Circuit AntMiner S2 ASIC = 1000GH/s for 120w
  • 56. RETURN ON INVESTMENTRETURN ON INVESTMENT ROI = Miner costs / (Income per day - Power costs)
  • 57. YOUR COMPETITORS:YOUR COMPETITORS: In this highly competitive environment, miners collaborate to form mining pools INSIDE A SECRET CHINESE BITCOIN MINEINSIDE A SECRET CHINESE BITCOIN MINE
  • 58. USER SECURITY BEST PRACTICESUSER SECURITY BEST PRACTICES Physical Bitcoin Storage Hardware Wallets Balancing Risk Diversifying Risk Multisig and Governance Survivability
  • 59. BLOCKCHAIN APPLICATIONSBLOCKCHAIN APPLICATIONS Digital Identity Proof-of-Existence (Digital Notary) Kickstarter Smart Contracts Distributed Cloud Storage