fn generate_offset<K>(&mut self, keychain: &K, sec_key: &mut SecretKey) -> Result<(), Error>
	where
		K: Keychain,
	{
		// Generate a random kernel offset here
		// and subtract it from the blind_sum so we create
		// the aggsig context with the "split" key
		self.tx.offset =
			BlindingFactor::from_secret_key(SecretKey::new(&keychain.secp(), &mut thread_rng()));
		let blind_offset = keychain.blind_sum(
			&BlindSum::new()
				.add_blinding_factor(BlindingFactor::from_secret_key(sec_key.clone()))
				.sub_blinding_factor(self.tx.offset),
		)?;
		*sec_key = blind_offset.secret_key(&keychain.secp())?;
		Ok(())
	}
/// Somebody involved needs to generate an offset with their private key
/// For now, we'll have the transaction initiator be responsible for it
/// Return offset private key for the participant to use later in the
/// transaction
Somebody involved needs to generate an offset with their private key
For now, we'll have the transaction initiator be responsible for it
Return offset private key for the participant to use later in the
transaction
Somebody involved needs to generate an offset with their private key For now we ' ll have the transaction initiator be responsible for it Return offset private key for the participant to use later in the transaction
fn generate_offset<K>(&mut self, keychain: &K, sec_key: &mut SecretKey) -> Result<(), Error>
	where
		K: Keychain,
	{
		// Generate a random kernel offset here
		// and subtract it from the blind_sum so we create
		// the aggsig context with the "split" key
		self.tx.offset =
			BlindingFactor::from_secret_key(SecretKey::new(&keychain.secp(), &mut thread_rng()));
		let blind_offset = keychain.blind_sum(
			&BlindSum::new()
				.add_blinding_factor(BlindingFactor::from_secret_key(sec_key.clone()))
				.sub_blinding_factor(self.tx.offset),
		)?;
		*sec_key = blind_offset.secret_key(&keychain.secp())?;
		Ok(())
	}
fn generate_offset < K > ( & mut self , keychain : & K , sec_key : & mut SecretKey ) -> Result < ( ) , Error > where K : Keychain , { // Generate a random kernel offset here // and subtract it from the blind_sum so we create // the aggsig context with the "split" key self . tx . offset = BlindingFactor :: from_secret_key ( SecretKey :: new ( & keychain . secp ( ) , & mut thread_rng ( ) ) ) ; let blind_offset = keychain . blind_sum ( & BlindSum :: new ( ) . add_blinding_factor ( BlindingFactor :: from_secret_key ( sec_key . clone ( ) ) ) . sub_blinding_factor ( self . tx . offset ) , ) ? ; * sec_key = blind_offset . secret_key ( & keychain . secp ( ) ) ? ; Ok ( ( ) ) }
Somebody involved needs to generate an offset with their private key
For now, we'll have the transaction initiator be responsible for it
Return offset private key for the participant to use later in the
transaction
Somebody involved needs to generate an offset with their private key For now we ' ll have the transaction initiator be responsible for it Return offset private key for the participant to use later in the transaction
&mut self
keychain
&K
sec_key
&mut SecretKey