Blockchain - peer-network/peer_backend GitHub Wiki
🔗 Blockchain Integration — Peer Network
This page outlines the current and planned blockchain integration for the Peer Network platform, focusing on token management and the transition from a Web2 to a Web3 architecture.
🧱 Current Architecture
- Token Management: Currently, all token-related operations, including balance tracking, reward distribution, and referral earnings, are managed off-chain within the
peer_backend
service. - Technology Stack:
- Backend: PHP 8.3 with a custom GraphQL resolver stack.
- Database: PostgreSQL for storing user data and token balances.
- Authentication: JWT-based token authentication.
🚀 Transition to Web3
We are in the process of transitioning to a Web3 architecture to enhance transparency, security, and decentralization. The key components of this transition include:
- Blockchain Platform: Solana, chosen for its high throughput and low transaction costs.
- Smart Contracts: Development of smart contracts to handle token minting, burning, and transfers.
- On-Chain Token Tracking: Migrating token balances and transactions to the blockchain to ensure immutability and transparency.
peer_rust_backend
Repository
🛠️ The peer_rust_backend
repository is dedicated to developing the Rust-based backend components necessary for blockchain integration.
- Purpose: To build a robust, high-performance backend that interacts seamlessly with the Solana blockchain.
- Current Status: In active development, focusing on:
- Establishing connections with Solana nodes.
- Implementing token minting and burning functionalities.
- Ensuring secure and efficient transaction processing.
🔄 Planned Token Flow
- User Actions: Users perform actions on the platform (e.g., posting content, engaging with others).
- Reward Calculation: The backend calculates rewards based on predefined criteria.
- Token Minting: The system mints the appropriate number of tokens on the Solana blockchain.
- Token Distribution: Minted tokens are transferred to the user's on-chain wallet.
- Token Burning: When users spend tokens, the corresponding amount is burned or transferred, as per the application's logic.
📌 Future Considerations
- Wallet Integration: Developing or integrating user-friendly wallets to manage on-chain tokens.
- Cross-Platform Compatibility: Ensuring seamless blockchain interactions across iOS, Android, and Web platforms.
- Security Audits: Conducting thorough audits of smart contracts and blockchain interactions to ensure security and compliance.
📓 Related Pages
- 🏠 Home
- 🔧 Backend
- 💻 Clients
- 📬 GraphQL Schema Overview
- 📓 Changelogs