https://github.com/azuchi/secp256k1rb
Ruby binding for libsecp256k1.
https://github.com/azuchi/secp256k1rb
musig2 ruby secp256k1
Last synced: 4 months ago
JSON representation
Ruby binding for libsecp256k1.
- Host: GitHub
- URL: https://github.com/azuchi/secp256k1rb
- Owner: azuchi
- License: mit
- Created: 2024-05-07T06:27:20.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-12-30T05:29:20.000Z (6 months ago)
- Last Synced: 2026-01-02T16:13:00.936Z (6 months ago)
- Topics: musig2, ruby, secp256k1
- Language: Ruby
- Homepage:
- Size: 1.68 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# secp256k1rb
This is a Ruby binding for Bitcoin Core's [secp256k1 library](https://github.com/bitcoin-core/secp256k1/).
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'secp256k1rb', require: 'secp256k1'
```
And then execute:
$ bundle install
Or install it yourself as:
$ gem install secp256k1rb
## Usage
To use this library, you need to specify the path of the secp256k1 shared library in environment variable
`SECP256K1_LIB_PATH`, e.g: `$ export SECP256K1_LIB_PATH=/var/local/lib/libsecp256k1.so`.
Note: This library also implements the recovery module, so you must have built the secp256k1 library with the
`--enable-module-recovery` option.
By including the Secp256k1 module, you can use the features provided by the `libsepc256k1` library. For example:
```ruby
require 'secp256k1'
include Secp256k1
generate_key_pair
=> ["e00c2ae99e59b5262be3d507d026081f0e6cf9972ffdd4f2d45a390f7a41b053", "027e0f70b540d627422cf7bb77d86ae1bb6829c80104dd48dc2539e6277ea25624"]
```
See [here](https://www.rubydoc.info/gems/secp256k1rb/Secp256k1) for available methods.
In addition, the following modules are also included, so you can use them as they are.
* [Recover](https://www.rubydoc.info/gems/secp256k1rb/Secp256k1/Recover)
* [SchnorrSig](https://www.rubydoc.info/gems/secp256k1rb/Secp256k1/SchnorrSig)
* [MuSig](https://www.rubydoc.info/gems/secp256k1rb/Secp256k1/MuSig)
* [EllSwift](https://www.rubydoc.info/gems/secp256k1rb/Secp256k1/EllSwift)
### Compatibility
secp256k1 version | secp256k1rb version
:---:|:---:
v0.4.0 | v0.1.x
v0.6.0 | v0.2.x