Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Plasma on Substrate
Search
satellitex
May 28, 2019
Technology
57
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Plasma on Substrate
satellitex
May 28, 2019
More Decks by satellitex
See All by satellitex
Plasm Network L2L2
sate
1
480
Plasm Network 0504.
sate
0
59
New generation blockchain token design
sate
0
130
About Plasm Project
sate
0
190
Cross Blockchain Trading Protocols
sate
1
700
Other Decks in Technology
See All in Technology
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
310
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
420
公式ドキュメントの歩き方etc
coco_se
1
120
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
150
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
0
170
世界、断片、モデル。そして理解
ardbeg1958
1
130
誤解だらけの開発生産性 / Myths and Misconceptions about Developer Productivity
i35_267
2
810
[2026-07-15] AI Ready なはずだったアーキテクチャと、見えてきた課題・次に目指す状態
wxyzzz
9
4k
「早く出す」より「事業に効く」 ── 顧客の業務サイクルから逆算するAI時代の二重ループ開発と「変化の設計者」 / devsumi2026
rakus_dev
1
400
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
290
AIが実装を自走する時代の認知負債との戦い
lycorptech_jp
PRO
1
360
CIで使うClaude
iwatatomoya
0
290
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
350
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
180
Everyday Curiosity
cassininazir
0
260
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Mind Mapping
helmedeiros
PRO
1
280
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Between Models and Reality
mayunak
4
370
Deep Space Network (abreviated)
tonyrice
0
230
Speed Design
sergeychernyshev
33
1.9k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Transcript
Plasma on Substrate Takumi Yamashita @ public_sate 1
Takumi Yamashita (@public_sate) 所属:Staked Inc/東京大学大学院情報理工学研究科 趣味/特技だったもの: 競技プログラミング(ACM-ICPC WorldFinals 2016/2017) Splatoon(WiiU)(関東3位)
スマブラ(地元最強) 週刊少年ジャンプ Twitter(アルファ) 同人誌 (冬コミC91) 2
Proskenion 3 未踏2018年度
Substrate とは 日本語 Substrate Docs https://t.co/gB3CGA2w0Q ブロックチェーンフレームワーク モジュールを組み合わせて 君だけのブロックチェーンを作ろう 4
Plasma とは スケーラビリティのソリューション (既に詳しい説明がなされているはずなので省略します。 ) 5 Parent Child Submit Exit
Deposit
Plasm あなたのブロックチェーンに 無限のスケーラビリティを 6 © Staked Technologies https://github.com/stakedtechnologies/Plasm
Plasm を動かす Let's make a Plasma chain with Plasm and
Substrate. https://medium.com/staked-technologies/lets-make-a-plasma-chain-with-plasm-an d-substrate-39cbd868022d 7
Plasm の展望 Plasm は 親チェーンであり 子チェーンでもある ブロックチェーンを作れる。 多階層 Plasma チェーン
- Plasma Dictys 8 Root chain Parent chain / Child chain Parent chain / Child chain Child chain Child chain Child chain Child chain
Plasma Dictys Plasma の特徴 ExitGame によりメインチェーンのセキュリティを 子チェーンであやかることができる。 9 Root chain
Parent chain / Child chain Parent chain / Child chain Child chain Child chain Child chain Child chain
Plasma Dictys 10 Root chain Parent chain / Child chain
Parent chain / Child chain Child chain Child chain Child chain Child chain Root Chain のセキュリティ Parent Chain のセキュリティ = Root Chain のセキュリティ 無限のスケーラビリ ティ Fast Finality による即時決済 すごい!! MapReduce による 効率的トランザクション処理
Plasma Dictys 11 Root chain Parent chain / Child chain
Parent chain / Child chain Child chain Child chain Child chain Child chain Root Chain のセキュリティ Parent Chain のセキュリティ = Root Chain のセキュリティ 無限のスケーラビリ ティ Fast Finality による即時決済 すごい!! MapReduce による 効率的トランザクション処理 甘くない トートロジー
Substrate アンチパターン Rustの機能 Trait Trait はある型が実装しなければならない機能をコンパイラ に伝える機能を持つ。 C# や Java
でいうところのインター フェースのようなもの。 トレイト境界 ジェネリック型に指定されたトレイトが実装されることを強要 する機能。 関連型 トレイト内で複数の型をグループ化するものです。 12
Substrate アンチパターン 13 たくさんのジェネリック引数を持った構造体 を使いたいが毎回決まった定義を書くのが面倒
Trait Alias Pattern パターン 型エイリアスを使って Trait の型を省略する。 14
type AccountId = sr25519::Pubkey; のときは type Signature = sr25519::Signature; type
AccountId = ed25519::Pubkey; のときは type Signature = ed25519::Signature; を指定しないとエラーが起きるような設計にしたい。 Substrate アンチパターン 15
Verify trait を実装していて且つ verify に使う Signer(公開鍵)の型が AccountId であるような Signature でなければならない仕様にすることで解決。
Relational Trait Lock Pattern 16
Substrate アンチパターン Event テストパターン:Event が正しく発行されているかをどうテストするか? 17 マクロ展開 参考 https://docs.substrate.dev/docs/event-enum
Event Test Pattern Event テスト : Trait と super Trait
の Event への From を実装したTestEvent を使う 18 参考 : https://github.com/stakedtechnologies/Plasm/blob/v0.2.0/core/child/src/mvp.rs#L172
Super SRML Trait Pattern 異なる SRML をある SRML をラップした機能を作りたい時 例:balances
SRML と timestamp SRML を内部で使いたい。 スーパートレイトを使って指定した SRML とセットで使うことを強制する。 19
Using SRML Module Trait Pattern ある機能が実装された任意の SRML を別の SRML で使いたい時
SRML の Module を関連型として与える。 20 runtime/src/lib.rs srml/system/src/lib.rs srml/indices/src/lib.rs indices::Module<Runtime>
Plasma on Substrate の規格策定 21 PlasmParent PlasmChild PlasmUtxo PlasmMerkle PlasmProof
has PlasmTx mvp cash chamber mvp cash chamber mvp cash predicate dynamic static mvp cash predicate
Plasma on Substrate の規格策定 Rust の Trait を用いて規格を記述する 自由度の高いコードを書いても規格に沿ったプログラムを実装可能になる。 コンパイル時にバグを防ぐ。
22
PlasmTx 23 tx_hash out_index tx_hash out_index value keys quorum value
keys quorum value keys quorum Transaction input1 input2 output2 output3 output1 SignedTransaction Signature0 Signature1 Signature.. utxo_a signature public_key utxo_b unlock
PlasmTx ver Predicate. predicateAddress stateID Contract Transaction input1 predicateAddress stateID
input2 deprecate0 deprecate1
UtxoTrait MakePayment Plasma on Substrate の規格策定 type Signature; type TimeLock:
type Value; type OnNewAccount; 25 PlasmParent PlasmChild PlasmUtxo PlasmMerkle PlasmProof has PlasmTx type Utxo = PlasmUtxo; type Tree = PlasmMerkle; type Hash; type Hashing; MerkleTreeTrait
ブロックチェーンの歴史 • 過去 • 今 • 未来 26
議題 27 Polkadot Harberger Tax Child Chainの作成者は一定期間(月次) ごとに7%のtaxをroot chainに自動的に 支払う。その内、2%を僕らが運営費とし
て頂き、5%を使われているチェーン に還元する。%はトークンによるVotingに より変動する。このモデルはP4のエッセン スを大いに含むモデルである。Harberger Taxに関してはRadical Marketという書籍を 参考にされたい。 Plasma Chain IoTユースケース 電力ユースケース ゲームユースケース predicateAddress stateID Contract Transaction input1 predicateAddress stateID input2 deprecate0 deprecate1 ここのDSL 作るべき では? 子チェーンの Tx 親 子 孫 SkipExit/二段Exit