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

Had to Install secp256k1 #9

@ethereumdegen

Description

@ethereumdegen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions