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
なぜBlockchainはRustを選ぶのか #roppongirs / why-blockc...
Search
jkcomment
July 30, 2019
Technology
2
2k
なぜBlockchainはRustを選ぶのか #roppongirs / why-blockchain-chooses-rust
2019/07/30 Roppongi.rs #1 登壇資料
jkcomment
July 30, 2019
Tweet
Share
More Decks by jkcomment
See All by jkcomment
DAppsを支えるバックエンド開発の話
jkcomment
2
820
Ethereumを支えるネットワークの話
jkcomment
11
4.9k
Other Decks in Technology
See All in Technology
30分でわかる『アジャイルデータモデリング』
hanon52_
9
2.7k
OpenID Connect for Identity Assurance の概要と翻訳版のご紹介 / 20250219-BizDay17-OIDC4IDA-Intro
oidfj
0
280
Developers Summit 2025 浅野卓也(13-B-7 LegalOn Technologies)
legalontechnologies
PRO
0
740
株式会社EventHub・エンジニア採用資料
eventhub
0
4.3k
エンジニアのためのドキュメント力基礎講座〜構造化思考から始めよう〜(2025/02/15jbug広島#15発表資料)
yasuoyasuo
18
6.9k
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
980
全文検索+セマンティックランカー+LLMの自然文検索サ−ビスで得られた知見
segavvy
2
110
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
25
7.2k
インフラをつくるとはどういうことなのか、 あるいはPlatform Engineeringについて
nwiizo
5
2.6k
ユーザーストーリーマッピングから始めるアジャイルチームと並走するQA / Starting QA with User Story Mapping
katawara
0
210
明日からできる!技術的負債の返済を加速するための実践ガイド~『ホットペッパービューティー』の事例をもとに~
recruitengineers
PRO
3
410
2025-02-21 ゆるSRE勉強会 Enhancing SRE Using AI
yoshiiryo1
1
370
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
Building Applications with DynamoDB
mza
93
6.2k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Designing Experiences People Love
moore
140
23k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Agile that works and the tools we love
rasmusluckow
328
21k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Thoughts on Productivity
jonyablonski
69
4.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
960
Transcript
Powered by DMM Blockchain Labs 1 なぜBlockchainは Rustを選ぶのか
自己紹介 - About me @ DMM.com Jikyung Kim(金 志京) ・DMM.com
Blockchain Engineer ・Blockchain研究・開発 ・スニーカー、ロードバイク @jkcomment 2
書籍紹介 - Publishing @ DMM.com 3
Agenda @ DMM.com • Rustの現状 • なぜBlockchainはRustを選ぶのか • まとめ 4
Rustの現状 5
Rust? @ DMM.com • Rustとは? ◦ システムプログラミング言語 ◦ 安全性(型安全、メモリ安全) ◦
速度(C, C++並) ◦ コンパイラが優秀 ◦ FireFox, Dropbox, Dwango etc... 6
Rust? @ DMM.com • Stack Overflow 2018年の調査結果でRustが一番好きな言語に! 7
Rustの現状 @ DMM.com 8
Rustの現状 @ DMM.com 9 Rustやめますか!
Rustの現状 @ DMM.com • Rust実装の有名なサービスがまだない(少ない) • Rust実装の有名なOSSプロジェクトがまだない • システム系 +
組み込み系はC言語1強 • 学習コストが高い • なんか難しそうー 10
なぜBlockchainは Rustを選ぶのか 11
Blockchainとは @ DMM.com • Blockchain? ◦ P2Pで形成されたネットワーク上で動作する分散型台帳システム ◦ 「ブロック」と呼ばれるデータの単位を一定時間ごとに生成し、チェーン のように連結していくことによりデータを保管する
◦ 取引情報やブロックはハッシュ関数で暗号化される 12
Blockchain Nodeの実装例 @ DMM.com • C++: bitcoin, EOS, Zilliqa •
Go: Ethereum, Klaytn, Quorum 13
Blockchain Nodeの実装例 @ DMM.com • C++: bitcoin, EOS, Zilliqa •
Go: Ethereum, Klaytn, Quorum • Rust: Ethereum(Parity), Polkadot(Substrate), Holochain, NEAR, Grin, Conflux, CodeChain, Purple Protocol, Enigma(core), zero-chain, Plasm, Edgeware… 14
なぜRustなのか @ DMM.com • なぜ!? 15
なぜRustなのか @ DMM.com • なぜ!? 16 特に理由はない
なぜRustなのか① - 性能 @ DMM.com • 理由は様々 ◦ Memory Safety
◦ Concurrency ◦ Fast 17
なぜRustなのか② - モジュール @ DMM.com • Blockchainにおける必要な処理 ◦ Networking(P2P) ◦
Cryptography ◦ Consensus ◦ Storage ◦ etc 18
なぜRustなのか② - モジュール @ DMM.com • Blockchainにおける必要な処理 ◦ Networking(P2P) ◦
Cryptography ◦ Consensus ◦ Storage ◦ etc 19
なぜRustなのか② - モジュール(Networking) @ DMM.com • Networking(P2P) ◦ BlockchainはP2Pでネットワークを形成する ◦
P2P(Peer to Peer)? ▪ 対等の者同士が対等な立場で相互にやり取りをおこなう ▪ 実現するために必要な機能が多い • Transport, Discovery, Peer Routing, NAT越えなど 20
なぜRustなのか② - モジュール(Networking) @ DMM.com • libp2p ◦ p2pアプリケーションを実現するために必要なモジュールを提供 21
なぜRustなのか② - モジュール(Cryptography) @ DMM.com • Cryptography ◦ 暗号化関連のモジュールが豊富 22
なぜRustなのか③ - wasm @ DMM.com • wasmとは? ◦ WebAssembly •
他の言語でも書けるじゃん? ◦ Go/C#の場合、runtimeのライブラリが大きすぎてバイナリのサイズが 大きくなるし、C/C++の場合、wasmへのプロセスが面倒 ◦ Rustはバイナリが小さい、楽、wasmにしてもメモリ安全 23
なぜRustなのか④ - Substrate @ DMM.com 24
なぜRustなのか④ - Substrate @ DMM.com • Substrateとは? ◦ Parity社が開発したBlockchain Framework
◦ 誰でも簡単(?)に独自のBlockchainが作れる ◦ Substrateベースのプロジェクトが増えている ▪ zero-chain, Plasm, Edgeware, shasper, ChainX... 25
BlockchainにおけるRustの悪い使い方 @ DMM.com • マクロが便利なのはわかりますが、、、 ◦ コードが理解しづらい ◦ コンパイルエラーは展開後のコードで起こり原因が分かりづらい •
トレイト地獄 • match地獄 26
Blockchain以外のRustの使い道 @ DMM.com • システムプログラミング言語なのでOSが作れる • Webアプリケーション開発もイケる ◦ Rocket, Iron,
actix-webなど • フロントエンド開発もできるぞ!(feat. wasm) 27
番外編① - 個人的にRustが良いと思う理由 @ DMM.com • オブジェクト指向言語好きじゃない • 速さ =
正義 • 堅牢さ = 正義 28
番外編② - 個人的にRustで苦労した話 @ DMM.com • 関数型言語がわからず。。。 ◦ Haskellを勉強しますた •
国内だと情報が少ない ◦ 最近本が色々出始めてますね!嬉しい! 29
まとめ 30
まとめ @ DMM.com • BlockchainでRustが選ばれる理由は特にない ◦ RustはBlockchainでよく選ばれているのは事実 ▪ RustはBlockchainと相性が良い!(かも) •
Blockchain以外でもRustは全然イケる! • ものづくりは楽しむべき。Rustで楽しんで行きましょう! ◦ Blockchain楽しいですよ:D 31
参考 @ DMM.com 32 https://insights.stackoverflow.com/survey/2018#most-loved-dreaded-and-wanted https://www.parity.io/why-rust/ https://lib.rs/cryptography https://www.parity.io/wasm-smart-contract-development/ https://github.com/WebAssembly/meetings/blob/master/2018/CG-04.md#webassembly-in-blockchain https://github.com/paritytech/substrate
https://grin-tech.org/ https://libp2p.io/implementations/ https://github.com/libp2p/specs https://github.com/rust-in-blockchain/awesome-blockchain-rust https://github.com/klaytn/klaytn https://github.com/libra/libra https://github.com/substrate-developer-hub/awesome-substrate https://github.com/darwinia-network/darwinia-appchain https://github.com/servo/servo https://github.com/actix https://github.com/SergioBenitez/Rocket https://github.com/libp2p/rust-libp2p https://github.com/rust-lang/book
Thank you for the attention. Powered by DMM Blockchain Labs
33