i’ve seen many questions brought up on tweaking a public key for taproot and i’ve been able to do that while using the bitcoin rust crate (see below):
let secp = Secp256k1::new();
let private_key = PrivateKey::from_wif(private_key_wif).expect("Invalid private key");
let public_key = private_key.public_key(&secp);
let mut original_pubkey_bytes = public_key.to_bytes();
original_pubkey_bytes.remove(0);
let tap_tweak_hash = TapTweakHash::from_key_and_tweak(UntweakedPublicKey::from_slice(&original_pubkey_bytes)?, None);
let tweaked_pub_key = XOnlyPublicKey::from_slice(&original_pubkey_bytes)?.add_tweak(&secp, &tap_tweak_hash.to_scalar())?;
But how does one actually tweak a private key using the bitcoin rust crate? i couldn’t find any suitable modules or structs for this as its needed for the key path spend method.











