Contracts as Append-Only Logs
A Modality contract is an append-only log of signed commits. Each commit can:
- Add or modify state (data files)
- Add rules (temporal formulas that constrain behavior)
- Perform actions (state transitions in the model)
Example Log
Commit 0: Genesis
└─ Created contract
Commit 1: Alice signs
├─ state/parties/alice.id = "ed25519:abc..."
└─ rules/alice.modality = "always (...)"
Commit 2: Bob signs
├─ state/parties/bob.id = "ed25519:def..."
└─ rules/bob.modality = "always (...)"
Commit 3: Alice deposits (ACTION)
└─ action: DEPOSIT
Key Properties
| Property | Description |
|---|---|
| Immutable | Once committed, history cannot change |
| Ordered | Commits form a linear sequence |
| Signed | Each commit is cryptographically signed |
| Validated | Action commits are validated against ALL accumulated rules |
Why Append-Only?
Append-only logs provide:
- Auditability — Every change is recorded
- Non-repudiation — Signatures prove who did what
- Determinism — Same log = same state
- Trust — No hidden modifications