diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index ececea696..a730d0208 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -295,8 +295,8 @@ impl From for KnownHrp { /// ``` /// /// 2. `Debug` on `Address` does not produce clean address but address wrapped by -/// an indicator that its network has not been checked. This is to encourage programmer to properly -/// check the network and use `Display` in user-facing context. +/// an indicator that its network has not been checked. This is to encourage programmer to properly +/// check the network and use `Display` in user-facing context. /// /// ``` /// # use std::str::FromStr; diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index b45bfea4a..60bbe5c74 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -798,19 +798,16 @@ impl TapTweak for UntweakedKeypair { type TweakedAux = TweakedKeypair; type TweakedKey = TweakedKeypair; - /// Tweaks private and public keys within an untweaked [`Keypair`] with corresponding public key - /// value and optional script tree merkle root. + /// Applies a Taproot tweak to both keys within the keypair. /// - /// This is done by tweaking private key within the pair using the equation q = p + H(P|c), where - /// * q is the tweaked private key - /// * p is the internal private key - /// * H is the hash function - /// * c is the commitment data - /// The public key is generated from a private key by multiplying with generator point, Q = qG. + /// If `merkle_root` is provided, produces a Taproot key that can be spent by any + /// of the script paths committed to by the root. If it is not provided, produces + /// a Taproot key which can [provably only be spent via + /// keyspend](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#cite_note-23). /// /// # Returns /// - /// The tweaked key and its parity. + /// The tweaked keypair. fn tap_tweak( self, secp: &Secp256k1, diff --git a/bitcoin/src/crypto/sighash.rs b/bitcoin/src/crypto/sighash.rs index 0ea93820b..a11c770de 100644 --- a/bitcoin/src/crypto/sighash.rs +++ b/bitcoin/src/crypto/sighash.rs @@ -886,8 +886,8 @@ impl> SighashCache { /// # Warning /// /// - Does NOT attempt to support OP_CODESEPARATOR. In general this would require evaluating - /// `script_pubkey` to determine which separators get evaluated and which don't, which we don't - /// have the information to determine. + /// `script_pubkey` to determine which separators get evaluated and which don't, which we don't + /// have the information to determine. /// - Does NOT handle the sighash single bug (see "Return type" section) /// /// # Returns diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index 3639f6a30..ed8f26dc7 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -191,6 +191,7 @@ impl Decodable for MerkleBlock { /// - uint256[] hashes in depth-first order (<= 32*N bytes) /// - varint number of bytes of flag bits (1-3 bytes) /// - byte[] flag bits, packed per 8 in a byte, least significant bit first (<= 2*N-1 bits) +/// /// The size constraints follow from this. #[derive(PartialEq, Eq, Clone, Debug)] pub struct PartialMerkleTree {