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: PayerProof

Implementations§

§

impl PayerProof

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

The hash of the invoice preimage (Self::proof_preimage).

TLV type: 168 (invoice_payment_hash)

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

The payee’s signature over the invoice. See also: Self::invoice_node_id.

TLV type: 240 (signature)

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

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>

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>

The offer’s advertised description.

TLV type: 10 (offer_description)

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>

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>

The amount the payee’s invoice asked for.

TLV type: 170 (invoice_amount)

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])>

The proof’s TLV records as (type, value), type-ascending.

Trait Implementations§

§

impl Debug for PayerProof

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for PayerProof

§

fn deserialize<__D>( deserializer: __D, ) -> Result<PayerProof, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for PayerProof

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<PayerProof> for PayerProof

§

fn from(value: PayerProof) -> PayerProof

Converts to this type from the input type.
§

impl FromStr for PayerProof

§

type Err = ParseError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<PayerProof, <PayerProof as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl PartialEq for PayerProof

§

fn eq(&self, other: &PayerProof) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for PayerProof

§

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 PayerProof

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<F, T, U> Apply<F, U> for T
where F: FnOnce(T) -> U,

§

fn apply(self, f: F) -> U

Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,