Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
2018 - How the Rubyist use Blockchain
Search
蒼時弦や
May 07, 2018
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2018 - How the Rubyist use Blockchain
The talks about ruby and blockchain in rubyelixirconftw.
蒼時弦や
May 07, 2018
More Decks by 蒼時弦や
See All by 蒼時弦や
2024 - COSCUP - Clean Architecture in Rails
elct9620
2
260
2023 - RubyConfTW - Rethink Rails Architecture
elct9620
0
310
20230916 - DDDTW - 導入 Domain-Driven Design 的最佳時機
elct9620
0
550
2023 - WebConf - 選擇適合你的技能組合
elct9620
0
780
20230322 - Generative AI 小聚 ft. Happy Designer
elct9620
0
520
2022 - 默默會 - 重新學習 MVC 的 Model
elct9620
1
550
MOPCON 2022 - 從 Domain-Driven Design 看網站開發框架隱藏
elct9620
1
550
2022 - COSCUP - 我想慢慢寫程式該怎麼辦?
elct9620
0
350
2022 - COSCUP - 打造高速 Ruby 專案開發流程
elct9620
0
390
Other Decks in Technology
See All in Technology
Gifu WordPress Meetup #200 に向けて、私たちには何ができるだろうか?/ 2026-11-07 Gifu WordPress Meetup
torounit
0
100
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
150
2拠点SRE活動始めてみた | sogaoh's LT @ ホンマでっかSRE勉強会 #3
sogaoh
PRO
0
240
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
130
OneLakeをデータソースにした AI Search(Foundry IQ)の ライフサイクル管理
ryuseiiida
0
220
20261031_IoTLT_vol140_kitazaki_v1.pdf
kitazaki
0
170
新卒エンジニア、 介護士になる
ryu1013
1
690
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
170
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
220
分析作業をどこまで任せるか自分で決められる AIネイティブBI『Golden Analytics』が 良さげな話 /golden-analytics-is-ai-native-bi
shinyaa31
0
120
Maestro MCPとClaude Code Skillsによる自律的なE2Eテスト支援
asmz
0
420
AI AgentによるEmbedded SREの取り組み
tgidgd
1
340
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
550
Evolving SEO for Evolving Search Engines
ryanjones
0
350
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
600
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building Applications with DynamoDB
mza
96
7.3k
Abbi's Birthday
coloredviolet
4
11k
Writing Fast Ruby
sferik
630
63k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
290
Transcript
How the Rubyist use Blockchain
WEB DEVELOPER GAME DEVELOPER 襟 儘 䓛⛳ @elct9620
None
I will talk about What is the Blockchain The examples
use Ruby and Ethereum
What is the Blockchain
Linked List Cryptography Key-Value Data Store Distributed System
There is nothing new for us
None
Cryptocurrency
None
So, how the Blockchain works?
Chain =~ Linked List
The Chain Block #1 Block #2 Block #3 Pointer Pointer
Ok, I think you already learned it!
But, we have to limit anyone to write it!!!
1. Proof of Work
1. Prevent mass request from somebody 2. Other people can
verify in short time Cryptography
Use cryptography to resolve question!
Cryptography Network Hash start with “000” Workers Define a Question
Broadcast
Cryptography Workers 000abcdefaaabc… Network Try hash block Submit
Cryptography Network 000abcdefaaabc Block Created Verify result Accept
Wait! The same content will get the same hash result!
None
We add a random “Proof” string with block data
So, the worker should spend the time
And others can check it in short time
If we receive many correct answers…
Which one should accept?
2. Byzantine Generals Problem
Distributed 1. Longest is right 2. 51% node think it
is right
But, we didn’t discuss the algorithm in this talk
And last
How the Blockchain save data?
Merkle Tree
None
Very useful to update and verify data
But read will spend more time
Should I use pure ruby gem to operate blockchain?
It is hard to implement the same API in pure
Ruby
Use the existed API to operate Blockchain.
But, you can implement blockchain in Ruby
Example Ethereum’s IPC Use Ruby to operate Ethereum
IPC =~ UnixSocket
None
How to get IPC and comminuted with it?
IPC 1. Ethereum Wallet 2. brew install geth 3. Compile
from source code
“geth —light —testnet”
But I suggest using Ethereum Wallet
Because you can find IPC file very easy
But how to use UnixSocket to operate Ethereum?
JSON-RPC 2.0
None
None
And it always ends with a linefeed (\n)
None
None
Now, we can interact with Ethereum in Ruby
But the result has many hash value
What are the meaning and real data?
Ethereum Data 1. Call another API to get transaction value
2. Read from “data” depend on ABI
If we just want to know transaction value
It always contains in API response
So, we talk about smart contract event
None
But we got the data in hex
None
It always returns the 32byte hex string for us
So, we need ABI to help us know the data
type
None
Demo - Subscribe event and get data
Now, we know what can we do on the Ethereum
And last, is there has any useful resource?
Ruby Reference 1. digest-sha3 2. rlp 3. ruby-ethereum 4. Naivechain.rb
Conclusion
Build a blockchain in Ruby can help us learn it
And didn’t try to write a client in pure ruby
THANKS