Skip to content

Idea discussion: Allow PlutusV1-V3 with Nested Transactions #5474

@lehins

Description

@lehins

I had an interesting discussion with @fallen-icarus and I wanted to write up my idea before it fades away from my brain.

We were discussing the desire to use CIP-159 with PlutusV1-V3, which, by itself, could be dangerous, since new features cannot be translated to older scripts and filtering out new fields, like deposits would violate implicit invariant that transaction balances out (eg. there is a deposit of 5ADA into an account, which PlutusV3 script can't see, thus it will look like the whole transaction does not balance out)

At this point I remembered an ability that Nested Transaction will bring to the table, namely PlutusV4 script will happily coexist with PlutusV5 script that uses features that PlutusV4 does not understand, as long as they are in separate sub-transactions. By itself, this capability does not help us with PlutuV1-V3 scripts. However, this got me thinking... What if we allow PlutusV1-V3 scripts in the top level transaction, even with presence of sub-transaction in it, but only when top level transaction itself balances out and passes all of the rules that are today in Conway (I don't mean literally running Conway rules, I mean morally same validation that PlutuV1-V3 scripts would expect in a transaction).

I am not quite sure at this point if there is an easy way to implement this or not, but conceptually this idea should be sound:

  • Because top level transaction is processed last, for all intents and purposes it will look like if all sub-transactions were regular transactions processed in a block prior to the top-level transaction because top level transaction would be isolated form them.
  • PlutusV1-V3 scripts will be oblivious to the fact that sub-transactions were also processed in the same transactions. The only notable difference will be a higher fee and potentially higher collateral, which is not a forbidden property today.

This would open up a nice opportunity for future compatibility of older scripts to be mixed with new features. In particular for CIP-159, it would be possible to say use PlutusV2 script in a transaction that itself has a sub-transaction that deposits 5ADA into an account with only one restriction that it can't be the top level transaction that produced that ADA, it mwill have to come either form that or another sub-transaction.

So, the caveats to this are, when PlutusV1-V3 script is present at the top level:

  • all sub-transactions will have to balance each other out (if there is only one sub-transaction than it itself will have to balance)
  • top-level transaction cannot use any of new features. So, it cannot rely on any sub-transaction to provide anything for its validity, no datums, no reference scripts, etc.

If there is a way to enable such use case without a lot of work, I believe it would be worthwhile to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❓ questionFurther information is requestedCIP-118 - Nested TransactionsThis is a label is for any task related to CIP-118: Nested TransactionsDijkstraEraLedger era that will follow after ConwayenhancementNew feature or requestneeds-breakdown

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions