prototype for a generic ERC7579 recovery module #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
see #66
Approach
This prototype preserves the initial flow of the recovery module with some modifications.
In order to make the recovery module more generic for multiple guardian types, this prototype separates the guardian verification mechanism from the recovery module contract which makes the core recovery module much more simpler. This separation allows for greater flexibility in supporting different kinds of guardians. For example, a user could choose to use a P-256 public key as a guardian, an EOA etc.
Smart contract changes
bytes
to support multiple types usingabi.encode(...)
.Some example verifiers where created, such as
EmailGuardianVerifier.sol
andEDCSAGuardianVerifier.sol
to demonstrate what the interface for guardian verifiers would look like (EmailGuardianVerifier.sol
has not been tested; it is included only to illustrate how it could be implemented as a separate verifier).Testing
The prototype tests demonstrate a happy path for recovering a validator using a direct EOA (msg.sender), ECDSA signatures, and a combination of both.
to run tests:
forge test --match-path 'test/prototype/**/*.t.sol'
all changes can be found in
src/prototype/*
andtest/prototype/*