Skip to content

Sgiath/secp256k1

Repository files navigation

Secp256k1 library

Hex.pm Docs

Elixir bindings for the secp256k1 cryptographic library, used extensively in blockchain and cryptocurrency applications.

Installation

Add lib_secp256k1 to your project's dependencies in mix.exs:

def deps do
  [
    {:lib_secp256k1, "~> 0.6.0"},
  ]
end

The underlying C library and Elixir bindings are compiled automatically during the installation. If you encounter issues during compilation, please check the original secp256k1 repository.

Currently, compilation is tested primarily on Linux. If you experience issues on macOS or Windows, please open an issue—although immediate support for these platforms is limited, contributions are always welcome.

MacOS

You may need to install additional dependencies via Homebrew:

brew install make gcc autoconf autobuild

Features

  • generate secure random seckey
  • derive pubkey and serialize it in compressed, uncompressed or xonly format
  • generate and validate ECDSA signatures
  • generate and validate Schnorr signatures
  • compute Diffie-Hellman secret