mirror of
https://github.com/corda/corda.git
synced 2024-12-23 23:02:29 +00:00
691 B
691 B
Simple payment
CashState:
- Issuing institution
- Deposit reference (pointer into internal ledger)
- Currency code
- Claim size (initial state = size of original deposit)
- Public key of current owner
ExitCashState:
- Amount to reduce claim size by
- Signature signed by ownerPubKey
State transition function (contract):
- If input states contains an ExitCashState, set reduceByAmount=state.amount
- For all proposed output states, they must all be instances of CashState For all proposed input states, they must all be instances of CashState
- Sum claim sizes in all predecessor states. Sum claim sizes in all successor states
- Accept if outputSum == inputSum - reduceByAmount