In order to use this gem, libsecp256k1 must be in place.
brew tap nervosnetwork/tap
brew install libsecp256k1
sudo apt install libsecp256k1-dev
$ git clone https://github.com/bitcoin-core/secp256k1.git && cd secp256k1
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Or if you have cloned the project, you could go to project root and run this install script:
git submodule update --init --recursive
./install_lib.sh
The recovery and ecdh modules are optional. If your local installation of secp256k1 doesn't enable them then the gem would throw LoadModuleError
when related functions are invoked.
gem i bitcoin-secp256k1
Then require 'secp256k1'
(without bitcoin-
prefix) in your source code.
Check test for examples.