Multisig Wallet Creation

Overview

Wafra implements a Gnosis Safe multisig wallet system that combines server-controlled keys with user WebAuthn passkeys for secure, user-friendly wallet management. The system uses an async task-based approach for wallet deployment, ensuring reliable creation even under high load conditions.

Wallet Architecture

Three-Key Configuration

Key Types and Purposes:

  • Controller Key: Server-controlled key stored in encrypted format for transaction validation and co-signing
  • User Passkey: WebAuthn hardware-backed key derived from user’s device biometrics for authorization
  • Backup Key: Recovery key derived from user password for emergency access and device loss scenarios
  • Threshold: 2-of-3 signature required (any two keys can authorize transactions)

Security Benefits:

  • No single point of failure - keys distributed across multiple entities
  • Hardware-backed security through passkey integration
  • Server validation prevents malicious transactions
  • Recovery mechanism for lost devices
  • Biometric authentication for user-friendly security

Safe Configuration

Current Deployment Parameters:

  • Version: Gnosis Safe 1.4.1
  • Network: Base L2 for low-cost transactions
  • Owners: Three addresses (controller, passkey-derived, backup)
  • Threshold: 1 signature required for execution
  • Deployment: Async task-based with retry logic

Async Wallet Creation Process

Step-by-Step Flow

1. User Registration Phase

  • User completes phone number verification
  • Basic profile information collection
  • Password creation for backup key derivation
  • Terms and conditions acceptance

2. Async Safe Deployment Trigger

  • System generates controller and backup keys
  • Creates async task for Safe deployment
  • User receives confirmation of registration
  • Background deployment begins immediately

3. Safe Deployment Task Processing

  • Task processor retrieves deployment parameters
  • Gnosis Safe deployment transaction creation
  • Transaction submission to Base network
  • Deployment confirmation and address recording
  • Event logging for audit trail

4. Passkey Registration Flow

  • User initiates passkey setup in mobile app
  • WebAuthn challenge generation and response
  • Hardware-backed key pair creation
  • Public key extraction and address derivation
  • Passkey verifier contract deployment

5. Passkey Addition to Safe

  • Async task creation for adding passkey to Safe
  • Owner addition transaction preparation
  • Transaction execution with controller key
  • Safe configuration update confirmation
  • Wallet activation and user notification

6. Verification and Activation

  • Test transaction execution capability
  • Passkey signature validation
  • Controller co-signing verification
  • Final wallet status confirmation

Technical Implementation Details

Async Task System Benefits:

  • Reliable deployment under high load
  • Comprehensive error handling and retry logic
  • Progress tracking and status updates
  • Audit trail for debugging and compliance
  • Separation of user experience from blockchain latency

Safe Deployment Configuration: The Safe is deployed with the controller and backup addresses as initial owners, with the passkey address added after successful passkey registration. This ensures the wallet is functional even if passkey registration encounters issues.

Error Handling and Recovery:

  • Failed deployments trigger automatic retries
  • Task status tracking enables manual intervention
  • Event logging provides detailed error diagnostics
  • Partial deployment recovery mechanisms

Passkey Integration

WebAuthn Implementation

Passkey Registration Process: The system uses WebAuthn standards for hardware-backed authentication, creating a P-256 elliptic curve key pair stored in the device’s Secure Enclave or TPM.

Address Derivation from Passkey: The Ethereum address is derived from the P-256 public key coordinates using standard cryptographic methods, ensuring deterministic address generation from the same passkey.

Security Features:

  • Hardware-backed private key storage
  • Biometric verification (Face ID, Touch ID, fingerprint)
  • Origin-bound credentials preventing phishing attacks
  • Device-specific keys for additional security
  • Anti-tampering hardware protection

Passkey Verifier Contract: A specialized contract is deployed to handle passkey signature verification, enabling the Safe to validate signatures from WebAuthn credentials using P-256 cryptography.

Multi-Device Support

Device Management:

  • Users can register multiple passkeys across different devices
  • Each device maintains its own hardware-backed key
  • Device approval workflow for adding new trusted devices
  • Remote device revocation capabilities

Cross-Platform Compatibility:

  • iOS Secure Enclave integration
  • Android Hardware Security Module support
  • Windows Hello and macOS Touch ID compatibility
  • Fallback to platform PIN/password authentication

Security Model

Multi-Layer Protection

Defense in Depth Strategy:

  • Hardware-backed passkey security
  • Server-side transaction validation
  • Encrypted backup key storage
  • Audit logging for all operations
  • Network-level DDoS protection

Threat Mitigation:

  • Device Loss: Backup key enables recovery without seed phrases
  • Server Compromise: Passkey required for transaction authorization
  • Phishing: WebAuthn origin-binding prevents credential theft
  • Social Engineering: Hardware keys resist remote compromise
  • Malicious Transactions: Server validation before co-signing

Key Distribution Benefits:

  • No single entity controls user funds
  • User maintains ultimate control through passkey
  • Server provides convenience and validation
  • Backup enables recovery in emergency situations

Transaction Authorization Flow

Signature Requirements: Currently using 1-of-3 threshold for operational efficiency while maintaining security through distributed key management and server-side validation.

Authorization Process:

  1. User initiates transaction through mobile app
  2. Passkey signature required for user authorization
  3. Server validates transaction parameters and intent
  4. Controller key provides co-signature if validation passes
  5. Transaction execution on Gnosis Safe contract

Recovery Mechanisms

Backup Key System

Recovery Process for Lost Devices:

  1. User contacts support with identity verification
  2. Multi-factor identity confirmation through various channels
  3. Backup key activation using encrypted private key
  4. New passkey registration on replacement device
  5. Safe owner update to include new passkey address
  6. Previous passkey removal from Safe configuration

Identity Verification Requirements:

  • Phone number verification
  • Email confirmation
  • Personal information validation
  • Potential video call verification for high-value accounts
  • Time delays for additional security

Security Considerations:

  • Backup key stored with strong encryption
  • Recovery process includes mandatory waiting periods
  • Multiple verification steps prevent unauthorized access
  • Complete audit trail for all recovery operations

Emergency Procedures

Rapid Response Capabilities:

  • Immediate passkey revocation for compromised devices
  • Emergency pause functionality for suspicious activity
  • Backup key activation for time-sensitive situations
  • Support team override capabilities with proper authorization

Business Continuity:

  • Multiple recovery pathways prevent permanent lockout
  • Automated backup systems for key storage
  • Geographic distribution of backup infrastructure
  • Regular disaster recovery testing and validation

Performance and Monitoring

Wallet Creation Metrics

Performance Tracking:

  • Average wallet creation time from registration to activation
  • Task completion rates and retry statistics
  • Passkey registration success rates across device types
  • Network congestion impact on deployment timing
  • User experience metrics and conversion rates

Error Monitoring:

  • Failed deployment analysis and resolution
  • Passkey registration issues by device platform
  • Network-related deployment failures
  • User abandonment points in creation flow
  • Support ticket volume and resolution times

Security Monitoring:

  • Failed registration attempt patterns
  • Unusual device registration behaviors
  • Recovery request frequency and success rates
  • Duplicate address generation detection
  • Anomalous transaction authorization patterns

Operational Analytics

Real-Time Monitoring:

  • Active wallet creation attempts
  • Task queue depth and processing times
  • Blockchain network status and gas prices
  • System resource utilization and scaling needs
  • User support queue and response times

Long-Term Analytics:

  • Wallet creation trends and seasonal patterns
  • Device platform adoption and success rates
  • Security incident frequency and resolution
  • User retention and engagement metrics
  • Cost analysis for deployment and operations

Future Enhancements

Planned Security Improvements

Enhanced Multisig Options:

  • Configurable threshold settings (1-of-3, 2-of-3, 3-of-3)
  • User choice in security vs convenience trade-offs
  • Hardware wallet integration as additional owners
  • Time-locked transactions for enhanced security

Advanced Recovery Features:

  • Social recovery through trusted contacts
  • Multi-party recovery with distributed verification
  • Biometric backup using multiple identification methods
  • Compliance-integrated recovery for regulated users

Scalability Enhancements:

  • Batch wallet deployment for improved efficiency
  • Layer 2 optimization for lower deployment costs
  • Multi-chain wallet creation across different networks
  • Enhanced task processing for higher throughput

Technology Roadmap

Smart Contract Upgrades:

  • Enhanced passkey verification contracts
  • Gas optimization for common operations
  • Advanced security modules and plugins
  • Cross-chain compatibility and bridge integration

Infrastructure Improvements:

  • Hardware Security Module integration for enterprise users
  • Distributed key generation for enhanced security
  • AI-powered anomaly detection for wallet security
  • Automated compliance reporting and audit trails

This async multisig wallet creation system provides enterprise-grade security while maintaining the simplicity and reliability users expect from modern financial applications. The combination of hardware-backed security, distributed key management, and robust recovery mechanisms ensures both security and accessibility for all users.