Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Sharding
Search
wshino
June 26, 2018
Technology
4
1.1k
Sharding
6/26のビットコインとか勉強会#19の発表資料です。
wshino
June 26, 2018
Tweet
Share
More Decks by wshino
See All by wshino
Past, Present and Future
wshino
1
460
libp2p
wshino
7
1.3k
Superiority of Rust
wshino
3
370
Try Cross Compile Then Fail
wshino
0
150
GORMOS - A high performance and scalable design for decentralized applications -
wshino
4
1.9k
DAppのデプロイ戦略 / DApp Deployment Strategy
wshino
3
1.8k
Plasma Debit
wshino
2
2k
ブロックチェーン技術の登場とスマートコントラクト化する社会
wshino
5
5.3k
Truffle + Drizzle と、Ethereumの概況について
wshino
2
1.2k
Other Decks in Technology
See All in Technology
re:Invent 2025 ~何をする者であり、どこへいくのか~
tetutetu214
0
230
AlmaLinux + KVM + Cockpit で始めるお手軽仮想化基盤 ~ 開発環境などでの利用を想定して ~
koedoyoshida
0
120
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
1.5k
AWS re:Invent 2025 re:Cap LT大会 データベース好きが語る re:Invent 2025 データベースアップデート/セッションの紹介
coldairflow
0
120
文字列の並び順 / Unicode Collation
tmtms
3
620
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
330
AI との良い付き合い方を僕らは誰も知らない
asei
0
170
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
380
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
160
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
7
1.6k
【ServiceNow SNUG Meetup LT deck】WorkFlow Editorの廃止と Flow Designerへの移行戦略
niwato
0
110
フィッシュボウルのやり方 / How to do a fishbowl
pauli
2
220
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
85
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
400
The Mindset for Success: Future Career Progression
greggifford
PRO
0
180
Believing is Seeing
oripsolob
0
11
From π to Pie charts
rasagy
0
86
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.8k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
710
RailsConf 2023
tenderlove
30
1.3k
Done Done
chrislema
186
16k
Building Applications with DynamoDB
mza
96
6.8k
How to Ace a Technical Interview
jacobian
281
24k
Transcript
sharding ビットコインとか勉強会 2018.6 DMM.comラボ スマートコントラクト事業部 篠原航
本日のアジェンダ • スケーラビリティ問題 • shardingとは • sharding phase 1
自己紹介 篠原航 DMMスマートコントラクト事業 部テックリード。計算リソース の効率化、継続的デリバリや デプロイの開発を支える仕組 み作り、ウォレットの実装を担 当。最近ヨーヨーにはまってい て、ループザループを習得し たい。
https://www.amazon.co.jp/dp/4839965137/
Caution! 6/24に発表された Casper + Shardingの同時実装の話ではありません。 こちらはまた追って解説します。 https://ethresear.ch/t/convenience-link-to-full-casper-chain-v2-spec/2332
スケーラビリティ問題 Shardingとは Sharding Phase 1 Section01 Section02 Section03
スケーラビリティ問題 • 全てのノードが同じ処理をする • 全てのノードが同じ状態を持つ • ハッシュパワーが上がってもtxスピードは変わらない Node 10tx/s Node
10tx/s New! DatabaseでいうとMulti-Masterの状態 タスク、みんなと一緒。。
スケーラビリティの解決方法 • Raiden ◦ 家の外で遊ぶ • Plasma ◦ 隣の部屋で遊びながら都度報告してくれる
Raiden • Off Chainのスケーリングソリューション ◦ Lightning NetworkのEthereum版 • 状態遷移をオフチェーンでやり取りする •
State(Payment) Channelと言われる On-Chain Off-Chain ここでのやり取りは記録さ れない
Plasma • Side Chainのスケーリングソリューション • Main ChainにPlasma Chainを接続 • Plasmaに処理を移譲
On-Chain Plasma-Chain ここでのやり取りは Plasma Chainに記録。適 宜Merkle RootをMain Chainに公開する
Plasmaの現状 • 2017年に公開 • 様々な提案がなされている ◦ Plasma ◦ Minimal Viable
Plasma ◦ More Viable Plasma ◦ Plasma Cache, Plasma XT, Plasma Debit
スケーラビリティ問題 Shardingとは Sharding Phase 1 Section01 Section02 Section03
データベースのSharding • MySQLであれば、PartitioningとかSpider Engineとか ◦ データを水平に分割してデータ容量と処理性能をかせぐ Alice Bob Charlie Dave
EthereumのSharding • On Chainのスケーラビリティソリューション • Off Chain, Side Chainではなく、Main Chain(Ethereum本体)を改良
◦ ハードフォークの必要性がある • PoSに移行することが前提
Shardingの構成 • Main ChainをK個の断片に分割する ◦ アドレスごとに分割する • 各断片では全体のtxを並列に処理する • 理論値
= Main Chainの処理性能 x K
Shardingのロードマップ Phase 1 ◦ 基本的なshard ◦ EVMなし Phase 2 ◦
EVM実装 Phase 3 ◦ Executor ◦ ライトクライアントの実装 Phase 4 ◦ Shard間のコミュニケーション Phase 5 ◦ Main Chainのセキュリティと密結合 Phase 6 ◦ Shard内でのShard ◦ ロードバランシング
スケーラビリティ問題 Shardingとは Sharding Phase 1 Section01 Section02 Section03
用語の解説 • Collation ◦ Collation Header • Period • Proposer
• Collator • Sharding Manager Contract • Lookahead Period • Executor (Phase3)
Collation, Collation Header • Main Chainと異なる用語を使う
Collation内部構造 shard_id : Collationの番号 parent_hash : 前のCollationのハッシュ chunk_root : txをmerklizeしたroot
period : Collationが入るPeriodの番号 proposer_address : Collationを提出したユーザーアドレス proposer_bid : Collatorに渡す報酬 proposer_signature : Proposerの署名 Collation Header Collation Body collation_body : txを32byteのchunkにしたもの Collation
Period • Main Chainで決めている周期の単位 ◦ PERIOD_LENGTH = 5であればMain Chainの5blockごとにPeriod が切られている
Period 1 Period 2
Proposer • blob(tx)を拾いchunkにエンコードする • chunkをchunk treeにしてchunk rootをcollation headerに入れる blob 1
blob 2 ... blob i chunk 1 chunk 2 ... chunk j 32byte単位 chunk 1 chunk 2 chunk 3 chunk 4 chunk root
Proposer • collationを作成してCollatorに渡す collation Proposer Collator
Collator • Proposerから受け取ったcollationを検証する • 検証後、shard内のチェーンにcollationを繋げる Collator collation Validate collation collation
collation New! chaining
Collator • Periodごとにcollation headerをMain Chainに送信する Collator collation header Main Chain(SMC)
Sharding Manager Contract(SMC) • PeriodごとにCollatorを各shardに割り振る
Sharding Manager Contract(SMC) • PeriodごとにProposerを登録する • Collatorのdepositを管理し、collationを検証し、不正なら提出した Collatorからdepositを没収する Collator invalid
collation header SMC No!
Lookahead Period • Collatorが先にどこのShardに配属されるかを教える ◦ LOOKAHEAD_PERIODS = 4 ◦ 4Period前にStateをダウンロード
◦ Collatorは準備期間が持てる
Executor • Phase3で実装予定 ◦ ProposerがExecutorを兼ねる • txの処理を行う • コントラクトのコードを実行する(EVMはphase2で実装予定) •
状態遷移の結果を提示する
流れ Proposer Main Chain(SMC) Collator 1. Proposer -> SMCにdeposit 2.
Collator -> SMCにdeposit Shard 1 ... Shard 2 Shard n
流れ Main Chain(SMC) Collator 3. Collator -> SMC、どこのShard に割り振られているのか定期的 に確認
4. 割り当てられていたら Lookahead Period期間に ShardのStateをダウンロードす る どこのShard? Shard 1 ... Shard 2 Shard n Download Shard 2 Proposer
流れ Collator 5. Proposer -> Collator、 Proposal Bidと署名を入れて collationを提出 6.
Collator、collationを検証して Proposal bidをもらう 7. 前のcollationに5で受け取った collcationを繋げる Proposer collation Validate collation collation collation New! Get bid Shard 2
流れ Collator 5. PeriodごとにCollation Header をSMCに送る Proposer collation
悪意のあるCollatorがいた時は • シャッフルされた後のCollatorがheadのCollationの不正を見つける • 遡って検証してフォークする • フォークした正しいcollation headerをMain Chainに送信する
• PeriodごとにSMCでCollatorを入れ替える ◦ 入れ替え作業はMain Chainで行う Phase1の問題 入れ替えはtxの承認を待つので、 その間shard側の処理ができない
Phase1の問題 • Shardは常にCollatorによって処理をしつつ、適切なタイミングでMain Chainから値を受け取るようなcross-linkにできないか? • S2MC link
ZilliqaのSharding • ZilliqaではShardingを実現している • Ethereumとの違い ◦ ネットワークの分割で並行処理する ◦ 状態ごとに分割していない(Full State)
• 特定のアドレスを処理するShardは固定している • Shard内でブロックを生成し、特権ノードに送信 • 特権ノードが各Shardにブロックをブロードキャスト
KyberNetworkのSharding • Gormos ◦ KyberNetworkが用意する独自のPlasma Chain ◦ Plasma Chainの中でShardingする ◦
テクニカルペーパーがそろそろ出る
• DMMでは様々な人材を募集しています ◦ https://dmm-corp.com/recruit/top • 私はブロックチェーンと AIと量子コンピュータについて対話できる人を募集しています 最後に