Skip to content

PurroWallet/purro-extension

Repository files navigation

🐱 Purro - The Purr-fect Web3 Wallet

Purro is a native-first wallet crafted for the Hyperliquid and HyperEVM ecosystems. Built with practical UX, developer enablement, and deep protocol alignment in mind.

Version License: CC BY-NC-ND 4.0 Discord

🎯 Overview

Purro is a frictionless liquidity access layer for Hyperliquid + HyperEVMβ€”not just a key manager. Built on Alchemy infrastructure and Hyper-native primitives (names, gasless flows), Purro prioritizes intent-driven UX and developer extensibility.

🌟 Key Highlights

  • Native Hyperliquid Integration: Built specifically for Hyperliquid and HyperEVM ecosystems
  • Gasless Workflows: Zero-fee transactions with native relayers (no HYPE needed)
  • Unified Portfolio: Seamless view across Hyperliquid L1 and HyperEVM
  • Developer-First: Standards-compliant provider and SDK modules
  • Multichain-Ready: Designed to extend to Ethereum, Arbitrum, Base, Solana, and Sui

✨ Features

πŸ” Secure Wallet Management

  • Create new wallet with 12-word seed phrase
  • Import wallet from seed phrase or private key
  • Watch-only accounts for address monitoring
  • Data encryption with password protection
  • Auto-lock after inactivity period
  • Password change and seed phrase management

🌐 Multi-Network Support

  • Hyperliquid EVM (mainnet & testnet) - Primary network
  • Ethereum mainnet
  • Arbitrum One
  • Base mainnet
  • Solana (in development)
  • Sui (in development)

πŸ”„ Advanced Trading Features

  • In-App Swap Execution: Complete token swapping on HyperEVM network
  • Advanced Token Search: Comprehensive token discovery with infinite scroll
  • Real-Time Pricing: Live price feeds from GeckoTerminal API
  • Gas Optimization: Intelligent gas estimation with safety buffers
  • WRAP/UNWRAP Support: Seamless HYPE ↔ WHYPE token conversion

🌐 dApp Integration & Discovery

  • DApp Explorer: Curated directory with 11+ featured dApps
  • Watchlist System: Star/unstar favorite dApps for quick access
  • EIP-1193 standard support with multi-provider discovery (EIP-6963)
  • EIP-712 typed data signing
  • Provider injection for web pages

🏷️ Hyperliquid Names

  • Human-readable addresses: Send and receive using Hyperliquid Names (e.g., purro.hl)
  • Name resolution in transaction history
  • Native integration with Hyperliquid ecosystem

πŸ’° Fee Rebates

  • Default: 40% swap fee rebates for all users in early phase
  • Boost: 50% tier by invite/eligibility (partners, builders, high-volume)

πŸ”’ Security & Testing

  • Comprehensive Security Test Suite: 100+ security tests
  • Encryption Validation: AES-256-GCM with PBKDF2 key derivation
  • Session Management: Enhanced timeout and expiration handling
  • Memory Safety: Secure cleanup and isolation

πŸ—οΈ Architecture

purro-extension/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ background/          # Background scripts & service worker
β”‚   β”‚   β”œβ”€β”€ providers/       # Blockchain providers (EVM, Hyperliquid)
β”‚   β”‚   β”œβ”€β”€ handlers/        # Message handlers (accounts, storage, auth)
β”‚   β”‚   β”œβ”€β”€ lib/            # Core libraries (encryption, offscreen)
β”‚   β”‚   └── types/          # Type definitions
β”‚   β”œβ”€β”€ client/             # React UI components
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ screens/        # App screens (main, swap, explorer, etc.)
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”‚   └── services/       # API services (Alchemy, Etherscan, etc.)
β”‚   β”œβ”€β”€ assets/             # Static assets (icons, logos)
β”‚   └── manifest.json       # Extension manifest (v3)
β”œβ”€β”€ html/                   # HTML entry points
β”œβ”€β”€ docs/                   # Documentation
└── public/                 # Public assets

Core Components

1. Background Script (src/background/)

  • Provider Manager: Manages blockchain providers and connections
  • EVM Provider: EIP-1193 implementation for EVM chains
  • Message Handler: Handles communication between UI and background
  • Account Handler: Manages accounts, keys, and encryption
  • Storage Handler: Encrypted storage management

2. UI Client (src/client/)

  • React 19.1.0 with TypeScript for type safety
  • Zustand for state management with persistence
  • TanStack Query 5.80.7 for data fetching and caching
  • Tailwind CSS 4.1.8 for modern styling
  • Framer Motion for smooth animations

3. Provider System

  • EIP-1193 compliant Ethereum provider
  • EIP-6963 multi-provider discovery
  • Content script injection into web pages
  • Event system for dApp communication

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (package manager)
  • Chrome browser

Installation

# Clone the repository
git clone https://github.com/purro-xyz/purro-extension.git
cd purro-extension

# Install dependencies
pnpm install

# Build the extension
pnpm run build

Development

# Build and watch changes
pnpm run build:watch

# Type checking
pnpm run type-check

# Run tests
pnpm run test

# Run security tests
pnpm run test:security

Load Extension in Chrome

  1. Open Chrome and go to chrome://extensions/
  2. Enable "Developer mode"
  3. Click "Load unpacked" and select the dist folder

πŸ“± Usage

First-time Setup

  1. Install extension from Chrome Web Store (coming soon)
  2. Create new wallet or import existing wallet
  3. Create password to protect wallet
  4. Backup seed phrase securely

Account Management

  • Create new account for different chains
  • Import private key or seed phrase
  • Switch accounts easily
  • View balances across multiple networks

dApp Interaction

  • Connect wallet with dApps via EIP-1193
  • Sign transactions securely with EIP-712 support
  • Manage permissions per-site
  • Switch networks as requested by dApp

Trading & Swaps

  • In-app token swapping on HyperEVM
  • Real-time pricing from GeckoTerminal
  • Gas optimization with intelligent estimation
  • Transaction tracking with confirmation dialogs

πŸ”§ Developer Integration

EVM Provider API

Purro provides complete EVM provider API:

// Detect provider
const provider = window.ethereum; // or window.purro

// Connect wallet
const accounts = await provider.request({ 
  method: 'eth_requestAccounts' 
});

// Send transaction
const txHash = await provider.request({
  method: 'eth_sendTransaction',
  params: [{
    from: accounts[0],
    to: '0x...',
    value: '0x...'
  }]
});

// Sign message
const signature = await provider.request({
  method: 'personal_sign',
  params: ['Hello World!', accounts[0]]
});

Supported RPC Methods

  • eth_requestAccounts - Request account access
  • eth_accounts - Get connected accounts
  • eth_chainId - Get current chain ID
  • eth_sendTransaction - Send transaction
  • personal_sign - Sign message
  • eth_signTypedData_v4 - Sign typed data (EIP-712)
  • wallet_switchEthereumChain - Switch chain
  • wallet_addEthereumChain - Add new chain

EIP-6963 Multi-Provider Discovery

// Listen for provider announcements
window.addEventListener('eip6963:announceProvider', (event) => {
  const { detail } = event;
  console.log('Provider found:', detail.info.name);
  
  // Connect to Purro specifically
  if (detail.info.rdns === 'xyz.purro.app') {
    const provider = detail.provider;
    // Use provider...
  }
});

πŸ§ͺ Testing

Test Commands

# Run all tests
pnpm run test

# Run security tests
pnpm run test:security

# Run encryption tests
pnpm run test:encryption

# Run storage tests
pnpm run test:storage

# Full security audit
pnpm run security:check

Provider Testing

Open test-dapp-detection.html in browser to test provider functionality.

πŸ”’ Security

Encryption & Storage

  • AES-256-GCM encryption for sensitive data
  • PBKDF2 key derivation from password
  • Secure random seed generation with crypto.getRandomValues()
  • Memory cleanup for sensitive data

Permission System

  • Origin validation for all requests
  • User confirmation for transactions
  • Per-site permissions management
  • Session timeout protection

Security Features

  • Never store private keys in plaintext
  • Always verify transaction details
  • Comprehensive security tests (100+ tests)
  • Regular security audits

🌟 Roadmap

Phase 1: Core Infrastructure (Completed βœ…)

  • βœ… Multi-chain wallet functionality - Ethereum, Arbitrum, Base, HyperEVM
  • βœ… dApp integration - EIP-1193, EIP-6963, EIP-712 standards
  • βœ… Basic DeFi operations - Send, receive, portfolio management
  • βœ… Security framework - Encryption, authentication, session management
  • βœ… Provider system - EVM provider with multi-wallet discovery
  • βœ… UI/UX foundation - React 19, Tailwind CSS, responsive design

Phase 2: Advanced Features (Completed βœ…)

  • βœ… In-app swap functionality - Complete HyperEVM token swapping
  • βœ… DApp explorer - Curated directory with watchlist system
  • βœ… Advanced token management - Search, discovery, real-time pricing
  • βœ… Enhanced security - 100+ security tests, comprehensive audits
  • βœ… Performance optimizations - Smart caching, incremental fetching
  • βœ… Notifications system - Beta announcements and updates
  • βœ… Hyperliquid DEX integration - Deposit, transfer, portfolio tracking

Phase 3: Ecosystem Integration (In Progress πŸ”„)

  • πŸ”„ Solana integration - Full Solana network support
  • πŸ”„ Sui integration - Sui blockchain compatibility
  • πŸ”„ Enhanced DeFi integrations - More protocols and dApps
  • πŸ”„ Advanced portfolio analytics - Charts, P&L tracking, performance metrics
  • πŸ”„ Hardware wallet support - Ledger, Trezor integration
  • πŸ”„ Mobile app development - iOS and Android applications

Phase 4: Advanced Features (Planned πŸ“‹)

  • πŸ“‹ Account abstraction (EIP-4337) - Smart contract wallets
  • πŸ“‹ Gasless onboarding - Zero-fee user registration
  • πŸ“‹ Advanced trading features - Limit orders, DCA, portfolio rebalancing
  • πŸ“‹ Social features - Transaction sharing, community features
  • πŸ“‹ Multi-language support - Internationalization (i18n)
  • πŸ“‹ Advanced bridging - One-click cross-chain transfers
  • πŸ“‹ Token launcher integration - In-app token creation and deployment

Phase 5: Ecosystem Growth (Future Vision πŸš€)

  • πŸš€ Referral & reward system - Fee rebates and incentive programs
  • πŸš€ Community plugin layer - Developer mini-app/extension support
  • πŸš€ Liquidity incentive tracker - Farming, staking, yield optimization
  • πŸš€ Advanced identity system - NFT-based identity and reputation
  • πŸš€ Cross-surface continuity - Seamless experience across devices
  • πŸš€ AI-powered features - Smart recommendations and automation

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

How to Contribute

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Create a Pull Request

Development Standards

  • TypeScript for type safety
  • ESLint for code quality
  • Prettier for code formatting
  • Conventional commits for commit messages
  • Comprehensive testing for new features

Bug Reports

  • Use GitHub Issues
  • Provide detailed steps to reproduce
  • Include browser and extension version
  • Attach console logs if available

πŸ“ž Support & Community

Community Channels

Documentation

Website

πŸ“„ License

This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0).

Key Terms:

  • βœ… Copy & Share - Free to copy and redistribute for educational purposes
  • βœ… Study & Learn - Can study and learn from the code
  • βœ… Contribute - Welcome pull requests and issues
  • ❌ No Commercial Use - Cannot use for commercial purposes
  • ❌ No Derivatives - Cannot modify and redistribute
  • πŸ“ Attribution Required - Must credit Purro Team when sharing

Commercial Licensing: For commercial use or derivative works, contact: thaiphamngoctuong@gmail.com

License Link: https://creativecommons.org/licenses/by-nc-nd/4.0/

See the LICENSE file for complete terms and conditions.

🐱 About Purro

Purro was created with the goal of making Hyperliquid and HyperEVM accessible and secure for everyone. We believe that DeFi and blockchain technology will change the future of finance, and Purro is the bridge that helps users easily participate in this new world.

Our mission is to provide:

  • Intent-aware UX: Clear, contextual signing and gasless workflows
  • Ecosystem-native features: Hyperliquid Names, one-click bridging, and reliable swaps
  • Builder-first approach: Standards-compliant provider and SDK modules
  • Multichain-ready design: Extensible to Ethereum, Arbitrum, Base, Solana, and Sui

πŸ’œ Made with love by the Purro Team 🐱

Purro v0.6.8 - Enhanced Stability & Compatibility