eth.rb
• Let's take a look into the world of blockchain with eth.rb!
• https://github.com/q9f/eth.rb
Slide 10
Slide 10 text
Ethereum
Keys and Addresses
Slide 11
Slide 11 text
Blockchain Wallet
• When users create a wallet such as
MetaMask, an address of 0xabc.... is
created.
• This address is required on Ethereum
https://metamask.io/
Slide 12
Slide 12 text
Eth::Key
• The library can create private/public key pairs
• This can also show the required address on ethereum
Address
• Calculate hash value of public key with Keccak256
• Public key = K, last 20bytes of Keccak256(K)
• Returns with 0x; 42 characters (40 without 0x)
Slide 15
Slide 15 text
EIP-55
• If the checksum is 8 or higher, the corresponding address letter is
uppercase to prevent input errors.
• EIP(Ethereum Improvement Proposals)
EIP-55
• Addresses are not case sensitive
• Can be veri
fi
ed if the checksum is used
Slide 18
Slide 18 text
ENS
• Ethereum Domain Name Service
• kurotaky.eth
https://ens.domains/
https://eips.ethereum.org/EIPS/eip-137
Slide 19
Slide 19 text
Ethereum Signatures
Slide 20
Slide 20 text
Ethereum Signatures
• ECDSA (Eliptic Curve Digital Signature Algorithm)
• This is used for three purposes
1. proof of authorization to make ETH payments or execute smart
contracts
2. proof that the signature is non-repudiation
3. proof that no one has modi
fi
ed the transaction data since it was signed
https://ethereum.org/en/developers/docs/transactions/
Slide 21
Slide 21 text
personal_sign
•
Slide 22
Slide 22 text
sign
Slide 23
Slide 23 text
sign
Slide 24
Slide 24 text
Signature.verify
Slide 25
Slide 25 text
EIP-155
https://eips.ethereum.org/EIPS/eip-155
Slide 26
Slide 26 text
Chain ID
Slide 27
Slide 27 text
Transaction
Slide 28
Slide 28 text
Transaction
https://ethereum.org/en/whitepaper/
Slide 29
Slide 29 text
Go Ethereum(geth)
• Of
fi
cial Go implementation of the Ethereum protocol
• geth --dev --http --ipcpath /tmp/geth.ipc
https://geth.ethereum.org/
Slide 30
Slide 30 text
geth
Slide 31
Slide 31 text
Send ETH to another address
• Geth (use http server)
• use Eth::Client.create
Let's try it!
• This is a Rails application for creating Non Fungible Tokens
• Please try it out !
Slide 49
Slide 49 text
Conclusion
Slide 50
Slide 50 text
Conclusion
• Ethereum Blockchain Overview
• How Ethereum Addresses Work and EIP
• Overview of ethereum signatures
• About executing smart contracts using eth.rb
Slide 51
Slide 51 text
Future of eth.rb
• Language diversity is important so that Ruby can also connect with the
Ethereum world!
• More examples of creating DApps with Ruby and Rails
• Make it easy to connect to existing Rails applications
Slide 52
Slide 52 text
Acknowledgements
• @ethmarek
• He brought me into the world of Ethereum.rb
• @q9f
• He promotes and maintains the eth.rb project with us
• GMO Pepabo Web3 Development Team
• RubyKaigi staff, organizers, committers and attendees