[Dijkstra] CIP-159-11b: Prove UTxO and UTxOW preservation of value (#1186) - #1189
Open
williamdemeo wants to merge 10 commits into
Open
[Dijkstra] CIP-159-11b: Prove UTxO and UTxOW preservation of value (#1186)#1189williamdemeo wants to merge 10 commits into
williamdemeo wants to merge 10 commits into
Conversation
3 tasks
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
May 7, 2026 20:23
6763664 to
ca99121
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
4 times, most recently
from
May 8, 2026 22:32
f34dd7b to
ed32fcc
Compare
4 tasks
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
May 12, 2026 05:25
ed32fcc to
60167ea
Compare
williamdemeo
marked this pull request as ready for review
May 12, 2026 05:45
williamdemeo
marked this pull request as draft
May 14, 2026 04:28
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
2 times, most recently
from
May 14, 2026 19:51
cf7a86b to
e494a2e
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
3 times, most recently
from
May 20, 2026 01:13
91db883 to
ac0e814
Compare
4 tasks
williamdemeo
pushed a commit
that referenced
this pull request
Jun 23, 2026
Records the precise, ordered steps to make this PR faithful to the top-down plan: delete the Certs-PoV provider modules (Certs/Properties/PoV and PoVLemmas, which are #1210's work), drop their imports from Certs/Properties, and lift the facts they provide (CERTS-pov, and later CERTS-coinFromDeposits-updateCertDeposits) to module parameters in Entities.Properties.PoV and the LEDGER-PoV module. Notes that Utxo/Utxow-PoV are already absent (deferred to #1189) and already parameterized, flags the Conway-side touches to re-check, and cross-references the separate coinFromGovDeposit re-derivation. Prose only; to be executed in a session with the Agda toolchain so each step can be typechecked. https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
4 tasks
williamdemeo
pushed a commit
that referenced
this pull request
Jun 25, 2026
Records the precise, ordered steps to make this PR faithful to the top-down plan: delete the Certs-PoV provider modules (Certs/Properties/PoV and PoVLemmas, which are #1210's work), drop their imports from Certs/Properties, and lift the facts they provide (CERTS-pov, and later CERTS-coinFromDeposits-updateCertDeposits) to module parameters in Entities.Properties.PoV and the LEDGER-PoV module. Notes that Utxo/Utxow-PoV are already absent (deferred to #1189) and already parameterized, flags the Conway-side touches to re-check, and cross-references the separate coinFromGovDeposit re-derivation. Prose only; to be executed in a session with the Agda toolchain so each step can be typechecked. https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
williamdemeo
pushed a commit
that referenced
this pull request
Jun 25, 2026
…mas (#1186) First piece of the utxo/utxow-pov work that discharges #1187/#1203's UTxO-side module parameters. Ported verbatim from the stale #1189 branch (1186-dijkstra-utxo-and-utxow-pov); typechecks unchanged against the current spec (Agda 2.8.0 via the Nix flake), since these lemmas are era-independent: - ∙-homo-Coin : coin (x + y) ≡ coin x + coin y (coin monoid homomorphism) - coin-∑ˡ : coin distributes over a list-indexed ∑ˡ - newTxid⇒disj : TxId freshness ⇒ disjointness of dom utxo and dom (outs tx) - outs-disjoint : the (utxo ∣ SpendInputs ᶜ) / outs specialisation used by PoV balance-∪ / split-balance remain module parameters of Utxo.Properties.PoV (the set-theoretic balance-arithmetic port is tracked separately). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01We2YdXX2ozJAdAbCrRwi6r
williamdemeo
pushed a commit
that referenced
this pull request
Jun 25, 2026
Records the precise, ordered steps to make this PR faithful to the top-down plan: delete the Certs-PoV provider modules (Certs/Properties/PoV and PoVLemmas, which are #1210's work), drop their imports from Certs/Properties, and lift the facts they provide (CERTS-pov, and later CERTS-coinFromDeposits-updateCertDeposits) to module parameters in Entities.Properties.PoV and the LEDGER-PoV module. Notes that Utxo/Utxow-PoV are already absent (deferred to #1189) and already parameterized, flags the Conway-side touches to re-check, and cross-references the separate coinFromGovDeposit re-derivation. Prose only; to be executed in a session with the Agda toolchain so each step can be typechecked. https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
2 times, most recently
from
August 13, 2026 02:47
562929d to
23691f0
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
2 times, most recently
from
August 18, 2026 03:47
ef59a39 to
c600099
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
September 3, 2026 02:08
c600099 to
1701aa1
Compare
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
September 3, 2026 02:10
1701aa1 to
51c8463
Compare
Base automatically changed from
1187-dijkstra-NEW-ENTITIES-ledger-pov
to
master
September 4, 2026 03:21
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
2 times, most recently
from
September 8, 2026 19:08
35a5f55 to
cf3a26d
Compare
williamdemeo
requested review from
carlostome
and
a balanced review from Copilot
September 9, 2026 03:43
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The property catalog makes unsupported preservation claims and must be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
src/Ledger/Dijkstra/Specification/Ledger/Properties/PoV.lagda.md:188
- The
UTXOrule currently has no TxId-freshness premise, so this comment incorrectly states that the rule establishes freshness at batch level. This is still an assumption pending #1274 and should be documented as such.
-- Batch-wide invariants on the post-SUBLEDGERS UTxO state. Both follow from
-- batch-wide input disjointness and TxId freshness, which the outer UTXO rule
-- establishes at batch level, not per-step.
src/Ledger/Dijkstra/Specification/Utxo/Properties/PoV.lagda.md:139
- This says the consumer discharges
noMintingSubTxs, butLEDGER-PoVstill acceptsnoMintSubTxas a module parameter (lines 183–184); discharge fromSUBLEDGERSis deferred to #1274. Please describe it as a currently threaded hypothesis rather than an accomplished discharge.
steps. The batch-balance lemmas below therefore take the following
per-transaction fact as a hypothesis; the `LEDGER`{.AgdaDatatype}-level consumer
discharges it from the `SUBLEDGERS`{.AgdaDatatype} derivation.
src/Ledger/Dijkstra/Specification/Utxo/Properties/PoV.lagda.md:53
- The current
UTXOrule has no batch TxId-freshness premise (seeUtxo.lagda.md:507-527), and #1274 explicitly leaves open whether such a premise must be added. Claiming here that the rule already establishes fresh TxIds is therefore inaccurate; describe freshness as a required batch-threading hypothesis instead.
The `UTXO`{.AgdaDatatype} rule establishes this batch-wide (spend inputs are mutually
disjoint across the batch, TxIds are fresh) but does not expose it per step.
- Files reviewed: 10/10 changed files
- Comments generated: 3
- Review effort level: Balanced
| notes: "Covers both thm:CERT-PoV and thm:CERTS-PoV." | ||
|
|
||
| - id: dijkstra-utxo-pov | ||
| title: "UTXO preserves value" |
Member
Author
There was a problem hiding this comment.
Indeed, the new property tracker is not immune to human error. I need to fix the properties.yaml catalog entries.
| notes: "" | ||
|
|
||
| - id: dijkstra-utxow-pov | ||
| title: "UTXOW preserves value" |
…s.Base Port the Conway balance lemmas to Dijkstra: balance-cong, balance-cong-coin, balance-∪ (additivity on disjoint unions) and split-balance (partition along a key-set restriction), plus the freshness lemmas newTxid⇒disj / outs-disjoint, the coin homomorphism law ∙-homo-Coin, and coin-∑ˡ (coin distributes over list-indexed Value sums). The Conway indexedSumᵐ proofs now port directly because the Dijkstra balance is again an indexed sum over a finite map of transaction outputs (∑[ x ← mapValues txOutToValue utxo ] x); the earlier ∑ˢ-over-ℙ-Value definition that blocked this port is gone. balance-∪, split-balance and outs-disjoint match the corresponding module parameters of Ledger.Properties.PoV (#1203), which they discharge (#1186). AI-assisted: Claude Fable 5 (Anthropic)
…te change Add Utxo.Properties.PoV with the UTXO-level preservation-of-value facts (#1186): * Layered coin projection of the batch balance premise consumedBatch ≡ producedBatch (premise 8 of the UTXO rule): per-transaction (coin-consumedTx, coin-producedTx), sums over sub-transactions (coin-∑-consumedTx-sub, coin-∑-producedTx-sub), and batch level (coin-consumedBatch, coin-producedBatch), in the closed form consumed by LEDGER-pov — cert deposits as refundCertDeposits/newCertDeposits over allDCerts tx against the pre-batch pool set, gov-action deposits collected into a trailing group. Minted terms drop by premise 7 (top level) and the noMintingSubTxs hypothesis (sub level). * module UTXO-PoV (tx) (noMintSubTx): UTXO-pov-invalid (collateral collection preserves getCoin), UTXO-V-mechanical (valid-case state change given TxId freshness), UTXO-batch-balance-coin. * subutxo-step-coin: the per-step SUBUTXO coin equation, with the two batch-threading facts it needs (sub-tx TxId freshness in the running UTxO, running-vs-snapshot spend-input balance agreement) as explicit hypotheses. Pure +-rearrangements are discharged with the reflective ring solver, stated over raw ℕ addition (_+ᴺ_) per the established pattern in Ledger.Properties.PoV. Register Base and PoV in the Utxo.Properties aggregator. AI-assisted: Claude Fable 5 (Anthropic)
Add Utxow.Properties.PoV (#1186). Both UTXOW constructors (and SUBUTXOW) embed their state-changing UTXO (SUBUTXO) derivation as the final premise, so a pair of extractors (UTXOW⇒UTXO, SUBUTXOW⇒SUBUTXO) reduces every statement to its Utxo.Properties.PoV counterpart: * module UTXOW-PoV (tx) (noMintSubTx): utxow-pov-invalid, UTXOW-V-mechanical, and UTXOW-batch-balance-coin, with statements matching the corresponding module parameters of Ledger.Properties.PoV (#1203) verbatim. * module SUBUTXOW-PoV: subutxow-step-coin, given the two batch-threading invariants (per-sub-tx TxId freshness and running-vs-snapshot spend-input agreement) as module parameters — the SUBUTXOW premises do not provide them; they belong to the same follow-up family as the utxo₁-tx-spend-eq and fresh-top-tx-id parameters of LEDGER-pov. Instantiating LEDGER-PoV with these lemmas (balance-∪/split-balance/ outs-disjoint from Utxo.Properties.Base with the η-wrappers from the PR #1203 design notes, subutxow-step-coin from SUBUTXOW-PoV, and the three UTXOW facts from UTXOW-PoV) has been verified to elaborate LEDGER-pov end-to-end. Register the module in the Utxow.Properties aggregator. AI-assisted: Claude Fable 5 (Anthropic)
Per the review policy established on the base PR: issue numbers and follow-up prose move to the PR description; the ring-solver/HasAdd explanation duplicated from Ledger.Properties.PoV becomes a cross-reference; open module parameters are described in present tense. AI-assisted: Claude Fable 5 (Anthropic)
Per review feedback: open with the theorem and argument in plain terms, then a dedicated section answering why the proof splits into the mechanical and batch-balance pieces (different UTxOs: running state vs pre-batch snapshot) and why the batch-balance statement mentions no states, then the Conway differences and the detailed proof map. Echo the running-vs-snapshot point locally at UTXO-V-mechanical and UTXO-batch-balance-coin. Final polish: + general improvements + add mkdocs nav entries AI-assisted: Claude Fable 5 (Anthropic)
…eir parameters The UTxO-side obligations of LEDGER-PoV are theorems on this branch, so the module now imports them instead of assuming them: utxow-pov-invalid, UTXOW-V-mechanical and UTXOW-batch-balance-coin from UTXOW-PoV, and subutxow-step-coin from SUBUTXOW-PoV. The unused balance-∪, split-balance, outs-disjoint and noMintTx parameters are dropped outright. SUBUTXOW-PoV's two batch-threading hypotheses (subtx-fresh-txid, subtx-spend-agree) surface as new parameters, in the same family as utxo₁-tx-spend-eq/fresh-top-tx-id. noMintingSubTxs now has a single home in Utxo.Properties.PoV. AI-assisted development: Claude Fable 5 (Anthropic)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
williamdemeo
force-pushed
the
1186-dijkstra-utxo-and-utxow-pov
branch
from
September 9, 2026 20:01
1180e42 to
2c05ac6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #1186. Base:
master. First PR of the Dijkstra PoV stack (#1189, #1210, #1278).Proves the UTxO-side value-accounting facts and rewires
LEDGER-PoVto import them, deleting eight module parameters and adding the two batch-threading hypotheses.What lands
Utxo.Properties.Base: the balance algebra (balance-∪,split-balance,outs-disjoint,newTxid⇒disj).Utxo.Properties.PoV: the batch-balance coin projection and the mechanical state-change lemmas.Utxow.Properties.PoV: theUTXOW⇒UTXO/SUBUTXOW⇒SUBUTXOextractors and theUTXOW-PoV/SUBUTXOW-PoVmodules whose statements match theLEDGER-PoVparameters verbatim.Ledger.Properties.PoVrewiring:utxow-pov-invalid,UTXOW-V-mechanical,UTXOW-batch-balance-coinandsubutxow-step-coinare now imported instead of assumed; the unusedbalance-∪,split-balance,outs-disjointandnoMintTxparameters are dropped;noMintingSubTxshas a single home inUtxo.Properties.PoV.dijkstra-utxo-povanddijkstra-utxow-povderive as proved.Key points for review
subutxow-step-coinis proved conditionally on two batch-threading hypotheses (subtx-fresh-txid,subtx-spend-agree); they surface as newLEDGER-PoVparameters in the same family asutxo₁-tx-spend-eq/fresh-top-tx-id([Dijkstra] Batch-threading UTxO invariants for LEDGER-pov #1274).refundCertDeposits/newCertDepositsoverallDCerts txagainst the pre-batch pool set, and gov deposits on the produced side.UTXO-povtheorem:LEDGER-povdoes not consume one, and none is provable at this level (see [Dijkstra] UTxO and UTxOW PoV #1186).Verification
Ledger.Properties.PoVtypechecks with the parameters deleted, which verifies the discharge by construction.agda src/Ledger.lagda.mdandscan_properties.py --checkboth green.Checklist
CHANGELOG.md(none in this PR)🤖 AI-assisted development: Claude Fable 5 (Anthropic)