51
#chainskills #devoxx Why you should really care about the blockchain? Sébastien Arbogast - Said Eloudrhiri @sarbogast @eloudsa

Why you should be interested in the blockchain

Embed Size (px)

Citation preview

#chainskills #devoxx

Why you should really care about the blockchain?

Sébastien Arbogast - Said Eloudrhiri

@sarbogast @eloudsa

Who are we?

2

@sarbogast @eloudsa

#chainskills #devoxx

Sébastien Arbogast

#chainskills

• Software developer for 11+ years

• Agile practitioner

• Lean Startup coach

• Entrepreneur

• Mobile and Apple TV developer

• futurologist.co

• Blockchain enthusiast3

@sarbogast @eloudsa

#chainskills #devoxx

Said Eloudrhiri

#chainskills

• Developer since 1992

• Agile Coach, ScrumMaster, Team Lead

• Devoxx4Kids trainer, Wajug organizer

• Android developer (Pixync, Smartvoxx, My Devoxx, TVoxx)

• Blockchain developer (ChainSkills)

• Fatherologist (Nora, Rayane and Djenna)

• Founder of Noratek4

@sarbogast @eloudsa

#chainskills #devoxx

We are developers, not traders

#chainskills 5

@sarbogast @eloudsa

#chainskills #devoxx

We are enthusiasts, not experts

#chainskills 6

@sarbogast @eloudsa

#chainskills #devoxx

What is the blockchain?

7

@sarbogast @eloudsa

#chainskills #devoxx

@sarbogast @eloudsa

#chainskills #devoxx

2008

Satoshi Nakamoto

Whitepaper

Code base

@sarbogast @eloudsa

#chainskills #devoxx

Concepts

Implementations

Instances

@sarbogast @eloudsa

#chainskills #devoxx

Concepts

Implementations

Instances

Transaction order and state

11

@sarbogast @eloudsa

#chainskills #devoxx

Account holder Balance

Alice 15

Bob 5

John 10

From To Amount

Alice Bob 5

Bob John 10

John Alice 5

Account holder Balance

Alice 10

Bob 10

John 10

Account holder Balance

Alice 10

Bob 0

John 20

Account holder Balance

Alice 15

Bob 0

John 15

Scenario #1

Transaction order and state

12

@sarbogast @eloudsa

#chainskills #devoxx

Account holder Balance

Alice 15

Bob 5

John 10

From To Amount

Bob John 10

John Alice 5

Alice Bob 5

Account holder Balance

Alice 20

Bob 5

John 5

Account holder Balance

Alice 15

Bob 10

John 5

Scenario #2

Transaction order and state

13

• State depends on order of transactions

• When you have one database and only one way to access it, it's easy

• But: • What happens if someone changes the order or the state directly? (mutability) • What if the database fails? (fault tolerance) • Who can see what? (censorship)

@sarbogast @eloudsa

#chainskills #devoxx

In a centralized system

14

• Mutability: complex authorization and audit logging

• Fault tolerance: redundance, but then cross-server transactions so expensive middleware

• Censorship: APIs with complex security

@sarbogast @eloudsa

#chainskills #devoxx

In a distributed and decentralized database

15

• Data is distributed on all the nodes in the system

• Control over that data is decentralized too

• Fault tolerance: peer-to-peer distributed network

• Transparency: every node has all the data

• Anonymity: to protect data privacy despite distribution

• Immutability: consensus algorithm

@sarbogast @eloudsa

#chainskills #devoxx

How do you reach consensus?

16

• Transactions are ordered and bundled in blocks

• Blocks are chained together

• A consensus algorithm determines the order of blocks in a distributed mode

• Every node can verify that this order is cryptographically valid

@sarbogast @eloudsa

#chainskills #devoxx

@sarbogast @eloudsa

#chainskills #devoxx

Concepts

Implementations

Instances

Bitcoin Ethereum Ethereum Casper

Consensus algorithm Proof-of-Work Proof-of-Work Proof-of-Stake

Mining rewardStatic mining reward

(12,5BTC) halved every 4 years + transaction fees

Static mining reward (5ETH) + uncles + transactions fees +

gas

Bet rewards + transaction fees + gas

Block time ~10 minutes ~10 seconds ~4 seconds

Various implementations of these concepts

18

@sarbogast @eloudsa

#chainskills #devoxx

Con

cept

sIm

plem

enta

tions

Inst

ance

s

@sarbogast @eloudsa

#chainskills #devoxx

Concepts

Implementations

Instances

Different instances of the same implementation

20

• Blockchain = code base for node software (with consensus algorithm)

• Blockchain instance = • Genesis block • Network identifier • Chain of blocks built by software

• So if you change the software on some nodes, you build a forking chain

@sarbogast @eloudsa

#chainskills #devoxx

Con

cept

sIm

plem

enta

tions

Inst

ance

s

Why do you need a crypto-currency?

21

• To incentivize the nodes to participate in consensus algorithm (game theory)

• To discourage splits and build trust

• As a backing asset to transfer value

• On Ethereum, to pay for the execution of smart contracts

@sarbogast @eloudsa

#chainskills #devoxx

It started off as a currency

#chainskills 22

@sarbogast @eloudsa

#chainskills #devoxx

Source: www.kraken.com

You can pay for stuff in crypto-currencies

#chainskills 23

@sarbogast @eloudsa

#chainskills #devoxx

@sarbogast @eloudsa

#chainskills #devoxx

What is it useful for?

25

@sarbogast @eloudsa

#chainskills #devoxx

A payment transaction

26

@sarbogast @eloudsa

#chainskills #devoxx

If balance(A) > X, then decrease(A,X) and

increase (B,X)

State S1 State S2

Account A Account B Account A Account B

A payment blockchain

27

@sarbogast @eloudsa

#chainskills #devoxx

A generic transaction

28

@sarbogast @eloudsa

#chainskills #devoxx

Any modification on any number of variables of any account

State S1 State S2

Account A Account B Account A Account B

A generic blockchain

29

@sarbogast @eloudsa

#chainskills #devoxx

Everywhere there is a registry of ordered transactions nobody should be able to tamper with

30

@sarbogast @eloudsa

#chainskills #devoxx

Each transaction involves business logic

#chainskills 31

@sarbogast @eloudsa

#chainskills #devoxx

In a blockchain, business processes are coded into smart contracts

32

@sarbogast @eloudsa

#chainskills #devoxx

A distributed application (Dapp) is a set of smart contracts with a user interface

33

@sarbogast @eloudsa

#chainskills #devoxx

UI

0x123 0x456 0x789

A few Dapps

34

@sarbogast @eloudsa

#chainskills #devoxx

What is a DAO?

35

@sarbogast @eloudsa

#chainskills #devoxx

Token holdersContractorsBenefits

Value increase

Split

ALPHA

What is it NOT useful for?

36

@sarbogast @eloudsa

#chainskills #devoxx

Blockchain = design pattern

#chainskills 37

@sarbogast @eloudsa

#chainskills #devoxx

#chainskills #devoxx

First rule of the blockchainYou don't need a blockchain!

@sarbogast @eloudsa

Transparency and anonymity

#chainskills 39

@sarbogast @eloudsa

#chainskills #devoxx

www.blockchain.info

www.etherscan.io

Pay-to-participate

40

@sarbogast @eloudsa

#chainskills #devoxx

Value at time of transaction0.16 USD

Distributed consensus is slower

41

@sarbogast @eloudsa

#chainskills #devoxx

VISA (2000) Paypal (115) Bitcoin (7) Ethereum (20)

Transaction confirmation times are long

42

@sarbogast @eloudsa

#chainskills #devoxx

Bitcoin (6 blocks x 600s) Ethereum (12 blocks x 17s) REST (~500ms)

System evolution is slow

43

@sarbogast @eloudsa

#chainskills #devoxx

Soft forks are forward compatible Hard forks are NOT forward compatible

Requires miners to switch Requires everyone to switchRestricts block acceptance rules Eases block acceptance rules

Data storage is very limited

44

• Store data elsewhere, store the hash in the chain

• But then your file storage needs to be distributed too

• The bigger your chain, the more restricted it gets in terms of devices

@sarbogast @eloudsa

#chainskills #devoxx

June 2016 Bitcoin Ethereum

Blockchain size ~71GB ~22GB

Growth/month ~4GB ~2GB

You need a decision model

45

@sarbogast @eloudsa

#chainskills #devoxxhttps://medium.com/@sbmeunier/when-do-you-need-blockchain-decision-models-a5c40e7c9ba1#.vwz9bni3b

How do you develop on it?

46

@sarbogast @eloudsa

#chainskills #devoxx

The communities

47

• Forums on Reddit: /r/ethereum and /r/bitcoin

• News: steemit.com, CoinDesk, BitcoinMagazine

• Questions: bitcoin.stackexchange.com, ethereum.stackexchange.com

• Websites: fintech.ma, bitcoin.fr

• Slack groups: CryptoFR, BlockChainBelgium, fintech.ma

• Network monitors: blockchain.info, ethstats.net

@sarbogast @eloudsa

#chainskills #devoxx

Getting started with blockchain development

48

• Bitcoin: • Mastering Bitcoin, the book: https://bitcoin.org/en/developer-guide • https://github.com/bitcoinbook/bitcoinbook

• Ethereum: • https://ethereum.org/ • The smart contract language, Solidity: https://solidity.readthedocs.io • The build tool, Truffle: http://truffle.readthedocs.io/ • The developer friendly client, Geth: https://github.com/ethereum/go-ethereum/wiki/

geth

@sarbogast @eloudsa

#chainskills #devoxx

A few pieces of advice

49

• If you want to go for production quickly, your contracts don't need loops, and you have patience have a look at Bitcoin development first

• Documentation and articles get outdated really quickly, so be prepared to tinker a lot and figure things out as you go

• Development tools are still very very raw (Jetbrains, if you're listening to this…)

• Forget about mobile apps for now, light wallets are not ready yet

@sarbogast @eloudsa

#chainskills #devoxx

One more thing…

50

@sarbogast @eloudsa

#chainskills #devoxx

@sarbogast @eloudsa

#chainskills #devoxx

beta.chainskills.com