SlideShare una empresa de Scribd logo
1 de 73
Descargar para leer sin conexión
402/55 Lime Street Sydney 2000 NSW > AUSTRALIA> WWW.OCTO.COM
My life as a Blockchain Transaction
Yann Rouillard + Erwan Alliaume - April 2018
Deep dive into the blockchain
2OCTO TECHNOLOGY > THERE IS A BETTER WAY
WHO ARE WE?
Yann Rouillard
Senior consultant / expert DevOps
Erwan Alliaume
Senior consultant / CTO
3OCTO TECHNOLOGY > THERE IS A BETTER WAY
How to buy us
a beer using
bitcoin…
from your wallet to ours
through the blockchain
OCTO TECHNOLOGY > THERE IS A BETTER WAY 4
LIFECYCLE OVERVIEW
1F1tAaz5x1HUXrCNLM
ACCOUNT CREATION
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 5
TRANSACTION
PREPARATION
LIFECYCLE OVERVIEW
Tx
1F1tAaz5x1HUXrCNLM
ACCOUNT CREATION
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 6
TRANSACTION
SUBMISSION
LIFECYCLE OVERVIEW
Tx
1F1tAaz5x1HUXrCNLM
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
TRANSACTION
PREPARATION
ACCOUNT CREATION
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 7
TRANSACTION
EXECUTION
TRANSACTION
SUBMISSION
Tx
1F1tAaz5x1HUXrCNLM
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
TRANSACTION
PREPARATION
ACCOUNT CREATION
LIFECYCLE OVERVIEW
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 8
MINING PROCESS
Tx
1F1tAaz5x1HUXrCNLM
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
TRANSACTION
EXECUTION
TRANSACTION
SUBMISSION
TRANSACTION
PREPARATION
ACCOUNT CREATION
LIFECYCLE OVERVIEW
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 9
MINING PROCESS
LIFECYCLE OVERVIEW
Tx
1F1tAaz5x1HUXrCNLM
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx Tx
Tx
Tx
Tx
TRANSACTION
EXECUTION
TRANSACTION
SUBMISSION
TRANSACTION
PREPARATION
ACCOUNT CREATION
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 10
LIFECYCLE OVERVIEW
Tx
1F1tAaz5x1HUXrCNLM
Tx
MINING PROCESS
TRANSACTION
EXECUTION
TRANSACTION
SUBMISSION
TRANSACTION
PREPARATION
ACCOUNT CREATION
TRANSACTION
CONFIRMATION
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 11
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Some definitions first!
Transaction confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 12
THE ORIGIN: THE CYPHERPUNK MOVEMENT
OCTO TECHNOLOGY > THERE IS A BETTER WAY 13
WHAT IS A CRYPTO-CURRENCY?
Scarcity Fungibility
Transferability Divisibility
Durability
A crypto-currency is a virtual currency that
uses cryptography to guarantee
currency essential properties
OCTO TECHNOLOGY > THERE IS A BETTER WAY 14
SOME FAMOUS CRYPTO-CURRENCIES
Dogecoin
Bitcoin Dash
Litecoin
Ether Ripple
OCTO TECHNOLOGY > THERE IS A BETTER WAY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 15
Early 19th-century German ledger
WHAT IS A LEDGER?
Not a very
new thing !
OCTO TECHNOLOGY > THERE IS A BETTER WAY 16
WHAT IS A DISTRIBUTED LEDGER?
Centralised Ledger Distributed Ledger
OCTO TECHNOLOGY > THERE IS A BETTER WAY 17
WHAT IS A BLOCKCHAIN?
A blockchain is
one of the possible implementations
of a distributed ledger
where transactions are stored
in a series of cryptography-linked blocks
OCTO TECHNOLOGY > THERE IS A BETTER WAY 18
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Account creation
Transaction confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 19
WHAT IS AN ACCOUNT?
An account is a uniquely identified object that will be
able to issue transactions and store currency
Two problems:
● how to create a unique identifier without
a central authority?
● how to ensure transactions has been legitimely
issued from an account?
OCTO TECHNOLOGY > THERE IS A BETTER WAY 20
WHAT IS AN ACCOUNT?
An account is a uniquely identified object that will be
able to issue transactions and store currency
Two problems:
● how to create a unique identifier without
a central authority?
● how to ensure transactions has been legitimely
issued from an account?
Cryptography to
the rescue!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 2
1
3
CRYPTOGRAPHY 101: ELECTRONIC SIGNATURE
IN ONE SLIDE
Not
John
Private
key
Public
key
✗
Someone’s private key
Someone else’s private key
≠
Key
generator
Private
key
Public
key
John
Lorem ipsum
dolor alok sit
amet, tipeke
consectetur
adipiscing so
elit, sed do
eiusmod te
Document
Sign
Signature
Verify
✓
Lorem ipsum
dolor alok sit
amet, tipeke
consectetur
adipiscing so
elit, sed do
eiusmod te
OCTO TECHNOLOGY > THERE IS A BETTER WAY 22
IN ONE SLIDE
01010001000110001011
11010100101110101010
10010101010101010101
01010110101001010101
01010101010100101010
10100101010101010100
1010100101101
0x32ab7f65
Original input
Hash value
✗
CRYPTOGRAPHY 101: CRYPTOGRAPHIC HASH FUNCTION
01010001000110001011
11010100101110101010
10010101010101010101
01010110101001010101
01010101010100101010
10100101010101010100
1010100101101
0x32ab7f65
Any size
Fixed size
01010001000110001011
11010100101110101010
10010101010101010101
01010110101001010101
01010101010100101010
10100101010101010100
1010100101100
0x47f42e10
Small change
Big change
01010001000110001011
11010100101110101010
10010101010101010101
01010110101001010101
01010101010100101010
10100101010101010100
1010100101101
0x32ab7f65
11001000100010010101
01010101010101101010
10101011010101010101
01010101010100010101
01001010010001001010
00100010000011111101
0111011111111
≠
Original
input
Different
input
✗
OCTO TECHNOLOGY > THERE IS A BETTER WAY 23
ACCOUNT CREATION: STANDARD MECHANISM
Private
key
Public
key
1. Key generation
Most blockchain use
Elliptic Curve Algorithms
2. Public Key Hashing
Ensure shorter address
Protect against attack
on Public key
3. Address Encoding
0bed7abd61247635c197
3eb38474a2516ed1d884
Make it (a bit more)
readable
OCTO TECHNOLOGY > THERE IS A BETTER WAY 24
NICE WARNINGA NICE WARNING
OCTO TECHNOLOGY > THERE IS A BETTER WAY
YOU ARE (often)
PSEUDONYMOUS
NOT ANONYMOUS
OCTO TECHNOLOGY > THERE IS A BETTER WAY 25
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Transaction preparation
Transaction confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 26
WHAT IS A TRANSACTION
The pay-us-a-beer transaction
Issuer Recipients
Transactions scripts
“ Send to addresses ”
Amount
OCTO TECHNOLOGY > THERE IS A BETTER WAY 27
APPEND-ONLY LEDGER
Create 25 coins and credit to You
Transfert 17 coins from You to Erwan
Transfert 8 coins from Erwan to Yann
Transfert 5 coins from Yann to You
Transfert 15 coins from You to Erwan
Is it valid?
Time
Might need to scan
backwards until genesis!
asserted by miners
signed by you
signed by Erwan
signed by Yann
signed by You
Source: https://youtu.be/t7sGcST61sM
OCTO TECHNOLOGY > THERE IS A BETTER WAY 28
A TRANSACTION-BASED LEDGER LIKE BITCOIN
Is it valid?
Time
Input: Ø Outputs: You=25
1 1
Input: Outputs: You=8 Erwan=17
2 1 211
Input: Outputs: Erwan=9 Yann=83 1 22 2
Input: Outputs: Yann=3 You=13
4 1 2
2 1
3 2
Input: Outputs: You=-2 Erwan=24
5 1
4 2
2
3 1
Finite scan to
check validity
WTF!!!
Source: https://youtu.be/t7sGcST61sM
OCTO TECHNOLOGY > THERE IS A BETTER WAY 29
BITCOIN TRANSACTION BOOKKEEPING
You have
10 bitcoins
as base
balance
Tx1: pay-me-a-beer
Input 1 Output 1
Output 2
Unspent = your balance
10 - 1 = 9
easy!
1 bitcoin
9 bitcoins
unspent
Tx2: don’t forget Yann!
Input 1 Output 1
Output 2
1 bitcoin
5 bitcoins
unspent
Unspent = your balance
9 - 1 = 5 ??Really??
Yes, you gave 3 bitcoins as mining fees
9 - 1 -5 = 3
Inputs
Bitcoins to spend
Each input is a signed reference
from a previous trnx
Outputs
Assign to new
owners
Each output can be used by only 1
input do avoid double spend
Unspent outputs = balance of somebody
This is what we call bitcoins (add all unspent of a public ledger to
know how many bitcoins has the chain
Mining fees
sum(inputs) - sum(outputs)
OCTO TECHNOLOGY > THERE IS A BETTER WAY 30
TRANSACTION SIGNATURE
The pay-us-a-beer transaction
Input 1 Output 1
Digital
signature
Public key
1. You are paying the beer, so
you have to sign your
transaction with your private
key
2. You have to attach the the
signature and your public key
to the transaction so anybody
can check it
This process can be
done offline!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 31
OK OK, BUT WHAT ARE THE TRANSACTION SCRIPT
YOU WERE TALKING ABOUT
Bitcoin is using a stack
based language
Often limited instructions set
No-Loops in bitcoin
Sender choose the script
(but could be refused)
ByteCode running in a
Virtual Machine
OCTO TECHNOLOGY > THERE IS A BETTER WAY 32
SCRIPTING CAPABILITIES ARE DIFFERENT
FROM ONE BLOCKCHAIN TO ANOTHER!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 33
BITCOIN SCRIPT EXECUTION, A REAL LIFE EXAMPLE
<< Public Key >>
<< Signature>>
Check Transaction signature script!
99% of created transactions in bitcoin are using this script!
OP_DUP
OP_HASH160
<< PubKeyHash? >>
OP_EQUAL_VERIFY
OP_CHECK_SIG
Script
scriptPubKey
(output)
Signature
scriptSig
(input)
<< Public Key >>
<< Signature>>
Duplicate top of
the stack
<< Public Key >>
Hash top of the
stack
Source: https://youtu.be/ci1jFDRPoCw
INSTRUCTIONS MEMORY
OCTO TECHNOLOGY > THERE IS A BETTER WAY 34
BITCOIN SCRIPT EXECUTION, A REAL LIFE EXAMPLE
<< Public Key >>
<< Signature>>
Check Transaction signature script!
99% of created transactions in bitcoin are using this script!
OP_DUP
OP_HASH160
<< PubKeyHash? >>
OP_EQUAL_VERIFY
OP_CHECK_SIG
<< Public Key >>
<< Signature>>
<< Pub Key Hash >>
<< Pub Key Hash? >>
Public key hash
given by the
sender
Check 2 top
stack values
Check the
signature!
Source: https://youtu.be/ci1jFDRPoCw
INSTRUCTIONS MEMORY
Script
scriptPubKey
(output)
Signature
scriptSig
(input)
OCTO TECHNOLOGY > THERE IS A BETTER WAY 35
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Transaction submission
Transaction confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 36
FIRST STEP: FIND YOUR FRIENDS
To be able to do anything on the
blockchain, you must first...
Client node
Discover the blockchain network!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 37
Bootstrap node
Bootstrap node
FIRST STEP: FIND YOUR FRIENDS
To be able to do anything on the
blockchain, you must first...
Client node
Discover the blockchain network!
1. Find Bootstrap nodes
139.218.14.2
92.164.12.8
Hardcoded
addresses
OCTO TECHNOLOGY > THERE IS A BETTER WAY 38
FIRST STEP: FIND YOUR FRIENDS
To be able to do anything on the
blockchain, you must first...
Client node
Discover the blockchain network!
1. Find Bootstrap nodes
2. Find Peer nodes
Bootstrap node
Bootstrap node
Unknown nodesKnown nodes
OCTO TECHNOLOGY > THERE IS A BETTER WAY 39
FIRST STEP: FIND YOUR FRIENDS
To be able to do anything on the
blockchain, you must first...
Client node
Discover the blockchain network!
1. Find Bootstrap nodes
2. Find Peer nodes
3. Connect to random nodes
Bootstrap node
Bootstrap node
Unknown nodesKnown nodes
The whole network is
eventually interconnected
OCTO TECHNOLOGY > THERE IS A BETTER WAY 40
SECOND STEP: GOSSIP WITH YOUR FRIENDS
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
OCTO TECHNOLOGY > THERE IS A BETTER WAY
Principle
Just forward every transaction to
your neighbours!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 41
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Why it is cool?
● Reliable in case of failure
SECOND STEP: GOSSIP WITH YOUR FRIENDS
OCTO TECHNOLOGY > THERE IS A BETTER WAY
Tx
Tx
Tx
Principle
Just forward every transaction to
your neighbours!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 42
SECOND STEP: GOSSIP WITH YOUR FRIENDS
OCTO TECHNOLOGY > THERE IS A BETTER WAY
Principle
Just forward every transaction to
your neighbours!
Why it is cool?
● Reliable in case of failure
● Guaranteed delivery in
bounded time
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Less
than
10s
OCTO TECHNOLOGY > THERE IS A BETTER WAY 43
SECOND STEP: GOSSIP WITH YOUR FRIENDS
OCTO TECHNOLOGY > THERE IS A BETTER WAY
Principle
Just forward every transaction to
your neighbours!
Why it is cool?
● Reliable in case of failure
● Guaranteed delivery in
bounded time
● Scale with the number of peers
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
OCTO TECHNOLOGY > THERE IS A BETTER WAY 44
BAD TRANSACTIONS SHALL NOT PASS!
Transaction validity is first checked
before being accepted and transferred ✓Valid transaction
format…………..
✓Valid transaction…..
instructions used….
✓Valid signature
from the author……
✓Transaction integrity
not tampered……….
✓Coins spent are
available…………....
There should be a consensus about
validation rules among clients
Validation rules updates are
propagated through software
updates
OCTO TECHNOLOGY > THERE IS A BETTER WAY 45
LET’S GO TO THE POOL!
Accepted transactions go into a transaction pool
Mining node A
Pay-us-a-beer
Buy Crypto Kitty
Buy ICO Scam Token
Transactions
Buy ICO Scam Token
Buy ICO Scam Token
TransactionPool
Fee
30
25
12
7
0
Orderedbyfee
independently maintained by each node
Mining node B
Buy Crypto Kitty
Buy ICO Scam Token
Transactions
Buy ICO Scam Token
Buy ICO Scam Token
Fee
25
12
7
0
Buy Drugs 2
TransactionPool
Non
consistent
view across
all nodesBuy Drugs 2
OCTO TECHNOLOGY > THERE IS A BETTER WAY 46
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Mining process
Transaction confirmation
Tx Buy Crypto Kitty
OCTO TECHNOLOGY > THERE IS A BETTER WAY 473
A SIMPLE EXECUTION MODEL
...that are executed sequentially
Tx Buy Crypto Kitty
Tx Buy Beer
Transaction Pool
Tx Buy Beer Tx Buy Crypto Kitty
New Potential
Blockchain State
State 3State 2
Initial
Blockchain State
State 1
Transactions are just state transition functions...
47
OCTO TECHNOLOGY > THERE IS A BETTER WAY 483
BUT WHAT IS A BLOCKCHAIN STATE?
It depends...
20 coins spendable by Bob
10 coins spendable by John
5 coins spendable by Bob
5 coins spendable by Lucie
Unspent transactions coins
Bitcoin State
1F1tAaz5x
1F1tAaz5x
1F1tAaz5x
Ethereum State
Account information
Bob has 25 coins
John has 10 coins
Lucie has 5 coins
Contract Foo contains A=10
}
cont
{
48
OCTO TECHNOLOGY > THERE IS A BETTER WAY 49
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
OCTO TECHNOLOGY > THERE IS A BETTER WAY
A MODEL NOT VERY SCALABLE
All nodes execute
all the transactions
Adding new nodes
doesn’t increase
computing power
OCTO TECHNOLOGY > THERE IS A BETTER WAY 503
PROTECTIONS AGAINST THE EVIL
Solution
No Loop or Goto in script langage
Pay for each instruction execution
Threat 1 Infinite loop in transaction scripts
Solution
Transaction chaining
Incremental id per transaction/account
Threat 2 Transaction Replay attack
OCTO TECHNOLOGY > THERE IS A BETTER WAY 51
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Block propagation
Transaction confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 52
DID WE SAY BLOCKCHAIN? WHAT IS IT?
Now that our pay-us-a-beer transaction is executed and validated,
it needs to be included in a newly created block
Previous Block
Hash
Transactions
Tree
Random
Nonce
Current
Block Hash
Our block!
Previous Block
Hash
Transactions
Tree
Random
Nonce
Current
Block Hash
Block N-1
Previous Block
Hash
Transactions
Tree
Random
Nonce
Current
Block Hash
Block N+1
The average block generation time
is usually constant
● ~10 mn for Bitcoin
● ~12 seconds for Ethereum
Why to bundle transactions in a block?
● Single unit of work for miners
( will be described later )
● Limit length of the blockchain
( faster to verify history )
Merkle Root
Hash
Hash HashHashHash
Hash
Dat
a 4
Dat
a 3
Dat
a 2
Dat
a 1
Tx4Tx3Tx1 Tx2
Transactions
pay-us-a-beer TX
OCTO TECHNOLOGY > THERE IS A BETTER WAY 53
HOW TO RESOLVE COMPETING STATES?
Tx1
Tx2
Tx6
Tx5
Tx4
Tx3
Tx3
Tx4
Tx5
Tx6
Tx3
Tx5
Tx4
Tx6
Tx1
Tx2
Tx3
Tx4
Tx5
Tx6
How to bundle
transactions in blocks
pay-us-a-beer TX
Distributed process =
need to arbitrate between several valid states
?
OCTO TECHNOLOGY > THERE IS A BETTER WAY 54
CONSENSUS ALGORITHM
“ How to find a truth, in a world full of liars ”
● Agree on a unique blockchain state
amongst all valid possibilities
● Prevent bad actors from influencing
the outcome
● Ensure a consensus will be
eventually reached despite faulty and
evil nodes
Sybil attack
fake multitude of nodes using forged
identities
Double spend
spending the same money twice
Transaction censorship or delaying
prevent trnx to be included in the
blockchain
Long Range attack
Create a long valid blockchain and
advertise it to new nodes joining
Most well known
attacks
OCTO TECHNOLOGY > THERE IS A BETTER WAY 55
2 main answers to avoid those attacks
● Choose the next block producer
randomly!
● Ensure messing with the blockchain
is not for free
Solution = Mining!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 56
hash( block + random value ) < difficulty
PROOF OF WORK, THE MOST COMMON MINING TECHNIQUE
A computational challenge must be solved
to be able to create a valid block
Challenge: Find a random hash value inferior to a threshold (difficulty)
Difficulty is regularly adjusted to keep a constant average block generation time
OCTO TECHNOLOGY > THERE IS A BETTER WAY 57
RESOLVING FORKS
The process continues and
What happen when 2 miners find a block at the same time?
OCTO TECHNOLOGY > THERE IS A BETTER WAY 58
WHAT A MINER IS DOING?
1. Collect transactions from the pool
2. Validate transactions
3. Invest power and electricity!
4. Try to create a new block as previously
described
5. Eventually, get rewards in form of new
created bitcoins
* old numbers
OCTO TECHNOLOGY > THERE IS A BETTER WAY 59
CAREERS.OCTO.COM.AU
OCTO TECHNOLOGY > THERE IS A BETTER WAY 60
Account creation
Transaction preparation
Transaction submission
Transaction execution
Mining process
Lifecycle of a transaction:
Transaction confirmation
Transaction confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 61
BEFORE: THE (NOT SO SIMPLE) BLOCK PROPAGATION
● Like transactions, blocks are propagated
in the network using the Gossip protocol
● On Bitcoin
50% of blocks are propagated under 6s
Problem: High propagation time is bad for security
but 10% are often propagated > 120s
OCTO TECHNOLOGY > THERE IS A BETTER WAY 62
2
2
✗
✗
3
IMPACT OF A SMALL BLOCK TIME
1
12 s 18 s 24 s
25%
50%
25%
1
1
2
A
B
C
BLOCK TIME: 6 S
PROPAGATION TIME: 12 S
1'
✗
✗
2'
12 s 18 s 24 s0 s 6 s
OCTO TECHNOLOGY > THERE IS A BETTER WAY 63
CENTRALISATION COUNTER-MEASURES
High propagation time lead to centralisation
Solutions:
● Low block size and
high block time
1 MB Block size limit
● Make orphan blocks
count to select winner
OCTO TECHNOLOGY > THERE IS A BETTER WAY 643
THE TRANSACTION CONFIRMATION ISSUE
● Transactions can be re-organized in the short term as part of
forks resolution
● Problem: blockchain are eventually consistent
C
A P
Tx 1
Tx 3
Tx 3 Tx 4
Tx
Tx
Tx 1
Tx Tx 3
Tx 3
OCTO TECHNOLOGY > THERE IS A BETTER WAY 653
HOW TO BE SURE ABOUT YOUR TRANSACTION
The oldest is a transaction
the less likely a transaction could be reverted
Tx
Not sure we will have our beer!
0 confirmation
OCTO TECHNOLOGY > THERE IS A BETTER WAY 663
HOW TO BE SURE ABOUT YOUR TRANSACTION
The oldest is a transaction
the less likely a transaction could be reverted
Tx 1Tx Tx 2 Tx 3
We may have our beer!
3 confirmations
OCTO TECHNOLOGY > THERE IS A BETTER WAY 673
HOW TO BE SURE ABOUT YOUR TRANSACTION
The oldest is a transaction
the less likely a transaction could be reverted
Tx 1Tx Tx 2 Tx 3 Tx 4 Tx 5 Tx 6
6 confirmations
We will have our beer!
OCTO TECHNOLOGY > THERE IS A BETTER WAY 683
HOW TO BE SURE ABOUT YOUR TRANSACTION
The oldest is a transaction
the less likely a transaction could be reverted
6 blocks-old transactions are considered close to 100% safe
Tx 1Tx Tx 2 Tx 3 Tx 4 Tx 5 Tx 6
6 confirmations
OCTO TECHNOLOGY > THERE IS A BETTER WAY 69
Thank you!
CAREERS.OCTO.COM.AU
OCTO TECHNOLOGY > THERE IS A BETTER WAY 70
Annexes
CAREERS.OCTO.COM.AU
Merkle Root
Data 4Data 3Data 2Data 1
OCTO TECHNOLOGY > THERE IS A BETTER WAY 713
COINS GROWTH ON (MERKLE) TREES
Most blockchains use Merkle Trees to store
transactions list or whole blockchain state
Data 4Data 3Data 1
Hash H3
Hash(Data 3)
Hash H4
Hash(Data 4)
Hash H2
Hash(Data 2)
Hash H1
Hash(Data 1)
Merkle Root
Hash(H12+H34)
Hash H34
Hash(H3+H4)
Hash H12
Hash(H1+H2)
Data 2
Hash H2
Hash(Data 2)
Merkle Root
Hash(H12+H34)
Hash H12
Hash(H1+H2)
Data 2
Merkle Trees are cool!
● Performant
Only re-hash what changed!
● Light Client Friendly
Easy to prove a transaction
without downloading the
whole tree!
Data modified
Tx Root
Tx 4Tx 3Tx 1
Tx Root
Tx 2
Block
OCTO TECHNOLOGY > THERE IS A BETTER WAY 723
WHERE ARE MERKLE TREES USED?
Bitcoin Ethereum
Tx 4Tx 3Tx 1 Tx 2
Tx Root
Tx Root
Block
Receipt Root
Rc 4Rc 3Rc 1
Receipt Root
Rc 2
Account 1
State Root
State Root
Account 2 Account 3 Account 4Storage
Block
Tx Buy Crypto Kitty
OCTO TECHNOLOGY > THERE IS A BETTER WAY 733
BACK TO TRANSACTIONS EXECUTION
Transactions are executed sequentially by nodes
State Root
Data
4
Data
3
Data
2
Data
1
Data 4Data 3Data 1 Data 2
State Root
Data
4
Data
3
Data
2
Data
1
Data 4Data 3Data 1 Data 2
State Root
Data
4
Data
3
Data
2
Data
1
Data 4Data 3Data 1 Data 2
Tx Buy Crypto Kitty
Tx Buy Beer
Transaction Pool
Tx Buy Beer Tx Buy Crypto Kitty
New Blockchain
State Hash
Ethereumexample

Más contenido relacionado

La actualidad más candente

bitcoin pricing - jan2017
bitcoin pricing - jan2017bitcoin pricing - jan2017
bitcoin pricing - jan2017Patrick Bucquet
 
BitCoin explained
BitCoin explainedBitCoin explained
BitCoin explainedHarelc
 
Boolberry reduces blockchain bloat
Boolberry reduces blockchain bloatBoolberry reduces blockchain bloat
Boolberry reduces blockchain bloatboolberry
 
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
 
Introduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSAIntroduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSANikesh Mistry
 
Bitcoin: the future money, or a scam?
Bitcoin: the future money, or a scam?Bitcoin: the future money, or a scam?
Bitcoin: the future money, or a scam?Ignaz Wanders
 
Cryptocurrency-Bitcoin
Cryptocurrency-BitcoinCryptocurrency-Bitcoin
Cryptocurrency-BitcoinSatwikaHotwani
 
Blockchain, Bitcoin, Mining - My Product School Presentation
Blockchain, Bitcoin, Mining - My Product School Presentation Blockchain, Bitcoin, Mining - My Product School Presentation
Blockchain, Bitcoin, Mining - My Product School Presentation Aarthi Srinivasan
 
Bitcoin (Cryptocurrency)
Bitcoin (Cryptocurrency)Bitcoin (Cryptocurrency)
Bitcoin (Cryptocurrency)Tsasaa Tsas
 
Bitcoin : A fierce Decentralized internet currency
Bitcoin : A fierce Decentralized internet currencyBitcoin : A fierce Decentralized internet currency
Bitcoin : A fierce Decentralized internet currencyShivek Khurana
 
Introduction to blockchain and cryptocurrency technologies
Introduction to blockchain and cryptocurrency technologiesIntroduction to blockchain and cryptocurrency technologies
Introduction to blockchain and cryptocurrency technologiesPaweł Wacławczyk
 
Introduction to bit coin
Introduction to bit coinIntroduction to bit coin
Introduction to bit coinVivian S. Zhang
 
Introduction to bitcoin
Introduction to bitcoinIntroduction to bitcoin
Introduction to bitcoinWolf McNally
 
Introduction to Bit Coin Model
Introduction to Bit Coin ModelIntroduction to Bit Coin Model
Introduction to Bit Coin ModelAsoka Korale
 
Report on Bitcoin- The cryptocurrency (November 2017)
Report on Bitcoin- The cryptocurrency (November 2017)Report on Bitcoin- The cryptocurrency (November 2017)
Report on Bitcoin- The cryptocurrency (November 2017)AJSH & Co LLP
 

La actualidad más candente (20)

Bitcoins Math
Bitcoins MathBitcoins Math
Bitcoins Math
 
bitcoin pricing - jan2017
bitcoin pricing - jan2017bitcoin pricing - jan2017
bitcoin pricing - jan2017
 
BitCoin explained
BitCoin explainedBitCoin explained
BitCoin explained
 
Boolberry reduces blockchain bloat
Boolberry reduces blockchain bloatBoolberry reduces blockchain bloat
Boolberry reduces blockchain bloat
 
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
 
Introduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSAIntroduction to Bitcoin and ECDSA
Introduction to Bitcoin and ECDSA
 
Bitcoin: the future money, or a scam?
Bitcoin: the future money, or a scam?Bitcoin: the future money, or a scam?
Bitcoin: the future money, or a scam?
 
Cryptocurrency-Bitcoin
Cryptocurrency-BitcoinCryptocurrency-Bitcoin
Cryptocurrency-Bitcoin
 
Blockchain, Bitcoin, Mining - My Product School Presentation
Blockchain, Bitcoin, Mining - My Product School Presentation Blockchain, Bitcoin, Mining - My Product School Presentation
Blockchain, Bitcoin, Mining - My Product School Presentation
 
Bitcoin (Cryptocurrency)
Bitcoin (Cryptocurrency)Bitcoin (Cryptocurrency)
Bitcoin (Cryptocurrency)
 
Bitcoin : A fierce Decentralized internet currency
Bitcoin : A fierce Decentralized internet currencyBitcoin : A fierce Decentralized internet currency
Bitcoin : A fierce Decentralized internet currency
 
BITCOIN EXPLAINED
BITCOIN EXPLAINEDBITCOIN EXPLAINED
BITCOIN EXPLAINED
 
Introduction to blockchain and cryptocurrency technologies
Introduction to blockchain and cryptocurrency technologiesIntroduction to blockchain and cryptocurrency technologies
Introduction to blockchain and cryptocurrency technologies
 
Introduction to bit coin
Introduction to bit coinIntroduction to bit coin
Introduction to bit coin
 
Introduction to bitcoin
Introduction to bitcoinIntroduction to bitcoin
Introduction to bitcoin
 
Introduction to Bit Coin Model
Introduction to Bit Coin ModelIntroduction to Bit Coin Model
Introduction to Bit Coin Model
 
Explaining Ethereum
Explaining EthereumExplaining Ethereum
Explaining Ethereum
 
Blockchain Corporate Style
Blockchain Corporate StyleBlockchain Corporate Style
Blockchain Corporate Style
 
Bit coin(2)
Bit coin(2)Bit coin(2)
Bit coin(2)
 
Report on Bitcoin- The cryptocurrency (November 2017)
Report on Bitcoin- The cryptocurrency (November 2017)Report on Bitcoin- The cryptocurrency (November 2017)
Report on Bitcoin- The cryptocurrency (November 2017)
 

Similar a Blockchain: life of a blockchain transaction

Blockchain: The Next Generation
Blockchain: The Next GenerationBlockchain: The Next Generation
Blockchain: The Next GenerationYann Rouillard
 
Roseville Blockchain Meetup #1
Roseville Blockchain Meetup #1Roseville Blockchain Meetup #1
Roseville Blockchain Meetup #1Switch Local
 
Banking on The Future of Blockchains
Banking on The Future of BlockchainsBanking on The Future of Blockchains
Banking on The Future of BlockchainsMark Smalley
 
Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur...
 Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur... Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur...
Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur...Bernhard Haslhofer
 
Banking on blockchains
Banking on blockchainsBanking on blockchains
Banking on blockchainsRuben Tan
 
Wallets and Transactions #2
Wallets and Transactions #2Wallets and Transactions #2
Wallets and Transactions #2BCWorkspace
 
Blockchain and Applications Class - 2022.pdf
Blockchain and Applications Class - 2022.pdfBlockchain and Applications Class - 2022.pdf
Blockchain and Applications Class - 2022.pdfEdilson Osorio Junior
 
CBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primerCBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primerBlockstrap.com
 
Blockchain disruptive technology 2018
Blockchain disruptive technology 2018Blockchain disruptive technology 2018
Blockchain disruptive technology 2018Ziyad Abualrob
 
Blockchain (and Bitcoin)
Blockchain (and Bitcoin) Blockchain (and Bitcoin)
Blockchain (and Bitcoin) Nitin Jain
 
SAA Blockchain Presentation. 10 Startups using the Blockchain
SAA Blockchain Presentation.  10 Startups using the BlockchainSAA Blockchain Presentation.  10 Startups using the Blockchain
SAA Blockchain Presentation. 10 Startups using the BlockchainTom McGovern
 
Understand Bitcoin in 5 minutes
Understand Bitcoin in 5 minutesUnderstand Bitcoin in 5 minutes
Understand Bitcoin in 5 minutesPatrick Bucquet
 
Paradigm shift: from the bitcoin Blockchain to Networked Computing
Paradigm shift: from the bitcoin Blockchain to Networked ComputingParadigm shift: from the bitcoin Blockchain to Networked Computing
Paradigm shift: from the bitcoin Blockchain to Networked Computingkumar641
 
Blockchain & the law 101
Blockchain & the law 101Blockchain & the law 101
Blockchain & the law 101Mathew Chacko
 
SVC INTERNATIONAL LLC | Shinevcoin.org
SVC INTERNATIONAL LLC | Shinevcoin.orgSVC INTERNATIONAL LLC | Shinevcoin.org
SVC INTERNATIONAL LLC | Shinevcoin.orgShineVCoin
 
Shine V Coin | SVC International | SVC Coin | GDVC
Shine V Coin | SVC International | SVC Coin | GDVCShine V Coin | SVC International | SVC Coin | GDVC
Shine V Coin | SVC International | SVC Coin | GDVCShineVCoin
 
Shine City | Shine Group
Shine City | Shine GroupShine City | Shine Group
Shine City | Shine GroupShineVCoin
 

Similar a Blockchain: life of a blockchain transaction (20)

Blockchain: The Next Generation
Blockchain: The Next GenerationBlockchain: The Next Generation
Blockchain: The Next Generation
 
Roseville Blockchain Meetup #1
Roseville Blockchain Meetup #1Roseville Blockchain Meetup #1
Roseville Blockchain Meetup #1
 
Banking on The Future of Blockchains
Banking on The Future of BlockchainsBanking on The Future of Blockchains
Banking on The Future of Blockchains
 
Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur...
 Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur... Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur...
Post-Bitcoin Cryptocurrencies, Off-Chain Transaction Channels, and Cryptocur...
 
Banking on blockchains
Banking on blockchainsBanking on blockchains
Banking on blockchains
 
Wallets and Transactions #2
Wallets and Transactions #2Wallets and Transactions #2
Wallets and Transactions #2
 
Blockchain and Applications Class - 2022.pdf
Blockchain and Applications Class - 2022.pdfBlockchain and Applications Class - 2022.pdf
Blockchain and Applications Class - 2022.pdf
 
CBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primerCBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primer
 
Blockchain disruptive technology 2018
Blockchain disruptive technology 2018Blockchain disruptive technology 2018
Blockchain disruptive technology 2018
 
Blockchain (and Bitcoin)
Blockchain (and Bitcoin) Blockchain (and Bitcoin)
Blockchain (and Bitcoin)
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Let’s Talk Crypto
Let’s Talk CryptoLet’s Talk Crypto
Let’s Talk Crypto
 
SAA Blockchain Presentation. 10 Startups using the Blockchain
SAA Blockchain Presentation.  10 Startups using the BlockchainSAA Blockchain Presentation.  10 Startups using the Blockchain
SAA Blockchain Presentation. 10 Startups using the Blockchain
 
Understand Bitcoin in 5 minutes
Understand Bitcoin in 5 minutesUnderstand Bitcoin in 5 minutes
Understand Bitcoin in 5 minutes
 
Paradigm shift: from the bitcoin Blockchain to Networked Computing
Paradigm shift: from the bitcoin Blockchain to Networked ComputingParadigm shift: from the bitcoin Blockchain to Networked Computing
Paradigm shift: from the bitcoin Blockchain to Networked Computing
 
Blockchain Brochure
Blockchain Brochure Blockchain Brochure
Blockchain Brochure
 
Blockchain & the law 101
Blockchain & the law 101Blockchain & the law 101
Blockchain & the law 101
 
SVC INTERNATIONAL LLC | Shinevcoin.org
SVC INTERNATIONAL LLC | Shinevcoin.orgSVC INTERNATIONAL LLC | Shinevcoin.org
SVC INTERNATIONAL LLC | Shinevcoin.org
 
Shine V Coin | SVC International | SVC Coin | GDVC
Shine V Coin | SVC International | SVC Coin | GDVCShine V Coin | SVC International | SVC Coin | GDVC
Shine V Coin | SVC International | SVC Coin | GDVC
 
Shine City | Shine Group
Shine City | Shine GroupShine City | Shine Group
Shine City | Shine Group
 

Último

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Último (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Blockchain: life of a blockchain transaction

  • 1. 402/55 Lime Street Sydney 2000 NSW > AUSTRALIA> WWW.OCTO.COM My life as a Blockchain Transaction Yann Rouillard + Erwan Alliaume - April 2018 Deep dive into the blockchain
  • 2. 2OCTO TECHNOLOGY > THERE IS A BETTER WAY WHO ARE WE? Yann Rouillard Senior consultant / expert DevOps Erwan Alliaume Senior consultant / CTO
  • 3. 3OCTO TECHNOLOGY > THERE IS A BETTER WAY How to buy us a beer using bitcoin… from your wallet to ours through the blockchain
  • 4. OCTO TECHNOLOGY > THERE IS A BETTER WAY 4 LIFECYCLE OVERVIEW 1F1tAaz5x1HUXrCNLM ACCOUNT CREATION OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 5. OCTO TECHNOLOGY > THERE IS A BETTER WAY 5 TRANSACTION PREPARATION LIFECYCLE OVERVIEW Tx 1F1tAaz5x1HUXrCNLM ACCOUNT CREATION OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 6. OCTO TECHNOLOGY > THERE IS A BETTER WAY 6 TRANSACTION SUBMISSION LIFECYCLE OVERVIEW Tx 1F1tAaz5x1HUXrCNLM Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx TRANSACTION PREPARATION ACCOUNT CREATION OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 7. OCTO TECHNOLOGY > THERE IS A BETTER WAY 7 TRANSACTION EXECUTION TRANSACTION SUBMISSION Tx 1F1tAaz5x1HUXrCNLM Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx TRANSACTION PREPARATION ACCOUNT CREATION LIFECYCLE OVERVIEW OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 8. OCTO TECHNOLOGY > THERE IS A BETTER WAY 8 MINING PROCESS Tx 1F1tAaz5x1HUXrCNLM Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx TRANSACTION EXECUTION TRANSACTION SUBMISSION TRANSACTION PREPARATION ACCOUNT CREATION LIFECYCLE OVERVIEW OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 9. OCTO TECHNOLOGY > THERE IS A BETTER WAY 9 MINING PROCESS LIFECYCLE OVERVIEW Tx 1F1tAaz5x1HUXrCNLM Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx TRANSACTION EXECUTION TRANSACTION SUBMISSION TRANSACTION PREPARATION ACCOUNT CREATION OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 10. OCTO TECHNOLOGY > THERE IS A BETTER WAY 10 LIFECYCLE OVERVIEW Tx 1F1tAaz5x1HUXrCNLM Tx MINING PROCESS TRANSACTION EXECUTION TRANSACTION SUBMISSION TRANSACTION PREPARATION ACCOUNT CREATION TRANSACTION CONFIRMATION OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 11. OCTO TECHNOLOGY > THERE IS A BETTER WAY 11 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Some definitions first! Transaction confirmation
  • 12. OCTO TECHNOLOGY > THERE IS A BETTER WAY 12 THE ORIGIN: THE CYPHERPUNK MOVEMENT
  • 13. OCTO TECHNOLOGY > THERE IS A BETTER WAY 13 WHAT IS A CRYPTO-CURRENCY? Scarcity Fungibility Transferability Divisibility Durability A crypto-currency is a virtual currency that uses cryptography to guarantee currency essential properties
  • 14. OCTO TECHNOLOGY > THERE IS A BETTER WAY 14 SOME FAMOUS CRYPTO-CURRENCIES Dogecoin Bitcoin Dash Litecoin Ether Ripple OCTO TECHNOLOGY > THERE IS A BETTER WAY
  • 15. OCTO TECHNOLOGY > THERE IS A BETTER WAY 15 Early 19th-century German ledger WHAT IS A LEDGER? Not a very new thing !
  • 16. OCTO TECHNOLOGY > THERE IS A BETTER WAY 16 WHAT IS A DISTRIBUTED LEDGER? Centralised Ledger Distributed Ledger
  • 17. OCTO TECHNOLOGY > THERE IS A BETTER WAY 17 WHAT IS A BLOCKCHAIN? A blockchain is one of the possible implementations of a distributed ledger where transactions are stored in a series of cryptography-linked blocks
  • 18. OCTO TECHNOLOGY > THERE IS A BETTER WAY 18 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Account creation Transaction confirmation
  • 19. OCTO TECHNOLOGY > THERE IS A BETTER WAY 19 WHAT IS AN ACCOUNT? An account is a uniquely identified object that will be able to issue transactions and store currency Two problems: ● how to create a unique identifier without a central authority? ● how to ensure transactions has been legitimely issued from an account?
  • 20. OCTO TECHNOLOGY > THERE IS A BETTER WAY 20 WHAT IS AN ACCOUNT? An account is a uniquely identified object that will be able to issue transactions and store currency Two problems: ● how to create a unique identifier without a central authority? ● how to ensure transactions has been legitimely issued from an account? Cryptography to the rescue!
  • 21. OCTO TECHNOLOGY > THERE IS A BETTER WAY 2 1 3 CRYPTOGRAPHY 101: ELECTRONIC SIGNATURE IN ONE SLIDE Not John Private key Public key ✗ Someone’s private key Someone else’s private key ≠ Key generator Private key Public key John Lorem ipsum dolor alok sit amet, tipeke consectetur adipiscing so elit, sed do eiusmod te Document Sign Signature Verify ✓ Lorem ipsum dolor alok sit amet, tipeke consectetur adipiscing so elit, sed do eiusmod te
  • 22. OCTO TECHNOLOGY > THERE IS A BETTER WAY 22 IN ONE SLIDE 01010001000110001011 11010100101110101010 10010101010101010101 01010110101001010101 01010101010100101010 10100101010101010100 1010100101101 0x32ab7f65 Original input Hash value ✗ CRYPTOGRAPHY 101: CRYPTOGRAPHIC HASH FUNCTION 01010001000110001011 11010100101110101010 10010101010101010101 01010110101001010101 01010101010100101010 10100101010101010100 1010100101101 0x32ab7f65 Any size Fixed size 01010001000110001011 11010100101110101010 10010101010101010101 01010110101001010101 01010101010100101010 10100101010101010100 1010100101100 0x47f42e10 Small change Big change 01010001000110001011 11010100101110101010 10010101010101010101 01010110101001010101 01010101010100101010 10100101010101010100 1010100101101 0x32ab7f65 11001000100010010101 01010101010101101010 10101011010101010101 01010101010100010101 01001010010001001010 00100010000011111101 0111011111111 ≠ Original input Different input ✗
  • 23. OCTO TECHNOLOGY > THERE IS A BETTER WAY 23 ACCOUNT CREATION: STANDARD MECHANISM Private key Public key 1. Key generation Most blockchain use Elliptic Curve Algorithms 2. Public Key Hashing Ensure shorter address Protect against attack on Public key 3. Address Encoding 0bed7abd61247635c197 3eb38474a2516ed1d884 Make it (a bit more) readable
  • 24. OCTO TECHNOLOGY > THERE IS A BETTER WAY 24 NICE WARNINGA NICE WARNING OCTO TECHNOLOGY > THERE IS A BETTER WAY YOU ARE (often) PSEUDONYMOUS NOT ANONYMOUS
  • 25. OCTO TECHNOLOGY > THERE IS A BETTER WAY 25 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Transaction preparation Transaction confirmation
  • 26. OCTO TECHNOLOGY > THERE IS A BETTER WAY 26 WHAT IS A TRANSACTION The pay-us-a-beer transaction Issuer Recipients Transactions scripts “ Send to addresses ” Amount
  • 27. OCTO TECHNOLOGY > THERE IS A BETTER WAY 27 APPEND-ONLY LEDGER Create 25 coins and credit to You Transfert 17 coins from You to Erwan Transfert 8 coins from Erwan to Yann Transfert 5 coins from Yann to You Transfert 15 coins from You to Erwan Is it valid? Time Might need to scan backwards until genesis! asserted by miners signed by you signed by Erwan signed by Yann signed by You Source: https://youtu.be/t7sGcST61sM
  • 28. OCTO TECHNOLOGY > THERE IS A BETTER WAY 28 A TRANSACTION-BASED LEDGER LIKE BITCOIN Is it valid? Time Input: Ø Outputs: You=25 1 1 Input: Outputs: You=8 Erwan=17 2 1 211 Input: Outputs: Erwan=9 Yann=83 1 22 2 Input: Outputs: Yann=3 You=13 4 1 2 2 1 3 2 Input: Outputs: You=-2 Erwan=24 5 1 4 2 2 3 1 Finite scan to check validity WTF!!! Source: https://youtu.be/t7sGcST61sM
  • 29. OCTO TECHNOLOGY > THERE IS A BETTER WAY 29 BITCOIN TRANSACTION BOOKKEEPING You have 10 bitcoins as base balance Tx1: pay-me-a-beer Input 1 Output 1 Output 2 Unspent = your balance 10 - 1 = 9 easy! 1 bitcoin 9 bitcoins unspent Tx2: don’t forget Yann! Input 1 Output 1 Output 2 1 bitcoin 5 bitcoins unspent Unspent = your balance 9 - 1 = 5 ??Really?? Yes, you gave 3 bitcoins as mining fees 9 - 1 -5 = 3 Inputs Bitcoins to spend Each input is a signed reference from a previous trnx Outputs Assign to new owners Each output can be used by only 1 input do avoid double spend Unspent outputs = balance of somebody This is what we call bitcoins (add all unspent of a public ledger to know how many bitcoins has the chain Mining fees sum(inputs) - sum(outputs)
  • 30. OCTO TECHNOLOGY > THERE IS A BETTER WAY 30 TRANSACTION SIGNATURE The pay-us-a-beer transaction Input 1 Output 1 Digital signature Public key 1. You are paying the beer, so you have to sign your transaction with your private key 2. You have to attach the the signature and your public key to the transaction so anybody can check it This process can be done offline!
  • 31. OCTO TECHNOLOGY > THERE IS A BETTER WAY 31 OK OK, BUT WHAT ARE THE TRANSACTION SCRIPT YOU WERE TALKING ABOUT Bitcoin is using a stack based language Often limited instructions set No-Loops in bitcoin Sender choose the script (but could be refused) ByteCode running in a Virtual Machine
  • 32. OCTO TECHNOLOGY > THERE IS A BETTER WAY 32 SCRIPTING CAPABILITIES ARE DIFFERENT FROM ONE BLOCKCHAIN TO ANOTHER!
  • 33. OCTO TECHNOLOGY > THERE IS A BETTER WAY 33 BITCOIN SCRIPT EXECUTION, A REAL LIFE EXAMPLE << Public Key >> << Signature>> Check Transaction signature script! 99% of created transactions in bitcoin are using this script! OP_DUP OP_HASH160 << PubKeyHash? >> OP_EQUAL_VERIFY OP_CHECK_SIG Script scriptPubKey (output) Signature scriptSig (input) << Public Key >> << Signature>> Duplicate top of the stack << Public Key >> Hash top of the stack Source: https://youtu.be/ci1jFDRPoCw INSTRUCTIONS MEMORY
  • 34. OCTO TECHNOLOGY > THERE IS A BETTER WAY 34 BITCOIN SCRIPT EXECUTION, A REAL LIFE EXAMPLE << Public Key >> << Signature>> Check Transaction signature script! 99% of created transactions in bitcoin are using this script! OP_DUP OP_HASH160 << PubKeyHash? >> OP_EQUAL_VERIFY OP_CHECK_SIG << Public Key >> << Signature>> << Pub Key Hash >> << Pub Key Hash? >> Public key hash given by the sender Check 2 top stack values Check the signature! Source: https://youtu.be/ci1jFDRPoCw INSTRUCTIONS MEMORY Script scriptPubKey (output) Signature scriptSig (input)
  • 35. OCTO TECHNOLOGY > THERE IS A BETTER WAY 35 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Transaction submission Transaction confirmation
  • 36. OCTO TECHNOLOGY > THERE IS A BETTER WAY 36 FIRST STEP: FIND YOUR FRIENDS To be able to do anything on the blockchain, you must first... Client node Discover the blockchain network!
  • 37. OCTO TECHNOLOGY > THERE IS A BETTER WAY 37 Bootstrap node Bootstrap node FIRST STEP: FIND YOUR FRIENDS To be able to do anything on the blockchain, you must first... Client node Discover the blockchain network! 1. Find Bootstrap nodes 139.218.14.2 92.164.12.8 Hardcoded addresses
  • 38. OCTO TECHNOLOGY > THERE IS A BETTER WAY 38 FIRST STEP: FIND YOUR FRIENDS To be able to do anything on the blockchain, you must first... Client node Discover the blockchain network! 1. Find Bootstrap nodes 2. Find Peer nodes Bootstrap node Bootstrap node Unknown nodesKnown nodes
  • 39. OCTO TECHNOLOGY > THERE IS A BETTER WAY 39 FIRST STEP: FIND YOUR FRIENDS To be able to do anything on the blockchain, you must first... Client node Discover the blockchain network! 1. Find Bootstrap nodes 2. Find Peer nodes 3. Connect to random nodes Bootstrap node Bootstrap node Unknown nodesKnown nodes The whole network is eventually interconnected
  • 40. OCTO TECHNOLOGY > THERE IS A BETTER WAY 40 SECOND STEP: GOSSIP WITH YOUR FRIENDS Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx OCTO TECHNOLOGY > THERE IS A BETTER WAY Principle Just forward every transaction to your neighbours!
  • 41. OCTO TECHNOLOGY > THERE IS A BETTER WAY 41 Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Why it is cool? ● Reliable in case of failure SECOND STEP: GOSSIP WITH YOUR FRIENDS OCTO TECHNOLOGY > THERE IS A BETTER WAY Tx Tx Tx Principle Just forward every transaction to your neighbours!
  • 42. OCTO TECHNOLOGY > THERE IS A BETTER WAY 42 SECOND STEP: GOSSIP WITH YOUR FRIENDS OCTO TECHNOLOGY > THERE IS A BETTER WAY Principle Just forward every transaction to your neighbours! Why it is cool? ● Reliable in case of failure ● Guaranteed delivery in bounded time Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Less than 10s
  • 43. OCTO TECHNOLOGY > THERE IS A BETTER WAY 43 SECOND STEP: GOSSIP WITH YOUR FRIENDS OCTO TECHNOLOGY > THERE IS A BETTER WAY Principle Just forward every transaction to your neighbours! Why it is cool? ● Reliable in case of failure ● Guaranteed delivery in bounded time ● Scale with the number of peers Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx
  • 44. OCTO TECHNOLOGY > THERE IS A BETTER WAY 44 BAD TRANSACTIONS SHALL NOT PASS! Transaction validity is first checked before being accepted and transferred ✓Valid transaction format………….. ✓Valid transaction….. instructions used…. ✓Valid signature from the author…… ✓Transaction integrity not tampered………. ✓Coins spent are available………….... There should be a consensus about validation rules among clients Validation rules updates are propagated through software updates
  • 45. OCTO TECHNOLOGY > THERE IS A BETTER WAY 45 LET’S GO TO THE POOL! Accepted transactions go into a transaction pool Mining node A Pay-us-a-beer Buy Crypto Kitty Buy ICO Scam Token Transactions Buy ICO Scam Token Buy ICO Scam Token TransactionPool Fee 30 25 12 7 0 Orderedbyfee independently maintained by each node Mining node B Buy Crypto Kitty Buy ICO Scam Token Transactions Buy ICO Scam Token Buy ICO Scam Token Fee 25 12 7 0 Buy Drugs 2 TransactionPool Non consistent view across all nodesBuy Drugs 2
  • 46. OCTO TECHNOLOGY > THERE IS A BETTER WAY 46 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Mining process Transaction confirmation
  • 47. Tx Buy Crypto Kitty OCTO TECHNOLOGY > THERE IS A BETTER WAY 473 A SIMPLE EXECUTION MODEL ...that are executed sequentially Tx Buy Crypto Kitty Tx Buy Beer Transaction Pool Tx Buy Beer Tx Buy Crypto Kitty New Potential Blockchain State State 3State 2 Initial Blockchain State State 1 Transactions are just state transition functions... 47
  • 48. OCTO TECHNOLOGY > THERE IS A BETTER WAY 483 BUT WHAT IS A BLOCKCHAIN STATE? It depends... 20 coins spendable by Bob 10 coins spendable by John 5 coins spendable by Bob 5 coins spendable by Lucie Unspent transactions coins Bitcoin State 1F1tAaz5x 1F1tAaz5x 1F1tAaz5x Ethereum State Account information Bob has 25 coins John has 10 coins Lucie has 5 coins Contract Foo contains A=10 } cont { 48
  • 49. OCTO TECHNOLOGY > THERE IS A BETTER WAY 49 Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx OCTO TECHNOLOGY > THERE IS A BETTER WAY A MODEL NOT VERY SCALABLE All nodes execute all the transactions Adding new nodes doesn’t increase computing power
  • 50. OCTO TECHNOLOGY > THERE IS A BETTER WAY 503 PROTECTIONS AGAINST THE EVIL Solution No Loop or Goto in script langage Pay for each instruction execution Threat 1 Infinite loop in transaction scripts Solution Transaction chaining Incremental id per transaction/account Threat 2 Transaction Replay attack
  • 51. OCTO TECHNOLOGY > THERE IS A BETTER WAY 51 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Block propagation Transaction confirmation
  • 52. OCTO TECHNOLOGY > THERE IS A BETTER WAY 52 DID WE SAY BLOCKCHAIN? WHAT IS IT? Now that our pay-us-a-beer transaction is executed and validated, it needs to be included in a newly created block Previous Block Hash Transactions Tree Random Nonce Current Block Hash Our block! Previous Block Hash Transactions Tree Random Nonce Current Block Hash Block N-1 Previous Block Hash Transactions Tree Random Nonce Current Block Hash Block N+1 The average block generation time is usually constant ● ~10 mn for Bitcoin ● ~12 seconds for Ethereum Why to bundle transactions in a block? ● Single unit of work for miners ( will be described later ) ● Limit length of the blockchain ( faster to verify history ) Merkle Root Hash Hash HashHashHash Hash Dat a 4 Dat a 3 Dat a 2 Dat a 1 Tx4Tx3Tx1 Tx2 Transactions pay-us-a-beer TX
  • 53. OCTO TECHNOLOGY > THERE IS A BETTER WAY 53 HOW TO RESOLVE COMPETING STATES? Tx1 Tx2 Tx6 Tx5 Tx4 Tx3 Tx3 Tx4 Tx5 Tx6 Tx3 Tx5 Tx4 Tx6 Tx1 Tx2 Tx3 Tx4 Tx5 Tx6 How to bundle transactions in blocks pay-us-a-beer TX Distributed process = need to arbitrate between several valid states ?
  • 54. OCTO TECHNOLOGY > THERE IS A BETTER WAY 54 CONSENSUS ALGORITHM “ How to find a truth, in a world full of liars ” ● Agree on a unique blockchain state amongst all valid possibilities ● Prevent bad actors from influencing the outcome ● Ensure a consensus will be eventually reached despite faulty and evil nodes Sybil attack fake multitude of nodes using forged identities Double spend spending the same money twice Transaction censorship or delaying prevent trnx to be included in the blockchain Long Range attack Create a long valid blockchain and advertise it to new nodes joining Most well known attacks
  • 55. OCTO TECHNOLOGY > THERE IS A BETTER WAY 55 2 main answers to avoid those attacks ● Choose the next block producer randomly! ● Ensure messing with the blockchain is not for free Solution = Mining!
  • 56. OCTO TECHNOLOGY > THERE IS A BETTER WAY 56 hash( block + random value ) < difficulty PROOF OF WORK, THE MOST COMMON MINING TECHNIQUE A computational challenge must be solved to be able to create a valid block Challenge: Find a random hash value inferior to a threshold (difficulty) Difficulty is regularly adjusted to keep a constant average block generation time
  • 57. OCTO TECHNOLOGY > THERE IS A BETTER WAY 57 RESOLVING FORKS The process continues and What happen when 2 miners find a block at the same time?
  • 58. OCTO TECHNOLOGY > THERE IS A BETTER WAY 58 WHAT A MINER IS DOING? 1. Collect transactions from the pool 2. Validate transactions 3. Invest power and electricity! 4. Try to create a new block as previously described 5. Eventually, get rewards in form of new created bitcoins * old numbers
  • 59. OCTO TECHNOLOGY > THERE IS A BETTER WAY 59 CAREERS.OCTO.COM.AU
  • 60. OCTO TECHNOLOGY > THERE IS A BETTER WAY 60 Account creation Transaction preparation Transaction submission Transaction execution Mining process Lifecycle of a transaction: Transaction confirmation Transaction confirmation
  • 61. OCTO TECHNOLOGY > THERE IS A BETTER WAY 61 BEFORE: THE (NOT SO SIMPLE) BLOCK PROPAGATION ● Like transactions, blocks are propagated in the network using the Gossip protocol ● On Bitcoin 50% of blocks are propagated under 6s Problem: High propagation time is bad for security but 10% are often propagated > 120s
  • 62. OCTO TECHNOLOGY > THERE IS A BETTER WAY 62 2 2 ✗ ✗ 3 IMPACT OF A SMALL BLOCK TIME 1 12 s 18 s 24 s 25% 50% 25% 1 1 2 A B C BLOCK TIME: 6 S PROPAGATION TIME: 12 S 1' ✗ ✗ 2' 12 s 18 s 24 s0 s 6 s
  • 63. OCTO TECHNOLOGY > THERE IS A BETTER WAY 63 CENTRALISATION COUNTER-MEASURES High propagation time lead to centralisation Solutions: ● Low block size and high block time 1 MB Block size limit ● Make orphan blocks count to select winner
  • 64. OCTO TECHNOLOGY > THERE IS A BETTER WAY 643 THE TRANSACTION CONFIRMATION ISSUE ● Transactions can be re-organized in the short term as part of forks resolution ● Problem: blockchain are eventually consistent C A P Tx 1 Tx 3 Tx 3 Tx 4 Tx Tx Tx 1 Tx Tx 3 Tx 3
  • 65. OCTO TECHNOLOGY > THERE IS A BETTER WAY 653 HOW TO BE SURE ABOUT YOUR TRANSACTION The oldest is a transaction the less likely a transaction could be reverted Tx Not sure we will have our beer! 0 confirmation
  • 66. OCTO TECHNOLOGY > THERE IS A BETTER WAY 663 HOW TO BE SURE ABOUT YOUR TRANSACTION The oldest is a transaction the less likely a transaction could be reverted Tx 1Tx Tx 2 Tx 3 We may have our beer! 3 confirmations
  • 67. OCTO TECHNOLOGY > THERE IS A BETTER WAY 673 HOW TO BE SURE ABOUT YOUR TRANSACTION The oldest is a transaction the less likely a transaction could be reverted Tx 1Tx Tx 2 Tx 3 Tx 4 Tx 5 Tx 6 6 confirmations We will have our beer!
  • 68. OCTO TECHNOLOGY > THERE IS A BETTER WAY 683 HOW TO BE SURE ABOUT YOUR TRANSACTION The oldest is a transaction the less likely a transaction could be reverted 6 blocks-old transactions are considered close to 100% safe Tx 1Tx Tx 2 Tx 3 Tx 4 Tx 5 Tx 6 6 confirmations
  • 69. OCTO TECHNOLOGY > THERE IS A BETTER WAY 69 Thank you! CAREERS.OCTO.COM.AU
  • 70. OCTO TECHNOLOGY > THERE IS A BETTER WAY 70 Annexes CAREERS.OCTO.COM.AU
  • 71. Merkle Root Data 4Data 3Data 2Data 1 OCTO TECHNOLOGY > THERE IS A BETTER WAY 713 COINS GROWTH ON (MERKLE) TREES Most blockchains use Merkle Trees to store transactions list or whole blockchain state Data 4Data 3Data 1 Hash H3 Hash(Data 3) Hash H4 Hash(Data 4) Hash H2 Hash(Data 2) Hash H1 Hash(Data 1) Merkle Root Hash(H12+H34) Hash H34 Hash(H3+H4) Hash H12 Hash(H1+H2) Data 2 Hash H2 Hash(Data 2) Merkle Root Hash(H12+H34) Hash H12 Hash(H1+H2) Data 2 Merkle Trees are cool! ● Performant Only re-hash what changed! ● Light Client Friendly Easy to prove a transaction without downloading the whole tree! Data modified
  • 72. Tx Root Tx 4Tx 3Tx 1 Tx Root Tx 2 Block OCTO TECHNOLOGY > THERE IS A BETTER WAY 723 WHERE ARE MERKLE TREES USED? Bitcoin Ethereum Tx 4Tx 3Tx 1 Tx 2 Tx Root Tx Root Block Receipt Root Rc 4Rc 3Rc 1 Receipt Root Rc 2 Account 1 State Root State Root Account 2 Account 3 Account 4Storage Block
  • 73. Tx Buy Crypto Kitty OCTO TECHNOLOGY > THERE IS A BETTER WAY 733 BACK TO TRANSACTIONS EXECUTION Transactions are executed sequentially by nodes State Root Data 4 Data 3 Data 2 Data 1 Data 4Data 3Data 1 Data 2 State Root Data 4 Data 3 Data 2 Data 1 Data 4Data 3Data 1 Data 2 State Root Data 4 Data 3 Data 2 Data 1 Data 4Data 3Data 1 Data 2 Tx Buy Crypto Kitty Tx Buy Beer Transaction Pool Tx Buy Beer Tx Buy Crypto Kitty New Blockchain State Hash Ethereumexample