Skip to content

Elixir wrapper for Bitcoin Core secp256k1 library

License

Notifications You must be signed in to change notification settings

Sgiath/secp256k1

Repository files navigation

Secp256k1 library

Hex.pm Docs

Elixir bindings for secp256k1 library

Installation

The package can be installed by adding lib_secp256k1 to your list of dependencies in mix.exs:

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

During the compilation the C library is cloned and build from source. If you are having problem compiling the library please refer to the original repository.

The C code wrapping the library is also build during the compilation. I only tested it on Linux machine so if you are having problem compiling it on Mac or Windows it is most likely related to that. Please fill an issue but I don't have other systems available to me so don't expect me to fix it anytime soon (contributions are welcome though :) ).

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