Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIP-0069: alternative approach #769

Closed
zliu41 opened this issue Feb 29, 2024 · 10 comments · Fixed by #784
Closed

CIP-0069: alternative approach #769

zliu41 opened this issue Feb 29, 2024 · 10 comments · Fixed by #784

Comments

@zliu41
Copy link
Contributor

zliu41 commented Feb 29, 2024

I had a conversation about this CIP several weeks ago with a few others, including @lehins from the ledger team. This seems desirable to do, easy to implement (on both the Plutus and the ledger side), and if we want it in Plutus V3 then it must be done soon.

I'm opening this issue to discuss an alternative approach: the problem with the proposed approach is that it adds a ScriptArgs argument, which leads to the "ugly unchecked dependence" problem as pointed out in #321 (comment). But this doesn't seem necessary: we can simply use two different types for scriptContextPurpose, and the key of txInfoRedeemers. E.g., Alexey suggested that we can create a ScriptPurposeWithDatum type for scriptContextPurpose, while keeping the txInfoRedeemers key type as it is, which would avoid the problem.

If we can agree and settle on the design soon, it should have a good chance to be done in time for Plutus V3. @KtorZ @michaelpj @zygomeb

@rphair
Copy link
Collaborator

rphair commented Mar 1, 2024

@michaelpj
Copy link
Contributor

I don't find the unchecked dependence problem to be that bad, but I also don't desperately hate the combined thing. Perhaps we could give it a different name. ScriptInfo? IDK.

I was going to say that the unchecked approach would make it easier if we decided to allow the spending of script outputs without datums. But if we did that we would probably need to tie it to a new ledger language anyway, in which case we could change the ScriptInfo type just as easily.

@MicroProofs
Copy link
Contributor

I made some updates to CIP 69 to mention the no datum case, but looks like the typing for ScriptInfo is better since you don't end up with an impossible type combination of ScriptArgs DatumAndRedeemer with a ScriptPurpose of Mint, Withdraw, etc.

@rphair
Copy link
Collaborator

rphair commented Mar 5, 2024

Added to today's CIP editors' meeting agenda (https://hackmd.io/@cip-editors/83) to discuss with #774 (#774 (comment)).

@zliu41
Copy link
Contributor Author

zliu41 commented Mar 8, 2024

@rphair has this been discussed and what was the outcome?

@MicroProofs
Copy link
Contributor

MicroProofs commented Mar 10, 2024

@zliu41 The outcome was to discuss with the Plutus Core team next CIP meeting to get the path forward that everyone is most comfortable implementing.

It sounds like the approach talked about in this issue is a more wholistic approach for typing validators.
We can also continue the discussion here in the comments. I can update the pr to reflect any changes decided on and finalized here.

@leo42
Copy link
Contributor

leo42 commented Mar 10, 2024

I would love to see this implemented.

It is a prerequisite for smart wallets if we want them to have a smooth and intuitive UX .

I will also be implementing the Plutus-wallet connector soon and hopefully we can get this section of the market going, so having it in Plutus V3 will help everything accelerate .

Lots of innovation waiting to be unlocked.

@michaelpj
Copy link
Contributor

If we are going to incorporate making the datum optional, then I think we should also propose the corresponding change to the ledger rules to make it legal to spend outputs without datums.

@zliu41
Copy link
Contributor Author

zliu41 commented Mar 19, 2024

propose the corresponding change to the ledger rules to make it legal to spend outputs without datums.

We can continue the discussion of that in CIP-87. The only reason it is related to CIP-69 is because the original ScriptArg proposal accidentally did what CIP-87 wants. If we go with the ScriptInfo approach then these two CIPs are completely orthogonal.

@michaelpj
Copy link
Contributor

I don't think they're orthogonal, since you have to decide here if you're going to have Datum or Maybe Datum in the spending purpose. It's weird to have Maybe Datum if we're not going to make that legal. So they are coupled!

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 a pull request may close this issue.

5 participants