Ledger¶
This module defines the ledger transition system where valid transactions transform the ledger state.
LEDGER Transition System Types¶
record SubLedgerEnv : Type where field slot : Slot ppolicy : Maybe ScriptHash pparams : PParams enactState : EnactState treasury : Treasury utxo₀ : UTxO certState : CertState allScripts : ℙ Script isTopLevelValid : Bool record LedgerEnv : Type where field slot : Slot ppolicy : Maybe ScriptHash pparams : PParams enactState : EnactState treasury : Treasury
record LedgerState : Type where
field utxoSt : UTxOState govSt : GovState certState : CertState
Helper Functions¶
txgov : ∀ {ℓ} → TxBody ℓ → List (GovVote ⊎ GovProposal) txgov txb = map inj₂ txGovProposals ++ map inj₁ txGovVotes where open TxBody txb GovProposals+Votes : ∀ {ℓ} → Tx ℓ → List (GovVote ⊎ GovProposal) GovProposals+Votes tx = map inj₂ (ListOfGovProposalsOf tx) ++ map inj₁ (ListOfGovVotesOf tx) rmOrphanDRepVotes : CertState → GovState → GovState rmOrphanDRepVotes cs govSt = L.map (map₂ go) govSt where ifDRepRegistered : Credential → Type ifDRepRegistered c = c ∈ dom (DRepsOf cs) go : GovActionState → GovActionState go gas = record gas { votes = record (GovVotesOf gas) { gvDRep = filterKeys ifDRepRegistered (GovVotes.gvDRep (GovVotesOf gas)) } } allColdCreds : GovState → EnactState → ℙ Credential allColdCreds govSt es = ccCreds (es .cc) ∪ concatMapˢ (λ (_ , st) → proposedCC (GovActionOf st)) (fromList govSt)
LedgerState holds three coin-bearing components:
- UTxO state (UTxO balance plus fees plus donations)
- the rewards balance in
DState.rewards; -
The three
CertStatedeposit fields, via coinFromDeposits: -
DState.deposits(stake-key deposits,Credential ⇀ Coin) PState.deposits(pool deposits,KeyHash ⇀ Coin)GState.deposits(governance action deposits,Credential ⇀ Coin)
N.B. Existing HasCoin-CertState only counts 2; 3 has to be added on at the
LedgerState level to make the LEDGER-pov equation balance against the
UTXO batch-balance equation, which charges newCertDeposits and
govProposalsDeposits on the consumed side. Both of these are absorbed
into coinFromDeposits on the produced side (cert deposits via the
DState/PState deltas; gov-action deposits via the GState growth).
LEDGER Transition System¶
New in Dijkstra¶
In Dijkstra we compute the set of "global" scripts and data once at the
top-level in the LEDGER rule. This is threaded through
SUBLEDGER to UTXOW/SUBUTXOW via
UTxOEnv/SubUTxOEnv.
- allScripts : ℙ Script is the union of all scripts relevant to the entire
batch: scripts referenced/witnessed by the top-level transaction plus
scripts referenced/witnessed by every subtransaction (computed by
getAllScripts).
Design Rationale for Ledger Rule Premises¶
- Batch-scoped phase-2 context.
We compute allScripts once, from the pre-batch UTxO snapshot
and the full batch (top-level transaction and all subtransactions). This ensures a
shared, batch-scoped pool of scripts for phase-2 validation.
-
Subtransactions are conditional on top-level validity.
-
If
IsValidFlagOf txTop ≡ true, then each subtransaction parametrizes its ownUTXOW/CERTS/GOVSrelation and the resulting (codomain) states are carried forward (viaSUBLEDGERS). -
If
IsValidFlagOf txTop ≡ false, thenSUBLEDGERSis the identity relation (no subtransaction effects are applied). -
Connecting top-level CERTS and GOVS relations relative to UTXOW.
We check top-level CERTS and GOVS relations before
top-level UTXOW because:
CERTStracks deposit updates (now included inCertState),-
UTXOaccounting needs the net deposit change of the whole batch in theUTxOEnv(used innewDepositsBatch/depositRefundsBatchin theUtxo.Accountingmodule). -
CertState and GovState Dependencies.
-
Top-level
CERTSrelates the post-SUBLEDGERSCertState(which reflects subtransaction certificates) to the finalCertState. - Top-level
GOVSrelates the post-SUBLEDGERSGovState(which relfects proposals/votes of subtransactions) to the finalGovState, and is parameterized by the finalCertState(so it sees the final registered DRep set after certificates). -
Orphan DRep votes are removed using the final (post-
CERTS)CertState. -
allColdCredsuses the finalGovState
The CertEnv assumed in the CERTS relation includes
allColdCreds govState₁ enactState to so that CC hot key registration can account
for both enacted CC credentials and any newly proposed CC actions that appear in
the final (post-subtransaction processing) GovState.
data _⊢_⇀⦇_,SUBLEDGER⦈_ : SubLedgerEnv → LedgerState → SubLevelTx → LedgerState → Type where SUBLEDGER-V : ∙ isTopLevelValid ≡ true ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{10300}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{10307}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{10312}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6539}{\htmlId{10323}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6630}{\htmlId{10331}{\htmlClass{Generalizable}{\text{certState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7116}{\htmlId{10343}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7073}{\htmlId{10356}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \end{pmatrix}$ ⊢ utxoState₀ ⇀⦇ stx ,SUBUTXOW⦈ utxoState₁ ∙ $\begin{pmatrix} \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{10426}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{10432}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{10439}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#12751}{\htmlId{10444}{\htmlClass{Field}{\text{ListOfGovVotesOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6784}{\htmlId{10461}{\htmlClass{Generalizable}{\text{stx}}}}\, \\ \,\href{Ledger.Core.Specification.Address.html#3223}{\htmlId{10467}{\htmlClass{Field}{\text{WithdrawalsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6784}{\htmlId{10481}{\htmlClass{Generalizable}{\text{stx}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5059}{\htmlId{10487}{\htmlClass{Function}{\text{allColdCreds}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{10500}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{10510}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#13558}{\htmlId{10523}{\htmlClass{Field}{\text{DirectDepositsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6784}{\htmlId{10540}{\htmlClass{Generalizable}{\text{stx}}}}\, \end{pmatrix}$ ⊢ certState₀ ⇀⦇ DCertsOf stx ,ENTITIES⦈ certState₁ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Transaction.html#11338}{\htmlId{10607}{\htmlClass{Field}{\text{TxIdOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6784}{\htmlId{10614}{\htmlClass{Generalizable}{\text{stx}}}}\, \\ \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{10620}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{10626}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{10633}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{10638}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{10648}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6651}{\htmlId{10661}{\htmlClass{Generalizable}{\text{certState₁}}}}\, \\ \,\href{Class.IsSet.html#916}{\htmlId{10674}{\htmlClass{Function}{\text{dom}}}}\, \,\htmlId{10678}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Certs.html#3723}{\htmlId{10679}{\htmlClass{Field}{\text{RewardsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6651}{\htmlId{10689}{\htmlClass{Generalizable}{\text{certState₁}}}}\,\,\htmlId{10699}{\htmlClass{Symbol}{\text{)}}}\, \end{pmatrix}$ ⊢ govState₀ ⇀⦇ GovProposals+Votes stx ,GOVS⦈ govState₁ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{10809}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{10816}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{10826}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{10831}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{10844}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6539}{\htmlId{10855}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6630}{\htmlId{10863}{\htmlClass{Generalizable}{\text{certState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7116}{\htmlId{10875}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7073}{\htmlId{10888}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{10910}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{10923}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{10935}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ stx ,SUBLEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6593}{\htmlId{10969}{\htmlClass{Generalizable}{\text{utxoState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6699}{\htmlId{10982}{\htmlClass{Generalizable}{\text{govState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6651}{\htmlId{10994}{\htmlClass{Generalizable}{\text{certState₁}}}}\, \end{pmatrix}$ SUBLEDGER-I : ∙ isTopLevelValid ≡ false ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{11066}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{11073}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{11078}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6539}{\htmlId{11089}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6630}{\htmlId{11097}{\htmlClass{Generalizable}{\text{certState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7116}{\htmlId{11109}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7073}{\htmlId{11122}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \end{pmatrix}$ ⊢ utxoState₀ ⇀⦇ stx ,SUBUTXOW⦈ utxoState₀ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{11234}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{11241}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{11251}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{11256}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{11269}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6539}{\htmlId{11280}{\htmlClass{Generalizable}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6630}{\htmlId{11288}{\htmlClass{Generalizable}{\text{certState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7116}{\htmlId{11300}{\htmlClass{Generalizable}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7073}{\htmlId{11313}{\htmlClass{Generalizable}{\text{isTopLevelValid}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{11335}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{11348}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{11360}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ stx ,SUBLEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{11394}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{11407}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{11419}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ _⊢_⇀⦇_,SUBLEDGERS⦈_ : SubLedgerEnv → LedgerState → List SubLevelTx → LedgerState → Type _⊢_⇀⦇_,SUBLEDGERS⦈_ = ReflexiveTransitiveClosure {sts = _⊢_⇀⦇_,SUBLEDGER⦈_} data _⊢_⇀⦇_,LEDGER⦈_ : LedgerEnv → LedgerState → TopLevelTx → LedgerState → Type where LEDGER-V : let utxo₀ : UTxO utxo₀ = UTxOOf utxoState₀ allScripts : ℙ Script allScripts = getAllScripts tx utxo₀ in ∙ IsValidFlagOf tx ≡ true ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{11883}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{11890}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{11900}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{11905}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{11918}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11709}{\htmlId{11929}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{11937}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11767}{\htmlId{11950}{\htmlClass{Bound}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#13862}{\htmlId{11963}{\htmlClass{Field}{\text{IsValidFlagOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6735}{\htmlId{11977}{\htmlClass{Generalizable}{\text{tx}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{11986}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{11999}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{12011}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ SubTransactionsOf tx ,SUBLEDGERS⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6593}{\htmlId{12063}{\htmlClass{Generalizable}{\text{utxoState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6699}{\htmlId{12076}{\htmlClass{Generalizable}{\text{govState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6651}{\htmlId{12088}{\htmlClass{Generalizable}{\text{certState₁}}}}\, \end{pmatrix}$ ∙ $\begin{pmatrix} \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{12111}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{12117}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{12124}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#12751}{\htmlId{12129}{\htmlClass{Field}{\text{ListOfGovVotesOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6735}{\htmlId{12146}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Core.Specification.Address.html#3223}{\htmlId{12151}{\htmlClass{Field}{\text{WithdrawalsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6735}{\htmlId{12165}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#5059}{\htmlId{12170}{\htmlClass{Function}{\text{allColdCreds}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6699}{\htmlId{12183}{\htmlClass{Generalizable}{\text{govState₁}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{12193}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#13558}{\htmlId{12206}{\htmlClass{Field}{\text{DirectDepositsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6735}{\htmlId{12223}{\htmlClass{Generalizable}{\text{tx}}}}\, \end{pmatrix}$ ⊢ certState₁ ⇀⦇ DCertsOf tx ,ENTITIES⦈ certState₂ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Transaction.html#11338}{\htmlId{12288}{\htmlClass{Field}{\text{TxIdOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6735}{\htmlId{12295}{\htmlClass{Generalizable}{\text{tx}}}}\, \\ \,\href{Ledger.Core.Specification.Epoch.html#954}{\htmlId{12300}{\htmlClass{Function}{\text{epoch}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{12306}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{12313}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{12318}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{12328}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6662}{\htmlId{12341}{\htmlClass{Generalizable}{\text{certState₂}}}}\, \\ \,\href{Class.IsSet.html#916}{\htmlId{12354}{\htmlClass{Function}{\text{dom}}}}\, \,\htmlId{12358}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Certs.html#3723}{\htmlId{12359}{\htmlClass{Field}{\text{RewardsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6662}{\htmlId{12369}{\htmlClass{Generalizable}{\text{certState₂}}}}\,\,\htmlId{12379}{\htmlClass{Symbol}{\text{)}}}\, \end{pmatrix}$ ⊢ govState₁ ⇀⦇ GovProposals+Votes tx ,GOVS⦈ govState₂ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{12447}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{12454}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{12459}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11709}{\htmlId{12470}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{12478}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#11767}{\htmlId{12491}{\htmlClass{Bound}{\text{allScripts}}}}\, \end{pmatrix}$ ⊢ utxoState₁ ⇀⦇ tx ,UTXOW⦈ utxoState₂ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{12593}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{12600}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{12610}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{12615}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{12628}{\htmlClass{Generalizable}{\text{treasury}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{12643}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{12656}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{12668}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ tx ,LEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6604}{\htmlId{12698}{\htmlClass{Generalizable}{\text{utxoState₂}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#4686}{\htmlId{12711}{\htmlClass{Function}{\text{rmOrphanDRepVotes}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6662}{\htmlId{12729}{\htmlClass{Generalizable}{\text{certState₂}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6710}{\htmlId{12740}{\htmlClass{Generalizable}{\text{govState₂}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6662}{\htmlId{12752}{\htmlClass{Generalizable}{\text{certState₂}}}}\, \end{pmatrix}$ LEDGER-I : let utxo₀ : UTxO utxo₀ = UTxOOf utxoState₀ allScripts : ℙ Script allScripts = getAllScripts tx utxo₀ in ∙ IsValidFlagOf tx ≡ false ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{12963}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{12970}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{12980}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{12985}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{12998}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12788}{\htmlId{13009}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{13017}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12846}{\htmlId{13030}{\htmlClass{Bound}{\text{allScripts}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Transaction.html#13862}{\htmlId{13043}{\htmlClass{Field}{\text{IsValidFlagOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Ledger.html#6735}{\htmlId{13057}{\htmlClass{Generalizable}{\text{tx}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{13066}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{13079}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{13091}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ SubTransactionsOf tx ,SUBLEDGERS⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{13143}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{13156}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{13168}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ∙ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{13191}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{13198}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{13203}{\htmlClass{Generalizable}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12788}{\htmlId{13214}{\htmlClass{Bound}{\text{utxo₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{13222}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#12846}{\htmlId{13235}{\htmlClass{Bound}{\text{allScripts}}}}\, \end{pmatrix}$ ⊢ utxoState₀ ⇀⦇ tx ,UTXOW⦈ utxoState₁ ──────────────────────────────── $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6833}{\htmlId{13337}{\htmlClass{Generalizable}{\text{slot}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6876}{\htmlId{13344}{\htmlClass{Generalizable}{\text{ppolicy}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6931}{\htmlId{13354}{\htmlClass{Generalizable}{\text{pp}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6977}{\htmlId{13359}{\htmlClass{Generalizable}{\text{enactState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#7026}{\htmlId{13372}{\htmlClass{Generalizable}{\text{treasury}}}}\, \end{pmatrix}$ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6582}{\htmlId{13387}{\htmlClass{Generalizable}{\text{utxoState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{13400}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{13412}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ ⇀⦇ tx ,LEDGER⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Ledger.html#6593}{\htmlId{13442}{\htmlClass{Generalizable}{\text{utxoState₁}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6688}{\htmlId{13455}{\htmlClass{Generalizable}{\text{govState₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Ledger.html#6640}{\htmlId{13467}{\htmlClass{Generalizable}{\text{certState₀}}}}\, \end{pmatrix}$ _⊢_⇀⦇_,LEDGERS⦈_ : LedgerEnv → LedgerState → List TopLevelTx → LedgerState → Type _⊢_⇀⦇_,LEDGERS⦈_ = ReflexiveTransitiveClosure {sts = _⊢_⇀⦇_,LEDGER⦈_}