5 releases (3 stable)

new 2.1.2 Nov 22, 2024
2.1.1 Nov 16, 2024
2.1.0 Oct 29, 2024
0.0.2 Oct 18, 2024
0.0.1 Jul 3, 2024

#156 in Magic Beans

Download history 14/week @ 2024-09-14 11/week @ 2024-09-21 18/week @ 2024-09-28 2/week @ 2024-10-05 59/week @ 2024-10-12 122/week @ 2024-10-19 2510/week @ 2024-10-26 5994/week @ 2024-11-02 6899/week @ 2024-11-09 7784/week @ 2024-11-16

23,188 downloads per month
Used in 135 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