The Natural Blockchain
Tally is an EUTxO blockchain with fully reprogrammable ledger rules
An example constitution
It shows the governance language being built for tally. The language is not implemented yet, so this constitution does not run today.
1constitution :: Constitution ()
2constitution = do
3 stakeholders <- body "stakeholders" DelegatedStake
4 board <- body "board" (Members 7)
5 ceo <- role "ceo"
6 funds <- treasury
7
8 capacity <- parameterClass "capacity"
9 [ MaxBlockBodySize, MaxBlockHeaderSize, MaxTransactionSize, MaxValueSize
10 , MaxTransactionExecutionUnits, MaxBlockExecutionUnits, MaxCollateralInputs ]
11 fees <- parameterClass "fees"
12 [ FeePerByte, FixedFee, ExecutionUnitPrices, ReferenceScriptFeePerByte
13 , CostPerUTxOByte, StakeAddressDeposit, StakePoolDeposit ]
14 scripts <- parameterClass "scripts"
15 [ CostModels, CollateralPercentage ]
16 staking <- parameterClass "staking"
17 [ TargetPoolCount, PledgeInfluence, MinimumPoolCost, PoolRetirementWindow ]
18 monetary <- parameterClass "monetary"
19 [ MonetaryExpansion, TreasuryCut ]
20 rules <- parameterClass "rules"
21 [ Constitution ]
22
23 elects stakeholders board (Threshold 1 2) (Epochs 73)
24 removes stakeholders board (Threshold 2 3)
25 appoints board ceo (Threshold 2 3)
26 removes board ceo (Threshold 2 3)
27
28 spends ceo funds
29 vetoes board funds (Threshold 2 3) (Epochs 1)
30
31 proposes ceo capacity
32 vetoes board capacity (Threshold 2 3) (Epochs 1)
33 proposes ceo fees
34 vetoes board fees (Threshold 2 3) (Epochs 1)
35 proposes ceo scripts
36 vetoes board scripts (Threshold 2 3) (Epochs 1)
37
38 decides stakeholders staking (Threshold 2 3) (Epochs 4)
39 decides stakeholders monetary (Threshold 2 3) (Epochs 4)
40 decides stakeholders rules (Threshold 3 4) (Epochs 8)
Hard forks only when primitives change
Rules as an on-chain parameter arrive with alder 0.6.
Hard forks only ever need to happen when the ledger's primitive operations change. Everything built from them is a governed update.
Tally's ledger rules are a program in a free monad over a small, fixed set of operations: spend an output, produce one, mint, run a Plutus script, check a signature. The rules are an on-chain parameter, so replacing them is a governance decision that takes effect at the next epoch. A node release is needed only when the operations underneath change: a new primitive, such as a signature scheme or a new script language version, a change to what an existing operation means, or a new type or encoding for them to work on.
What reprogrammable rules are for
Arriving with alder 0.6 and later releases.
- 1
Fix rule bugs without a hard fork.
A mistake in the ledger rules is corrected by a governed update at the next epoch, not an emergency release every validator must coordinate on. Example: a balance check that misses an edge case is patched, tested by the activation laws, and live one epoch later.
- 2
Change the fee formula, not just its numbers.
Example: add a charge per output, or price script memory differently, without waiting for a new node version.
- 3
Choose where fees go.
Burn them, pay them to a treasury, or share them among validators. Example: a network starts by burning fees and later votes to fund a treasury from them.
- 4
Let someone else pay.
Fee sponsorship: a sponsor covers a transaction's fee, so the sender holds nothing. Example: an operator pays for every transaction its AI agents submit.
- 5
Charge for storage.
Outputs that sit unspent pay rent or expire, so the ledger doesn't grow forever. Example: an abandoned record lapses after a set number of epochs unless someone renews it.
- 6
Set policy per network.
Each network runs the rules its purpose needs. Examples: only registered members may create outputs; every record must carry a schema hash; a regulated network blocks listed policies.
The default era: alder
This is the program every node runs to decide whether a transaction is valid. Ledger rules are replaced by replacing this program. It is alder in tally-ledger-alder 0.5.0.0.
1alder :: (Alder r) => Era -> Transaction -> Sem r ()
2alder era transaction = do
3 either refuse pure (canonical era transaction)
4 resolved <- traverse (resolve era) (positioned transaction)
5 either refuse pure (balanced era transaction resolved)
6 let due :: Natural
7 due = feeDue era transaction
8 when (transactionFee transaction < due) (refuse (Underpaid due))
9 signed era transaction resolved
10 for_ resolved \m ->
11 for_ (Map.keys (transactionRequiredGuards (resolvedTransaction m))) \c ->
12 unless (c `elem` guardCredentials (transactionGuards transaction)) (refuse (MissingTopLevelGuard c))
13 authorised era transaction
14 for_ resolved (approved era)
15 let subs :: [Resolved]
16 subs = filter (isJust . resolvedIndex) resolved
17 for_ resolved (scripted subs)
18 chargeFee (transactionFee transaction)
19 for_ (bundle transaction) (mint . Transaction.mint)