Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

private_key_to_public_key

Generates a Bitcoin public key from a private key using secp256k1 elliptic curve operations.

Performs elliptic curve point multiplication (private_key * G) where G is the secp256k1 generator point to derive the corresponding public key coordinates.

Arguments

  • private_key - The Bitcoin private key containing the scalar value and compression flag

Returns

  • BitcoinPublicKey - Public key with x,y coordinates and compression setting

Fully qualified path: alexandria_btc::keys::private_key_to_public_key

pub fn private_key_to_public_key(private_key: BitcoinPrivateKey) -> BitcoinPublicKey