mirror of
https://github.com/corda/corda.git
synced 2024-12-20 21:43:14 +00:00
20 lines
691 B
Markdown
20 lines
691 B
Markdown
# 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):
|
|
1. If input states contains an ExitCashState, set reduceByAmount=state.amount
|
|
1. For all proposed output states, they must all be instances of CashState
|
|
For all proposed input states, they must all be instances of CashState
|
|
2. Sum claim sizes in all predecessor states. Sum claim sizes in all successor states
|
|
3. Accept if outputSum == inputSum - reduceByAmount
|