pub struct Proof {
pub amount: Amount,
pub keyset_id: Id,
pub secret: Secret,
pub c: PublicKey,
pub witness: Option<Witness>,
pub dleq: Option<ProofDleq>,
}Expand description
Proofs
Fields§
§amount: AmountAmount
keyset_id: IdKeyset id
secret: SecretSecret message
c: PublicKeyUnblinded signature
witness: Option<Witness>Witness
dleq: Option<ProofDleq>DLEQ Proof
Implementations§
Source§impl Proof
impl Proof
Source§impl Proof
impl Proof
Sourcepub fn verify_p2pk(&self) -> Result<(), Error>
pub fn verify_p2pk(&self) -> Result<(), Error>
Verify P2PK signature on Proof
Per NUT-11, there are two spending pathways after locktime:
- Primary path (data + pubkeys): ALWAYS available
- Refund path (refund keys): available AFTER locktime
The verification tries both paths - if either succeeds, the proof is valid.
Source§impl Proof
impl Proof
Sourcepub fn verify_htlc(&self) -> Result<(), Error>
pub fn verify_htlc(&self) -> Result<(), Error>
Verify HTLC
Per NUT-14, there are two spending pathways:
- Receiver path (preimage + pubkeys): ALWAYS available
- Sender/Refund path (refund keys, no preimage): available AFTER locktime
The verification tries to determine which path is being used based on the witness provided, then validates accordingly.
Sourcepub fn add_preimage(&mut self, preimage: String)
pub fn add_preimage(&mut self, preimage: String)
Add Preimage
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Proof
impl<'de> Deserialize<'de> for Proof
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Proof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Proof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Proof
impl Ord for Proof
Source§impl PartialOrd for Proof
impl PartialOrd for Proof
Source§impl Serialize for Proof
impl Serialize for Proof
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Proof
impl StructuralPartialEq for Proof
Auto Trait Implementations§
impl Freeze for Proof
impl RefUnwindSafe for Proof
impl Send for Proof
impl Sync for Proof
impl Unpin for Proof
impl UnsafeUnpin for Proof
impl UnwindSafe for Proof
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more