Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Had to Install secp256k1 #9

Open
ethereumdegen opened this issue Jul 19, 2017 · 0 comments
Open

Had to Install secp256k1 #9

ethereumdegen opened this issue Jul 19, 2017 · 0 comments

Comments

@ethereumdegen
Copy link

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant