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
5k
Other Decks in Technology
See All in Technology
2025/3/1 公共交通オープンデータデイ2025
morohoshi
0
110
AIエージェント時代のエンジニアになろう #jawsug #jawsdays2025 / 20250301 Agentic AI Engineering
yoshidashingo
9
4.1k
JavaにおけるNull非許容性
skrb
2
2.7k
AWSアカウントのセキュリティ自動化、どこまで進める? 最適な設計と実践ポイント
yuobayashi
7
1.7k
Log Analytics を使った実際の運用 - Sansan Data Hub での取り組み
sansantech
PRO
0
120
MLflowはどのようにLLMOpsの課題を解決するのか
taka_aki
0
140
Snowflakeの開発・運用コストをApache Icebergで効率化しよう!~機能と活用例のご紹介~
sagara
1
540
役員・マネージャー・著者・エンジニアそれぞれの立場から見たAWS認定資格
nrinetcom
PRO
4
6.8k
マルチアカウント環境における組織ポリシーについて まとめてみる
nrinetcom
PRO
2
110
Охота на косуль у древних
ashapiro
0
130
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
540
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
19k
Featured
See All Featured
Done Done
chrislema
182
16k
GitHub's CSS Performance
jonrohan
1030
460k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
440
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Building Your Own Lightsaber
phodgson
104
6.2k
Agile that works and the tools we love
rasmusluckow
328
21k
RailsConf 2023
tenderlove
29
1k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Invisible Side of Design
smashingmag
299
50k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
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