Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

The Dijkstra UTXOS rule's preservation-of-value check (batchPOV) allows Ada forgery: an attacker can mint Ada in MintedValueOf, create matching outputs, and pass validation despite increasing total Ada supply.

Changes

  • Added batchMintedCoin function: Computes total Ada minted across top-level transaction and all sub-transactions by extracting and summing coin components from MintedValueOf values

  • Added constraint to UTXO-scripts✓ rule: batchMintedCoin Γ s tx ≡ 0 enforces zero net Ada minting across the batch, analogous to Conway's coin mint ≡ 0 but generalized for batch semantics

batchMintedCoin : Coin
batchMintedCoin = coin (MintedValueOf txTop) 
                  + sum (map (λ txSub  coin (MintedValueOf txSub)) (SubTransactionsOf txTop))

-- In UTXO-scripts✓ rule:
∙ batchMintedCoin Γ s tx ≡ 0

This prevents the forgery attack while preserving the batch-level preservation-of-value semantics.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI mentioned this pull request Jan 9, 2026
7 tasks
Copilot AI changed the title [WIP] Address feedback on UTXOS rule with batch-level validity checking Add batch-level coin mint constraint to prevent Ada forgery Jan 9, 2026
Copilot AI requested a review from williamdemeo January 9, 2026 04:14
@williamdemeo williamdemeo force-pushed the 1007-dijkstra-utxos-batch-level-validity branch from e43ee89 to 4f543af Compare January 9, 2026 05:54
williamdemeo and others added 5 commits January 8, 2026 23:03
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
Copy link
Member

@williamdemeo williamdemeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. LGTM!

@williamdemeo williamdemeo marked this pull request as ready for review January 9, 2026 06:10
@williamdemeo williamdemeo merged commit 03fc211 into 1007-dijkstra-utxos-batch-level-validity Jan 9, 2026
1 check passed
@williamdemeo williamdemeo deleted the copilot/sub-pr-1021 branch January 9, 2026 06:11
williamdemeo added a commit that referenced this pull request Jan 9, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 9, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 10, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 12, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 13, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 16, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 19, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo added a commit that referenced this pull request Jan 24, 2026
* improvements

* Initial plan

* Add batchMintedCoin constraint to prevent Ada forgery

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Add documentation for batchMintedCoin security constraint

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

* Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>
williamdemeo pushed a commit that referenced this pull request Jan 24, 2026
+ Initial plan and improvements
+ Add batchMintedCoin constraint to prevent Ada forgery
+ Add documentation for batchMintedCoin security constraint
+ Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

remove duplicate typeclass instance

address PR change requests

fix UTXOS and UTXO rules
williamdemeo added a commit that referenced this pull request Jan 27, 2026
+  Add batch-level coin mint constraint to prevent Ada forgery (#1023)

   + Initial plan and improvements
   + Add batchMintedCoin constraint to prevent Ada forgery
   + Add documentation for batchMintedCoin security constraint
   + Use consistent aggregation syntax for batchMintedCoin

Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

---------

Co-authored-by: William DeMeo <williamdemeo@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: williamdemeo <3528228+williamdemeo@users.noreply.github.com>

remove duplicate typeclass instance

address PR change requests

fix UTXOS and UTXO rules

Update src/Ledger/Dijkstra/Specification/Utxo.lagda.md

Co-authored-by: Carlos Tomé Cortiñas <carlos.tome-cortinas@iohk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants