Static secp256k1::SECP256K1

source ·
pub static SECP256K1: &GlobalContext
Available on crate features global-context and std only.
Expand description

A global static context to avoid repeatedly creating contexts.

If rand-std feature is enabled, context will have been randomized using thread_rng.

use secp256k1::{PublicKey, SECP256K1};
let _ = SECP256K1.generate_keypair(&mut rand::thread_rng());