sharding · 2021. 1. 15. · - alice from shard#1 sends money to bob on shard#2; - a tx that debits...

41
Sharding and other things

Upload: others

Post on 19-Jan-2021

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Shardingand other things

Page 2: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

About us

Bowen

- Core engineer at NEAR (built a lot of stuff we’re covering)

Peter

- Developer experience and developer tooling- Working on sustainable behavior on the side

Page 3: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

About NEAR Protocol

- Public Sharded Blockchain- Emphasis on usability, - (specifically Developer Usability)

- A bunch of ex-MemSQL and ex-Google- A group of ACM ICPC gold medalists- A grip of previous founders

Page 4: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

What we’re talking about

1. Sharding, (in blockchains)2. 10,000 ft view of crypto3. Behavior (it relates to blockchain)

Page 5: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Sharding Overview

Page 6: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Sharding Overview

Page 7: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Sharding Overview

Main Chaina.k.a.Beacon ChainRelay ChainHub

Shard Chainsa.k.a.ParachainsZones

Page 8: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Corrupting Validators

Page 9: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Sampling Validators

Page 10: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Sampling Validators

Page 11: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Malicious Behavior

Forking

Invalid State Transitions

Page 12: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Invalid State Transition

Page 13: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Malicious Behavior without Sharding

Forking

Invalid State Transitions

Page 14: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Malicious Behavior without Sharding

Page 15: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Malicious Behavior with Cross-Shard Transactions

Forking

Invalid State Transitions

Page 16: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Cross-shard Communication

Main Chaina.k.a.Beacon ChainRelay ChainHub

Shard Chainsa.k.a.ParachainsZones

Page 17: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Cross-shard Communication

Main Chaina.k.a.Beacon ChainRelay ChainHub

Shard Chainsa.k.a.ParachainsZones

Page 18: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Cross-shard Communication: Receipts

- Alice from Shard#1 sends money to Bob on Shard#2;- A tx that debits Alice’s account is executed on Shard#1;- A proof of execution (Receipt) is created and sent to Shard#2;- A tx that credits Bob’s account is executed on Shard#2.

Page 19: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

State Validity

Page 20: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

State Validity

Page 21: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

State Validity

Page 22: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Fisherman

Page 23: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Data Availability

Page 24: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Data Availability

Main ChainLight ClientCan’t download all the blocks from shard chains

Shard ChainsFull Nodes

Page 25: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Data Availability

Page 26: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Proposed Protocols

Page 27: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Cosmos

Page 28: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Cosmos

Validators do not rotate between Zones

IBC to transfer assets between Zones

Page 29: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Polkadot

Page 30: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Polkadot

Parachain runtime is on-chain

In principle possible to rotate validators

Fisherman

Page 31: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Zilliqa

Page 32: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Zilliqa

Only shard processing, do not shard state

Only parallelize single shard transactions

Stop all shards to batch-process cross-shard transactions

Page 33: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Ethereum Serenity

Page 34: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Near Protocol

Main Chain

Shard Chains

Page 35: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Near Protocol vs Ethereum Serenity

Main Chain

Ethereum: GHOST + Casper FFG among all validators

Near: Doomslug, validators rotate every epoch, (it’s a setting)

Page 36: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Near Protocol vs Ethereum Serenity

Shard Chains

Ethereum: Proposers + Attesters + Cross-linking

Near: Fast finality (roughly 3 seconds)

Page 37: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Crypto/business

Page 38: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Why are we doing any of this in the first place?● PoW → PoS → DPoS → Sharded DPoS● Locking value? Insurance? Supply chain?● Interesting promises from early Eth

○ DAOs○ Programmable Money○ New business models

Page 39: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

BehaviorAs it relates to crypto

Page 40: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Behavior As it doesn’t relate to crypto

Page 41: Sharding · 2021. 1. 15. · - Alice from Shard#1 sends money to Bob on Shard#2; - A tx that debits Alice’s account is executed on Shard#1; - A proof of execution (Receipt) is created

Thank YouCheck out code

- http://near.dev -- example apps- http://github.com/nearcore -- core chain code

Whiteboard Series (Cosmos, Solana, Ontology, more to come…)

- http://near.ai/youtube

Code is open, all the discussions are public

- http://near.chat - Nightshade: https://near.org/papers/nightshade/ and

https://nomicon.io/ChainSpec/Consensus.html