pub fn from_privkey(privkey: PrivKey) -> Self {
        let secp = &SECP256K1;
        let secret_key = SecretKey::from_slice(&privkey.0).expect("32 bytes, within curve order");
        let public_key = PublicKey::from_secret_key(secp, &secret_key);

        let serialized = public_key.serialize_uncompressed();
        let mut pubkey = PubKey::default();
        pubkey.0.copy_from_slice(&serialized[1..65]);

        KeyPair {
            privkey: privkey.into(),
            pubkey: pubkey,
        }
    }
/// Create a pair from private key
Create a pair from private key
Create a pair from private key
pub fn from_privkey(privkey: PrivKey) -> Self {
        let secp = &SECP256K1;
        let secret_key = SecretKey::from_slice(&privkey.0).expect("32 bytes, within curve order");
        let public_key = PublicKey::from_secret_key(secp, &secret_key);
        let serialized = public_key.serialize_uncompressed();
        let mut pubkey = PubKey::default();
        pubkey.0.copy_from_slice(&serialized[1..65]);
        KeyPair {
            privkey: privkey.into(),
            pubkey: pubkey,
        }
    }
pub fn from_privkey ( privkey : PrivKey ) -> Self { let secp = & SECP256K1 ; let secret_key = SecretKey :: from_slice ( & privkey . 0 ) . expect ( " " ) ; let public_key = PublicKey :: from_secret_key ( secp , & secret_key ) ; let serialized = public_key . serialize_uncompressed ( ) ; let mut pubkey = PubKey :: default ( ) ; pubkey . 0 . copy_from_slice ( & serialized [ 1 .. 65 ] ) ; KeyPair { privkey : privkey . into ( ) , pubkey : pubkey , } }
Create a pair from private key
Create a pair from private key
privkey
PrivKey
privkey
PrivKey