Skip to main content

PayerProof

Struct PayerProof 

Source
pub struct PayerProof { /* private fields */ }
Expand description

A cryptographic proof that a BOLT 12 invoice was paid.

Contains the payment preimage, selective disclosure of invoice fields, the invoice signature, and a payer signature proving who paid.

Implementations§

Source§

impl PayerProof

Source

pub fn payment_preimage(&self) -> PaymentPreimage

The payment preimage proving the invoice was paid.

Source

pub fn payer_signing_pubkey(&self) -> PublicKey

The payer’s public key (who paid).

Source

pub fn issuer_signing_pubkey(&self) -> PublicKey

The issuer’s signing public key (the key that signed the invoice).

Source

pub fn payment_hash(&self) -> PaymentHash

The payment hash.

Source

pub fn invoice_signature(&self) -> Signature

The invoice signature over the merkle root.

Source

pub fn proof_signature(&self) -> Signature

The payer’s schnorr signature proving who authorized the payment.

Source

pub fn offer_description(&self) -> Option<PrintableString<'_>>

The disclosed offer description, if included in the proof.

Source

pub fn offer_issuer(&self) -> Option<PrintableString<'_>>

The disclosed offer issuer, if included in the proof.

Source

pub fn invoice_amount_msats(&self) -> Option<u64>

The disclosed invoice amount, if included in the proof.

Source

pub fn invoice_created_at(&self) -> Option<Duration>

The disclosed invoice creation time, if included in the proof.

Source

pub fn proof_note(&self) -> Option<PrintableString<'_>>

A note the payer attached to this proof, if any.

This is distinct from InvoiceRequest::payer_note: the invoice-request note is sent to the payee at payment time, while this note is scoped to the proof and is committed to by the proof_signature alongside the invoice’s merkle root.

Source

pub fn merkle_root(&self) -> Hash

The merkle root of the original invoice.

Source

pub fn bytes(&self) -> &[u8]

The raw bytes of the payer proof.

Trait Implementations§

Source§

impl AsRef<[u8]> for PayerProof

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for PayerProof

Source§

fn clone(&self) -> PayerProof

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PayerProof

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for PayerProof

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FromStr for PayerProof

Source§

type Err = Bolt12ParseError

The associated error which can be returned from parsing.
Source§

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

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

impl TryFrom<Vec<u8>> for PayerProof

Source§

type Error = Bolt12ParseError

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

fn try_from(bytes: Vec<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Writeable for PayerProof

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Writes self out to the given Writer.
Source§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.
Source§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.

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
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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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, 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.