ruby-ethereum
ruby-ethereum copied to clipboard
Had to Install secp256k1
trafficstars
NOTE TO ALL DEVS
You will need to install the secp256k1 library on your machine (this is a C package) in order to run a lot of these functions in ruby.
https://github.com/bitcoin-core/secp256k1
Note that you will also run into this issue most likely so here you go: https://stackoverflow.com/questions/40615330/ruby-ffi-not-finding-certain-functions
Then you can go into the Rails controller and add this to the top:
require 'secp256k1' require 'ethereum'
include Ethereum::Secp256k1 include Ethereum::Utils
and then you can do things like this
public_key_raw = Secp256k1.recover_pubkey(challenge_hash, signatureToVRS(web3_signature) , compressed: false)
Hope I helped some people :)