16 stable releases

new 2.2.1 Feb 12, 2025
2.2.0 Feb 7, 2025
2.1.11 Jan 25, 2025
2.1.7 Dec 23, 2024
0.0.1 Jul 3, 2024

#230 in Magic Beans

Download history 4259/week @ 2024-10-29 6745/week @ 2024-11-05 7694/week @ 2024-11-12 10503/week @ 2024-11-19 10062/week @ 2024-11-26 11791/week @ 2024-12-03 12259/week @ 2024-12-10 13621/week @ 2024-12-17 8914/week @ 2024-12-24 8342/week @ 2024-12-31 12942/week @ 2025-01-07 14103/week @ 2025-01-14 14277/week @ 2025-01-21 16461/week @ 2025-01-28 24278/week @ 2025-02-04 39372/week @ 2025-02-11

97,375 downloads per month
Used in 341 crates (4 directly)

Apache-2.0

36KB
423 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.7–4.5MB
~89K SLoC