KIP 0028: Pact Verifier Plugins
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 https://github.com/kadena-io/chainweb-node/pull/1777 and https://github.com/kadena-io/pact/pull/1324.
Excellent initial exposition, @edmundnoble, you've made the intent of the proposal very clear.
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.
@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?
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_PAYERcapability, 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: https://github.com/kadena-io/chainweb-node/issues/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.
Thanks Pascal, I've submitted a document update request (https://github.com/kadena-community/kadena.js/pull/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 https://github.com/kadena-io/chainweb-node/issues/1702.
@edmundnoble I believe we can resolve the conversations and merge this proposal.
@Randynamic I need one more approval and then it's mergeable.