Skip to content

Repository files navigation

๐Ÿ›ก๏ธ gresistor - Gnosis Resilient Storage

A robust, decentralized backup system for wallet profile data using Shamir Secret Sharing and multiple storage backends.

๐Ÿš€ Live Demo: https://scbuergel.github.io/gresistor/

Last updated: July 2025


โœจ Features

โœ… Implemented

  • ๐Ÿ” Shamir Secret Sharing - Split sensitive data into configurable N-of-M threshold schemes
  • ๐Ÿ  Local Browser Storage - Full support for IndexedDB-based storage with multiple service management
  • ๐Ÿ”’ AES-256-GCM Encryption - Client-side encryption ensures complete data privacy
  • ๐ŸŒ Browser-First Design - Works entirely in the browser with no server dependencies
  • โšก Zero-Trust Architecture - Your keys never leave your device unencrypted
  • ๐ŸŽจ React UI - Complete user interface for backup, restore, and configuration
  • ๐Ÿ“š TypeScript Library - Full core library with backup/restore logic

๐Ÿšง Planned / In Development

  • ๐ŸŒ Remote Storage Backends - IPFS and Swarm integration (API stubs ready)
  • ๐Ÿ›ก๏ธ Safe Wallet Integration - EIP-712 signature validation and EIP-1271 support (structure in place)
  • ๐Ÿš€ Remote Key-Backup Service - Secure shard storage with Safe authentication (server framework ready)
  • ๐Ÿ”’ Privacy Routing - Enhanced anonymity features
  • ๐Ÿ”ง Additional Encryption Options - ChaCha20-Poly1305 and AES-GCM-SIV algorithms
  • ๐Ÿ“Š Advanced Nonce Strategies - Counter-based and XChaCha20 192-bit nonces

๐Ÿ—๏ธ Architecture

This project is organized as a monorepo with the following packages:

๐Ÿ“ฆ gresistor/
โ”œโ”€โ”€ ๐Ÿ“š packages/library/     # โœ… Core TypeScript library (IMPLEMENTED)
โ”œโ”€โ”€ ๐ŸŽจ packages/ui/          # โœ… React-based user interface (IMPLEMENTED)
โ””โ”€โ”€ ๐Ÿš€ services/key-backup/  # ๐Ÿšง Express.js backend for remote storage (PLANNED)

Current Implementation Status

Component Status Description
Core Library โœ… Complete Encryption, Shamir sharing, local storage
React UI โœ… Complete Backup, restore, and configuration interfaces
Local Storage โœ… Complete IndexedDB with multi-service management
Remote Storage ๐Ÿšง API Only Swarm/IPFS interfaces defined but not implemented
Safe Integration ๐Ÿšง Stubs EIP-712/EIP-1271 structure in place
Key-Backup Service ๐Ÿšง Framework Express server with route stubs

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm 8+

Installation

# Clone the repository
git clone https://github.com/SCBuergel/gresistor.git
cd gresistor

# Install dependencies
pnpm install

Development

# Start all services
pnpm dev

This launches:

  • ๐ŸŽจ UI Server โ†’ http://localhost:3000 (fully functional)
  • ๐Ÿš€ Backend Service โ†’ http://localhost:3001 (framework only)

Production Build

# Build for production
pnpm run deploy

Testing

Setup

Playwright browsers are automatically installed when you run:

# Install all dependencies (includes Playwright browsers)
pnpm install

Running Tests

# Run end-to-end tests with MetaMask integration
pnpm test

# Run with pause mode (pauses at strategic points for inspection)
pnpm test:pause

# Run local app tests only (excludes wallet interactions)
pnpm test:offchain

# Run local app tests in headed mode (browser visible)
pnpm test:offchain:headed

# Run local app tests with pause mode (headed + pauses for debugging)
pnpm test:offchain:pause

Test Types:

  • Full E2E (pnpm test): Complete workflow with MetaMask/Safe integration
  • Offchain (pnpm test:offchain): Local app functionality only, faster for development
  • Headed modes: Add :headed for visible browser, :pause for debugging

Troubleshooting

If tests fail with browser launch errors:

  • Try manually reinstalling Chromium: pnpm exec playwright install chromium
  • Check that you're running on a system that supports headed browsers (tests require GUI)
  • Ensure you have sufficient disk space for browser installation

๐Ÿ› ๏ธ Available Commands

๐Ÿš€ Development Commands

# Start all services in parallel development mode
pnpm dev

# Clean development start (removes cache first)
pnpm dev:clean

# Stop all development processes
pnpm kill-dev

๐Ÿ—๏ธ Build Commands

# Build all packages
pnpm build

# Build only UI packages (library + UI)
pnpm build:ui

# Deploy build (alias for build:ui)
pnpm deploy

๐Ÿ”ง Utility Commands

# Clean build artifacts and cache
pnpm clean:cache

# Kill processes on development ports
pnpm kill-ports

# Run linting across all packages
pnpm lint

๐Ÿ“– How It Works

Current Workflow (Local Storage)

  1. ๐Ÿ”ง Configure Storage - Set up local browser storage services in the Config tab
  2. ๐Ÿ’พ Create Backup - Enter your sensitive data and configure N-of-M parameters
  3. โœ‚๏ธ Generate Shares - System splits data using AES-256-GCM + Shamir Secret Sharing
  4. ๐Ÿ  Store Locally - Shards distributed across multiple IndexedDB services
  5. ๐Ÿ”„ Restore Data - Collect required threshold of shards to reconstruct original data

Planned Workflow (Remote Storage)

  1. ๐ŸŒ Configure Backends - Choose from IPFS, Swarm, or remote key services
  2. ๐Ÿ›ก๏ธ Safe Authentication - Sign EIP-712 messages for secure shard requests
  3. ๐Ÿ“ค Distributed Storage - Upload encrypted blob and shards to different services
  4. ๐Ÿ” Secure Retrieval - Authenticate with Safe to retrieve and reconstruct data

๐Ÿ› ๏ธ Technology Stack

โœ… Currently Used

  • Frontend: React + TypeScript + Vite
  • Crypto: Web Crypto API + shamirs-secret-sharing
  • Storage: IndexedDB (browser-native)
  • Build: pnpm workspaces
  • Testing: Playwright + Dappwright (E2E wallet simulation)

๐Ÿšง Planned Integration

  • Backend: Express.js + Node.js
  • Remote Storage: IPFS, Swarm APIs
  • Blockchain: Safe SDK, EIP-712/EIP-1271
  • Privacy: Enhanced anonymity protocols
  • CI/CD: GitHub Actions

๐Ÿ”’ Security Model

Current Implementation

  • AES-256-GCM encryption with 96-bit random nonces
  • Shamir Secret Sharing with user-configurable N-of-M thresholds
  • Browser-only execution - no server-side key handling
  • Multiple storage services for redundancy within browser

Planned Enhancements

  • EIP-712 signature validation for shard requests
  • Safe multisig authentication via EIP-1271
  • Transport-layer privacy via enhanced routing protocols
  • Hardware security module support for enterprise deployments

๐ŸŽฏ Development Roadmap

Phase 1: Core Foundation โœ… COMPLETE

  • TypeScript library with Shamir sharing
  • AES-256-GCM encryption
  • Local browser storage
  • React UI components

Phase 2: Remote Storage ๐Ÿšง IN PROGRESS

  • IPFS backend implementation
  • Swarm backend implementation
  • Remote service API completion
  • Integration testing

Phase 3: Safe Integration ๐Ÿ“‹ PLANNED

  • EIP-712 message signing
  • EIP-1271 signature verification
  • Safe SDK integration
  • Multi-owner authentication

Phase 4: Privacy & Enterprise ๐Ÿ”ฎ FUTURE

  • Enhanced privacy transport layers
  • Alternative encryption algorithms
  • Hardware security modules
  • Enterprise key management

๐Ÿ“„ License

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


๐Ÿค Contributing

This project is actively being developed. The core library and UI are functional for local storage use cases.

Current priorities:

  1. Complete IPFS/Swarm storage backend implementations
  2. Implement Safe wallet authentication features
  3. Build out the remote key-backup service functionality

See the roadmap above for detailed development phases.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages