Given two purse s of the same currency, you can deposit money into one from the other. This simple piece of code demonstrably has the following security properties Only someone with the mint of a given currency can violate conservation of that currency. The mint can only inflate its own currency. No one can affect the balance of a purse they don't have. With two purses of the same currency, one can transfer money between them.
Balances are always non-negative integers.
A reported successful deposit can be trusted as much as one trusts the purse one is depositing into. This last deposit operation is key. Under all other conditions it must fail. Under all conditions, the integrity of the money system must be conserved. All this despite the use of the payment parameter which, since it was received from an untrusted source, may be any arbitrary object.