pub struct DeterministicSecretWithBlinding {
pub secret: Secret,
pub blinding_factor: SecretKey,
pub amount: u64,
pub index: usize,
}Expand description
Deterministic secret with blinding factor Can hold any type of secret (simple P2PK, P2PK with conditions, HTLC, etc.)
Fields§
§secret: SecretThe secret (can be any NUT-10 secret with specified nonce)
blinding_factor: SecretKeyThe blinding factor
amount: u64The amount for this output
index: usizeThe index within outputs of the same amount (for per-proof blinding)
Implementations§
Source§impl DeterministicSecretWithBlinding
impl DeterministicSecretWithBlinding
Sourcepub fn new_p2pk(
pubkey: &PublicKey,
nonce: String,
blinding_factor: SecretKey,
amount: u64,
index: usize,
) -> Result<Self, Error>
pub fn new_p2pk( pubkey: &PublicKey, nonce: String, blinding_factor: SecretKey, amount: u64, index: usize, ) -> Result<Self, Error>
Create a simple P2PK output (1-of-1 signature) Used for commitment outputs (sender or receiver)
Sourcepub fn new_funding(
params: &ChannelParameters,
nonce: String,
blinding_factor: SecretKey,
amount: u64,
index: usize,
) -> Result<Self, Error>
pub fn new_funding( params: &ChannelParameters, nonce: String, blinding_factor: SecretKey, amount: u64, index: usize, ) -> Result<Self, Error>
Create a funding output with 2-of-2 multisig + expiry conditions Used for the funding token that both parties must sign to spend, or Alice alone can reclaim after expiry.
Uses BLINDED pubkeys for privacy - the mint cannot correlate the funding token to Alice and Charlie’s real identities.
Note: Funding outputs use SHARED blinding (same pubkey for all proofs) because SIG_ALL requires identical keys in every proof. The index is stored but not used for blinding derivation in the funding context.
Sourcepub fn to_blinded_message(
&self,
amount: Amount,
keyset_id: Id,
) -> Result<BlindedMessage, Error>
pub fn to_blinded_message( &self, amount: Amount, keyset_id: Id, ) -> Result<BlindedMessage, Error>
Create a BlindedMessage from this deterministic output
Trait Implementations§
Source§impl Clone for DeterministicSecretWithBlinding
impl Clone for DeterministicSecretWithBlinding
Source§fn clone(&self) -> DeterministicSecretWithBlinding
fn clone(&self) -> DeterministicSecretWithBlinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more