Module secp256k1
Expand description
ecrecover precompile.
Depending on enabled features, it will use different implementations of ecrecover.
k256- uses maintained pure rust libk256, it is perfect use for no_std environments.secp256k1- usesbitcoin_secp256k1lib, 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]
Modules§
- bitcoin_
secp256k1 - bitcoin_secp256k1 implementation of
ecrecover. More about it incrate::secp256k1. - k256
- k256 implementation of
ecrecover. More about it incrate::secp256k1.
Constants§
- ECRECOVER
ecrecoverprecompile, containing address and function to run.
Functions§
- ec_
recover_ run ecrecoverprecompile function. Read more about input and output format in this module docs.- ecrecover
- Recover the public key from a signature and a message.