Skip to content

lib eth.rb v0.5.0 beta

Compare
Choose a tag to compare
@q9f q9f released this 17 Jan 14:38
· 161 commits to main since this release
v0.5.0
4958dca

lib eth.rb v0.5.0 is a full-blown, modern, breaking, major rewrite of the ruby-eth gem. it is 100% spec-covered and 100% api-documented.

you broke my gem!

don't worry, I'm still maintaining the legacy gem v0.4.x releases. Just put 'eth', '< 0.5' in your gemspec.

feature overview

  • Secp256k1 Key-Pairs and Encrypted Ethereum Key-Stores (JSON)
  • EIP-55 Checksummed Ethereum Addresses
  • EIP-155 Replay protection with Chain IDs (with presets)
  • EIP-191 Ethereum Signed Messages (with prefix and type)
  • EIP-712 Ethereum Signed Type Data
  • EIP-1559 Ethereum Type-2 Transactions (with priority fee and max gas fee)
  • EIP-2028 Call-data intrinsic gas cost estimates (plus access lists)
  • EIP-2718 Ethereum Transaction Envelopes (and types)
  • EIP-2930 Ethereum Type-1 Transactions (with access lists)
  • ABI-Encoder and Decoder (including type parser)

notes on upgrading to 0.5.0

  • Eth::Key no longer requires monkey-patched OpenSSL/FFI and uses native Secp256k1 instead
    Eth::Key.new priv: "30137644b564785d01420f8043f043d74dcca64008e57c59f8ce713a0005a54b"
  • Eth::Address is returned as object in most places instead of a string, use .to_s to get a checksummed address string
    Eth::Key.new(priv: "30137644b564785d01420f8043f043d74dcca64008e57c59f8ce713a0005a54b").address.to_s
  • signature recovery was moved from the Eth::Key class to a Eth::Signature module
    Eth::Signature.verify "Hello World!", signature, address
  • EIP-155 replay protection is implemented everywhere, see Eth::Chain module
    chain_id = Eth::Chain::OPTIMISM
  • Eth::Tx.new params and Eth::Tx.parse hex always try to detect the transaction type (EIP-1559, EIP-2930, legacy)

what's changed

  • reset gem to point blank by @q9f in #1
  • ci: add nightly schedule by @q9f in #2
  • lib: implement Eth::Key class by @q9f in #4
  • docs: add AUTHORS file by @q9f in #6
  • ci: enable codecov by @q9f in #7
  • docs: add code climate badge by @q9f in #8
  • gems: bump keccak and secp256k1 by @q9f in #10
  • spec: improve key tests by @q9f in #11
  • spec: improve util tests by @q9f in #12
  • Address class implementation and tests by @chainoperator in #13
  • ci: add docs workflow by @q9f in #18
  • eth/util: public_key_to_address should return an eth::address by @q9f in #19
  • eth/chains: implement eip 155 for replay protection by @q9f in #20
  • lib/signature: implement personal_recover (eip 191) by @q9f in #21
  • ci: only run coverage on CI by @q9f in #23
  • key/signature: personal sign and verify by @q9f in #24
  • docs: add some examples to readme by @q9f in #25
  • rename util and chain to singular by @q9f in #26
  • lib: import ABI to eth/abi by @q9f in #29
  • signature: implement eip 712 typed structured data signing by @q9f in #27
  • gem: clean up some docs and scripts by @q9f in #32
  • eth/tx: create legacy, type-1, and type-2 transactions by @q9f in #33
  • Implement encrypt/decrypt by @chainoperator in #22
  • docs: update readme for tx and keys by @q9f in #40
  • lib: improve error handling by @q9f in #39
  • docs: improve readme by @q9f in #41
  • eth/abi: refactor for maintainability by @q9f in #42
  • eth/sig: allow v values > 0xff, fix #30 by @q9f in #43
  • gem: prepare for release by @q9f in #46
  • eth/key: allow chain_id empty for signing messages/data by @q9f in #47
  • eth/tx: add method to estimate intrinsic gas costs by @q9f in #48
  • docs: update readme with features by @q9f in #49

new contributors

full changelog: v0.4.16...v0.5.0