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

docs: zk email recovery module #53

Merged
merged 7 commits into from
Feb 6, 2025
Merged

Conversation

saugardev
Copy link
Contributor

@saugardev saugardev commented Jan 23, 2025

ZK Email Recovery Module Documentation

Copy link

vercel bot commented Jan 23, 2025

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 6:44pm

Copy link
Contributor

@JohnGuilding JohnGuilding left a comment

Choose a reason for hiding this comment

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

Great thanks for this Saul! Left some comments

Apart from comments on email-recovery.mdx, all very small suggestions

pages/module-sdk/modules/email-recovery.mdx Show resolved Hide resolved

## How it works

Email Recovery is a executor module that enables account recovery through email verification. When a guardian is set, their email address is hashed and stored on-chain. During recovery, the guardian's email response generates a ZK proof that validates against this stored hash, allowing them to authorize changes to validator configurations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we mention the random account code as this sounds insecure just reading that the email is hashed


## Getting started

To enable email recovery, you need to install the Email Recovery module. Once installed, configure the recovery settings by setting a guardian email and timelock duration — this creates a delay period between when guardians approve recovery and when it can be executed, providing security against malicious recovery attempts.
Copy link
Contributor

Choose a reason for hiding this comment

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

Once installed, configure the recovery settings by setting a guardian email and timelock duration

Configuration is done in the same step as installation here instead of a separate step

this creates a delay period between when guardians approve recovery and when it can be executed, providing security against malicious recovery attempts.

It's not clear "this" refers to the timelock, can you add emphasis that this sentence is referencing timelock.

Also if we're explaining the config in detail. Could we either:

  1. Explain all of it
  2. Point to where it is all explained
  3. Not go into detail on the delay period here


To enable email recovery, you need to install the Email Recovery module. Once installed, configure the recovery settings by setting a guardian email and timelock duration — this creates a delay period between when guardians approve recovery and when it can be executed, providing security against malicious recovery attempts.

The system will automatically send verification emails to each guardian. Guardians must confirm their role by simply replying to this verification email. This ensures guardians are aware of their responsibility and have access to the email account.
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of "system", can you mention something along the lines of "ZK Email infrastructure" or "relayer infrastructure"

@@ -0,0 +1,21 @@
# CANCEL_EXPIRED_RECOVERY_COOLDOWN

Returns the cooldown period that prevents a guardian from initiating another recovery request after their previous request expired.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Returns the cooldown period that prevents a guardian from initiating another recovery request after their previous request expired.
Returns the cooldown period after which a subsequent recovery attempt can be initiated by the same guardian. This helps prevent guardians threatening the liveness of recovery attempts by submitting malicious recovery hashes before honest guardians correctly submit theirs.


- Type: `bigint`

Template index parameter (unused in current implementation).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Template index parameter (unused in current implementation).
Template index parameter.


Object containing:
- `delay`: The delay period before recovery can be executed
- `expiry`: The timestamp when the recovery configuration expires
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `expiry`: The timestamp when the recovery configuration expires
- `expiry`: The timestamp when a recovery request expires


- Type: [`Address`](https://viem.sh/docs/glossary/types#address)

The address of the validator contract that will verify email signatures.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The address of the validator contract that will verify email signatures.
The address of the validator contract that will be initially configured for recovery


- Type: [`Hex`](https://viem.sh/docs/glossary/types#hex)

Context data used to check if the module is installed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Context data used to check if the module is installed.
Additional context that may be required to determine if the module is installed.


- Type: [`Hex`](https://viem.sh/docs/glossary/types#hex)

The initial function selector for the recovery process.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The initial function selector for the recovery process.
The function selector to allow when executing recovery for the specified module.

Copy link
Contributor

@JohnGuilding JohnGuilding left a comment

Choose a reason for hiding this comment

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

Thanks Saul, left a nitpick for CANCEL_EXPIRED_RECOVERY_COOLDOWN

…tFromRecoveryCommand.mdx

Co-authored-by: John Guilding <[email protected]>
@kopy-kat kopy-kat merged commit 5eeaab9 into rhinestonewtf:main Feb 6, 2025
2 checks passed
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.

3 participants