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-blockchain-chooses-rust
Search
jkcomment
July 30, 2019
Technology
2
1.6k
なぜ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
750
Ethereumを支えるネットワークの話
jkcomment
11
4.7k
Other Decks in Technology
See All in Technology
CTOから見た事業開発とプロダクト開発 / My Perspective on Business and Product Development as CTO
keisuke69
4
960
What is DRE? - Road to SRE NEXT@広島
chanyou0311
3
630
コンテナ・K8s研修 - 後半 Kubernetes 基礎&ハンズオン【MIXI 24新卒技術研修】
mixi_engineers
PRO
1
120
さらに高品質・高速化を目指すAI時代のテスト設計支援と、めざす先 / AI Test Lab vol.1
shift_evolve
0
190
AOAI Dev Day - Opening Session
yoshidashingo
2
470
大規模ドラレコデータ収集・機械学習基盤を支える AWS CDK 〜導入・運用事例紹介〜
pemugi
0
110
「単なる OAuth 2.0 を認証に使うと、車が通れるほどのどでかいセキュリティー・ホールができる」のか検証してみた
terara
0
380
LLMアプリケーションの評価の実践と課題 ~PharmaXにおける今後の展望~
pharma_x_tech
2
170
[I/O Extended Android 2024] What`s new in Android 2024
kyeongwan
0
220
Github Actions 로 Android 팀의 효율성 극대화
hadonghyun
0
160
【基調講演】変える、今ここから ― IoTとAIで紡ぐ未来
soracom
PRO
0
320
20240725 LLMによるDXのビジョンと、今何からやるべきか @Azure OpenAI Service Dev Day
nrryuya
3
1.2k
Featured
See All Featured
Gamification - CAS2011
davidbonilla
78
4.9k
A Tale of Four Properties
chriscoyier
155
22k
Practical Orchestrator
shlominoach
185
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
It's Worth the Effort
3n
181
27k
Faster Mobile Websites
deanohume
303
30k
Art, The Web, and Tiny UX
lynnandtonic
291
20k
How To Stay Up To Date on Web Technology
chriscoyier
784
250k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
35
6.3k
How STYLIGHT went responsive
nonsquared
93
5k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
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