pub struct PayerDeclaration {
pub payment_hash: String,
}Expand description
Buyer’s commitment to the fiat payer identity for one order.
Carried by crate::message::Action::DeclarePayer (buyer → Mostro) and
crate::message::Action::PayerDeclared (Mostro → buyer ack and
Mostro → seller forward). It holds only the hash; the plaintext goes
buyer → seller off-band.
Deserialization accepts any string: neither serde nor
crate::message::MessageKind::verify checks the hash format. A daemon
must call is_valid_payment_hash on receipt and answer
crate::error::CantDoReason::InvalidPaymentHash when it fails.
Fields§
§payment_hash: String64 lowercase hex characters. A reputation-mode buyer declares
payment_hash, sha256("mostro-payer-v1|" || canonical), which is
stable across orders and builds history. A full-privacy buyer declares
order_bound_payment_hash, sha256("mostro-payer-order-v1|" || order_id || "|" || canonical), so the node cannot link its orders. A
seller checking the plaintext uses the construction that matches the
buyer_mode reported in PaymentHistory (either one for a mode it
does not know).
Implementations§
Trait Implementations§
Source§impl Clone for PayerDeclaration
impl Clone for PayerDeclaration
Source§impl Debug for PayerDeclaration
impl Debug for PayerDeclaration
Source§impl<'de> Deserialize<'de> for PayerDeclaration
impl<'de> Deserialize<'de> for PayerDeclaration
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PayerDeclaration
Source§impl PartialEq for PayerDeclaration
impl PartialEq for PayerDeclaration
Source§impl Serialize for PayerDeclaration
impl Serialize for PayerDeclaration
impl StructuralPartialEq for PayerDeclaration
Auto Trait Implementations§
impl Freeze for PayerDeclaration
impl RefUnwindSafe for PayerDeclaration
impl Send for PayerDeclaration
impl Sync for PayerDeclaration
impl Unpin for PayerDeclaration
impl UnsafeUnpin for PayerDeclaration
impl UnwindSafe for PayerDeclaration
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more