26 releases

0.7.1 Jul 14, 2022
0.7.0 Sep 17, 2021
0.6.0 Jul 20, 2021
0.3.5 Feb 7, 2020
0.1.10 Nov 17, 2017

#6 in #secp256k1

Download history 116102/week @ 2024-07-20 109712/week @ 2024-07-27 135786/week @ 2024-08-03 139671/week @ 2024-08-10 109959/week @ 2024-08-17 128212/week @ 2024-08-24 124664/week @ 2024-08-31 124243/week @ 2024-09-07 108383/week @ 2024-09-14 277189/week @ 2024-09-21 280257/week @ 2024-09-28 722422/week @ 2024-10-05 595700/week @ 2024-10-12 627781/week @ 2024-10-19 162768/week @ 2024-10-26 129184/week @ 2024-11-02

1,547,016 downloads per month
Used in 2,753 crates (168 directly)

Apache-2.0

205KB
4.5K SLoC

SECP256K1 implementation in pure Rust

SECP256K1 implementation with no_std support. Currently we have implementation for:

  • Convert a private key to a public key.
  • Sign messages.
  • Signature verification.
  • Public key recovery from signed messages.
  • Shared secrets.

Feature flags

  • std: If disabled, works in no_std environment. Enabled by default.
  • hmac: Add certain features that requires the HMAC-DRBG. This includes signing. Enabled by default.
  • static-context: To speed up computation, the library uses a pre-computed table context for many ecmult operations. This feature flag puts the context directly as static variables. If disabled, the context must be created from heap manually. Increases binary size, enabled by default.
  • lazy-static-context: Instead of storing the pre-computed table context as static variables, store it as a variable that dynamically allocates the context in heap via lazy_static. It overwrites static-context. Impact bootstrap performance and only available in std, disabled by default.

Development workflow

Branch

This repository uses develop branch for development. Changes are periodically merged to master branch.

Pull request

All changes (except new releases) are handled through pull requests. Please open your PR against develop branch.

Versioning

libsecp256k1 follows Semantic Versioning. An unreleased crate in the repository will have the -dev suffix in the end, and we do rolling releases.

When you make a pull request against this repository, please also update the affected crates' versions, using the following rules. Note that the rules should be applied recursively -- if a change modifies any upper crate's dependency (even just the Cargo.toml file), then the upper crate will also need to apply those rules.

Additionally, if your change is notable, then you should also modify the corresponding CHANGELOG.md file, in the "Unreleased" section.

If the affected crate already has -dev suffix:

  • If your change is a patch, then you do not have to update any versions.
  • If your change introduces a new feature, please check if the local version already had its minor version bumped, if not, bump it.
  • If your change modifies the current interface, please check if the local version already had its major version bumped, if not, bump it.

If the affected crate does not yet have -dev suffix:

  • If your change is a patch, then bump the patch version, and add -dev suffix.
  • If your change introduces a new feature, then bump the minor version, and add -dev suffix.
  • If your change modifies the current interface, then bump the major version, and add -dev suffix.

If your pull request introduces a new crate, please set its version to 1.0.0-dev.

Dependencies

~1.1–2.2MB
~44K SLoC