A secure blockchain wallet application built with Next.js 14 and integrated with the AIBlock 2Way.js SDK.
- 🔐 Secure Wallet Management: Create, unlock, and recover wallets with bank-grade AES-GCM encryption
- 🔑 Multiple Access Methods:
- Create new wallet with mnemonic generation
- Unlock existing wallet with passphrase
- Recover wallet from 12-word recovery phrase
- 💰 AIBX Token Support: Real balance fetching and token management
- 🌐 2Way.js SDK Integration: Direct integration with AIBlock blockchain network
- 🔒 Google OAuth: Secure authentication system
- 📱 Responsive Design: Modern UI with Tailwind CSS
- 🤖 AI Assistant: Built-in wallet assistant for user guidance
- Framework: Next.js 14 with TypeScript
- Styling: Tailwind CSS + shadcn/ui components
- Blockchain: AIBlock 2Way.js SDK
- Authentication: Google OAuth
- Encryption: Web Crypto API (AES-GCM + PBKDF2)
- Deployment: Vercel with GitHub Actions
- Node.js 18+
- npm or yarn
- Git
-
Clone the repository
git clone git@github.com:AIBlockOfficial/peerstone.git cd peerstone
-
Install dependencies
npm install
-
Set up environment variables (optional)
cp .env.example .env.local
Configure the following variables:
NEXT_PUBLIC_MEMPOOL_HOST=https://mempool.aiblock.dev NEXT_PUBLIC_STORAGE_HOST=https://storage.aiblock.dev NEXT_PUBLIC_VALENCE_HOST=https://valence.aiblock.dev
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
This project uses GitHub Actions + Vercel deploy hooks for seamless deployment:
-
Automatic Process:
- Push to
main
branch triggers GitHub Actions - Actions run: linting → type checking → build verification
- On success, triggers Vercel deployment via webhook
- Vercel pulls latest code from GitHub and deploys
- Push to
-
No Configuration Needed:
- Deploy hook is already configured in the workflow
- Environment variables are set in
vercel.json
- Just push to main and your app deploys automatically!
You can also use Vercel's GitHub integration directly:
-
Connect to Vercel
- Go to Vercel Dashboard
- Click "Add New..." → "Project"
- Import your GitHub repository
- Vercel will automatically detect it's a Next.js project
-
Environment Variables The environment variables are already configured in
vercel.json
:{ "NEXT_PUBLIC_MEMPOOL_HOST": "https://mempool.aiblock.dev", "NEXT_PUBLIC_STORAGE_HOST": "https://storage.aiblock.dev", "NEXT_PUBLIC_VALENCE_HOST": "https://valence.aiblock.dev" }
-
Deploy
- Click "Deploy"
- Vercel will automatically deploy on every push to main branch
# Install Vercel CLI
npm i -g vercel
# Deploy to Vercel
vercel --prod
The GitHub Actions workflow automatically:
- ✅ Runs ESLint checks
- ✅ Performs TypeScript compilation
- ✅ Builds the production bundle
- ✅ Verifies all environment variables
- ✅ Triggers Vercel deployment on success
peerstone/
├── app/ # Next.js 14 app directory
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Main page with authentication flow
│ └── globals.css # Global styles
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── login-page.tsx # Google OAuth login
│ ├── wallet-setup.tsx # Wallet creation/recovery
│ ├── wallet-interface.tsx # Main wallet UI
│ └── wallet-provider.tsx # Wallet state management
├── lib/ # Utility libraries
│ ├── wallet.ts # Core wallet service
│ ├── keypairs.ts # Keypair utilities
│ └── utils.ts # General utilities
├── .github/workflows/ # GitHub Actions
└── vercel.json # Vercel configuration
- AES-GCM Encryption: Industry-standard encryption for wallet data
- PBKDF2 Key Derivation: 100,000 iterations for password-based encryption
- Mnemonic Validation: BIP39-compliant seed phrase generation and validation
- Secure Headers: XSS protection, content type sniffing prevention
- No Private Key Exposure: Private keys never leave the encrypted storage
The wallet integrates with AIBlock's infrastructure:
- Mempool: Transaction broadcasting and monitoring
- Storage: Blockchain data storage and retrieval
- Valence: Network validation and consensus
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- GitHub Issues: Create an issue
- Documentation: AIBlock 2Way.js SDK
Built with ❤️ by the AIBlock team