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

Pact On-Chain ECDSA Cryptographic Verification #26

Open
kiruthikraaj opened this issue Aug 10, 2022 · 2 comments
Open

Pact On-Chain ECDSA Cryptographic Verification #26

kiruthikraaj opened this issue Aug 10, 2022 · 2 comments

Comments

@kiruthikraaj
Copy link

Problem

To be able to verify cryptographic signatures generated by signing arbitrary data with the associated public key on-chain / contracts.

Current Approach

We can create a signature for a message with a key-pair and verify it off-chain using the function Pact.crypto.sign provided in pact-lang-api Js library.

But there is no way to verify this signature on-chain / in contract.

Proposal

To add ECDSA crytopgraphic method to verify a signed message as a built in function.

  • verify-sig that takes public key and a signature as parameters and returns a boolean value representing whether the public key is the one used to generate the given signature.

Current Alternatives

There are no current alternatives to my knowledge. Also suggest if there is any other way to achieve the same.

References

@kitty-kad
Copy link

kitty-kad commented Oct 4, 2022

I'm wondering if it's needed in Pact, specifically since it's possible to have multiple signing keysets on a transaction.
Then its possible to use key-sets / guards to verify if a guard passes for a specific account.

I might also be mis-understanding the use-case :) Would be interesting to get an example of a dapp that would use this

@kiruthikraaj
Copy link
Author

I don't want the authorised keyset to sign the transaction but to sign a message. I am aware of using multiple keyset in a transaction and I have used it.

  • With multiple keyset I have to sign the transaction for each user and then send it to the chain.
  • With the ECDSA I can generate a signature with a nonce / validity allowing any user to use the signed message and submit the transaction.

This way for an example, an admin can sign a message, send it to user and user submits the txn. Note that the admin is signing an arbitrary message and not the txn.

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

No branches or pull requests

2 participants