1 stable release

2.2.1 Apr 29, 2025

#5 in #recover

Download history 52/week @ 2025-04-23 98/week @ 2025-04-30 23/week @ 2025-05-07

173 downloads per month
Used in 38 crates (3 directly)

Apache-2.0

36KB
415 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
~93K SLoC