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

LINEAR NETWORK Introduction & Future

LINEAR NETWORK Introduction & Future

Shiki Takahashi @shiki_developer
LINE Corporation Blockchain Lab エンジニア

blockchain.tokyo#16 での発表資料です。
https://blockchain-tokyo.connpass.com/event/113023/

LINE Developers

January 24, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. 高橋 史季 Shiki Takahashi Software Engineer @LINE Blockchain Lab ・

    現在の業務 - LINK ScanのStorage周りの開発 ・ 個人的に今気になっているBlockchain – Ethereum2.0, Zilliqa, EOS ABOUT ME
  2. https://www.stateofthedapps.com/stats Ethereum周辺の現在 Current Status ・ 1日当たりのDAU → Total DAU 14,000(Top

    DAU:3,651) ・ 1日当たりのトランザクション数 → 62290 TX/day ・ DAppsのカテゴリー → ゲームが中心
  3. ・ 1つのRoot Chainと複数のLeaf Chainから形成される ・ 各Leaf ChainにdAppをデプロイする ・ Leaf Chain間の取引はKafkaを使ったRelayerを介して行われる

    ・ Root Chainではユーザ間の取引を行わず、Leaf Chain間の送金の仲介を管理する ・ Root ChainとLeaf Chainの2階層のみで3階層以上のレイヤー構造は作らない LINEAR Networkの概要 Leaf Chain A Root Chain Leaf Chain B Relayer Leaf Chain C
  4. Protocolとは Leaf Chain A Root Chain Leaf Chain B Leaf

    Chain C ・ アプリケーションを介さずにブロックチェーン 同士を接続するための仕組み ・ Public Blockchainとして公開するときにブロックチェーンの機能として追加予定
  5. 1. Chainの追加 ① Leaf Chainを構築する。 Leaf Chain A Leaf Chain

    Manger Contract Root Chain Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer
  6. 1. Chainの追加 ② Root ChainにLeaf Chain AのためのRelayer Contractを配置する。 Leaf Chain

    A Root Chain Leaf Chain A Relayer Contract Leaf Chain Manger Contract Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer
  7. 1. Chainの追加 ③ Root ChainのLeaf Chain Relayer Contract と Leaf

    Chain Manager Contractにアクセスできるユーザを追加する。 Leaf Chain A Root Chain user address user address Leaf Chain Manger Contract Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain A Relayer Contract
  8. Leaf Chain A dApp Contract Root Chain 2. dAppのDeploy ①

    Smart ContractをDeployする。 Leaf Chain A Relayer Contract SO Address SO Address(Service Operator Address): dAppの管理者権限を持つAddress Leaf Chain Manger Contract Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer
  9. 3. Tokenの発行 ① Root Chainのadmin userがLeaf ChainのためにTokenを発行する。 Leaf Chain A

    Root Chain Leaf Chain A Relayer Contract Leaf Chain Manger Contract Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer dApp Contract SO Address T
  10. ② RelayerはToken発行イベントを検知して、Leaf Chainの Leaf Chain Manager ContractにToken発行をリクエストする。 Leaf Chain A

    Root Chain 3. Tokenの発行 Leaf Chain A Relayer Contract Leaf Chain Manger Contract Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer dApp Contract SO Address T
  11. ③ Leaf Chain Manager Contractは発行対象のContractを探してTokenを 発行する。 Leaf Chain A Root

    Chain 3. Tokenの発行 Leaf Chain A Relayer Contract Leaf Chain Manger Contract Root Chain Manger Contract Relayer Kafka Cluster Producer Consumer dApp Contract SO Address T T
  12. 4. Chain間の送金 ① Leaf Chain AのユーザがLeaf Chain Bのユーザへ送金リクエストを 発行する。 Leaf

    Chain B dApp Contract Leaf Chain A Root Chain Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract T Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer dApp Contract SO Address SO Address
  13. ② 正常なリクエストの場合、送金する分のTokenをロックし、ブロックに記録する。 Leaf Chain B Leaf Chain A Root Chain

    OK 4. Chain間の送金 T Success! Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract dApp Contract SO Address SO Address
  14. ② 正常なリクエストでなければ、失敗の内容をブロックに記録する。 この場合Relayerには記録されない。 Leaf Chain B Leaf Chain A Root

    Chain 4. Chain間の送金 T NG Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract Failure…
  15. ③ RelayerはLeaf Chain Aの送金リクエストを検知して、Root Chainに伝える。 Leaf Chain B Leaf Chain

    A Root Chain 4. Chain間の送金 T OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract
  16. ④ Root ChainでLeaf Chain Aに発行したTotal Supplyを確認して、正常な リクエストであれば、Root Chainのブロックにトランザクションを 書き込む Leaf

    Chain B Leaf Chain A Root Chain OK 4. Chain間の送金 T OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address Success! dApp Contract
  17. ④ トランザクションが正常に処理されず失敗するとそれをブロックに 記録し、その結果が Leaf Chain Aに伝わり、ロックが解除される。 Leaf Chain B Leaf

    Chain A Root Chain NG 4. Chain間の送金 T OK NG Failure… Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract
  18. ⑤ RelayerはRoot ChainのLeaf Chain Bへの送金リクエストを 検知してLeaf Chain Bにリクエストを伝える。 Leaf Chain

    B Leaf Chain A Root Chain OK 4. Chain間の送金 T OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract
  19. Leaf Chain B Leaf Chain A Root Chain OK NG

    ⑤ Leaf Chain Bが正常に動作しておらず、invokeが失敗する場合、 再度Root Chainを経由してLeaf Chain Aにトランザクションの失敗が 伝えられ、ロックが解除される。 4. Chain間の送金 T OK NG Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract Failure…
  20. ⑥ Leaf Chain Bは正常なリクエストであることを確認して、ユーザBに Tokenを送金して自身のChainで発行されているTokenのTotal Supplyを 増加させる。 Leaf Chain B

    Leaf Chain A Root Chain OK 4. Chain間の送金 T T OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address Success! dApp Contract
  21. ⑦ トランザクションの結果が、Relayerに伝わる。 Leaf Chain B Leaf Chain A Root Chain

    OK 4. Chain間の送金 T T OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address Success! dApp Contract
  22. ⑧ RelayerはLeaf Chain Bの送金が完了したことを検知してトランザクションの 結果をRoot Chainに伝える。 Leaf Chain B Leaf

    Chain A Root Chain OK 4. Chain間の送金 T T OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract
  23. Leaf Chain B Leaf Chain A Root Chain OK OK

    ⑨ Root Chainは送金の結果を受け取り、ブロックに書き込む。 4. Chain間の送金 T T OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address Success! dApp Contract
  24. ⑩ RelayerはRoot Chainの送金リクエストの結果を検知して、 Leaf Chain Aにその結果を伝える。 Leaf Chain B Leaf

    Chain A Root Chain OK OK 4. Chain間の送金 T T OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address dApp Contract
  25. Leaf Chain B Leaf Chain Manger Contract Dapp Contract OK

    Leaf Chain B Leaf Chain A Root Chain OK OK ⑪ Leaf Chain Aは送金の結果を受け取り、ロックを解除して全体のTotal Supplyを 差し引く。 4. Chain間の送金 T OK OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Relayer Kafka Cluster Producer Consumer Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address Success! dApp Contract
  26. Relayer Kafka Cluster Producer Consumer ⑫ Leaf Chain Aのトランザクション結果はRoot Chainに送られ、ブロックに

    記録される。 Leaf Chain B Leaf Chain A Root Chain OK OK OK 4. Chain間の送金 T OK OK OK Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract SO Address SO Address Success! dApp Contract
  27. Relayer Kafka Cluster Producer Consumer Leaf Chain B Leaf Chain

    A Root Chain T Leaf Chain Manger Contract Root Chain Manger Contract Leaf Chain Manger Contract Leaf Chain B Relayer Contract Leaf Chain A Relayer Contract dApp Contract ※ SO Address ※ SO Address ① Request Transaction ② ③ ④ Send to Leaf Chain B ⑥ Receive a token ⑦ ⑧ ⑧ Send the response to Root Chain ⑨ ⑪ ③ Send to Root Chain Send request result from Root Chain ⑩ ⑫ Send the transaction result ⑤ Leaf Chain間の送金のまとめ ※ SO Address(Service Operator Address): dAppの管理者権限を持つAddress dApp Contract
  28. Ethereum LINE Current Status ・DAU:全体で約14,000 ・ゲームが中心 ・MAU: 日本だけで7,800万 ・ゲーム、ソーシャルから Financialと多岐に渡る

    共通の課題 On Chainのスケーラビリティ問題に対応する 必要がある Raiden Network Plasma Sharding Private Chain Solution Relayer (Private Blockchain) Protocol (Public Blockchain) On Chain Now Future LINEAR Network