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

KIP 0028: Pact Verifier Plugins #57

Merged
merged 3 commits into from
Oct 31, 2024
Merged

KIP 0028: Pact Verifier Plugins #57

merged 3 commits into from
Oct 31, 2024

Conversation

edmundnoble
Copy link
Contributor

@edmundnoble edmundnoble commented Feb 12, 2024

This is a proposal to add Verifier Plugins to Pact as a way to add new cryptography to Pact and integrate it with the capability paradigm. Implementation is at kadena-io/chainweb-node#1777 and kadena-io/pact#1324.


@jwiegley
Copy link
Contributor

Excellent initial exposition, @edmundnoble, you've made the intent of the proposal very clear.

@CryptoPascal31
Copy link

CryptoPascal31 commented Feb 14, 2024

Suggestion : The REPL simulation function (env-verfiers ) should be described (or at least mentioned) in the KIP.

Question 1: Is a managed cap automatically installed by a verfier (like it is with a signature) ?

Question 2: Does the magic triggered by GAS_PAYER cap works with verifier ? I mean, can we trigger a gas station from a verifier ?

Question 3: Do you plan to create a new type a guard that automatically enforce a verifier ? (similar to a keyset guard)

Question 4: Do you plan to add some doc for the verifiers (at least one short paragraph ) ? btw: it may answer to my question 1.

@edmundnoble
Copy link
Contributor Author

edmundnoble commented Feb 15, 2024

@CryptoPascal31 thanks for the questions!

Suggestion : The REPL simulation function (env-verfiers) should be described (or at least mentioned) in the KIP.

Good idea, I'll add that. Edit: done.

Question 1: Is a managed cap automatically installed by a verfier (like it is with a signature) ?

Yes.

Question 2: Does the magic triggered by GAS_PAYER cap works with verifier ? I mean, can we trigger a gas station from a verifier ?

Not initially. This is mentioned in the KIP:

"A verifier may charge gas after gas is bought and before any transaction code is run. Because of this, currently, a verifier cannot grant the GAS_PAYER capability, which would allow paying for gas using a verifier’s attestation. This may change in the future."

Question 3: Do you plan to create a new type a guard that automatically enforce a verifier ? (similar to a keyset guard)

No plans to do this at the moment. I would recommend using a capability guard for this.

Question 4: Do you plan to add some doc for the verifiers (at least one short paragraph ) ? btw: it may answer to my question 1.

What exactly are you asking about documenting? The Pact code, chainweb code, this KIP, or something else? Or is there a particular workflow you're asking about documenting?

@CryptoPascal31
Copy link

Thank you for your answers @edmundnoble

Question 2: Does the magic triggered by GAS_PAYER cap works with verifier ? I mean, can we trigger a gas station from a verifier ?

Not initially. This is mentioned in the KIP:

"A verifier may charge gas after gas is bought and before any transaction code is run. Because of this, currently, a verifier cannot grant the GAS_PAYER capability, which would allow paying for gas using a verifier’s attestation. This may change in the future."

In fact, I was especially thinking about this:
kadena-io/chainweb-node#1702

I was wondering whether the "Allow" verifier could be an elegant solution for the suggestion I raised. Currently, a GAS_PAYER triggered gas station is not related to the signature, as it may not be related not to a verifier attestation. I know, I'm not clear..
But maybe you should take a quick look at the code (function findPayer of TransactionExec.hs . The code just searches for GAS_PAYER cap in the signatures and if found it calls the related module, to unlock the guard of the sender ... independently of who signed the cap... I mean, maybe it would be possible to search into the "verifiers caps" in addition to the "signatures caps".

Question 4: Do you plan to add some doc for the verifiers (at least one short paragraph ) ? btw: it may answer to my question 1.

What exactly are you asking about documenting? The Pact code, chainweb code, this KIP, or something else? Or is there a particular workflow you're asking about documenting?

I mean in the official Pact doc:
https://github.com/kadena-io/pact/blob/master/docs/en/pact-reference.md

There is a lot about caps, signatures, managed caps... I think the concept of verifiers should be explained here.

IMHO: new users are not supposed to know that the documentation is spread between the official doc and the KIPs.. I mean, users are not supposed to search into the KIP repository to understand the concept of a verifier.

@edmundnoble
Copy link
Contributor Author

edmundnoble commented Feb 16, 2024

Thanks Pascal, I've submitted a document update request (kadena-community/kadena.js#1661), we'll have an update in the official docs page soonish, ideally by the release. Word from the Pact team is that we're trying to phase out the readthedocs website in favor of https://docs.kadena.io.

Re: findPayer, that makes sense to me though it seems a bit wasteful to use allow, because it does require that the proof match the cap. Let's continue that discussion on kadena-io/chainweb-node#1702.

kip-0028.md Outdated Show resolved Hide resolved
kip-0028.md Show resolved Hide resolved
kip-0028.md Outdated Show resolved Hide resolved
@edmundnoble edmundnoble force-pushed the push-trwunkrrylyn branch 2 times, most recently from df8be21 to 69f7f55 Compare April 4, 2024 15:10
kip-0028.md Show resolved Hide resolved
Randynamic
Randynamic previously approved these changes Oct 16, 2024
@Randynamic
Copy link
Contributor

@edmundnoble I believe we can resolve the conversations and merge this proposal.

@edmundnoble
Copy link
Contributor Author

@Randynamic I need one more approval and then it's mergeable.

jmcardon
jmcardon previously approved these changes Oct 22, 2024
@edmundnoble edmundnoble dismissed stale reviews from jmcardon and Randynamic via 7c72b9f October 31, 2024 14:28
@edmundnoble edmundnoble merged commit dcc4f7b into master Oct 31, 2024
@edmundnoble edmundnoble deleted the push-trwunkrrylyn branch October 31, 2024 15:18
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.

8 participants