Overview
The timelock mechanism (24-48 hours) is useless without notifications. Users must be alerted when security-critical actions are proposed so they can cancel malicious actions within the timelock window.
This is the most critical security improvement for EthAura.
Problem Statement
Current State:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Attacker │ │ 48-hour │ │ User doesn't │
│ proposes new │ ──► │ timelock │ ──► │ check app │
│ passkey │ │ starts │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Account │
│ takeover! │
└─────────────────┘
Risk: If a user doesn't manually check the app during the 48-hour window, the attacker succeeds.
Solution
Proposed State:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Attacker │ │ 48-hour │ │ User receives │
│ proposes new │ ──► │ timelock │ ──► │ email/push │
│ passkey │ │ starts │ │ notification │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ User cancels │
│ from any device │
└─────────────────┘
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Notification System │
├─────────────────────────────────────────────────────────────────┤
│ │
│ On-Chain Events Indexer/Backend User Alerts │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ ActionProp- │ ───► │ Event │ ───► │ Email │ │
│ │ osed(...) │ │ Listener │ │ Push │ │
│ │ RecoveryIn- │ │ │ │ SMS │ │
│ │ itiated(..) │ │ │ │ Telegram │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Events to Monitor
| Event |
Priority |
Message |
ActionProposed |
🔴 Critical |
"Passkey update proposed. If not you, cancel within 48h" |
RecoveryInitiated |
🔴 Critical |
"Recovery started. If not you, cancel within 24h" |
RecoveryApproved |
🟠 High |
"Guardian approved recovery" |
GuardianAdded |
🟠 High |
"New guardian added to your account" |
GuardianRemoved |
🟠 High |
"Guardian removed from your account" |
ActionExecuted |
🟡 Medium |
"Passkey successfully updated" |
ActionCancelled |
🟢 Info |
"Proposed action was cancelled" |
Implementation Phases
Phase 1: Backend Event Indexer
Phase 2: Email Notifications
Phase 3: Push Notifications
Phase 4: Frontend Integration
Phase 5: Additional Channels (Optional)
User Settings UI
┌─────────────────────────────────────────────────────────────────┐
│ Security Notifications │
│ │
│ Get notified about security-critical events: │
│ │
│ ☑ Email ([email protected]) [Change Email] │
│ ☑ Push notifications [Test] │
│ ☐ SMS (+1 555-0123) [Add Phone] │
│ ☐ Telegram (@username) [Connect] │
│ │
│ Alert Types: │
│ ☑ Passkey changes (proposed/executed) │
│ ☑ Recovery attempts │
│ ☑ Guardian changes │
│ ☐ All transactions (high volume) │
│ │
└─────────────────────────────────────────────────────────────────┘
Email Template Example
Subject: ⚠️ Security Alert: Passkey Update Proposed for Your EthAura Account
------------------------------------------------------------------
A passkey update has been proposed for your account:
Account: 0x1234...5678
Proposed at: 2024-01-15 10:30 UTC
Executable after: 2024-01-17 10:30 UTC (48 hours)
IF THIS WAS NOT YOU:
Cancel immediately: https://app.ethaura.io/cancel/0xactionhash
This action will replace your passkey. If an attacker proposed
this, they will gain full control of your account.
Time remaining to cancel: 47 hours 30 minutes
------------------------------------------------------------------
You received this because you have security alerts enabled.
Manage preferences: https://app.ethaura.io/settings/notifications
Technical Considerations
Event Indexing Options
-
Self-hosted indexer (The Graph, Ponder, or custom)
- Pro: Full control, no third-party dependency
- Con: Infrastructure cost
-
Third-party service (Alchemy Webhooks, QuickNode Streams)
- Pro: No infrastructure needed
- Con: Vendor dependency
-
Hybrid (third-party webhook → our notification service)
- Pro: Best of both worlds
- Con: More complexity
Database Schema
-- User notification preferences
CREATE TABLE notification_preferences (
account_address VARCHAR(42) PRIMARY KEY,
email VARCHAR(255),
email_verified BOOLEAN DEFAULT FALSE,
push_enabled BOOLEAN DEFAULT FALSE,
push_subscription JSONB,
phone VARCHAR(20),
telegram_chat_id VARCHAR(50),
created_at TIMESTAMP,
updated_at TIMESTAMP
);
-- Sent notifications (for deduplication)
CREATE TABLE sent_notifications (
id SERIAL PRIMARY KEY,
account_address VARCHAR(42),
event_type VARCHAR(50),
tx_hash VARCHAR(66),
channel VARCHAR(20),
sent_at TIMESTAMP,
UNIQUE(account_address, event_type, tx_hash, channel)
);
Acceptance Criteria
Security Considerations
- Email verification required before sending alerts
- Cancel links should require re-authentication (passkey)
- Rate limit notifications to prevent DoS
- Don't expose sensitive data in notification content
- Secure webhook endpoints
Estimated Effort
- Backend indexer + email: 1 week
- Push notifications: 3-4 days
- Frontend settings UI: 2-3 days
- Testing + polish: 2-3 days
Total: 2-3 weeks
Dependencies
- P256Account events already emit correctly ✅
- Backend infrastructure (Node.js/Python service)
- Email service (SendGrid, AWS SES)
- Push service (Firebase, OneSignal)
Related Issues
Overview
The timelock mechanism (24-48 hours) is useless without notifications. Users must be alerted when security-critical actions are proposed so they can cancel malicious actions within the timelock window.
This is the most critical security improvement for EthAura.
Problem Statement
Risk: If a user doesn't manually check the app during the 48-hour window, the attacker succeeds.
Solution
Architecture
Events to Monitor
ActionProposedRecoveryInitiatedRecoveryApprovedGuardianAddedGuardianRemovedActionExecutedActionCancelledImplementation Phases
Phase 1: Backend Event Indexer
Phase 2: Email Notifications
Phase 3: Push Notifications
Phase 4: Frontend Integration
Phase 5: Additional Channels (Optional)
User Settings UI
Email Template Example
Technical Considerations
Event Indexing Options
Self-hosted indexer (The Graph, Ponder, or custom)
Third-party service (Alchemy Webhooks, QuickNode Streams)
Hybrid (third-party webhook → our notification service)
Database Schema
Acceptance Criteria
Security Considerations
Estimated Effort
Total: 2-3 weeks
Dependencies
Related Issues