pub fn generate_keypair(secp: &Secp256k1<All>) -> (SecretKey, PublicKey)
Expand description
Generates a new keypair
§Arguments
secp
- The secp256k1 context
§Returns
A tuple of the secret key and public key
§Errors
Secp256k1Error
if the keys are not valid.
§Examples
use bitcoin::secp256k1::{Secp256k1, All};
use spark_cryptography::secp::generate_keypair;
let secp = Secp256k1::new();
let (sk, pk) = generate_keypair(&secp);