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

pruntime: Support for query signed in EIP-712 #1345

Merged
merged 6 commits into from
Jul 27, 2023
Merged

pruntime: Support for query signed in EIP-712 #1345

merged 6 commits into from
Jul 27, 2023

Conversation

kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Jul 19, 2023

This PR adds support for querying to pRuntime with EIP-712 signature which is used in Ethereum wallets.
The current implementation only uses part of the fields of domainSeparator:

#[eip712(
    name = "Phat Query Certificate",
    version = "1",
    salt = "phala/phat-contract"
)]

the chainId is not used. This allow the wallet to sign our messages no matter what active chain is.

A demo front-end script can be found at scripts/mm-eip712.html or here.

@kvinwang
Copy link
Collaborator Author

cc @Leechael @jasl

Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

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

lgtm, with minor suggestion

crates/phactory/api/src/crypto.rs Show resolved Hide resolved
crates/phactory/api/src/crypto.rs Outdated Show resolved Hide resolved
@kvinwang kvinwang enabled auto-merge July 27, 2023 01:45
@kvinwang kvinwang merged commit 2cb5c1b into master Jul 27, 2023
8 checks passed
@kvinwang kvinwang deleted the eip712 branch July 27, 2023 04:43
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.

2 participants