10 stable releases

new 2.1.10 Jan 19, 2025
2.1.9 Jan 15, 2025
2.1.7 Dec 23, 2024
2.1.4 Nov 27, 2024
0.0.1 Jul 3, 2024

#240 in Magic Beans

Download history 20/week @ 2024-09-30 162/week @ 2024-10-14 23/week @ 2024-10-21 3239/week @ 2024-10-28 6631/week @ 2024-11-04 7255/week @ 2024-11-11 10273/week @ 2024-11-18 9905/week @ 2024-11-25 11855/week @ 2024-12-02 11954/week @ 2024-12-09 13371/week @ 2024-12-16 9951/week @ 2024-12-23 8241/week @ 2024-12-30 12157/week @ 2025-01-06 14820/week @ 2025-01-13

46,409 downloads per month
Used in 327 crates (2 directly)

Apache-2.0

35KB
404 lines

Public key recovery from secp256k1 ECDSA signatures.

This module provides low-level cryptographic building blocks that must be used carefully to ensure proper security. Read this documentation and accompanying links thoroughly.

The secp256k1_recover syscall allows a secp256k1 public key that has previously signed a message to be recovered from the combination of the message, the signature, and a recovery ID. The recovery ID is generated during signing.

Use cases for secp256k1_recover include:

  • Implementing the Ethereum ecrecover builtin contract.
  • Performing secp256k1 public key recovery generally.
  • Verifying a single secp256k1 signature.

While secp256k1_recover can be used to verify secp256k1 signatures, Solana also provides the secp256k1 program, which is more flexible, has lower CPU cost, and can validate many signatures at once.

Dependencies

~2.5–4.5MB
~82K SLoC