Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Plasma on Substrate

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Plasma on Substrate

Avatar for satellitex

satellitex

May 28, 2019
Tweet

More Decks by satellitex

Other Decks in Technology

Transcript

  1. 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
  2. Plasm の展望 Plasm は 親チェーンであり 子チェーンでもある ブロックチェーンを作れる。 多階層 Plasma チェーン

    - Plasma Dictys 8 Root chain Parent chain / Child chain Parent chain / Child chain Child chain Child chain Child chain Child chain
  3. 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 による 効率的トランザクション処理
  4. 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 による 効率的トランザクション処理 甘くない トートロジー
  5. Substrate アンチパターン Rustの機能 Trait Trait はある型が実装しなければならない機能をコンパイラ に伝える機能を持つ。 C# や Java

    でいうところのインター フェースのようなもの。 トレイト境界 ジェネリック型に指定されたトレイトが実装されることを強要 する機能。 関連型 トレイト内で複数の型をグループ化するものです。 12
  6. type AccountId = sr25519::Pubkey; のときは type Signature = sr25519::Signature; type

    AccountId = ed25519::Pubkey; のときは type Signature = ed25519::Signature; を指定しないとエラーが起きるような設計にしたい。 Substrate アンチパターン 15
  7. 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
  8. Super SRML Trait Pattern 異なる SRML をある SRML をラップした機能を作りたい時 例:balances

    SRML と timestamp SRML を内部で使いたい。 スーパートレイトを使って指定した SRML とセットで使うことを強制する。 19
  9. 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>
  10. 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
  11. 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
  12. 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
  13. 議題 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