secp256k1
Rust wrapper library for Pieter Wuille's `libsecp256k1`. Implements ECDSA and BIP 340 signatures for the SECG elliptic curve group secp256k1 and related utilities.
0.31.1
74M downloads/mo
#969 most downloaded on crates.io
rust-bitcoin/rust-secp256k1
What this package is like to depend on
Last release 9 months ago
30 Oct 2025
Release timing varies
gaps range from 2 weeks to 7 months
Some releases are documented
notes for 50 of 89 stable releases
6 versions withdrawn
withdrawn after publishing
11 years old
98 releases · first in 2015
3 releases in the last 12 months
see the full history below
Release timeline
98 releases · May 2015 to Oct 2025Releases
latest 60 of 98-
0.32.0-beta.230 Oct 2025 pre-release -
0.32.0-beta.128 Oct 2025 pre-release -
0.32.0-beta.014 Oct 2025 pre-release -
0.31.123 Jun 2025 -
0.31.026 Apr 2025Release notes
Open source →- Update
randto 0.9 #788 - Create keys from owned array values instead of from references #781
- Add
from_u8_maskedRecoveryIdconstructor #778 - Update upstream to
0cdc758a56360bf58a851fe91085a327ec97685a(secp256k1-sys 0.6) #764 - Add
Keypair::sign_schnorr_no_aux_rand#762 - Replace
MessagewithInto<Message>in ECDSA signing API #755 - Deprecate
ElligatorSwiftPartyin favor ofParty#752
- Update
-
0.30.009 Oct 2024Release notes
Open source →- Allow signing variable-length messages #706
- Bump MSRV to 1.63 #709
- Deprecate
Message::from_digest_slicein favor ofMessage::from_digest#712 - Truncate debug output of
SecretKey; tightenbitcoin_hashesdependency version #722 - Simplify and improve consistency of secret key types' debug output #726
- Simplify and improve consistency of public key types' debug output #745
- Feature-gate
KeyPair::from_stronglobal-contextoralloc#728 - Add infallible constructors for
schnorr::Signaturefrom byteslices #730 - Deprecate slice-parsing methods in favor of array-parsing ones #737
- Make
RecoveryIdan enum rather than integer #743
-
0.29.106 Sep 2024Nothing published for this version
-
0.29.002 Apr 2024Release notes
Open source →-
Deprecate
ThirtyTwoByteHash#686This trait turned out to be problematic during upgrade because we support a ranged dependency for
bitcoin_hashes. Consider implementingFrom<T> for Messagefor your type iff your type is a 32 byte hash (ie, output from a hash algorithm that produces a 32 byte digest like sha256). When using the impl, consider usingMessage::frominstead ofhash.into()because we will be introducing generics in a future version and the compiler will not be able to work out the target type. -
Bump MSRV to Rust
v1.56.1#693 -
Upgrade
hashesusing range dependencyversion = ">= 0.12, <= 0.14"#690 -
Depend on latest
secp256k1-sys(vendorssecp256k1 v0.4.1) #688
-
-
0.28.231 Jan 2024 -
0.28.103 Jan 2024Release notes
Open source →- Update secp265k1-sys to 0.9.2 (contains some fixes for WASM and a FFI binding fix)
- Various improvements to the
SerializedSignaturetype #658 #659
-
0.28.009 Oct 2023 withdrawnRelease notes
Open source →- Add bindings to the ElligatorSwift implementation #627
- Depend on recent release of
bitcoin_hashesv0.13.0 #621 - Add a verify function to
PublicKey#618 - Add serialize function for schnorr::Signature #607
- Bump MSRV to 1.48 #595
- Remove implementations of
PartialEq,Eq,PartialOrd,Ord, andHashfrom theimpl_array_newtypemacro. Users will now need to derive these traits if they are wanted.
-
0.27.017 Mar 2023 -
0.26.015 Jan 2023 -
0.25.012 Dec 2022Release notes
Open source →- Fix soundness issue with
preallocated_gen_new - Update to
secp256k1-sysv0.7.0 - Use type system to improve safety.
- Change secp256k1-sys symbol names to 0_6_1.
- Introduce
rustfmtto the codebase. - Make all raw pointer methods go through the CPtr trait.
- Make comparison functions stable.
- Remove public constant
ONE_KEY(consider usingFromStras a replacement).
- Fix soundness issue with
-
0.24.313 Jan 2023Nothing published for this version
-
0.24.207 Dec 2022Nothing published for this version
-
0.24.125 Oct 2022 withdrawnRelease notes
Open source →- Fix broken deserialization logic of
KeyPairthat previously always panicked. After the patch deserialization only panics if neither theglobal-contextnor thealloc(default) feature is active.
- Fix broken deserialization logic of
-
0.24.019 Jul 2022 -
0.23.507 Dec 2022Nothing published for this version
-
0.23.419 Jul 2022 withdrawn -
0.23.329 Jun 2022 -
0.23.227 Jun 2022 -
0.23.124 Jun 2022Release notes
Open source →Enable "rand/std_rng" feature when the crate's "rnd-std" feature is enabled.
-
0.23.022 Jun 2022Release notes
Open source →The major change in this version is the increase of the Minimum Supported Rust Version (MSRV) from 1.29 to 1.41.1, this is a big change because it introduces Rust Edition 2018 to the codebase along with all the benefits that brings.
Breaking changes
- MSRV bumped to 1.41.1 and edition changed to 2018
- serde implements serialize fixed-width arrays as tuples in binary formats to avoid encoding the length
- Key tweaking methods renamed and refactored to use a more functional-style, they now accept a new Scalar type instead of raw slices
- Update
randdependency to 0.8 KeyPair::from_secret_keyborrows SecretKey instead of taking ownershipSerializedSignatureno longer implementsDefault
New features/APIs
- Several convenience/conversion methods between keys
sign_ecdsa_with_noncedataandsign_ecdsa_recoverable_with_noncedatacan be used to add additional entropy to ECDSA signatures- Errors now display their sources if std is unavailable, with std they rely on the consumer to use the source() method
- Implemented
TryFromforParity - The alloc feature can be used on targets with allocators without a standard library
SharedSecretcan be created from a slice, parsed from a hex string, or (de)serialized using serdeSerializedSignatureimplementsIntoIterator(both owned and shared reference)- We now derive
std::hash::HashforSignature
Other improvements
global-context-less-securefeature now activatesglobal-context.githooks/directory added for contributors- Clippy is now used in CI and the code is clippy-compliant
- Various documentation improvements
- Various CI/development improvements
- Various code quality improvements/refactors
-
0.22.207 Dec 2022Nothing published for this version
-
0.22.111 Mar 2022 withdrawnRelease notes
Open source →- Reintroduce accidentally removed possibility to create
SharedSecretfrom byte serialization
- Reintroduce accidentally removed possibility to create
-
0.22.009 Mar 2022Release notes
Open source →- Disable
bitcoin_hashes/stdby default; addbitcoin-hashes-stdfeature to re-enable it - Rename more
schnorrsigmethods toschnorr - Obfuscate
SharedSecretstring serialization - Simplify
SharedSecretAPI to use a 32-byte buffer; users of custom hashes should now use bare arrays rather than this type. - Change serde serialization of
Parityfromi32tou8; clean up error handling
- Disable
-
0.21.323 Feb 2022Release notes
Open source →- Several documentation improvements (#366, #365, #373, #381, #369, #389, #391, #397, #399, #340)
- Deprecate the
generate_schnorrsig_keypairmethod (unclear value) - Add serde traits to
KeyPair - Redo the API of the new
Paritytype to more clearly match our desired semantics; theFrom<i32>impl on this type is now deprecated. Also #400. - Randomize the global context on creation when possible; weaken
global-context-less-securefeature accordingly. - Improve the global context API
- Fix the
Debugimpl forRecoverableSignature - Implement
LowerHexandDisplay
-
0.21.206 Jan 2022Nothing published for this version
-
0.21.106 Jan 2022Nothing published for this version
-
0.21.005 Jan 2022 withdrawnRelease notes
Open source →- Fix
KeyPair::from_seckey_sliceerror return value - Reduce the
lowmemoryprecomp table size - Add
KeyPair::serialize_sec - Increase
bitcoin_hashesversion to 0.10; renamesecp256k1::bitcoin_hashesmodule tosecp256k1::hashesto align withbitcoincrate naming - Add new error variant for
PublicKey::combine_keys - Change
DisplayandDebugfor secret keys to only output a truncated hash - Improve documentation
- Implement
Hashforschnorrsig::Signature - Refactor modules to put Schnorr and ECDSA on more equal footing
- Add serde traits for
KeyPairtype - Fix context bound requirements for a few methods
- Add a static immutable-zero aligned type
- Change
tweak_add_assignandtweak_add_checkto use an opaqueParitytype rather than a boolean
- Fix
-
0.20.318 Jun 2021Release notes
Open source →- Fix
SecretKeyvalidation infrom_str - Add
global-context-less-securefeature which creates a non-randomized global context (and does not requirerandorstd) - Add
schnorrsig::KeyPair::from_secret_keyconvenience function - Add
combine_keysfunction toPublicKey - Reduce symbol visibility in C compilation to allow LTO to work
- Add
allocfeature requiring rustc 1.36+ to enable context creation without std - Rewrite stubbed-out-for-fuzzing version of the library to improve fuzzer accessibility
- Fix
-
0.20.228 Apr 2021Release notes
Open source →- Fix some WASM build issues
- Add some missing
#derives toError - Add serde support for Schnorr signatures and for deserializing from owned types
-
0.20.115 Jan 2021Nothing published for this version
-
0.20.003 Jan 2021Release notes
Open source →- remove
ffi::PublicKey::blankand replace with unsafeffi::PublicKey::newandffi::PublicKey::from_array_unchecked; similar for all other FFI types - support wasm32-wasi target
- make the global-context feature depend on the rand-std feature
- add a lexicographic ordering to
PublicKeywhich does not match the ordering used by Bitcoin Core (matching this would be impossible as it requires tracking a compressedness flag, which libsecp256k1 does not have) - implement BIP340 Schnorr signatures
- require use of new
AlignedTypein preallocated-context API to enforce alignment requirements; previously it was possible to get UB by using misaligned memory stores - enforce correct alignment when using preallocated context API
- stop using cargo features for dangerous build-breaking options, require setting
RUSTFLAGSinstead - implement low-R signing and function to grind even smaller signatures
- remove endomorphism feature, following upstream in enabling it by default
- remove
-
0.19.027 Aug 2020 -
0.18.027 Aug 2020Release notes
Open source →- Add feature-gated
bitcoin_hashesdependency andThirtyTwoByteHashtrait - Add feature-gated global static context
- Allow all-zero messages to be constructed
- Bump rust-secp-sys to 0.2.0
- Add feature-gated
-
0.17.209 Jan 2020 -
0.17.111 Dec 2019 -
0.17.010 Dec 2019Release notes
Open source →- Move FFI into secp256k1-sys crate.
- Add
external-symbolsfeature for not building upstream. - Add functions to create a context from a raw pointer.
- Support passing custom hash functions to ECDH.
- Wrap Secp256k1 from raw context in a ManuallyDrop.
-
0.16.005 Nov 2019Nothing published for this version
-
0.15.509 Sep 2019Nothing published for this version
-
0.15.406 Sep 2019 withdrawnRelease notes
Open source →- Add
rand-stdfeature. - Pin the cc build-dep version to
< 1.0.42to remain compatible with rustc 1.22.0. - Changed all
as_*ptr()to a new saferCPtrtrait
- Add
-
0.15.319 Aug 2019Nothing published for this version
-
0.15.212 Aug 2019Release notes
Open source →- Add feature
lowmemorythat reduces the EC mult window size to require significantly less memory for the validation context (~680B instead of ~520kB), at the cost of slower validation. It does not affect the speed of signing, nor the size of the signing context.
- Add feature
-
0.15.102 Aug 2019Nothing published for this version
-
0.15.026 Jul 2019Release notes
Open source →- Implement hex human-readable serde for PublicKey
- Implement fmt::LowerHex for SecretKey and PublicKey
- Relax
ccdependency requirements - Add links manifest key to prevent cross-version linkage
-
0.14.114 Jul 2019Release notes
Open source →- Implemented FFI functions:
secp256k1_context_createandsecp256k1_context_destroyin rust.
- Implemented FFI functions:
-
0.14.008 Jul 2019Release notes
Open source →- Feature-gate endormorphism optimization because of a lack of clarity with respect to patents
- Got full no-std support including eliminating all use of libc in C bindings. PR 1 PR 2. This library should be usable in bare-metal environments and with rust-wasm. Thanks to Elichai Turkel for driving this forward!
- Update upstream libsecp256k1 version to 143dc6e9ee31852a60321b23eea407d2006171da
-
0.13.021 May 2019Release notes
Open source →- Update minimum supported rust compiler 1.22.
- Replace
serialize_derfunction withSerializedSignaturestruct. - Allow building without a standard library (
no_std).stdfeature is on by default. - Add human readable serialization to
SignaturesandSecretKeys. - Stop displaying 0 bytes if a
Signatureis less than 72 bytes. - Only compile recovery module if feature
recoveryis set (non-default). - Update
randdependency from 0.4 to 0.6 and addrand_core0.4 dependency. - Relax
ccdependency requirements.
-
0.12.218 Jan 2019 -
0.12.115 Jan 2019Release notes
Open source →- Minor bug fixes
- Fixed
cccrate version to maintain minimum compiler version without breakage - Removed
libcdependency as it our uses have been subsumed into stdlib
-
0.12.003 Dec 2018Release notes
Open source →- Overhaul API to remove context object when no precomputation is needed
- Add
ThirtyTwoByteHashtrait which allows infallible conversions toMessages - Disallow 0-valued
Messageobjects since signatures on them are forgeable for all keys - Remove
ops::Indeximplementations forSignature - Remove depecated constants and unsafe
ZERO_KEYconstant
-
0.11.619 Dec 2018Nothing published for this version
-
0.11.509 Nov 2018 -
0.11.406 Nov 2018Release notes
Open source →- Add
FromStrandDisplayforSignatureand both key types - Fix
build.rsfor Windows and rustfmt configuration for docs.rs - Correct endianness issue for
SignatureDebugoutput
- Add
-
0.11.328 Oct 2018 -
0.11.211 Sep 2018 -
0.11.122 Aug 2018Release notes
Open source →- Put
PublicKey::combineback because it is currently needed to implement Lightning BOLT 3
- Put
-
0.11.022 Aug 2018Release notes
Open source →- Update
randto 0.4 andgcc0.3 tocc1.0. (rand0.5 exists but has a lot of breaking changes and no longer compiles with 1.14.0.) - Remove
PublicKey::combinefrom API since it cannot be used with anything else in the API - Detect whether 64-bit compilation is possible, and do it if we can (big performance improvement)
- Update