pub fn derive_intermediate_key(&self, customize: impl FnOnce(&mut Transcript)) -> Xprv {
        let xpub = self.to_xpub();

        let mut t = Transcript::new(b"Keytree.derivation");
        t.commit_bytes(b"pt", xpub.precompressed_pubkey.as_bytes());
        t.commit_bytes(b"dk", &xpub.dk);

        // change the derivation path for this key
        customize(&mut t);

        // squeeze a challenge scalar
        let f = t.challenge_scalar(b"f.intermediate");

        // squeeze a new derivation key
        let mut child_dk = [0u8; 32];
        t.challenge_bytes(b"dk", &mut child_dk);

        let child_point = xpub.point + (f * &constants::RISTRETTO_BASEPOINT_POINT);

        Xprv {
            scalar: self.scalar,
            dk: child_dk,
            precompressed_pubkey: child_point.compress(),
        }
    }
/// Returns a intermediate child xprv. Users must provide customize, in order to separate
/// sibling keys from one another through unique derivation paths.
Returns a intermediate child xprv. Users must provide customize, in order to separate
sibling keys from one another through unique derivation paths.
Returns a intermediate child xprv . Users must provide customize in order to separate sibling keys from one another through unique derivation paths .
pub fn derive_intermediate_key(&self, customize: impl FnOnce(&mut Transcript)) -> Xprv {
        let xpub = self.to_xpub();
        let mut t = Transcript::new(b"Keytree.derivation");
        t.commit_bytes(b"pt", xpub.precompressed_pubkey.as_bytes());
        t.commit_bytes(b"dk", &xpub.dk);
        // change the derivation path for this key
        customize(&mut t);
        // squeeze a challenge scalar
        let f = t.challenge_scalar(b"f.intermediate");
        // squeeze a new derivation key
        let mut child_dk = [0u8; 32];
        t.challenge_bytes(b"dk", &mut child_dk);
        let child_point = xpub.point + (f * &constants::RISTRETTO_BASEPOINT_POINT);
        Xprv {
            scalar: self.scalar,
            dk: child_dk,
            precompressed_pubkey: child_point.compress(),
        }
    }
pub fn derive_intermediate_key ( & self , customize : impl FnOnce ( & mut Transcript ) ) -> Xprv { let xpub = self . to_xpub ( ) ; let mut t = Transcript :: new ( b" " ) ; t . commit_bytes ( b" " , xpub . precompressed_pubkey . as_bytes ( ) ) ; t . commit_bytes ( b" " , & xpub . dk ) ; // change the derivation path for this key customize ( & mut t ) ; // squeeze a challenge scalar let f = t . challenge_scalar ( b" " ) ; // squeeze a new derivation key let mut child_dk = [ 0u8 ; 32 ] ; t . challenge_bytes ( b" " , & mut child_dk ) ; let child_point = xpub . point + ( f * & constants :: RISTRETTO_BASEPOINT_POINT ) ; Xprv { scalar : self . scalar , dk : child_dk , precompressed_pubkey : child_point . compress ( ) , } }
Returns a intermediate child xprv.
Returns a intermediate child xprv .
&self
customize
impl FnOnce(&mut Transcript)
&self
customize
impl FnOnce(&mut Transcript)