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
2.1k
なぜ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
860
Ethereumを支えるネットワークの話
jkcomment
11
5k
Other Decks in Technology
See All in Technology
金融システムをモダナイズするためのAmazon Elastic Kubernetes Service(EKS)ノウハウ大全
daitak
0
140
実践Kafka Streams 〜イベント駆動型アーキテクチャを添えて〜
joker1007
1
640
うちの会社の評判は?SNSの投稿分析にAIを使ってみた
doumae
0
380
プロジェクトマネジメント実践論|現役エンジニアが語る!~チームでモノづくりをする時のコツとは?~
mixi_engineers
PRO
3
190
組織とセキュリティ文化と、自分の一歩
maimyyym
3
1.2k
Swiftは最高だよの話
yuukiw00w
2
290
OpenJDKエコシステムと開発中の機能を紹介 2025夏版
chiroito
1
410
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
38k
Cursor Meetup Tokyo
iamshunta
3
1.1k
kintone開発組織のDevOpsへの移り変わりと実践
ueokande
1
170
Javaアプリケーションの配布とパッケージング / Distribution and packaging of Java applications
hogelog
1
410
FastMCPでSQLをチェックしてくれるMCPサーバーを自作してCursorから動かしてみた
nayuts
1
220
Featured
See All Featured
KATA
mclloyd
29
14k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
Designing for Performance
lara
608
69k
A better future with KSS
kneath
239
17k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
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