the emergent layer 2

24
The Emergent “Layer 2”

Upload: chris-priest

Post on 13-Apr-2017

501 views

Category:

Economy & Finance


0 download

TRANSCRIPT

Page 1: The Emergent Layer 2

The Emergent “Layer 2”

Page 2: The Emergent Layer 2

Overview● Part 1: The history of Bitcoin scaling

○ This issue has transcended technology and has become political

● Part 2: All about “Layer 2”○ Has already emerged

● Part 3: Layer 2 Live Demo

Page 3: The Emergent Layer 2

Bitcoin has changed a lot since Satoshi left the project.

Page 4: The Emergent Layer 2

When satoshi was around... (2009 to mid 2010)● There was no price because there were no exchanges● There were no block explorers● The entire network used full node wallets● System resources for installing and running a wallet compare to other apps.

After Satoshi completely left… (late 2010)● The first 3rd party wallet was developed● The entire blockchain reached 1GB in size.● The price reached $1 per BTC● The first mining pool started

Page 5: The Emergent Layer 2

“The Scaling Problem”● Bitcoin as Satoshi wrote it only works if each node keeps the entire

blockchain around for verification purposes.● It doesn’t take an Einstein to see that this is going to eventually cause

problems.● Proto-Blocksize debate with two camps

○ “This can never be fixed, bitcoin is stupid, all bitcoiners are idiots”○ “This can be fixed through engineering and it really not a problem”

Page 6: The Emergent Layer 2

What is “Layer 2”?● The specific term is not attributable to anyone● 1) Build Bitcoin, 2) … 3) Profit

○ #2 is Layer 2

● All forms of Layer 2 are transparent to the wallet user

BTC Network

Wallet

Layer 2

Page 7: The Emergent Layer 2

Two Layer 2 philosophies● Minimal changes to the protocol back end

○ These people believe Satoshi got it right

○ Instead of redesigning the consensus protocol, let’s hide the blockchain away on remote servers so users are never bothered by it

○ “Big Blockist” - Conservative - Keep it the way it is○ “Emergent Layer 2”

● Maximal changes to the protocol back end○ These people believe Satoshi got it wrong○ Essentially redesigning everything about how nodes/transactions/timestamping work○ “Small Blockist” - Liberal - Constant improvement○ Lightning Network, etc.

Page 8: The Emergent Layer 2

“SPV” The first Layer 2● The Bitcoin whitepaper, by Satoshi Nakamoto, January, 2009

○ “Simplified Payment Verification” paragraph 8 on page 5

● Satoshi foresaw a need for users to send and receive bitcoin without storing the ever growing blockchain locally.

● Often referred to as “client only mode”

Page 9: The Emergent Layer 2

Why SPV is/was a crappy Layer 2● Written in the whitepaper as a “Layer 1 feature”.

○ No mention of protocol or 3rd party wallets. No “Layer 2”

● Instead of downloading full blocks, it would only download headers○ Still had to sync with network

● Described way of verifying transaction validity by using Merkle Roots.○ I think Satoshi was a trained mathematician.

● Problems:○ Written as a solution using circa-2009 bitcoin technology (solution before problem)○ Admits in roundabout way that this scheme is vulnerable to attack.

● Back then this was a good solution, but today we can do better

Page 10: The Emergent Layer 2

Things Satoshi did not foresee● Mining Pools● ASICS● Block Explorers

Page 11: The Emergent Layer 2

“Layer 1” - Installations of bitcoind or alternate impl.● ~6,000 nodes● Each node has the

full blockchain● Each node is

anonymous● Validity is based on

math only● One of these orange

dots can be either an honest node or a dishonest node (Sybil Attack)

Page 12: The Emergent Layer 2

What is a Block Explorer?● A Block explorer is

a full node● Contains a web

interface for viewing partial blockchain data

● Also a JSON API for building wallets on top of

Blockchain.info

= Single Server

= HTTPS JSON API

= bitcoind full node

Page 13: The Emergent Layer 2

“Layer 2”● ~35 nodes● Each node is

connected to the Layer 1 network

● Validity is not based on math, but rather on reputation

● SSL certificate ensures against Sybil attacks

Toshi.io

Blockr.io

BlockCypher

BlockSeer

Blockchain.info

= Single Server

= HTTPS JSON API

= bitcoind full node

Page 14: The Emergent Layer 2

“Layer 2”● Lightweight wallets

connect to Layer 2● Full Node wallets

connect to Later 1● Since you can’t trust

anonymous peers, you have to verify data they give you, therefore you need the full blockchain

● Lightweight wallets don’t mathematically verify anything, they instead cross check other Layer 2 providers

Blockr.io

BlockCypher

BlockSeer

Blockchain.info

Lightweight walletFull node

wallet

Toshi.io

Page 15: The Emergent Layer 2

Which Wallet do I use?

● You are a libertarian● You are accepting bitcoin at high volume

(exchange, casino, etc)● You can afford to spare some computer

resources (hard drive space, RAM, bandwidth)

● You are an online Pablo Escobar who needs maximum privacy

● You are a hipster who like using retro software

Full node wallet

Lightweight wallet

● You are a regular person

Page 16: The Emergent Layer 2

Verifying Layer 2 - each dialect is slightly different

Chain.So

Blockchain.info

BitpayInsight

https://blockchain.info/unspent?active=1PZ3Ps9RvCmUW1s1rHE25FeR8vtKUrhEai

Page 17: The Emergent Layer 2

Verifying Layer 2 - each dialect is slightly different

Chain.So

Blockchain.info

https://chain.so/api/v2/get_tx_unspent/btc/1PZ3Ps9RvCmUW1s1rHE25FeR8vtKUrhEai

BitpayInsight

Page 18: The Emergent Layer 2

Verifying Layer 2 - each dialect is slightly different

Chain.So

Blockchain.info

BitpayInsight

http://insight.bitpay.com/api/addr/1PZ3Ps9RvCmUW1s1rHE25FeR8vtKUrhEai/utxo?noCache=1

Page 19: The Emergent Layer 2

“Layer 2 Kernel”5 different APIs,

5 times as much work to implement

Not good :(

Lightweight wallet

Blockchain.info

BlockCypher

BlockSeer

Toshi.io

Blockr.io

Page 20: The Emergent Layer 2

“Layer 2 Kernel”moneywagon - Open source “layer 2 kernel”, or

“universal block explorer client library”

Moneywagon

Lightweight wallet

Blockchain.info

BlockCypher

BlockSeer

Toshi.io

Blockr.io

Page 21: The Emergent Layer 2

Layer 2 forks

● In the case of a network fork, some Layer 2 nodes will be split just like the underlying Layer 1 network

Toshi.io(running XT)

Big blockistLightweight wallet

Full node wallet (running XT)

Blockchain.info(running XT)

BlockCypher(running core)

BlockSeer(running core)

Blockr.io(running core)

Full node wallet (running core)

Small blockistLightweight wallet

● Full node wallets choose which side they are on by the software they run.

● Lightweight wallets can choose which side they are on by choosing which Layer 2 services they interact with

Exchange

Page 22: The Emergent Layer 2

Is Layer 2 secure?● Layer 2 is essentially the web

○ To assert Layer 2 is insecure is to argue the web is insecure.○ DDOS protection? Same as any other website○ Load balancing? Same as any other website○ Privacy/Anonymity? Through Tor just like any other website.

Page 23: The Emergent Layer 2

Isn’t Layer 2 centralization?If there was only one block explorer API in existence, then yes

but there are many, and it’s pretty easy to make your own Layer 2 Node.

Install Bitpay Insight on an Amazon VPS ($10/month), and register a domain name + SSL cert.

Page 24: The Emergent Layer 2

Questions / Live Demo