You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
362 B
14 lines
362 B
3 years ago
|
use bdk::bitcoin;
|
||
|
use bdk::bitcoin::secp256k1::{self, SECP256K1};
|
||
|
use rand::{CryptoRng, RngCore};
|
||
|
|
||
|
pub fn new<R>(rng: &mut R) -> (secp256k1::SecretKey, bitcoin::PublicKey)
|
||
|
where
|
||
|
R: RngCore + CryptoRng,
|
||
|
{
|
||
|
let sk = secp256k1::SecretKey::new(rng);
|
||
|
let pk = bitcoin::PublicKey::new(secp256k1::PublicKey::from_secret_key(SECP256K1, &sk));
|
||
|
|
||
|
(sk, pk)
|
||
|
}
|