Skip to main content

Module payer

Module payer 

Source
Expand description

Payment-sender declaration and payment-account history (anti-triangulation).

A buyer commits to the fiat account it will pay from by sending only a hash of the canonicalised account details (PayerDeclaration); the plaintext travels buyer → seller over the peer channel and never reaches Mostro. Mostro answers the seller with aggregate counters for that (buyer, payment_hash) pair (PaymentHistory).

The canonicalisation rules are a client contract defined in the protocol book (payer_declaration.md); this module only fixes the hash construction so every client derives the same value from the same canonical string.

Structs§

PayerDeclaration
Buyer’s commitment to the fiat payer identity for one order.
PaymentHistory
Aggregate, order-scoped history of a (buyer, payment_hash) pair.

Enums§

BuyerMode
Whether the buyer’s history is meaningful for this order.

Constants§

PAYMENT_HASH_DOMAIN
Domain-separation prefix hashed in front of the canonical payment data.
PAYMENT_HASH_HEX_LEN
Length, in hex characters, of a valid PayerDeclaration::payment_hash.
PAYMENT_HASH_ORDER_DOMAIN
Domain-separation prefix of the order-bound declaration a full-privacy buyer sends (see order_bound_payment_hash).

Functions§

is_valid_payment_hash
true when hash is exactly 64 lowercase hexadecimal characters.
order_bound_payment_hash
The declaration hash of a full-privacy buyer, bound to one order.
payment_hash
Hash an already-canonicalised payment-data string.