SlideShare a Scribd company logo
NYC Data Science Academy
Introduction to BitCoin
NYC Data Science Academy
P2P: Peer-to-Peer Network
 A peer-to-peer (P2P) network is a type of
decentralized and distributed network architecture in
which individual nodes in the network (called "peers")
act as both suppliers and consumers of resources, in
contrast to the centralized client–server model where
client nodes request access to resources provided by
central servers.
 Peers are distributed in the whole Internet. It is hard
to control and monitor the network activities. It is
widely used in fields asking for high privacy.
A P2P network
A network based on the
client-server model
NYC Data Science Academy
BitCoin
 The fundamental paper by Satoshi Nakamot
 Feature: Based on algorithm and public recognition, Decentralized
 Scarcity, Mining, SHA256, Easy to exam, limit of speed
 Comparing to Gold. Does bitcoin worth it?
 Is BitCoin a Ponzi Scheme?
 BitCoin and Anarchism
 Problems: Copycats, Deflation, Anti-Conservation
 How to maintain and manage the P2P network?
NYC Data Science Academy
Blueprint of Electronic Money
NYC Data Science Academy
Duplicated transactions
 Solution: An authorized organization to record and exam transactions
 A Mint is an organization that produce valid electronic money(avoid duplicated
transactions). Receiver of a transaction need to send electronic money back to the
mint for validation.
 Pitfall: Relying too much on the central organization
(Breakdown, Attacked, Manipulated, Monitored or Spied)
NYC Data Science Academy
Basic Concepts: the system of Bitcoin
 Block: account book
 Transaction
 Bitcoin
 Item: record of transactions
 Transactions are recorded by Items
 A block consists of many items (and other data)
 Many blocks form a chain
 Iterate over the items in the block chain to check account balance and transaction
validity,
NYC Data Science Academy
Experiment: Check a block
 http://blockexplorer.com/
 Enter your block number to see the data
NYC Data Science Academy
What is inside a Block?
NYC Data Science Academy
Transaction
NYC Data Science Academy
Block
 Bitcoin system only record blocks but not balance. Balance is calculated from items
(records of transactions) in blocks
 Every block stores all the items from all over the world in ten minutes. And there will
be a new block every ten minutes. The speed is stable.
 Number of items in a block is not stationary
 Every node is producing block but the valid block is unique. We will talk about it later.
 An ideal block:
Block ID
Item 1,
Item 2,
...
Item n
Previous Block ID,
Next Block ID,
Other Information
NYC Data Science Academy
Block Chain
 Blocks are connected by doubly linked list according to their generation order. This
structure is convenient for iteration.
 Every node is storing a block chain. Finally these chains are all the same, as the only
valid one in the system.
The 1st Block
Block ID
Prev ID
Next ID
The 2nd Block
Block ID
Prev ID
Next ID
The 3rd Block
Block ID
Prev ID
Next ID
NYC Data Science Academy
Bitcoin and block generation
 How to create Bitcoin: generate blocks (Fierce competitions of the generation, that is
what we called 'Mining' .)
 Rules: the first to the 210 thousand-th block worth 50 Bitcoins each, the 210
thousand-th to the 420 thousand-th block woth 25 Bitcoins, and so on. Repeating this
procedure, we will get in total 21Million Bitcoins.
 Because the real-world is always expanding, Bitcoin is determined to meet the
problem of deflation.
 Blocks will be generated cotinuously, because transactions will be charged for the
service.
NYC Data Science Academy
Security
 Private key and Public key, digital signature
 SHA256: http://en.wikipedia.org/wiki/SHA-2
NYC Data Science Academy
Security
 Private key and Public key, digital signature
 SHA256: http://en.wikipedia.org/wiki/SHA-2
NYC Data Science Academy
Security
 Enough money for the transaction (Solved)
 Authenticity of transaction
 Repeat Transactions
NYC Data Science Academy
Authenticity of transaction: Digital Signature
NYC Data Science Academy
 Calculate a hash number a, from all the data of block A.
 Store a in the next block B.
 Verify that if A is the previous block of B: Calculate a from A again, then compare to
the hash number x stored in B.
 Generate b from B and store it in C. Then we repeat this process and will get a block
chain.
Duplicated Transactions: Timestamp
Block
Previous hash number x
Item Item Item Item
Block
Previous hash number x
Item Item Item Item
NYC Data Science Academy
Timestamp
 Do not rely on the local time, only related to the order of blocks
 If there's a center maintaining the chain of valid blocks, it would be easy to check
duplicated transactions.
 How to achieve it in a decentralized network?
NYC Data Science Academy
Problems of P2P
 Various network condition
 Nodes are not running 24/7
 No center for management
 May exist evil nodes
NYC Data Science Academy
Bitcoin solution of P2P
 Proof of Work
 Controlling of block generation speed
 Block broadcast and valid block chain
NYC Data Science Academy
Proof of Work
1. Calculate a hash number from the latest block
2. Keep receive items that are broadcasted but not inside any blocks. Check them and
delete invalid ones(not enough money).
3. Randomly choose a number, Nounce.
4. Group data in step 1~3 and use SHA256 to calculate a 256bit hash number x.
5. Verify if there are enough leading 0s in x. If yes, then verify if this x meets the
difficulty. If yes, then this process is finished.
6. Else, repeat from step 2. If there's a new block from other nodes, we need to restart
the whole process.
NYC Data Science Academy
Difficulty of Proff-of-Work
 https://en.bitcoin.it/wiki/Difficulty
NYC Data Science Academy
Difficulty
 Controlling the speed of block generation. Updated every 2016 blocks (2 weeks) .
 Difficulty = maximum_target / current_target
 The target is a 256-bit number (extremely large) that all Bitcoin clients share. The SHA-
256 hash of a block's header must be lower than or equal to the current target for the
block to be accepted by the network. The lower the target, the more difficult it is to
generate a block.
 Max target:
00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
 Current target (this is changing):
0000000000000000B3AA00000000000000000000000000000000000000000000
NYC Data Science Academy
Bits
 Each block stores a packed representation (called "Bits") for its actual hexadecimal
target. The target can be derived from it via a predefined formula. For example, if the
packed target in the block is 0x1b0404cb, the hexadecimal target is
 0x0404cb * 2**(8*(0x1b - 3)) =
0x00000000000404CB000000000000000000000000000000000000000000000000
NYC Data Science Academy
Difficulty is a Global parameter
 If there's the only valid block chain, every node will get the same difficulty.
 Difficulty is controlling the speed of block generation
 Difficulty is also useful when checking a block's validity.
NYC Data Science Academy
Meaning of Difficulty
 Control the speed and avoid inflation. A rapid increase in computation power is not
affecting the generation speed.
 Increase the cost of cheating.
 The P2P netword need a lot of nodes to ensure the security (avoid manipulation).
Difficulty is what drives nodes running.
NYC Data Science Academy
Temporal Block
 Content of the block:
1. x genereted from SHA256, as the block ID
2. All the collected valid items
3. Random Number n
4. The latest hash number from the global block chain
5. Other informations
 Broadcast this block to the P2P network
 What will other nodes do:
Duplication transactions and Validation
NYC Data Science Academy
Validation
 Get items in the block
 Check if there's duplicated items
 Other validation steps
 Link this block to the end of the locally stored 'Global Block Chain' . It is not formally
added to the global block chain yet.
NYC Data Science Academy
Braches
 A node will receive many new blocks generated from a common global chain.
 For each block, generate braches locally.
 Nodes are receiving blocks in different time points, and this leads to different local
braches.
 When there comes a longer chain, a node will turn to the longer one and discard the
shorter one.
 This algorithms will ensure the convergence to the longest chain.
NYC Data Science Academy
Example of Braches
 The Green block is the 1st block of the world.
 Black blocks represents the longest block
chain, and validated to be the global chain.
 Grey blocks are blocks on local braches, and
discarded finally.
NYC Data Science Academy
Example of Braches
1. The form of two braches.
2. The right brach receive a new block and we discard the left one.
3. Again, different blocks linked to the end of global chain.
NYC Data Science Academy
Example of Braches
4. Firstly we receive two more blocks on the right brach
5. And another two blocks on the left brach, now these two
braches are still of the same length.
6. Receive another block and we finally discards the right one.
NYC Data Science Academy
Example of Braches
7. The left brach receives another block.
8. Another one added to the left branch.
NYC Data Science Academy
Example of Braches
 Finally, we have our longest block chain.
NYC Data Science Academy
Confirm the Transaction
 To confirm a transaction, we need to add it to a newly generated block, and after 5
more blocks, this transaction could be finally confirmed and the transaction is
successfully recorded.
 After 6 blocks added to the global chain, it is nearly impossible to cheat or attack the
original chain. The cheater cannot find a cluster that overwhelms all the other honest
nodes and add 6 more fake blocks to the global chain.
 Once the transaction is confirmed, it is almost impossible to modify or cancel.
NYC Data Science Academy
Summary of security of Bitcoin
 All nodes in a P2P network monitor and save the global unique transaction backup
 Timestamp ensure the order of blocks is valid
 SHA256 ensure the generation of a block is hard, but validation is easy.
 Proof-of-Work ensure the majority (honest nodes) have the true transaction record.
NYC Data Science Academy
Problems of Bitcoin system
 Privacy
 Transaction needs a lot of time to be confirmed
 Deflation
 Anti Conservation
 Increasing amount of data
NYC Data Science Academy
Bitcoin in Action!
 How to register?
 How to mine?
 How to trade Bitcoin?
 How to pay with Bitcoin?
NYC Data Science Academy
The official website
 https://bitcoin.org/en/
NYC Data Science Academy
What? There's official website?
 https://bitcoin.org/en/about-us
NYC Data Science Academy
Bitcoin Wallet
 MultiBit
NYC Data Science Academy
Need Screenshot from Mac or just
demonstration in real time
 Need Screenshot from Mac or just demonstration in real time
NYC Data Science Academy
Bitcoin Miner
 GUIMiner
NYC Data Science Academy
Popular Mining Website
 Deepbit
 BTCGuild
 BMP
NYC Data Science Academy
Need Screenshot from Mac or just
demonstration in real time
 Need Screenshot from Mac or just demonstration in real time
NYC Data Science Academy
Bitcoin exchange
 Mt.Gox: It was the largest website, but closed in February 2014.
 BTC-E: https://btc-e.com/
 Bitstamp: https://www.bitstamp.net/
NYC Data Science Academy
Pay with Bitcoin
 Bitcoin is told to be the best currency for illegal missions.
 But publicly it is not very popular.
 Donate bitcoin to personal projects is more popular. As in the popular game 2048.
NYC Data Science Academy
FAQ
FAQ

More Related Content

PDF
Bit coin(2)
Srinivas Vaidyanathan
 
PPT
BIT COIN ,MINING & ATM
Sumbal Jahan
 
PPTX
Bit coin presentation
Olexiy Dubilet
 
PPTX
BITCOIN EXPLAINED
Murlidhar Sarda
 
PPTX
Introduction to Bit Coin Model
Asoka Korale
 
PPTX
Bitcoin
ghanbarianm
 
PPT
An introduction to bit coins and bit coin mining
Anirudh Kadevari
 
PPTX
Withum cryptocurrency 101
Withum
 
BIT COIN ,MINING & ATM
Sumbal Jahan
 
Bit coin presentation
Olexiy Dubilet
 
BITCOIN EXPLAINED
Murlidhar Sarda
 
Introduction to Bit Coin Model
Asoka Korale
 
Bitcoin
ghanbarianm
 
An introduction to bit coins and bit coin mining
Anirudh Kadevari
 
Withum cryptocurrency 101
Withum
 

What's hot (20)

PDF
Report on Bitcoin- The cryptocurrency (November 2017)
AJSH & Co LLP
 
PPTX
What is Bitcoin?
SAKSHAM AGARWAL
 
PPTX
Bitcoin data mining
malathieswaran29
 
PDF
BitCoining Experience
Ranjeet Tayi
 
PPTX
Bitcoin presentation slides
Ahmad Asad
 
PPTX
Bitcoin - Understanding and Assessing potential Opportunities
QuasarVentures
 
PDF
Bitcoin: The Internet of Money Seminar Report
MaheshInder2
 
ODP
A primer on Bitcoin Technology
Sebin Benjamin
 
PPTX
Bitcoin:Global Digital Currency
Surbhi Jain
 
KEY
Introduction to bitcoin
Wolf McNally
 
PDF
Bitcoin as an Emerging Technology Written Report
Shane Hickey
 
PPTX
Introduction to BitCoin
Rajesh Kumar
 
PDF
Seminar Report On Bitcoin
Touroxy
 
PPTX
Bitcoin ppt
Rohit Gautam
 
PPTX
Bitcoin ppt
shivaniyadav112
 
PDF
What is Bitcoin? - A guide for beginners
Jonathan Waller
 
DOCX
BITCOIN TECHNOLOGY(AAappZZ)
Arun Nair
 
PPTX
Blockchain and Bitcoin
Hugo Rodrigues
 
Report on Bitcoin- The cryptocurrency (November 2017)
AJSH & Co LLP
 
What is Bitcoin?
SAKSHAM AGARWAL
 
Bitcoin data mining
malathieswaran29
 
BitCoining Experience
Ranjeet Tayi
 
Bitcoin presentation slides
Ahmad Asad
 
Bitcoin - Understanding and Assessing potential Opportunities
QuasarVentures
 
Bitcoin: The Internet of Money Seminar Report
MaheshInder2
 
A primer on Bitcoin Technology
Sebin Benjamin
 
Bitcoin:Global Digital Currency
Surbhi Jain
 
Introduction to bitcoin
Wolf McNally
 
Bitcoin as an Emerging Technology Written Report
Shane Hickey
 
Introduction to BitCoin
Rajesh Kumar
 
Seminar Report On Bitcoin
Touroxy
 
Bitcoin ppt
Rohit Gautam
 
Bitcoin ppt
shivaniyadav112
 
What is Bitcoin? - A guide for beginners
Jonathan Waller
 
BITCOIN TECHNOLOGY(AAappZZ)
Arun Nair
 
Blockchain and Bitcoin
Hugo Rodrigues
 
Ad

Viewers also liked (10)

PPTX
Bitcoin -An Introduction
Sudhanshu Maurya
 
PPTX
Bitcoin - An Introduction
Dawie Poolman
 
PDF
Magento North East: Introduction to BitCoin
Peacock Carter Ltd
 
PDF
An Introduction to BitCoin and Cryptocurrency Ecosystem
Jalal Rohani
 
PPTX
Introduction Bitcoin
Chitpong Wuttanan
 
PDF
What is Bitcoin? How Bitcoin works in under 5 minutes.
Ryan Shea
 
PPTX
Bitcoin technology
Wajid Hamdani
 
PPTX
Bitcoin - the Basics
Vesa Linja-aho
 
PDF
An Introduction to Bitcoin
Sigimera
 
PDF
Bitcoin: The Internet of Money
winklevosscap
 
Bitcoin -An Introduction
Sudhanshu Maurya
 
Bitcoin - An Introduction
Dawie Poolman
 
Magento North East: Introduction to BitCoin
Peacock Carter Ltd
 
An Introduction to BitCoin and Cryptocurrency Ecosystem
Jalal Rohani
 
Introduction Bitcoin
Chitpong Wuttanan
 
What is Bitcoin? How Bitcoin works in under 5 minutes.
Ryan Shea
 
Bitcoin technology
Wajid Hamdani
 
Bitcoin - the Basics
Vesa Linja-aho
 
An Introduction to Bitcoin
Sigimera
 
Bitcoin: The Internet of Money
winklevosscap
 
Ad

Similar to Introduction to bit coin (20)

DOCX
Get Some Ideas About Bitcoin.docx
SameerShaik43
 
PPTX
The Basic Theories of Blockchain
Sota Watanabe
 
PPTX
Blockchain. A Guide For Beginners
ElifTech
 
PPTX
The Blockchain - The Technology behind Bitcoin
Jérôme Kehrli
 
PDF
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
Mariya James
 
PPTX
BLOCKCHAIN PPT.pptx
SohanaAmreen
 
PDF
Bitcoin : A fierce decentralized crypto currency - Report
Shivek Khurana
 
PDF
Blockchain Money PPTjthkgykjtjkhyjhj.pdf
mrmanojkumar1004
 
PPTX
1910990335_ppt on blockchain and its issue.ppt
bansalvvinayak832
 
PPTX
BLOCKCHAIN TECHNOLOGY
garishma bhatia
 
PDF
Blockchain Facts_ What Is It, How It Works, and How It Can Be Used.pdf
MaryRozetteNuezca
 
DOCX
38 C O M M U N I C AT I O N S O F T H E A C M M A.docx
domenicacullison
 
PDF
Basics of Block Chain
Tharindu Weerasinghe
 
PDF
Blockchain Technology | Bitcoin | Ethereum Coin | Cryptocurrency
Unbiased Technolab
 
PPT
Blockchain
Naveen Kumar Neelam
 
PPTX
Blockchain
TinaGupta23
 
PDF
A_Survey_on_Mining_Cryptocurrencies Paper
allberson
 
PPTX
Blockchain technology
Rajlakshmi Maurya
 
PDF
Blockchain and bitcoin
Tejhaskar Ashok Kumar
 
PPTX
Tutorial blockchain technical overview-ss
Howard Anglin
 
Get Some Ideas About Bitcoin.docx
SameerShaik43
 
The Basic Theories of Blockchain
Sota Watanabe
 
Blockchain. A Guide For Beginners
ElifTech
 
The Blockchain - The Technology behind Bitcoin
Jérôme Kehrli
 
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
Mariya James
 
BLOCKCHAIN PPT.pptx
SohanaAmreen
 
Bitcoin : A fierce decentralized crypto currency - Report
Shivek Khurana
 
Blockchain Money PPTjthkgykjtjkhyjhj.pdf
mrmanojkumar1004
 
1910990335_ppt on blockchain and its issue.ppt
bansalvvinayak832
 
BLOCKCHAIN TECHNOLOGY
garishma bhatia
 
Blockchain Facts_ What Is It, How It Works, and How It Can Be Used.pdf
MaryRozetteNuezca
 
38 C O M M U N I C AT I O N S O F T H E A C M M A.docx
domenicacullison
 
Basics of Block Chain
Tharindu Weerasinghe
 
Blockchain Technology | Bitcoin | Ethereum Coin | Cryptocurrency
Unbiased Technolab
 
Blockchain
TinaGupta23
 
A_Survey_on_Mining_Cryptocurrencies Paper
allberson
 
Blockchain technology
Rajlakshmi Maurya
 
Blockchain and bitcoin
Tejhaskar Ashok Kumar
 
Tutorial blockchain technical overview-ss
Howard Anglin
 

More from Vivian S. Zhang (20)

PDF
Why NYC DSA.pdf
Vivian S. Zhang
 
PPTX
Career services workshop- Roger Ren
Vivian S. Zhang
 
PDF
Nycdsa wordpress guide book
Vivian S. Zhang
 
PDF
We're so skewed_presentation
Vivian S. Zhang
 
PDF
Wikipedia: Tuned Predictions on Big Data
Vivian S. Zhang
 
PDF
A Hybrid Recommender with Yelp Challenge Data
Vivian S. Zhang
 
PDF
Kaggle Top1% Solution: Predicting Housing Prices in Moscow
Vivian S. Zhang
 
PDF
Data mining with caret package
Vivian S. Zhang
 
PDF
Xgboost
Vivian S. Zhang
 
PPTX
Streaming Python on Hadoop
Vivian S. Zhang
 
PDF
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its author
Vivian S. Zhang
 
PDF
Xgboost
Vivian S. Zhang
 
PDF
Nyc open-data-2015-andvanced-sklearn-expanded
Vivian S. Zhang
 
PDF
Nycdsa ml conference slides march 2015
Vivian S. Zhang
 
PDF
THE HACK ON JERSEY CITY CONDO PRICES explore trends in public data
Vivian S. Zhang
 
PDF
Max Kuhn's talk on R machine learning
Vivian S. Zhang
 
PDF
Winning data science competitions, presented by Owen Zhang
Vivian S. Zhang
 
PDF
Using Machine Learning to aid Journalism at the New York Times
Vivian S. Zhang
 
PDF
Introducing natural language processing(NLP) with r
Vivian S. Zhang
 
PDF
Bayesian models in r
Vivian S. Zhang
 
Why NYC DSA.pdf
Vivian S. Zhang
 
Career services workshop- Roger Ren
Vivian S. Zhang
 
Nycdsa wordpress guide book
Vivian S. Zhang
 
We're so skewed_presentation
Vivian S. Zhang
 
Wikipedia: Tuned Predictions on Big Data
Vivian S. Zhang
 
A Hybrid Recommender with Yelp Challenge Data
Vivian S. Zhang
 
Kaggle Top1% Solution: Predicting Housing Prices in Moscow
Vivian S. Zhang
 
Data mining with caret package
Vivian S. Zhang
 
Streaming Python on Hadoop
Vivian S. Zhang
 
Kaggle Winning Solution Xgboost algorithm -- Let us learn from its author
Vivian S. Zhang
 
Nyc open-data-2015-andvanced-sklearn-expanded
Vivian S. Zhang
 
Nycdsa ml conference slides march 2015
Vivian S. Zhang
 
THE HACK ON JERSEY CITY CONDO PRICES explore trends in public data
Vivian S. Zhang
 
Max Kuhn's talk on R machine learning
Vivian S. Zhang
 
Winning data science competitions, presented by Owen Zhang
Vivian S. Zhang
 
Using Machine Learning to aid Journalism at the New York Times
Vivian S. Zhang
 
Introducing natural language processing(NLP) with r
Vivian S. Zhang
 
Bayesian models in r
Vivian S. Zhang
 

Recently uploaded (20)

PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Basics and rules of probability with real-life uses
ravatkaran694
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 

Introduction to bit coin

  • 1. NYC Data Science Academy Introduction to BitCoin
  • 2. NYC Data Science Academy P2P: Peer-to-Peer Network  A peer-to-peer (P2P) network is a type of decentralized and distributed network architecture in which individual nodes in the network (called "peers") act as both suppliers and consumers of resources, in contrast to the centralized client–server model where client nodes request access to resources provided by central servers.  Peers are distributed in the whole Internet. It is hard to control and monitor the network activities. It is widely used in fields asking for high privacy. A P2P network A network based on the client-server model
  • 3. NYC Data Science Academy BitCoin  The fundamental paper by Satoshi Nakamot  Feature: Based on algorithm and public recognition, Decentralized  Scarcity, Mining, SHA256, Easy to exam, limit of speed  Comparing to Gold. Does bitcoin worth it?  Is BitCoin a Ponzi Scheme?  BitCoin and Anarchism  Problems: Copycats, Deflation, Anti-Conservation  How to maintain and manage the P2P network?
  • 4. NYC Data Science Academy Blueprint of Electronic Money
  • 5. NYC Data Science Academy Duplicated transactions  Solution: An authorized organization to record and exam transactions  A Mint is an organization that produce valid electronic money(avoid duplicated transactions). Receiver of a transaction need to send electronic money back to the mint for validation.  Pitfall: Relying too much on the central organization (Breakdown, Attacked, Manipulated, Monitored or Spied)
  • 6. NYC Data Science Academy Basic Concepts: the system of Bitcoin  Block: account book  Transaction  Bitcoin  Item: record of transactions  Transactions are recorded by Items  A block consists of many items (and other data)  Many blocks form a chain  Iterate over the items in the block chain to check account balance and transaction validity,
  • 7. NYC Data Science Academy Experiment: Check a block  http://blockexplorer.com/  Enter your block number to see the data
  • 8. NYC Data Science Academy What is inside a Block?
  • 9. NYC Data Science Academy Transaction
  • 10. NYC Data Science Academy Block  Bitcoin system only record blocks but not balance. Balance is calculated from items (records of transactions) in blocks  Every block stores all the items from all over the world in ten minutes. And there will be a new block every ten minutes. The speed is stable.  Number of items in a block is not stationary  Every node is producing block but the valid block is unique. We will talk about it later.  An ideal block: Block ID Item 1, Item 2, ... Item n Previous Block ID, Next Block ID, Other Information
  • 11. NYC Data Science Academy Block Chain  Blocks are connected by doubly linked list according to their generation order. This structure is convenient for iteration.  Every node is storing a block chain. Finally these chains are all the same, as the only valid one in the system. The 1st Block Block ID Prev ID Next ID The 2nd Block Block ID Prev ID Next ID The 3rd Block Block ID Prev ID Next ID
  • 12. NYC Data Science Academy Bitcoin and block generation  How to create Bitcoin: generate blocks (Fierce competitions of the generation, that is what we called 'Mining' .)  Rules: the first to the 210 thousand-th block worth 50 Bitcoins each, the 210 thousand-th to the 420 thousand-th block woth 25 Bitcoins, and so on. Repeating this procedure, we will get in total 21Million Bitcoins.  Because the real-world is always expanding, Bitcoin is determined to meet the problem of deflation.  Blocks will be generated cotinuously, because transactions will be charged for the service.
  • 13. NYC Data Science Academy Security  Private key and Public key, digital signature  SHA256: http://en.wikipedia.org/wiki/SHA-2
  • 14. NYC Data Science Academy Security  Private key and Public key, digital signature  SHA256: http://en.wikipedia.org/wiki/SHA-2
  • 15. NYC Data Science Academy Security  Enough money for the transaction (Solved)  Authenticity of transaction  Repeat Transactions
  • 16. NYC Data Science Academy Authenticity of transaction: Digital Signature
  • 17. NYC Data Science Academy  Calculate a hash number a, from all the data of block A.  Store a in the next block B.  Verify that if A is the previous block of B: Calculate a from A again, then compare to the hash number x stored in B.  Generate b from B and store it in C. Then we repeat this process and will get a block chain. Duplicated Transactions: Timestamp Block Previous hash number x Item Item Item Item Block Previous hash number x Item Item Item Item
  • 18. NYC Data Science Academy Timestamp  Do not rely on the local time, only related to the order of blocks  If there's a center maintaining the chain of valid blocks, it would be easy to check duplicated transactions.  How to achieve it in a decentralized network?
  • 19. NYC Data Science Academy Problems of P2P  Various network condition  Nodes are not running 24/7  No center for management  May exist evil nodes
  • 20. NYC Data Science Academy Bitcoin solution of P2P  Proof of Work  Controlling of block generation speed  Block broadcast and valid block chain
  • 21. NYC Data Science Academy Proof of Work 1. Calculate a hash number from the latest block 2. Keep receive items that are broadcasted but not inside any blocks. Check them and delete invalid ones(not enough money). 3. Randomly choose a number, Nounce. 4. Group data in step 1~3 and use SHA256 to calculate a 256bit hash number x. 5. Verify if there are enough leading 0s in x. If yes, then verify if this x meets the difficulty. If yes, then this process is finished. 6. Else, repeat from step 2. If there's a new block from other nodes, we need to restart the whole process.
  • 22. NYC Data Science Academy Difficulty of Proff-of-Work  https://en.bitcoin.it/wiki/Difficulty
  • 23. NYC Data Science Academy Difficulty  Controlling the speed of block generation. Updated every 2016 blocks (2 weeks) .  Difficulty = maximum_target / current_target  The target is a 256-bit number (extremely large) that all Bitcoin clients share. The SHA- 256 hash of a block's header must be lower than or equal to the current target for the block to be accepted by the network. The lower the target, the more difficult it is to generate a block.  Max target: 00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF  Current target (this is changing): 0000000000000000B3AA00000000000000000000000000000000000000000000
  • 24. NYC Data Science Academy Bits  Each block stores a packed representation (called "Bits") for its actual hexadecimal target. The target can be derived from it via a predefined formula. For example, if the packed target in the block is 0x1b0404cb, the hexadecimal target is  0x0404cb * 2**(8*(0x1b - 3)) = 0x00000000000404CB000000000000000000000000000000000000000000000000
  • 25. NYC Data Science Academy Difficulty is a Global parameter  If there's the only valid block chain, every node will get the same difficulty.  Difficulty is controlling the speed of block generation  Difficulty is also useful when checking a block's validity.
  • 26. NYC Data Science Academy Meaning of Difficulty  Control the speed and avoid inflation. A rapid increase in computation power is not affecting the generation speed.  Increase the cost of cheating.  The P2P netword need a lot of nodes to ensure the security (avoid manipulation). Difficulty is what drives nodes running.
  • 27. NYC Data Science Academy Temporal Block  Content of the block: 1. x genereted from SHA256, as the block ID 2. All the collected valid items 3. Random Number n 4. The latest hash number from the global block chain 5. Other informations  Broadcast this block to the P2P network  What will other nodes do: Duplication transactions and Validation
  • 28. NYC Data Science Academy Validation  Get items in the block  Check if there's duplicated items  Other validation steps  Link this block to the end of the locally stored 'Global Block Chain' . It is not formally added to the global block chain yet.
  • 29. NYC Data Science Academy Braches  A node will receive many new blocks generated from a common global chain.  For each block, generate braches locally.  Nodes are receiving blocks in different time points, and this leads to different local braches.  When there comes a longer chain, a node will turn to the longer one and discard the shorter one.  This algorithms will ensure the convergence to the longest chain.
  • 30. NYC Data Science Academy Example of Braches  The Green block is the 1st block of the world.  Black blocks represents the longest block chain, and validated to be the global chain.  Grey blocks are blocks on local braches, and discarded finally.
  • 31. NYC Data Science Academy Example of Braches 1. The form of two braches. 2. The right brach receive a new block and we discard the left one. 3. Again, different blocks linked to the end of global chain.
  • 32. NYC Data Science Academy Example of Braches 4. Firstly we receive two more blocks on the right brach 5. And another two blocks on the left brach, now these two braches are still of the same length. 6. Receive another block and we finally discards the right one.
  • 33. NYC Data Science Academy Example of Braches 7. The left brach receives another block. 8. Another one added to the left branch.
  • 34. NYC Data Science Academy Example of Braches  Finally, we have our longest block chain.
  • 35. NYC Data Science Academy Confirm the Transaction  To confirm a transaction, we need to add it to a newly generated block, and after 5 more blocks, this transaction could be finally confirmed and the transaction is successfully recorded.  After 6 blocks added to the global chain, it is nearly impossible to cheat or attack the original chain. The cheater cannot find a cluster that overwhelms all the other honest nodes and add 6 more fake blocks to the global chain.  Once the transaction is confirmed, it is almost impossible to modify or cancel.
  • 36. NYC Data Science Academy Summary of security of Bitcoin  All nodes in a P2P network monitor and save the global unique transaction backup  Timestamp ensure the order of blocks is valid  SHA256 ensure the generation of a block is hard, but validation is easy.  Proof-of-Work ensure the majority (honest nodes) have the true transaction record.
  • 37. NYC Data Science Academy Problems of Bitcoin system  Privacy  Transaction needs a lot of time to be confirmed  Deflation  Anti Conservation  Increasing amount of data
  • 38. NYC Data Science Academy Bitcoin in Action!  How to register?  How to mine?  How to trade Bitcoin?  How to pay with Bitcoin?
  • 39. NYC Data Science Academy The official website  https://bitcoin.org/en/
  • 40. NYC Data Science Academy What? There's official website?  https://bitcoin.org/en/about-us
  • 41. NYC Data Science Academy Bitcoin Wallet  MultiBit
  • 42. NYC Data Science Academy Need Screenshot from Mac or just demonstration in real time  Need Screenshot from Mac or just demonstration in real time
  • 43. NYC Data Science Academy Bitcoin Miner  GUIMiner
  • 44. NYC Data Science Academy Popular Mining Website  Deepbit  BTCGuild  BMP
  • 45. NYC Data Science Academy Need Screenshot from Mac or just demonstration in real time  Need Screenshot from Mac or just demonstration in real time
  • 46. NYC Data Science Academy Bitcoin exchange  Mt.Gox: It was the largest website, but closed in February 2014.  BTC-E: https://btc-e.com/  Bitstamp: https://www.bitstamp.net/
  • 47. NYC Data Science Academy Pay with Bitcoin  Bitcoin is told to be the best currency for illegal missions.  But publicly it is not very popular.  Donate bitcoin to personal projects is more popular. As in the popular game 2048.
  • 48. NYC Data Science Academy FAQ FAQ