Skip to content

Latest commit

Β 

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SentinelX

Decentralized Account Recovery for Casper Network

License: MIT Casper Network TypeScript Next.js

SentinelX enables trustless account recovery through threshold-based guardianship. Designate trusted friends as guardians who can collectively help you recover access if you lose your private key.

frontend https://sentinelx-3h81.onrender.com/
backend https://guardian-recovery-protocol.onrender.com

Screenshots

alt text alt text alt text alt text

Features

  • πŸ›‘οΈ Guardian-Based Recovery β€” Your trusted contacts act as recovery guardians
  • πŸ” Threshold Signatures β€” Requires M-of-N guardian consensus (e.g., 2 of 3)
  • βœ… On-Chain Verification β€” All signatures verified by smart contract
  • πŸ”„ Replay Protection β€” Nonce and timestamp validation
  • πŸ“§ Email Notifications β€” Guardians receive approval requests via email

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              FRONTEND                                    β”‚
β”‚                     Next.js 15 + React 19 + TailwindCSS                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Landing β”‚  β”‚  Setup   β”‚  β”‚ Recovery β”‚  β”‚Dashboard β”‚  β”‚  Admin   β”‚  β”‚
β”‚  β”‚   Page   β”‚  β”‚  Wizard  β”‚  β”‚   Flow   β”‚  β”‚  Panel   β”‚  β”‚  Panel   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚ HTTP/REST
                                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              BACKEND                                     β”‚
β”‚                   Node.js + Express + TypeScript                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Recovery   β”‚  β”‚   Session    β”‚  β”‚   Account    β”‚  β”‚   Email     β”‚  β”‚
β”‚  β”‚   Service    β”‚  β”‚   Service    β”‚  β”‚   Service    β”‚  β”‚   Service   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                    β”‚                                β”‚
         β–Ό                    β–Ό                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    SUPABASE     β”‚  β”‚  CASPER NETWORK β”‚              β”‚   SMTP SERVER   β”‚
β”‚   (PostgreSQL)  β”‚  β”‚    (Testnet)    β”‚              β”‚   (Nodemailer)  β”‚
β”‚                 β”‚  β”‚                 β”‚              β”‚                 β”‚
β”‚  - users        β”‚  β”‚  - Contracts    β”‚              β”‚  - Notificationsβ”‚
β”‚  - recoveries   β”‚  β”‚  - Deploys      β”‚              β”‚  - Approvals    β”‚
β”‚  - deploys      β”‚  β”‚  - Signatures   β”‚              β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          SMART CONTRACTS                                 β”‚
β”‚                          Rust + Casper SDK                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                     recovery_registry                            β”‚   β”‚
β”‚  β”‚         (Guardian Management & Recovery Coordination)            β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  add_key    β”‚ β”‚ remove_key  β”‚ β”‚  update_    β”‚ β”‚ key_rotation    β”‚   β”‚
β”‚  β”‚   .wasm     β”‚ β”‚   .wasm     β”‚ β”‚ thresholds  β”‚ β”‚    .wasm        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Recovery Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   1. SETUP   │────▢│  2. INITIATE │────▢│  3. APPROVE  β”‚
β”‚              β”‚     β”‚              β”‚     β”‚              β”‚
β”‚ User adds    β”‚     β”‚ Guardian     β”‚     β”‚ Guardians    β”‚
β”‚ guardians    β”‚     β”‚ starts       β”‚     β”‚ sign until   β”‚
β”‚ to account   β”‚     β”‚ recovery     β”‚     β”‚ threshold    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                 β”‚
                                                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  6. DONE!    │◀────│  5. EXECUTE  │◀────│   4. WAIT    β”‚
β”‚              β”‚     β”‚              β”‚     β”‚              β”‚
β”‚ Account      β”‚     β”‚ Key rotation β”‚     β”‚ 30-day       β”‚
β”‚ recovered    β”‚     β”‚ on-chain     β”‚     β”‚ safety       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology Purpose
Frontend Next.js 15, React 19, TypeScript Web application
Styling TailwindCSS 4, shadcn/ui, Radix UI UI components
Backend Node.js, Express, TypeScript API server
Database Supabase (PostgreSQL) Data persistence
Blockchain casper-js-sdk Casper integration
Contracts Rust, Casper SDK On-chain logic
Email Nodemailer Guardian notifications

Project Structure

guardian-recovery-protocol/
β”œβ”€β”€ contracts/                 # Rust smart contracts
β”‚   β”œβ”€β”€ recovery_registry/     # Main coordination contract
β”‚   β”œβ”€β”€ add_associated_key/    # Add key session WASM
β”‚   β”œβ”€β”€ remove_associated_key/ # Remove key session WASM
β”‚   β”œβ”€β”€ update_thresholds/     # Update thresholds WASM
β”‚   └── wasm/                  # Compiled WASM output
β”‚
β”œβ”€β”€ backend/                   # Express API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”œβ”€β”€ routes/            # API endpoints
β”‚   β”‚   └── config/            # Configuration
β”‚   β”œβ”€β”€ sql/                   # Database migrations
β”‚   └── wasm/                  # Session WASMs for deploys
β”‚
└── frontend/                  # Next.js application
    β”œβ”€β”€ app/                   # App router pages
    β”‚   β”œβ”€β”€ setup/             # Guardian setup
    β”‚   β”œβ”€β”€ recovery/          # Recovery initiation
    β”‚   β”œβ”€β”€ dashboard/         # Guardian dashboard
    β”‚   └── admin/             # Contract deployment
    β”œβ”€β”€ components/            # React components
    └── lib/                   # Utilities

Quick Start

Prerequisites

  • Node.js 18+
  • Rust (for contracts)
  • Casper Wallet browser extension
  • Supabase account

Installation

# Clone repository
git clone https://github.com/crypticsaiyan/guardian-recovery-protocol.git
cd guardian-recovery-protocol

# Build contracts
cd contracts
make prepare && make build

# Start backend (Terminal 1)
cd ../backend
npm install
cp .env.example .env    # Configure your environment
npm run dev             # Runs on http://localhost:3001

# Start frontend (Terminal 2)
cd ../frontend
npm install
npm run dev             # Runs on http://localhost:3000

Environment Setup

Backend (backend/.env):

CASPER_NODE_URL=https://rpc.testnet.casperlabs.io/rpc
CASPER_CHAIN_NAME=casper-test
SUPABASE_URL=your-supabase-url
SUPABASE_SERVICE_ROLE_KEY=your-service-key
SMTP_HOST=smtp.gmail.com
SMTP_USER=your-email
SMTP_PASS=your-app-password
WASM_RECOVERY_KEY_ROTATION_PATH
WASM_RECOVERY_REGISTRY_PATH

Security

Protection Description
Account Isolation Guardian keys are bound to specific accounts
Threshold Enforcement Single guardian cannot recover alone
Time-Lock 30-day delay before execution
Replay Prevention Nonce and timestamp validation
On-Chain Verification All signatures verified by smart contract

License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❀️ on Casper Network

About

Decentralized account recovery through threshold-based guardianship on Casper Network. Your Keys, Your Friends, Your Recovery

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages