1 unstable release
new 0.1.0 | Jan 28, 2025 |
---|
#2 in #received
Used in 3 crates
(2 directly)
55KB
438 lines
Receipts states and checks
Receipts are used as single transaction promise of payment. A payment sender creates a receipt and ECDSA signs it, then sends it to a payment receiver. The payment receiver would verify the received receipt and store it to be accumulated with other received receipts in the future.
A list of checks are performed on the received receipts to ensure they are valid. The checks are performed when storing the receipt and when aggregating the receipts into a Receipt Aggregate Voucher (RAV).
Each receipt is wrapped into a State Machine that can be in one of the following states:
Checking
: The receipt is being checked.Failed
: The receipt has failed a check or validation.AwaitingReserve
: The receipt has passed all checks and is awaiting escrow reservation.Reserved
: The receipt has successfully reserved escrow.
Dependencies
~9MB
~166K SLoC