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

feat: erc 6492 signature validation #744

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

guru-web3
Copy link

@guru-web3 guru-web3 commented Oct 10, 2024

PR Documentation Outline:
Title: Add ERC-6942 Signature Validation for Pre-Deployed Contracts

Summary: This PR implements signature validation using ERC-6942, which enables verifying signatures for smart contract wallets even when they aren't deployed. This is necessary because some wallets delay contract deployment until the first transaction. By adopting ERC-6942, we validate signatures before wallet deployment.

Details:

  • isValidateSignature() currently validates deployed contract signatures.
  • ERC-6942 allows signature verification even when a contract is in the pre-deployment state.
  • This approach avoids delayed wallet interactions and enhances user experience.

Technical Changes:

  • Added new validation logic in accordance with ERC-6942 standards.
  • Ensured backward compatibility with already deployed contracts.

Changes Made:

  • Added signature verification logic compatible with ERC-6942.
  • Updated the isValidateSignature() method to support both deployed and pre-deployed contract signatures.
  • Comprehensive testing for deployed and pre-deployed wallet scenarios.

Why This Change? Some smart contract wallets only deploy upon the first transaction. With ERC-6942, we can validate signatures before deployment, ensuring users experience seamless wallet interactions.

This diagram shows the two flows:

Deployed Contract: Traditional signature verification for deployed wallets.
Pre-Deployed Contract (ERC-6942): Signature verification for wallets that haven't been deployed yet.

eip6492 drawio

universal validator ref: https://github.com/AmbireTech/signature-validator/blob/main/index.ts#L32

Copy link

vercel bot commented Oct 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vue-web-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 10:19am

Copy link

vercel bot commented Oct 10, 2024

@guru-web3 is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@ganchoradkov ganchoradkov left a comment

Choose a reason for hiding this comment

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

thanks for the PR, You're awesome! Left comments for two required changes 💯

advanced/dapps/react-dapp-v2/next.config.js Outdated Show resolved Hide resolved
advanced/dapps/react-dapp-v2/src/helpers/eip1271.ts Outdated Show resolved Hide resolved
@guru-web3
Copy link
Author

@ganchoradkov have addressed the comments, review when free please
thanks 🙏

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