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-0145? | Structured Contracts #963

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

polinavino
Copy link

@polinavino polinavino commented Jan 14, 2025

I wrote up a CIP for structured contracts before it gets forgotten entirely. It is mostly to try to bring some visibility to the project and find out if anyone is interested in using it to verify their contracts. The gist is that the "structured contract formalism" is easy to define (and basically done), but the difficult part is implementing some (all?) of the examples discussed there.

Any feedback is welcome - including opinions of whether or not, and how, I/we should try to pursue this further.


(rendered proposal)

@polinavino polinavino changed the title Struc Structured Contracts for Formal Script Verification Jan 14, 2025
@rphair rphair changed the title Structured Contracts for Formal Script Verification CIP-???? | Structured Contracts for Formal Script Verification Jan 15, 2025
Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

@polinavino I think this is a fine place for this to be, since we have a good target audience here to identify with potential usage & implementations - will tag some contributors to similar proposals that I can think of below & you are welcome to invite some more.

The Triage tag will put it up for introduction, rather than review, at the next CIP meeting: https://hackmd.io/@cip-editors/104 - so if you still want to incubate the idea before then you can put it in Draft review status before then. Otherwise I will try to keep it in the limelight to see if other voices can start building it up a bit... which generally doesn't happen if Draft status keeps it off the active proposal lists.

If it remains on the boards the editors will have to submit another review for compliance with the CIP-0001 document structure: unless you choose to attend to it in due course along with the validation of this idea & community participation.

cc @perturbing @KtorZ @MicroProofs @colll78 @michaelpj

CIP-????/CIP-????.md Outdated Show resolved Hide resolved
CIP-????/README.md Outdated Show resolved Hide resolved
CIP-????/README.md Show resolved Hide resolved
@rphair rphair added State: Triage Applied to new PR afer editor cleanup on GitHub, pending CIP meeting introduction. Category: Tools Proposals belonging to the 'Tools' category. labels Jan 15, 2025
@polinavino
Copy link
Author

@rphair I would he happy to attend the next Triage meeting to introduce the PR. Do i need to fill out any document? Get an invite link?

@polinavino polinavino changed the title CIP-???? | Structured Contracts for Formal Script Verification CIP-???? | Structured Contracts Jan 15, 2025
@rphair
Copy link
Collaborator

rphair commented Jan 16, 2025

@polinavino we will always be happy to have you there & every meeting is open to the public. Invite link (https://discord.gg/J8sGdCuKhs) and some other CIP-related info (especially the pages on review) you may find interesting are on the Wiki for this repo: https://github.com/cardano-foundation/CIPs/wiki

Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

Structural review promised in #963 (comment) (I'm not qualified to review the subject matter itself).

CIP-????/README.md Outdated Show resolved Hide resolved
CIP-????/README.md Outdated Show resolved Hide resolved
CIP-????/README.md Show resolved Hide resolved
CIP-????/README.md Outdated Show resolved Hide resolved
CIP-????/README.md Outdated Show resolved Hide resolved
CIP-????/README.md Outdated Show resolved Hide resolved
CIP-????/README.md Outdated Show resolved Hide resolved
@rphair
Copy link
Collaborator

rphair commented Jan 21, 2025

@polinavino we've chosen (at today's CIP meeting) to leave this tagged Triage in hope you can come to the next meeting and/or someone who's qualified to review in this subject can provide some confirmation of its feasibility & attractiveness for implementation.

Until then we don't have grounds for either Confirming or Unconfirming this. I hope the tags above are sufficient to produce this eventually & others can be tagged if not.

Personally, I might be in favour of progressing it anyway if a more detailed Path to Active could be developed that would leave the community with a path to follow if this were merged without such confirmation.

@polinavino
Copy link
Author

@rphair I was planning to come to the next meeting, thinking a link to it would be posted at https://lu.ma/cardano-cip whenever it is scheduled. There were no meetings there for this week. Is that the wrong place to look for a link to register for the meeting?

@rphair
Copy link
Collaborator

rphair commented Jan 21, 2025

@polinavino the primary source for the meetings is at the top of the CIP Discord server menu under Events. They've also generally been on that Luma calendar: we'd set it up this way to provide an easier reference & notifications, though the meetings run from Discord; e.g. https://discord.com/events/971785110770831360/1307327880925020211

I only found today that Luma doesn't have the 2025 meetings yet. Maybe the sequence stopped when the 24 December meeting was cancelled, or maybe the meetings hadn't been repeated into year 2025. @Crypto2099 set that up & I think he will be following up about it.

I am very sorry to have missed you. The meetings on Luma and Discord have been mutually consistent for as long as I can remember. Of course we will be happy to have you at the next meeting & hope to see plenty of activity in this thread in the meantime.

@polinavino
Copy link
Author

polinavino commented Jan 21, 2025

@rphair Thank you for the link! I am sad to have missed it - too bad Luma was being weird, I should have looked harder on Discord. I will try to make it to the next one 😅

@rphair rphair changed the title CIP-???? | Structured Contracts CIP-0145? | Structured Contracts Feb 4, 2025
Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

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

Thanks @polinavino for the introduction at the CIP meeting today. Please rename the project directory to CIP-0145 and update the link to your proposal in the first comment above. 🎉

Editors & community agreed this idea should be circulated, that it is a sound and useful proposal, and that giving it a number will help with the specialist review that it needs to identify specific applications & confirm an implementation path.

We thought a further way to tag qualified reviewers might also be through AGDA speciality: although we understand these specialists are generally pretty busy with their own work. @WhatisRT @lehins @bwbush (Ledger + Consensus) would you have any ideas who might be interested in applying this and/or giving it a practical review?

CIP-????/README.md Outdated Show resolved Hide resolved
as an instance of our proposed framework, including anything from minting policies, to a basic (single-execution)
UTxO-locking script, to sophisticated stateful apps distributed across multiple UTxOs and scripts. We do not propose any
automation for defining structured contract instances, however, the scope of this CIP should include automated conversion
from completed Agda smart contract functions to Plutus code.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm skeptical that automated conversion can produce both readable and performant plutus code. It seems more feasible to use it as a reference implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, technically you could use agda2hs which should generate Haskell code that isn't different from hand-written code. In many cases that can probably be quite performant. But agda2hs has its own set of constraints on the Agda you can write, which gets in the way of having the proofs you want. So yeah, it's probably more realistic to have hand-written scripts.

Copy link
Author

Choose a reason for hiding this comment

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

Maybe i should rephrase that as "looking into automation is a possible next step for the project if/when it gets traction and has working examples", and suggest agda2hs as an approach to consider.

@WhatisRT
Copy link
Contributor

WhatisRT commented Feb 5, 2025

I don't know anyone outside of IOG who really uses (hard) formal methods on Cardano, maybe the RV folks do some of it? I think inside of IOG most people who do FM are already familiar with this work to some degree. So sorry, I don't have any concrete suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Tools Proposals belonging to the 'Tools' category. State: Triage Applied to new PR afer editor cleanup on GitHub, pending CIP meeting introduction.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants