Skip to content

Add EIP-7702 support#104

Open
Agusx1211 wants to merge 5 commits intomasterfrom
7702
Open

Add EIP-7702 support#104
Agusx1211 wants to merge 5 commits intomasterfrom
7702

Conversation

@Agusx1211
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/Stage7702Module.sol Outdated
Comment thread src/modules/auth/Stage7702Auth.sol

/// @title Stage7702Auth
/// @author Agustin Aguilar
/// @notice EIP-7702 version auth contract (single stage)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This pattern prevents cross chain counterfactual implementation upgrades. e.g. Upgrade to wallet v4 would need to be another delegation signature per chain.

We could delegate to a Wallet proxy instead of directly to the implementation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If we do this, Stage7702Auth could act like Stage1Auth providing only counterfactual auth, and we upgrade the implementation to Stage2 when the image hash is no longer counterfactual. As per the existing flow.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did consider delegating to a proxy, but keep in mind that it wouldn't be as simple as delegating into an existing wallet proxy. Stage1 uses the self address to verify the counterfactual configuration, in 7702 this would end up being the EOA address, which has no counterfactual info. Doing the proxy directly to the Stage2 doesn't work either, because it needs setup, and we don't have a clean way of setting it up.

In order to make it work we would need to write a Stage1-7702 special contract, that verifies the imageHash by first loading the code from the EOA, then with that fetching the address of the proxy, and verifying the counterfactual data against that address, possible but imho a bit ugly.

My thinking is, at the end of the day 7702 is already a proxy, updating a 7702 wallet can be done by signing a new authorization, there is no need to add another layer and mechanism that does exactly the same, it increases gas on every transactions for what in my mind is no gain.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The feature miss with the current approach is we can't use a single signature for cross chain implementation upgrades, since 7702 doesn't use chain id = 0 as any chain. We will end up with the same pain we have for v1 wallet migrations.

Comment thread src/modules/auth/Stage7702Auth.sol Outdated
Agusx1211 and others added 2 commits April 13, 2026 09:45
Co-authored-by: Michael Standen <mstan@horizon.io>
@Agusx1211 Agusx1211 requested a review from ScreamingHawk April 13, 2026 08:52
Copy link
Copy Markdown
Collaborator

@ScreamingHawk ScreamingHawk left a comment

Choose a reason for hiding this comment

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

Approved.
I think the cross chain implementation upgrade concern is still valid. If we are happy to wear this risk for v4 then 👍

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