SlideShare a Scribd company logo
BITCOIN AND THE BLOCKCHAIN
FOR THE ENGINEER IN YOU
BLOCKCHAIN
INTRO
INTRO
WHY BITCOIN?
▸ Bitcoin is the first blockchain implementation
▸ The underlying use case (double-entry accounting) is easy
to understand
▸ The important part is not the crypto currency, it’s the
DECENTRALISED TRUST
THE BLOCKCHAIN
THE BLOCKCHAIN
WHAT IS IT?
▸ A replicated database (every full
node has a copy 140 GB)
▸ Constructed as a simple linked-list
▸ Each element is called a block
▸ Each element contains a large set
of data
THE BLOCKCHAIN
VOCABULARY
▸ Genesis block: The first block of
the chain, hardcoded in the system
▸ Block height: a block’s distance to
the genesis block
▸ Block depth: a block’s distance to
the current tip of the chain
THE BLOCKCHAIN
HOW IS TRUST ACHIEVED?
▸ Everybody has a copy of the database
▸ The database is (almost) append-only (i.e. data written is
immutable)
▸ The consistency of the database is easily verified as the
system follows specic rules
THE BLOCKCHAIN
THE PROOF OF WORK CONCEPT
▸ Writing into the database is controlled
▸ It must be difficult enough so that
• It requires a fair amount of computing power (cost, to discourage
attacks)
• It does not happen too often (to achieve consistency more easily)
▸ Solving the proof of work must be difficult, checking that the solution
found is right must be easy (typically using a hashing algorithm)
▸ Writers are called miners and they compete to write the next block
in the chain
THE BITCOIN
IMPLEMENTATION
TRANSACTIONS
THE BITCOIN IMPLEMENTATION
THE BITCOIN IMPLEMENTATION - TRANSACTIONS
ANATOMY OF A TRANSACTION
▸ A transaction uses previous transaction output(s) as input(s) and spends
them as new outputs
THE BITCOIN IMPLEMENTATION - TRANSACTIONS
TRANSACTION OUTPUT
▸ The address to which the funds are delivered is part of the locking
script (see Encumbrance script)
▸ Satoshis are 1/106th of a Bitcoin
▸ 1/103th of a Bitcoin are called milliBitcoin
THE BITCOIN IMPLEMENTATION - TRANSACTIONS
TRANSACTION INPUT
▸ References a previous transaction output
▸ Provides the means to unlock the money attached
BLOCKS
THE BITCOIN IMPLEMENTATION
THE BITCOIN IMPLEMENTATION - BLOCKS
ANATOMY OF A BLOCK
▸ A block is composed of
• a header
• a list of transactions (several 100s)
THE BITCOIN IMPLEMENTATION - BLOCKS
THE GENERATION BLOCK
▸ This is how Bitcoin are minted
▸ This is how the “miners” are compensated for the
computing power they lend to the network
▸ It is a special transaction with no inputs
▸ It contains a predefined amount of Bitcoins
▸ It contains the sum of transaction fees that the miner
pockets
THE BITCOIN IMPLEMENTATION - BLOCKS
THE BLOCK HEADER
▸ It contains
• A reference to the parent block
• A signature for the whole block (see Merkle Tree)
• A timestamp
• A difficulty target
• The proof of work
ENCUMBRANCE SCRIPT
THE BITCOIN IMPLEMENTATION
THE BITCOIN IMPLEMENTATION - ENCUMBRANCE SCRIPT
DESCRIPTION
▸ This is a bit of code that “locks” the bitcoin in an output
▸ It is based on a Forth-like reverse-polish notation stack-based
execution language
▸ It has a small set of available operations

(https://en.bitcoin.it/wiki/Script)
▸ Allow for other uses cases than locking to a user’s address
THE BITCOIN IMPLEMENTATION - ENCUMBRANCE SCRIPT
EXAMPLE
▸ Encumbrance script
▸ OP_SHA256 BITCOIN_ADDRESS OP_EQUAL
▸ Unlocking
▸ PUBLIC_KEY
Reality
is
a
bit
m
ore
com
plicated
ELEMENTS OF ARCHITECTURE
THE BITCOIN IMPLEMENTATION
ELEMENTS OF ARCHITECTURE
SOME PARAMETERS
▸ Total number of bitcoins: 21 millions, by 2140
▸ Generation speed: 50 bitcoins per block when it started
in 2009. Amount divided by 2 every 210,000 blocks (~4
years)
▸ Difficulty adjustment: every 2,016 blocks (~2 weeks)
▸ Typical fees: Depends on transaction size !
ELEMENTS OF ARCHITECTURE
RESOLVING THE FORKS
▸ It is possible that 2 miners competing might find a solution
at more or less the same time
▸ In this case, it creates 2 “sub-networks” of miners that try to
build a block based on a different parent
▸ Basically the first group that finishes wins as the network
always accepts the longest chain
ELEMENTS OF ARCHITECTURE
MERKLE TREE
▸ Binary hash tree
▸ Signs/summarises the entire dataset in a single hash
ELEMENTS OF ARCHITECTURE
MERKLE TREE - MERKLE PATH
▸ By communicating log2(n) transactions, one can prove the
inclusion of a transaction in the block
A block with 2048
transactions weighs
512 kB
There are 484700
blocks (Sept 2017)—>
140 GB
It takes only 11
hashes, i.e. 352
bytes to prove that a
transaction belongs
to this block
ELEMENTS OF ARCHITECTURE
BLOOM FILTER
▸ Allows to request transactions of interest without revealing one’s identity
▸ A bloom filter is a bit field of N bits
▸ It is based on H hashing algorithms that output a hash value between 1 and
N
▸ If a node is interested in a transaction
1.it hashes the transaction and gets a value V between 1 and N
2.it flips the Vth bit of the filter to 1
3.does the same with the other H hashing functions
4.does the same with the other transactions of interests
▸ It then broadcast this filter to neighbouring full bitcoin nodes
ELEMENTS OF ARCHITECTURE
BLOOM FILTER
▸ Allows to request transactions of interest without revealing one’s identity
ELEMENTS OF ARCHITECTURE
PROOF OF WORK AND TIMING
▸ The Bitcoin network is calibrated so that one block is generated
every 10 minutes on average
▸ It is based on a difficulty level that is fine-tuned every 2 weeks
▸ Miner compete to find a nonce so that the SHA256 hash of the
block header is smaller than the difculty target
▸ Miners moved from desktop computer CPU to FPGA to
specialised hardware (ASIC) that encodes SHA256 on the chip
▸ Today it is useless to try to mine bitcoin on a desktop computer
ELEMENTS OF ARCHITECTURE
PROOF OF WORK - NUMBERS
▸ In 2014:
▸ It took about 150 quadrillions hashes per second to find a
solution for a block (150 x 1015)
▸ The network was bringing 100 petahashes per second (100 x
1015)
▸ Resulted in a 1 block every 10 minutes
▸ Today (Sept 11th 2017)

(https://bitcoinwisdom.com/bitcoin/difculty)
▸ 5.6 x 1018 hashes per second
ELEMENTS OF ARCHITECTURE
PROOF OF WORK - SOURCE OF ENTROPY (1/3)
ELEMENTS OF ARCHITECTURE
PROOF OF WORK - SOURCE OF ENTROPY (2/3)
ELEMENTS OF ARCHITECTURE
PROOF OF WORK - SOURCE OF ENTROPY (3/3)
SECURITY
THE BITCOIN IMPLEMENTATION
SECURITY
TWO ATTACK TYPES
▸ Double spend
▸ Likelihood decreases with the block depth
▸ Denial of Service on an address
GOING FURTHER
OTHER BLOCKCHAINS
GOING FURTHER
LITECOIN
Litecoin is a peer-to-peer Internet currency that enables instant,
near-zero cost payments to anyone in the world. Litecoin is an
open source, global payment network that is fully decentralized
without any central authorities. Mathematics secures the network
and empowers individuals to control their own finances. Litecoin
features faster transaction confirmation times and improved
storage efficiency than the leading math-based currency. With
substantial industry support, trade volume and liquidity, Litecoin is
a proven medium of commerce complementary to Bitcoin.
NAMECOIN
Namecoin is a decentralized open source
information registration and transfer
system based on the Bitcoin cryptocurrency
ETHEREUM
Ethereum is a decentralized platform that runs smart
contracts: applications that run exactly as programmed
without any possibility of downtime, censorship, fraud or third
party interference.
Ethereum is how the Internet was supposed to work.
Ethereum was crowdfunded during August 2014 by fans all
around the world. It is developed by ETHDEV with
contributions from great minds across the globe.
And
for
the
Pros,
it is Turing
com
plete
LIMITATIONS
GOING FURTHER
GOING FURTHER
LIMITATIONS
▸ Waste a lot of resources
https://digiconomist.net/bitcoin-energy-consumption
GOING FURTHER
LIMITATIONS
▸ Concentration: Just a few mining rings doing most of the blocks
https://blockchain.info/blocks
GOING FURTHER
▸ Miner vulnerable
▸ Their location is known. Margins are low.
▸ Scalability
▸ The block size is limited. Lot of waste. 10 min for a block to appear
▸ Ambiguity due to forks
▸ Long latency to get the “truth”
▸ Suppose an honest majority of miners
LIMITATIONS
A NEW PROMISE?
GOING FURTHER
GOING FURTHER
▸ Algorand (https://people.csail.mit.edu/nickolai/papers/
gilad-algorand-eprint.pdf)
▸ No fork (10-18)
▸ No proof of work
▸ Byzantine agreement
▸ Assumes that the majority (2/3) of the money is in honest
hand
▸ Remains to be tested out of the lab
▸ Uses VRFs (Verifiable Random Function)
A NEW PROMISE?
MIT Turing Award
recipient Silvio Micali
ROTI
48
GrĂŠgory Bataille
@gregbveten
Pix4D
Back end engineer
Photogrammetry

More Related Content

What's hot

CBGTBT - Part 2 - Blockchains 101
CBGTBT - Part 2 - Blockchains 101CBGTBT - Part 2 - Blockchains 101
CBGTBT - Part 2 - Blockchains 101
Blockstrap.com
 
Introduction to Lightning Network
Introduction to Lightning NetworkIntroduction to Lightning Network
Introduction to Lightning Network
Alan Carbery
 
CBGTBT - Part 6 - Transactions 102
CBGTBT - Part 6 - Transactions 102CBGTBT - Part 6 - Transactions 102
CBGTBT - Part 6 - Transactions 102
Blockstrap.com
 
Building real-time apps with WebSockets
Building real-time apps with WebSocketsBuilding real-time apps with WebSockets
Building real-time apps with WebSockets
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Crytomining hacking
Crytomining hackingCrytomining hacking
Crytomining hacking
Cis siva
 
Blockchain part 2
Blockchain part 2Blockchain part 2
Blockchain part 2
Sanjay Basu
 
Real world blockchains
Real world blockchainsReal world blockchains
Real world blockchains
Dmitry Meshkov
 
CBGTBT - Part 3 - Transactions 101
CBGTBT - Part 3 - Transactions 101CBGTBT - Part 3 - Transactions 101
CBGTBT - Part 3 - Transactions 101
Blockstrap.com
 
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
 
Meta X Blockchain Bootcamp
Meta X Blockchain BootcampMeta X Blockchain Bootcamp
Meta X Blockchain Bootcamp
MetaX
 
Jason genge (A Bitcoin Lover) - what is ethereum ?
Jason genge (A Bitcoin Lover) - what is ethereum ?Jason genge (A Bitcoin Lover) - what is ethereum ?
Jason genge (A Bitcoin Lover) - what is ethereum ?
Jason Simeon Genge
 
Blockchain
BlockchainBlockchain
Blockchain
Soichiro Takagi
 
Ethereum Web3.js - Some tips for the developer
Ethereum Web3.js - Some  tips  for  the developer Ethereum Web3.js - Some  tips  for  the developer
Ethereum Web3.js - Some tips for the developer
炫成 林
 
Ethereum Intro
Ethereum IntroEthereum Intro
Ethereum Intro
Dejan Radic
 
以比特幣為例的區塊鏈技術介紹 ( 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)
Nicholas Lin
 
Writing smart contracts
Writing smart contractsWriting smart contracts
Writing smart contracts
Marek Kirejczyk
 
BLOCKCHAIN TECHNOLOGY
BLOCKCHAIN TECHNOLOGYBLOCKCHAIN TECHNOLOGY
BLOCKCHAIN TECHNOLOGY
garishma bhatia
 
Bitcoin
BitcoinBitcoin
Bitcoin
Sikun Lin
 
Intro into blockchain
Intro into blockchainIntro into blockchain
Intro into blockchain
Roderik van der Veer
 
Euklid (1)
Euklid (1)Euklid (1)
Euklid (1)
Antonio Simeone
 

What's hot (20)

CBGTBT - Part 2 - Blockchains 101
CBGTBT - Part 2 - Blockchains 101CBGTBT - Part 2 - Blockchains 101
CBGTBT - Part 2 - Blockchains 101
 
Introduction to Lightning Network
Introduction to Lightning NetworkIntroduction to Lightning Network
Introduction to Lightning Network
 
CBGTBT - Part 6 - Transactions 102
CBGTBT - Part 6 - Transactions 102CBGTBT - Part 6 - Transactions 102
CBGTBT - Part 6 - Transactions 102
 
Building real-time apps with WebSockets
Building real-time apps with WebSocketsBuilding real-time apps with WebSockets
Building real-time apps with WebSockets
 
Crytomining hacking
Crytomining hackingCrytomining hacking
Crytomining hacking
 
Blockchain part 2
Blockchain part 2Blockchain part 2
Blockchain part 2
 
Real world blockchains
Real world blockchainsReal world blockchains
Real world blockchains
 
CBGTBT - Part 3 - Transactions 101
CBGTBT - Part 3 - Transactions 101CBGTBT - Part 3 - Transactions 101
CBGTBT - Part 3 - Transactions 101
 
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)
 
Meta X Blockchain Bootcamp
Meta X Blockchain BootcampMeta X Blockchain Bootcamp
Meta X Blockchain Bootcamp
 
Jason genge (A Bitcoin Lover) - what is ethereum ?
Jason genge (A Bitcoin Lover) - what is ethereum ?Jason genge (A Bitcoin Lover) - what is ethereum ?
Jason genge (A Bitcoin Lover) - what is ethereum ?
 
Blockchain
BlockchainBlockchain
Blockchain
 
Ethereum Web3.js - Some tips for the developer
Ethereum Web3.js - Some  tips  for  the developer Ethereum Web3.js - Some  tips  for  the developer
Ethereum Web3.js - Some tips for the developer
 
Ethereum Intro
Ethereum IntroEthereum Intro
Ethereum Intro
 
以比特幣為例的區塊鏈技術介紹 ( 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)
 
Writing smart contracts
Writing smart contractsWriting smart contracts
Writing smart contracts
 
BLOCKCHAIN TECHNOLOGY
BLOCKCHAIN TECHNOLOGYBLOCKCHAIN TECHNOLOGY
BLOCKCHAIN TECHNOLOGY
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Intro into blockchain
Intro into blockchainIntro into blockchain
Intro into blockchain
 
Euklid (1)
Euklid (1)Euklid (1)
Euklid (1)
 

Similar to Bitcoin and blockchain engineering

BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
BlockchainHub Graz
 
Intro to blockchain - Dapper Dev Bootcamp
Intro to blockchain  - Dapper Dev BootcampIntro to blockchain  - Dapper Dev Bootcamp
Intro to blockchain - Dapper Dev Bootcamp
shotdsherrif
 
Blockchain and bitcoin
Blockchain and bitcoinBlockchain and bitcoin
Blockchain and bitcoin
Tejhaskar Ashok Kumar
 
Blockchain & Cryptocurrencies Intro - July 2017
Blockchain & Cryptocurrencies Intro - July 2017Blockchain & Cryptocurrencies Intro - July 2017
Blockchain & Cryptocurrencies Intro - July 2017
🔗Audrey Chaing
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchains
Brett Colbert
 
Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2
Wojciech Langiewicz
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How To
Nugroho Gito
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 Session
DSCIITPatna
 
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
SĂŠbastien Tandel
 
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
Ninad Sarang
 
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
 
Basics of Block Chain
Basics of Block ChainBasics of Block Chain
Basics of Block Chain
Tharindu Weerasinghe
 
Tutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssTutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ss
Howard Anglin
 
Node.js Blockchain Implementation
Node.js Blockchain ImplementationNode.js Blockchain Implementation
Node.js Blockchain Implementation
GlobalLogic Ukraine
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slides
Alex Akselrod
 
Introduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrenciesIntroduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrencies
Sergey Ivliev
 
BITCOIN EXPLAINED
BITCOIN EXPLAINEDBITCOIN EXPLAINED
BITCOIN EXPLAINED
Murlidhar Sarda
 
20190606 blockchain101
20190606 blockchain10120190606 blockchain101
20190606 blockchain101
Hu Kenneth
 
Connecting The Block Cointelligence Academy by Dr Vince Ming
Connecting The Block   Cointelligence Academy by Dr Vince MingConnecting The Block   Cointelligence Academy by Dr Vince Ming
Connecting The Block Cointelligence Academy by Dr Vince Ming
Cointelligence
 
Crypto currency1
Crypto currency1Crypto currency1
Crypto currency1
Karthik Muthuchandra
 

Similar to Bitcoin and blockchain engineering (20)

BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
 
Intro to blockchain - Dapper Dev Bootcamp
Intro to blockchain  - Dapper Dev BootcampIntro to blockchain  - Dapper Dev Bootcamp
Intro to blockchain - Dapper Dev Bootcamp
 
Blockchain and bitcoin
Blockchain and bitcoinBlockchain and bitcoin
Blockchain and bitcoin
 
Blockchain & Cryptocurrencies Intro - July 2017
Blockchain & Cryptocurrencies Intro - July 2017Blockchain & Cryptocurrencies Intro - July 2017
Blockchain & Cryptocurrencies Intro - July 2017
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchains
 
Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How To
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 Session
 
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
 
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
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin
 
Basics of Block Chain
Basics of Block ChainBasics of Block Chain
Basics of Block Chain
 
Tutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssTutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ss
 
Node.js Blockchain Implementation
Node.js Blockchain ImplementationNode.js Blockchain Implementation
Node.js Blockchain Implementation
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slides
 
Introduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrenciesIntroduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrencies
 
BITCOIN EXPLAINED
BITCOIN EXPLAINEDBITCOIN EXPLAINED
BITCOIN EXPLAINED
 
20190606 blockchain101
20190606 blockchain10120190606 blockchain101
20190606 blockchain101
 
Connecting The Block Cointelligence Academy by Dr Vince Ming
Connecting The Block   Cointelligence Academy by Dr Vince MingConnecting The Block   Cointelligence Academy by Dr Vince Ming
Connecting The Block Cointelligence Academy by Dr Vince Ming
 
Crypto currency1
Crypto currency1Crypto currency1
Crypto currency1
 

Recently uploaded

GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 

Recently uploaded (20)

GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 

Bitcoin and blockchain engineering

  • 1. BITCOIN AND THE BLOCKCHAIN FOR THE ENGINEER IN YOU BLOCKCHAIN
  • 3. INTRO WHY BITCOIN? ▸ Bitcoin is the rst blockchain implementation ▸ The underlying use case (double-entry accounting) is easy to understand ▸ The important part is not the crypto currency, it’s the DECENTRALISED TRUST
  • 5. THE BLOCKCHAIN WHAT IS IT? ▸ A replicated database (every full node has a copy 140 GB) ▸ Constructed as a simple linked-list ▸ Each element is called a block ▸ Each element contains a large set of data
  • 6. THE BLOCKCHAIN VOCABULARY ▸ Genesis block: The rst block of the chain, hardcoded in the system ▸ Block height: a block’s distance to the genesis block ▸ Block depth: a block’s distance to the current tip of the chain
  • 7. THE BLOCKCHAIN HOW IS TRUST ACHIEVED? ▸ Everybody has a copy of the database ▸ The database is (almost) append-only (i.e. data written is immutable) ▸ The consistency of the database is easily veried as the system follows specic rules
  • 8. THE BLOCKCHAIN THE PROOF OF WORK CONCEPT ▸ Writing into the database is controlled ▸ It must be difcult enough so that • It requires a fair amount of computing power (cost, to discourage attacks) • It does not happen too often (to achieve consistency more easily) ▸ Solving the proof of work must be difcult, checking that the solution found is right must be easy (typically using a hashing algorithm) ▸ Writers are called miners and they compete to write the next block in the chain
  • 11. THE BITCOIN IMPLEMENTATION - TRANSACTIONS ANATOMY OF A TRANSACTION ▸ A transaction uses previous transaction output(s) as input(s) and spends them as new outputs
  • 12. THE BITCOIN IMPLEMENTATION - TRANSACTIONS TRANSACTION OUTPUT ▸ The address to which the funds are delivered is part of the locking script (see Encumbrance script) ▸ Satoshis are 1/106th of a Bitcoin ▸ 1/103th of a Bitcoin are called milliBitcoin
  • 13. THE BITCOIN IMPLEMENTATION - TRANSACTIONS TRANSACTION INPUT ▸ References a previous transaction output ▸ Provides the means to unlock the money attached
  • 15. THE BITCOIN IMPLEMENTATION - BLOCKS ANATOMY OF A BLOCK ▸ A block is composed of • a header • a list of transactions (several 100s)
  • 16. THE BITCOIN IMPLEMENTATION - BLOCKS THE GENERATION BLOCK ▸ This is how Bitcoin are minted ▸ This is how the “miners” are compensated for the computing power they lend to the network ▸ It is a special transaction with no inputs ▸ It contains a predened amount of Bitcoins ▸ It contains the sum of transaction fees that the miner pockets
  • 17. THE BITCOIN IMPLEMENTATION - BLOCKS THE BLOCK HEADER ▸ It contains • A reference to the parent block • A signature for the whole block (see Merkle Tree) • A timestamp • A difculty target • The proof of work
  • 19. THE BITCOIN IMPLEMENTATION - ENCUMBRANCE SCRIPT DESCRIPTION ▸ This is a bit of code that “locks” the bitcoin in an output ▸ It is based on a Forth-like reverse-polish notation stack-based execution language ▸ It has a small set of available operations
 (https://en.bitcoin.it/wiki/Script) ▸ Allow for other uses cases than locking to a user’s address
  • 20. THE BITCOIN IMPLEMENTATION - ENCUMBRANCE SCRIPT EXAMPLE ▸ Encumbrance script ▸ OP_SHA256 BITCOIN_ADDRESS OP_EQUAL ▸ Unlocking ▸ PUBLIC_KEY Reality is a bit m ore com plicated
  • 21. ELEMENTS OF ARCHITECTURE THE BITCOIN IMPLEMENTATION
  • 22. ELEMENTS OF ARCHITECTURE SOME PARAMETERS ▸ Total number of bitcoins: 21 millions, by 2140 ▸ Generation speed: 50 bitcoins per block when it started in 2009. Amount divided by 2 every 210,000 blocks (~4 years) ▸ Difculty adjustment: every 2,016 blocks (~2 weeks) ▸ Typical fees: Depends on transaction size !
  • 23. ELEMENTS OF ARCHITECTURE RESOLVING THE FORKS ▸ It is possible that 2 miners competing might nd a solution at more or less the same time ▸ In this case, it creates 2 “sub-networks” of miners that try to build a block based on a different parent ▸ Basically the rst group that nishes wins as the network always accepts the longest chain
  • 24. ELEMENTS OF ARCHITECTURE MERKLE TREE ▸ Binary hash tree ▸ Signs/summarises the entire dataset in a single hash
  • 25. ELEMENTS OF ARCHITECTURE MERKLE TREE - MERKLE PATH ▸ By communicating log2(n) transactions, one can prove the inclusion of a transaction in the block A block with 2048 transactions weighs 512 kB There are 484700 blocks (Sept 2017)—> 140 GB It takes only 11 hashes, i.e. 352 bytes to prove that a transaction belongs to this block
  • 26. ELEMENTS OF ARCHITECTURE BLOOM FILTER ▸ Allows to request transactions of interest without revealing one’s identity ▸ A bloom lter is a bit eld of N bits ▸ It is based on H hashing algorithms that output a hash value between 1 and N ▸ If a node is interested in a transaction 1.it hashes the transaction and gets a value V between 1 and N 2.it flips the Vth bit of the lter to 1 3.does the same with the other H hashing functions 4.does the same with the other transactions of interests ▸ It then broadcast this lter to neighbouring full bitcoin nodes
  • 27. ELEMENTS OF ARCHITECTURE BLOOM FILTER ▸ Allows to request transactions of interest without revealing one’s identity
  • 28. ELEMENTS OF ARCHITECTURE PROOF OF WORK AND TIMING ▸ The Bitcoin network is calibrated so that one block is generated every 10 minutes on average ▸ It is based on a difculty level that is ne-tuned every 2 weeks ▸ Miner compete to nd a nonce so that the SHA256 hash of the block header is smaller than the difculty target ▸ Miners moved from desktop computer CPU to FPGA to specialised hardware (ASIC) that encodes SHA256 on the chip ▸ Today it is useless to try to mine bitcoin on a desktop computer
  • 29. ELEMENTS OF ARCHITECTURE PROOF OF WORK - NUMBERS ▸ In 2014: ▸ It took about 150 quadrillions hashes per second to nd a solution for a block (150 x 1015) ▸ The network was bringing 100 petahashes per second (100 x 1015) ▸ Resulted in a 1 block every 10 minutes ▸ Today (Sept 11th 2017)
 (https://bitcoinwisdom.com/bitcoin/difculty) ▸ 5.6 x 1018 hashes per second
  • 30.
  • 31. ELEMENTS OF ARCHITECTURE PROOF OF WORK - SOURCE OF ENTROPY (1/3)
  • 32. ELEMENTS OF ARCHITECTURE PROOF OF WORK - SOURCE OF ENTROPY (2/3)
  • 33. ELEMENTS OF ARCHITECTURE PROOF OF WORK - SOURCE OF ENTROPY (3/3)
  • 35. SECURITY TWO ATTACK TYPES ▸ Double spend ▸ Likelihood decreases with the block depth ▸ Denial of Service on an address
  • 38. LITECOIN Litecoin is a peer-to-peer Internet currency that enables instant, near-zero cost payments to anyone in the world. Litecoin is an open source, global payment network that is fully decentralized without any central authorities. Mathematics secures the network and empowers individuals to control their own finances. Litecoin features faster transaction confirmation times and improved storage efficiency than the leading math-based currency. With substantial industry support, trade volume and liquidity, Litecoin is a proven medium of commerce complementary to Bitcoin.
  • 39. NAMECOIN Namecoin is a decentralized open source information registration and transfer system based on the Bitcoin cryptocurrency
  • 40. ETHEREUM Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference. Ethereum is how the Internet was supposed to work. Ethereum was crowdfunded during August 2014 by fans all around the world. It is developed by ETHDEV with contributions from great minds across the globe. And for the Pros, it is Turing com plete
  • 42. GOING FURTHER LIMITATIONS ▸ Waste a lot of resources https://digiconomist.net/bitcoin-energy-consumption
  • 43. GOING FURTHER LIMITATIONS ▸ Concentration: Just a few mining rings doing most of the blocks https://blockchain.info/blocks
  • 44. GOING FURTHER ▸ Miner vulnerable ▸ Their location is known. Margins are low. ▸ Scalability ▸ The block size is limited. Lot of waste. 10 min for a block to appear ▸ Ambiguity due to forks ▸ Long latency to get the “truth” ▸ Suppose an honest majority of miners LIMITATIONS
  • 46. GOING FURTHER ▸ Algorand (https://people.csail.mit.edu/nickolai/papers/ gilad-algorand-eprint.pdf) ▸ No fork (10-18) ▸ No proof of work ▸ Byzantine agreement ▸ Assumes that the majority (2/3) of the money is in honest hand ▸ Remains to be tested out of the lab ▸ Uses VRFs (Veriable Random Function) A NEW PROMISE? MIT Turing Award recipient Silvio Micali
  • 47. ROTI