Module secp256k1

Source
Expand description

ecrecover precompile.

Depending on enabled features, it will use different implementations of ecrecover.

  • k256 - uses maintained pure rust lib k256, it is perfect use for no_std environments.
  • secp256k1 - uses bitcoin_secp256k1 lib, it is a C implementation of secp256k1 used in bitcoin core. It is faster than k256 and enabled by default and in std environment.
  • libsecp256k1 - is made from parity in pure rust, it is alternative for k256.

Order of preference is secp256k1 -> k256 -> libsecp256k1. Where if no features are enabled, it will use k256.

Input format: [32 bytes for message][64 bytes for signature][1 byte for recovery id]

Output format: [32 bytes for recovered address]

Re-exports§

pub use bitcoin_secp256k1::ecrecover;

Modules§

bitcoin_secp256k1
bitcoin_secp256k1 implementation of ecrecover. More about it in crate::secp256k1.
k256
k256 implementation of ecrecover. More about it in crate::secp256k1.

Constants§

ECRECOVER
ecrecover precompile, containing address and function to run.

Functions§

ec_recover_run
ecrecover precompile function. Read more about input and output format in this module docs.