From 5e1be48814d87374dcd1fecbeab57071ed278fd6 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 19 Apr 2021 14:50:09 +0200 Subject: purse state machine --- design-documents/013-peer-to-peer-payments.rst | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'design-documents') diff --git a/design-documents/013-peer-to-peer-payments.rst b/design-documents/013-peer-to-peer-payments.rst index 5797a72d..1724605a 100644 --- a/design-documents/013-peer-to-peer-payments.rst +++ b/design-documents/013-peer-to-peer-payments.rst @@ -269,6 +269,33 @@ Cross-exchange payment offer: Dave's exchange receives the wad, and credits Dave's account with the money. +State machine for Purses +------------------------ + +.. code-block:: none + + // The "OPEN" starte state requires funding + // the purse either from an account or from + // a coin. + -> OPEN + + // "Filled" means that it is filled with as many coins + // as indicated in the creation request. + OPEN -> FILLED + + // Canceled, all coins put into the purse are refunded + FILLED -> CLOSED_REFUNDED + + // Sent via a wad to a different exchange + FILLED -> PENDING_WAD + + // The associated wad transfer succeeded. + PENDING_WAD -> CLOSED_WAD + + // Merged into an account at the same exchange + FILLED -> CLOSED_MERGE + + Additional considerations ------------------------- -- cgit v1.2.3