29
Introduction to the Blockchain technology Blockchain Vlaanderen Meetup #2 April, 18th 2016 - KBC Boerentoren Antwerpen

Intro into blockchain

Embed Size (px)

Citation preview

Introduction to the Blockchain technology

Introduction to the Blockchain technology Blockchain Vlaanderen Meetup #2April, 18th 2016 - KBC Boerentoren Antwerpen

1. What is Blockchain?2. How does Blockchain work?3. And what are smart contracts?

How does Blockchain work,explained using the Bitcoin blockchain

Meet Peter and Mary

PeterMary

Only identified by their private key

Private key: MHQCAQEEIDlbCdPiELaz5K4+PO4w==Private key:MHQCAQEEIMxRjHiHBIJyuCtGkdJzw==PeterMary

And the public address of their wallet

Private key: MHQCAQEEIDlbCdPiELaz5K4+PO4w==Private key:MHQCAQEEIMxRjHiHBIJyuCtGkdJzw==

Address:19jgcudmDTvXfJd47yjLevAddress:1VDQ5BJfRC27SsKfUrgdaGPeterMary

Since the blockchain is a ledger, it knows the balance of those wallets

Private key: MHQCAQEEIDlbCdPiELaz5K4+PO4w==Private key:MHQCAQEEIMxRjHiHBIJyuCtGkdJzw==

Address:19jgcudmDTvXfJd47yjLevAddress:1VDQ5BJfRC27SsKfUrgdaG

PeterMary

Mary constructs a transaction to send 10BTC to Peter

PeterMarysend 10 BTC from 1VDQ5BJfRC27SsKfUrgdaGto 19jgcudmDTvXfJd47yjLevAddress:19jgcudmDTvXfJd47yjLevAddress:1VDQ5BJfRC27SsKfUrgdaG

And signs it with her private key

PeterMarysend 10 BTC from 1VDQ5BJfRC27SsKfUrgdaGto 19jgcudmDTvXfJd47yjLevAddress:19jgcudmDTvXfJd47yjLevAddress:1VDQ5BJfRC27SsKfUrgdaG

Private key:MHQCAQEEIMxRjHiHBIJyuCtGkdJzw==

The transaction is sent to the network and propagates intothe transaction pool of each node

Miners start to create a candidate block

Candidate BlockTransaction Pool

Validate and sort the transactions into a candidate block, no larger than the maximum blocksize

A block contains the transactions, plus the Merkle root

Candidate BlockTransaction Pool

Merkle root ~ hash of all transactionsin the block

And includes the hash of the previous block to chain them together

Candidate BlockTransaction Pool

Merkle root ~ hash of all transactionsin the block

Hash of the previous block

Solving the proof of work puzzle, finding the nonce

Transaction Pool

Proof of work

Candidate Block

After solving the puzzle, the result is sent back to the network

Transaction Pool

Proof of work

Transmit the blockto the network

Candidate Block

And start again

Transaction Pool

Proof of work

Transmit the blockto the network

Candidate Block

Challenges of a distributed network: forking

Blockchain

19:15:10 - New block found on top of green!A fork in the making

19:15:11 - New block found on top of green!

Blockchain

The chain has forked!

Blockchain

Some miners are mining on top of red, some on top of yellow

Blockchain

19:25:13 - New block found on top of yellow!

BlockchainA new block has been mined

Order has been restored, all is well

BlockchainForking over one/two blocks is extremely rare.Transactions are considered secure after 6 blocks

And what are smart contracts?

Peter, now using a wallet with Ether

Address:19jgcudmDTvXfJd47yjLevPeter

interacts with a living piece of software in the blockchain

Private key: MHQCAQEEIDlbCdPiELaz5K4+PO4w==

Address:19jgcudmDTvXfJd47yjLevAddress:1VDFGSJfRC27SsKfDhdiFPeter

Turing complete programming languagee.g. car lease

And pays for the processing power using gas

Private key: MHQCAQEEIDlbCdPiELaz5K4+PO4w==

Address:19jgcudmDTvXfJd47yjLevAddress:1VDFGSJfRC27SsKfDhdiFPeter

Turing complete programming language

Gas

Not just human to smart contract, but also between contracts

Private key: MHQCAQEEIDlbCdPiELaz5K4+PO4w==

Address:19jgcudmDTvXfJd47yjLevPeter

Questions?