ChatterPay is a Wallet that allows anyone to send and receive crypto with WhatsApp messages. Enabling crypto for +2B WhatsApp users.
This repository contains the Internet Computer backend implementation using Motoko.
Components:
- Landing Page (product, source code)
- User Dashboard Website (product, source code)
- Backend API (this Repo)
- Smart Contracts (source code)
- Data Indexing (Subgraph) (source code)
- Bot AI Admin Dashboard Website (product)
- Bot AI (Chatizalo) (product)
This repository contains the Internet Computer backend implementation using Motoko, providing a decentralized backend infrastructure for ChatterPay.
Built With:
- Platform: Internet Computer
- Language: Motoko, TypeScript
- Development Framework: DFX
- Interface Description: Candid
The ChatterPay backend is deployed on the Internet Computer mainnet with the following canister IDs:
| Service | Canister ID | IC URL |
|---|---|---|
| Analytics Service | x34wm-pqaaa-aaaan-qz6za-cai |
https://x34wm-pqaaa-aaaan-qz6za-cai.ic0.app |
| Auth Service | xo3hb-oyaaa-aaaan-qz62q-cai |
https://xo3hb-oyaaa-aaaan-qz62q-cai.ic0.app |
| Health Service | wkwit-xyaaa-aaaan-qz64q-cai |
https://wkwit-xyaaa-aaaan-qz64q-cai.ic0.app |
| Last Processed Blocks | weuf3-miaaa-aaaan-qz65q-cai |
https://weuf3-miaaa-aaaan-qz65q-cai.ic0.app |
| NFTs Storage | wnxoh-2aaaa-aaaan-qz64a-cai |
https://wnxoh-2aaaa-aaaan-qz64a-cai.ic0.app |
| Tokens | nb4jx-xiaaa-aaaah-arjsa-cai |
https://nb4jx-xiaaa-aaaah-arjsa-cai.ic0.app |
You can interact with each canister using the Candid interface by visiting the IC URLs above.
ChatterPay has demonstrated significant organic growth since its mainnet launch in May 2024:
- 720+ wallets created on Scroll mainnet
- 69 countries
- 700+ Discord community members
- 200k+ social media impressions
- $0 advertising spend - 100% organic growth
- No new apps installed
Track ChatterPay's on-chain metrics and usage statistics:
- Dune Analytics Dashboard - Comprehensive on-chain data and transaction analytics
The project's success validates market demand for crypto-enabled WhatsApp payments:
- Started at a Scroll hackathon in 2024 where we won several prizes
- Hackathon success provided initial funding to reach mainnet
- Launched mainnet in May 2025
- Achieved significant user adoption without paid marketing
- Strong community engagement across multiple platforms
These metrics demonstrate the product-market fit and growing demand for accessible crypto payments through familiar messaging platforms.
1. Install Requirements:
2. Clone repository:
git clone https://github.com/P4-Games/ChatterPay-ICP-Backend
cd ChatterPay-ICP-Backend3. Install DFX:
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"4. Start Local Network:
dfx start --background5. Deploy Canisters:
dfx deployThe backend will be available at the provided canister URLs.
src/:types.mo: Shared type definitionstransactions/: Transaction management canister with analyticsusers/: User management canister with security featuresblockchains/: Blockchain configuration canistertokens/: Token management canisternfts/: NFT management canister with batch operationslast_processed_blocks/: Block processing tracking canisterevm_service/: EVM integration service with multi-chain supportenv/: Environment configuration and constants
dfx.json: Project configuration file.gitignore: Git ignore configurationREADME.md: This file
The ChatterPay ICP Backend follows a unified two-tier microservices architecture:
Core data persistence and CRUD operations with native ICP optimization:
users- User profiles, authentication, rate limiting, audit logstransactions- Transaction records with multi-chain supportnfts- NFT storage and ownership trackingtokens- Token metadata and configurationsblockchains- Blockchain network configurationslast_processed_blocks- Block synchronization tracking
Business logic, external integrations, and advanced features:
evm_service- EVM blockchain interactions and multi-chain operationsanalytics_service- Analytics, metrics, and user insightsauth_service- Authentication and JWT token managementhealth_service- System health monitoringexternal_apis- Third-party API integrationsblockchain_service- Multi-chain operations coordinatordatabase_proxy- Database proxy and caching layer
This separation provides:
- ✅ Clear separation of concerns - Storage vs. business logic
- ✅ Technology optimization - Motoko for storage, TypeScript for complex logic
- ✅ Scalability - Independent canister scaling
- ✅ Maintainability - Easier to update and test individual layers
These would be the account creation and transfer flows we want to achieve in ICP, which allow us to minimize trust without leaving the WhatsApp interface.
The backend follows a unified two-tier architecture with clear separation between storage and service layers:
-
users - UserStorage:
- User profiles and authentication data
- Wallet associations and phone number mapping
- Security: Rate limiting (10 req/min), audit logging, security metrics
- Features: Enhanced validation, duplicate prevention, audit trails
-
transactions - TransactionManager:
- Transaction records with multi-chain support
- Transaction status tracking and history
- Advanced analytics and querying capabilities
- Features: Transaction analytics, volume tracking, gas estimation
- Supports Arbitrum, Polygon, BSC, Ethereum, and Scroll networks
-
nfts - NFTStorage:
- NFT minting and management with batch operations
- NFT metadata storage and validation
- Ownership and transfer tracking
- Features: Batch creation/updates, metadata validation, enhanced querying
-
tokens - TokenStorage:
- Token information and metadata
- Chain-specific token configurations
- Token balance tracking
-
blockchains - BlockchainStorage:
- Blockchain network configurations
- Smart contract addresses
- Network-specific settings
-
last_processed_blocks - LastProcessedBlockStorage:
- Blockchain synchronization state
- Processing checkpoints
- Network-specific block tracking
-
evm_service - EVMService:
- EVM blockchain integration
- Multi-chain transaction execution
- Gas estimation and chain management
- Automatic provider management
-
analytics_service - AnalyticsService:
- User analytics and metrics
- Platform statistics
- Event tracking and insights
-
auth_service - AuthService:
- JWT token generation and validation
- Session management
- Authentication flows
-
health_service - HealthService:
- System health monitoring
- Canister status checks
- Performance metrics
-
external_apis - ExternalAPIs:
- Third-party API integrations
- External service connections
- API rate limiting and caching
-
blockchain_service - BlockchainService:
- Multi-chain operations coordinator
- Cross-chain transaction routing
- Network management
-
database_proxy - DatabaseProxy:
- Database proxy layer
- Query optimization
- Caching mechanisms
Each canister exposes its API through Candid interfaces. Here are the main endpoints for each canister:
makeTransfer: Execute multi-chain transfers with gas estimationgetTransaction: Retrieve transaction by IDgetTransactionsByAddress: Get transactions for a specific addressgetAllTransactions: List all transactionsgetPendingTransactions: Get pending transactions- Analytics APIs:
getTransactionCountByStatus: Count transactions by statusgetTotalTransactionVolume: Get total confirmed transaction volumegetTransactionCountByAddress: Count transactions for addressestimateTransferGas: Estimate gas costs for transfers
createUser: Register a new user with validationgetUser: Retrieve user informationgetWalletByPhoneNumber: Get wallet address by phone numberupdateUser: Update user informationdeleteUser: Remove user account- Security APIs:
getAuditLogs: Get system audit logsgetAuditLogsByCaller: Get logs for specific callergetRateLimitStatus: Check rate limit statusgetSecurityMetrics: Get security metrics
createNFT: Mint a new NFT with metadata validationgetNFT: Retrieve NFT informationgetNFTsByWallet: Get NFTs owned by a walletupdateNFTMetadata: Update NFT metadata- Batch Operations:
batchCreateNFTs: Create multiple NFTs in one operationbatchUpdateMetadata: Update multiple NFT metadatavalidateMetadata: Validate NFT metadatagetNFTCountByWallet: Get NFT count for wallet
transfer: Execute cross-chain transfersgetTransactionStatus: Check transaction statusvalidateAddress: Validate Ethereum addresses- Multi-chain APIs:
estimateGas: Estimate gas costs for transactionsgetSupportedChains: Get list of supported blockchainsgetChainInfo: Get information about specific chain
For complete API documentation, deploy the canisters and visit the Candid interface.
To start development:
- Start local network:
dfx start --background- Deploy canisters:
dfx deploy- Test the API:
dfx canister call <canister_name> <method_name> '(<arguments>)'- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.



