Cross-Platform Web3 Incentive Distribution Component
Distribute Web3 rewards as easily as sending a message, with seamless reconciliation
RedPocket is a frictionless Web3 incentive distribution layer that eliminates traditional wallet barriers. Users don't need pre-existing wallets—they can claim rewards directly via social identities on Discord, Telegram, WhatsApp, and GitHub. Funds are centrally managed, and users only visit the main platform when withdrawing or reviewing reports.
Social Identity as Wallet (Social Login + Account Abstraction)
- Built on ERC-4337 Account Abstraction standard, auto-generating non-custodial AA wallets on first claim
- No private keys to remember, no app downloads—just click to claim
- Gas sponsorship enabled for zero-friction user onboarding
Cross-Platform Connectors
- GitHub: Interactive cards embedded in PR/Issue comments
- Telegram/Discord: Minimalist message cards triggered by bots
- WhatsApp: H5 link-based identity verification claims
Polkadot Cross-Chain Bridge
- Leverages Polkadot XCM protocol for cross-chain asset transfers
- Supports Polkadot, Kusama, and their parachain ecosystems
- Unified asset management with seamless cross-chain reconciliation
| Platform | Trigger | Interaction |
|---|---|---|
| GitHub | Action / Comment Command | Markdown claim card in PR/Issue |
| Telegram | Bot Command /send |
Inline Button / Lucky Money |
| Discord | Slash Command /reward |
Interactive Embed Message |
| H5 Share Link | Identity-verified claim short link |
Distribution Logic
- Enterprises initiate via platform or command, setting amount, quantity, and category
- Mandatory tagging (e.g., Marketing, Dev Bounty)
- Auto-reserve quotas for wallet-less users, activated on link click
Transaction Overview
- Real-time flow dashboard: distribution time, platform, recipient, status
- Multi-dimensional reconciliation: trace transactions to specific GitHub PRs or social tasks
- Auto-categorized statistics: generate pie charts by tags
Financial Reports
- Auto-generate P&L statements
- Tax-friendly receipts: each expense linked to task completion screenshot or URL
- Export accounting-standard CSV/PDF with real-time exchange rates
Fund Pool Management
- Enterprise deposits stablecoins to main account, shared across platforms
- Set spending limits per platform
- Multi-sig wallet for fund security
Balance Aggregation
- Auto-aggregate rewards from all platforms
- Unified display of cross-chain assets (Polkadot/Ethereum/Polygon)
- Real-time claim history
Flexible Withdrawal
- Web3 Path: Withdraw to MetaMask/OKX wallets
- Fiat Path: Cash out to bank via MoonPay/Transak
- Gas-sponsored, zero-cost withdrawals for users
Frontend
- Next.js 16 (React 19.2) - Server-side rendering
- TailwindCSS v4 - Glassmorphism design system
- shadcn/ui - Component library
- Framer Motion - Animation effects
Backend
- Node.js + NestJS - Multi-platform webhook hub
- Redis (Upstash) - Caching & session management
- PostgreSQL - Business data storage
Blockchain Layer
- Polkadot XCM - Cross-chain message passing
- ERC-4337 Account Abstraction
- Base / Polygon - Low-gas main chains
- Privy / Web3Auth - Social login & wallet generation
Smart Contracts
SimpleAccountFactory # AA wallet factory
SimpleAccount # AA wallet implementation
Paymaster # Gas sponsor contract
TokenVault # Token fund pool
RedPocket # Main red packet contract
TransparentUpgradeableProxy # Upgradeable proxy
Cross-Chain Bridge
- XCM Types & Config - Polkadot cross-chain config
- Bridge Service - Asset cross-chain service
- Chain Selector - Multi-chain routing
Social Integrations
- Telegram Bot API
- Discord.js
- Twilio / WhatsApp Business API
- GitHub App / Actions
┌─────────────────────────────────────────────────────────┐
│ Social Platform Layer │
│ Telegram │ Discord │ WhatsApp │ GitHub │
└─────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ RedPocket Middleware │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Webhook │ │ Auth │ │ Router │ │
│ │ Handler │ │ Service │ │ Service │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Polkadot Cross-Chain Layer (XCM) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Relay │ │Parachain │ │ Bridge │ │
│ │ Chain │ │ Selector │ │ Service │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ EVM Execution Layer │
│ Polygon │ Base │ Arbitrum │ Ethereum │
│ ERC-4337 Account Abstraction + Smart Contracts │
└─────────────────────────────────────────────────────────┘
Multi-Sig Mechanism
- ProxyAdmin supports multi-sig management
- Enterprise fund pools use Gnosis Safe
- Contract upgrades require multi-party signatures
Anti-Fraud System
- Rate limiting
- New account activity thresholds
- Bot behavior detection
Compliance & Audit
- Every transaction traceable on-chain
- Auto-generate tax receipts
- Support regulatory report exports
- Node.js 18+
- npm / pnpm / yarn
- Redis (Upstash or local)
npm installCreate .env.local file:
# Redis
KV_URL=your_redis_url
KV_REST_API_TOKEN=your_token
KV_REST_API_URL=your_api_url
# Backend API
NEXT_PUBLIC_API_URL=https://api.protocoolbanks.com
# Social Platform Tokens
TELEGRAM_BOT_TOKEN=your_telegram_token
DISCORD_BOT_TOKEN=your_discord_token
WHATSAPP_API_KEY=your_whatsapp_key
GITHUB_APP_PRIVATE_KEY=your_github_key
# Blockchain
PRIVATE_KEY=your_deployer_private_key
INFURA_API_KEY=your_infura_keynpm run devVisit http://localhost:3000
npm run build
npm start- Import GitHub repository in Vercel
- Configure environment variables (refer to
.env.production.example) - Auto-deploy on push
See detailed deployment steps in DEPLOYMENT.md
# Initialize AWS infrastructure
cd infrastructure
terraform init
terraform apply
# Deploy backend services
./scripts/deploy-all.sh# Testnet deployment
npm run deploy:mumbai
# Mainnet deployment
npm run deploy:polygon
npm run deploy:baseredpocket/
├── app/ # Next.js App Router
│ ├── page.tsx # Homepage (dual-theme red packet showcase)
│ ├── claim/[id]/ # Red packet claim page
│ ├── dashboard/ # Enterprise management dashboard
│ │ ├── campaigns/ # Campaign management
│ │ ├── claims/ # Transaction audit
│ │ ├── wallet/ # Fund pool management
│ │ └── settings/ # Enterprise settings
│ ├── portal/ # User withdrawal portal
│ └── api/ # API routes
├── components/ # React components
│ ├── redpocket/ # Red packet core components
│ ├── dashboard/ # Dashboard components
│ └── ui/ # UI base components
├── lib/ # Utility libraries
│ ├── api-client.ts # API client
│ ├── wallet.ts # AA wallet utilities
│ └── types.ts # TypeScript types
├── backend/ # Backend services (to be integrated)
├── infrastructure/ # Terraform IaC
└── scripts/ # Deployment scripts
- Zero-Barrier Entry: No wallet needed, claim via social accounts
- Cross-Chain Interoperability: Polkadot XCM enables free asset flow
- Platform Consistency: Unified account aggregates rewards across all platforms
- Compliance-Friendly: Every expense traceable, auto-generated financial receipts
- Enterprise-Grade Security: Multi-sig management, anti-fraud system, fund isolation
- Trigger: Project comments
/reward @dev_user 50 USDC --tag "SecurityFix" - Silent Accounting: Protocol Bank creates pending record, tagged "Security Fix"
- Frictionless Claim: Developer clicks card, logs in via GitHub to H5
- Wallet Generation: System detects wallet-less user, silently generates AA wallet
- Fund Transfer: 50 USDC auto-transferred to new wallet
- Reconciliation Complete: Dashboard displays full transaction trail
- Base red packet component (dual themes)
- Enterprise management dashboard
- User withdrawal portal
- GitHub integration
- Telegram Bot integration
- Discord Bot integration
- WhatsApp integration
- Polkadot cross-chain bridge
- Smart contract audit
- Mainnet launch
- Deployment Guide
- Deployment Checklist
- API Documentation (Coming soon)
- Smart Contract Documentation (Coming soon)
MIT License - See LICENSE
- Website: protocoolbanks.com
- Email: support@protocoolbanks.com
- GitHub: github.com/protocool-banks/redpocket
Built with Polkadot • Powered by Web3 • Designed for Everyone