Skip to content

Conversation

@williamdemeo
Copy link
Member

@williamdemeo williamdemeo commented Oct 7, 2025

Description

Initial PR for formalizing nested transactions in the Dijkstra era.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Any semantic changes to the specifications are documented in CHANGELOG.md
  • Code is formatted according to CONTRIBUTING.md
  • Self-reviewed the diff

Copy link
Collaborator

@carlostome carlostome left a comment

Choose a reason for hiding this comment

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

LGTM! I left some comments here and there.

Comment on lines 23 to 36
## Changes to Transaction Validity

As discussed in [Ledger.Conway.Specification.Properties][], transaction validity is
tricky, and this is as true in the Dijkstra era as it was in Conway, if not moreso.

Here are some key points about transaction validity in the Dijkstra era.

1. Sub-transactions are not allowed to contain sub-transactions themselves.

2. Sub-transactions are not allowed to contain collateral inputs. Only a top-level
transaction is allowed to (furthermore, obligated to) provide sufficient
collateral for all scripts that are run as part of validating all transactions in
that batch. If any script in a batch fails, none of the transactions in the batch
is applied; only the collateral is collected.
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this relevant to script validation?

Copy link
Member Author

@williamdemeo williamdemeo Oct 14, 2025

Choose a reason for hiding this comment

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

Okay, I moved this discussion of transaction validity to the bottom of Ledger.Dijkstra.Specification.Transaction, but please suggest a more appropriate place if you see one.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this will go in Ledger since is about the top level behaviour.

## Transaction levels

To differentiate between the two types of transactions (i.e. top-level
and sub), we define the type of transaction level:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
and sub), we define the type of transaction level:
and sub-level), we define the type of transaction level:

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm... I thought, since we call them "top-level transactions" and "sub-transactions," it is appropriate to say, "the two types of transactions (i.e., top-level and sub)..." On the other hand, I suppose it's also reasonable to sometimes use "sub-level transaction" to refer to a sub-transaction. 🤔 Wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just find a bit weird to use top-level but sub. But also it will be weird to use top and sub (top w/o level).

@williamdemeo williamdemeo marked this pull request as ready for review October 14, 2025 14:35
@williamdemeo
Copy link
Member Author

@carlostome thanks for all of your suggestions. I've incorporated all except for the two mentioned above. Please could you have one more quick look over the PR and let me know if you still approve?

carlostome and others added 6 commits October 15, 2025 22:38
+ Rename Observers to Guards
+ Rename Lvl to Level; use keyword 'mutual'
+ Add some text and comments
+ Expand code region
+ Add more explanations
+ Add headers
+ Reword and add more text
+ fix issues caused by merge of master
+ add and type-check some new modules:

  + Ledger.Dijkstra
  + Ledger.Dijkstra.Specification
  + Ledger.Dijkstra.Specification.Script.Validation

+ revert getCoin rename

+ remove unused

+ corrections
Copy link
Collaborator

@carlostome carlostome left a comment

Choose a reason for hiding this comment

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

LGTM!

@williamdemeo williamdemeo merged commit 5754797 into master Oct 17, 2025
14 checks passed
@williamdemeo williamdemeo deleted the dijkstra-dev branch October 17, 2025 06:24
@williamdemeo williamdemeo self-assigned this Nov 11, 2025
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