Struct PayerProof
pub struct PayerProof(pub PayerProof);Expand description
A cryptographic proof that a Bolt12Invoice was paid, disclosing a
payer-chosen subset of the invoice’s fields to a third-party verifier.
A PayerProof is already cryptographically verified; verification occurs
during parsing.
Serialized as bech32, e.g. lnp1....
Check Self::invoice_node_id to confirm the receiver of the payment.
Note that invoice_node_id may not match a node’s consistent ID if a
blinded path was used.
See the module docs to learn more about the fields a proof can carry.
Tuple Fields§
§0: PayerProofImplementations§
§impl PayerProof
impl PayerProof
pub fn invreq_payer_id(&self) -> PublicKey
pub fn invreq_payer_id(&self) -> PublicKey
The key that signed the invoice request. The Self::proof_signature
is verified against it.
TLV type: 88 (invreq_payer_id)
pub fn invoice_payment_hash(&self) -> PaymentHash
pub fn invoice_payment_hash(&self) -> PaymentHash
The hash of the invoice preimage (Self::proof_preimage).
TLV type: 168 (invoice_payment_hash)
pub fn invoice_node_id(&self) -> PublicKey
pub fn invoice_node_id(&self) -> PublicKey
The key that signed the invoice to produce Self::signature. Despite
the name, this is not necessarily a consistent node ID if the offer
used a blinded path.
This should match the paid offer’s issuer_signing_pubkey, if set.
TLV type: 176 (invoice_node_id)
pub fn signature(&self) -> Signature
pub fn signature(&self) -> Signature
The payee’s signature over the invoice. See also:
Self::invoice_node_id.
TLV type: 240 (signature)
pub fn proof_preimage(&self) -> PaymentPreimage
pub fn proof_preimage(&self) -> PaymentPreimage
The invoice preimage, which proves the payment actually settled.
TLV type: 1001 (proof_preimage)
pub fn proof_signature(&self) -> Signature
pub fn proof_signature(&self) -> Signature
The payer’s signature over the proof. See also:
Self::invreq_payer_id.
TLV type: 241 (proof_signature)
pub fn proof_note(&self) -> Option<&str>
pub fn proof_note(&self) -> Option<&str>
A note bound by signature to this proof, chosen when the proof was built.
TLV type: 1005 (proof_note)
pub fn offer_description(&self) -> Option<&str>
pub fn offer_description(&self) -> Option<&str>
The offer’s advertised description.
TLV type: 10 (offer_description)
pub fn offer_issuer(&self) -> Option<&str>
pub fn offer_issuer(&self) -> Option<&str>
The payee’s self-reported human-readable name.
TLV type: 18 (offer_issuer)
pub fn invreq_payer_note(&self) -> Result<Option<&str>, Error>
pub fn invreq_payer_note(&self) -> Result<Option<&str>, Error>
The message the payer sent to the payee when paying the offer.
TLV type: 89 (invreq_payer_note)
pub fn invoice_amount(&self) -> Option<Amount>
pub fn invoice_amount(&self) -> Option<Amount>
The amount the payee’s invoice asked for.
TLV type: 170 (invoice_amount)
pub fn invoice_created_at(&self) -> Result<Option<TimestampMs>, Error>
pub fn invoice_created_at(&self) -> Result<Option<TimestampMs>, Error>
The timestamp when the payee created the invoice. This is not the same
as a Lexe payment’s created_at.
TLV type: 164 (invoice_created_at)
pub fn tlv_records(&self) -> impl Iterator<Item = (u64, &[u8])>
pub fn tlv_records(&self) -> impl Iterator<Item = (u64, &[u8])>
The proof’s TLV records as (type, value), type-ascending.
Trait Implementations§
§impl Debug for PayerProof
impl Debug for PayerProof
§impl<'de> Deserialize<'de> for PayerProof
impl<'de> Deserialize<'de> for PayerProof
§fn deserialize<__D>(
deserializer: __D,
) -> Result<PayerProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
deserializer: __D,
) -> Result<PayerProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for PayerProof
impl Display for PayerProof
§impl From<PayerProof> for PayerProof
impl From<PayerProof> for PayerProof
§fn from(value: PayerProof) -> PayerProof
fn from(value: PayerProof) -> PayerProof
§impl FromStr for PayerProof
impl FromStr for PayerProof
§impl PartialEq for PayerProof
impl PartialEq for PayerProof
§impl Serialize for PayerProofwhere
PayerProof: Display,
impl Serialize for PayerProofwhere
PayerProof: Display,
§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,
impl Eq for PayerProof
Auto Trait Implementations§
impl Freeze for PayerProof
impl RefUnwindSafe for PayerProof
impl Send for PayerProof
impl Sync for PayerProof
impl Unpin for PayerProof
impl UnwindSafe for PayerProof
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.