Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

P-Project: The Social Impact Blockchain Ecosystem

License Rust Build Status

Static Web Image Web Static CI API Health

Welcome to P-Project, a cutting-edge social impact ecosystem built with Rust, WebAssembly, and modern blockchain technologies. What started as a meme coin has evolved into a comprehensive platform for humanitarian aid, social verification, and community-driven governance.

🚀 Project Overview

P-Project transforms blockchain technology into a robust, scalable ecosystem with real-world utility. Built with performance and security in mind, our platform offers:

  • Token Contracts with deflationary mechanisms and automatic rewards
  • DAO Governance for community-driven decision making
  • Staking System with time-based yield farming
  • Airdrop Distribution for early supporters
  • Cross-Chain Bridge for multi-network compatibility
  • Web Interface powered by WebAssembly for a seamless user experience
  • AI Integration for impact verification, NFT art generation, and fraud detection
  • IoT Solutions for smart donation boxes, refugee camp wristbands, and food distribution systems
  • Web2 Integration for social media donations, YouTube tips, and messaging platform bots

🏗️ Architecture

P-Project follows a modular monorepo architecture using Rust workspaces:

p-project/
├── p-project-core/          # Shared models, utilities, and database connectors
├── p-project-contracts/     # Token smart contracts with burn and reward mechanisms
├── p-project-api/           # RESTful API server for external integrations
├── p-project-dao/           # Decentralized Autonomous Organization governance
├── p-project-staking/       # Staking contract services with yield farming
├── p-project-airdrop/       # Airdrop distribution system
├── p-project-bridge/        # Cross-chain bridge functionality
└── p-project-web/           # WebAssembly frontend components

🛠️ Technology Stack

Layer Technology Purpose
Core Rust High-performance, memory-safe systems programming
Web WebAssembly Frontend components with near-native performance
Database MySQL Relational data storage for users and transactions
Cache Redis Session management and caching layer
Documents MongoDB Flexible storage for proposals and governance data
API Axum High-performance web framework for API endpoints
Build Cargo Dependency management and build system

📦 Installation

Prerequisites

  • Rust 1.70 or higher
  • MySQL server
  • Redis server
  • MongoDB server

Setup

  1. Clone the repository:
git clone https://github.com/flodecentralizedchat-source/P-Project.git
cd P-Project
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your database credentials
  1. Build the project:
cargo build
  1. Build WebAssembly components:
wasm-pack build p-project-web --target web

▶️ Running the Application

Start the API Server

cargo run -p p-project-api

The API will be available at http://localhost:3000

Run Tests

cargo test

Build Documentation

cargo doc --open

Static Web Image (GHCR)

Prebuilt NGINX image (with Brotli and precompressed assets) is published to GHCR:

Pull and run locally:

docker pull ghcr.io/flodecentralizedchat-source/p-project-web-static:latest
docker run -p 8080:80 ghcr.io/flodecentralizedchat-source/p-project-web-static:latest
# open http://localhost:8080

Use in docker-compose.yml instead of building:

services:
  nginx:
    image: ghcr.io/flodecentralizedchat-source/p-project-web-static:latest
    container_name: p_project_nginx
    ports:
      - "8080:80"
    depends_on:
      api:
        condition: service_healthy
    restart: unless-stopped

Notes:

  • The image proxies API requests to /api/ and serves the SPA from /.
  • If the image is private, ensure the GHCR package visibility is set to public or log in: echo $PAT | docker login ghcr.io -u USERNAME --password-stdin.

Docker Compose Profiles

  • Full stack (API + DBs + NGINX):

    • docker compose up --build -d
    • NGINX at http://localhost:8080, API at http://localhost:3000
  • Static web only (no API dependency):

    • docker compose --profile web up --build -d web-static
    • Opens http://localhost:8080 and serves the SPA; /api/ routes will 502 if called (API not started).

🧪 Core Components

Token Contract

The heart of P-Project features:

  • Burn Mechanism: 1-2% burn on each transaction to increase scarcity
  • Reflection Rewards: Automatic redistribution of 1-3% to all holders
  • Anti-Whale Measures: Transaction limits and maximum wallet restrictions

Staking System

Earn rewards by staking your P tokens:

  • Flexible staking periods (7-365 days)
  • Annual reward rates up to 20%
  • Automatic reward compounding

DAO Governance

Community-driven decision making:

  • Proposal creation and voting
  • Token-weighted voting system
  • Transparent execution of decisions

Cross-Chain Bridge

Seamless token transfers between:

  • Ethereum
  • Binance Smart Chain
  • Solana
  • Polygon
  • Base

AI Services

Intelligent features powered by artificial intelligence:

  • Impact Verification: AI chatbots that verify social impact activities
  • NFT Art Generation: AI-powered creation of unique Peace NFTs
  • Fraud Detection: Machine learning models to detect suspicious activities
  • Meme Generation: AI-powered creation of viral memes for community engagement

IoT Integration

Real-world applications through Internet of Things:

  • Smart Donation Boxes: Hardware wallets for physical donations
  • NFC Wristbands: Digital identity and payment solutions for refugee camps
  • QR-Code Food Distribution: Efficient food aid distribution systems

Web2 Integration

Bridging traditional platforms with blockchain:

  • Social Media Widgets: Donation widgets for Facebook and Instagram
  • YouTube Tips: "Tip in PeaceCoin" functionality for content creators
  • Messaging Bots: Telegram and Discord bots for tipping and transactions

Ecosystem Growth Incentives

  • Developer Grants: Fund developers building on your platform.

Multi‑EVM Setup (Mainnet + Testnet)

  • Configure the relayer via .env:

    • EVM_NETWORKS is a comma‑separated list (case‑insensitive, no spaces).
      • Mainnet example: ethereum,polygon,bsc,arbitrum,optimism
      • Testnet example: sepolia,amoy,arbitrum_sepolia,optimism_sepolia
    • For each <NAME> in the list, set:
      • EVM_<NAME>_RPC_URL, EVM_<NAME>_BRIDGE_ADDRESS, EVM_<NAME>_TOKEN_ADDRESS
    • Adapters default to ETH_PRIVATE_KEY; override per network using EVM_<NAME>_PRIVATE_KEY_ENV.
  • Hardhat networks (contracts):

    • Mainnet: mainnet, polygon, arbitrum, optimism (plus bsc/bscTestnet provided).
    • Testnet: sepolia, amoy, arbitrumSepolia, optimismSepolia.
    • Set RPC envs: SEPOLIA_URL, AMOY_URL, ARBITRUM_SEPOLIA_URL, OPTIMISM_SEPOLIA_URL.
    • Deploy examples:
      • npx hardhat run --network sepolia scripts/deploy.js
      • npx hardhat run --network amoy scripts/deploy.js
  • Docker Compose:

    • docker compose up -d uses .env. See .env.example for full entries.
  • Kubernetes:

    • Update k8s/secrets.example.yaml with EVM_NETWORKS and per‑network vars; apply secrets then deploy k8s/bridge-relayer.yaml.
  • Liquidity Incentives: Provide ongoing rewards for liquidity providers.

  • Merchant Adoption Programs: Incentivize businesses to accept your token as payment.

🌐 Web Interface

Our WebAssembly-powered frontend provides:

  • Real-time token balance tracking
  • Staking dashboard with yield calculators
  • Governance interface for proposals
  • Cross-chain bridge UI
  • Mobile-responsive design

🔧 API Endpoints

Endpoint Method Description
/ GET API health check
/users POST Create new user
/users/:id GET Get user details
/transfer POST Transfer tokens between users
/stake POST Stake tokens for rewards
/unstake POST Unstake tokens with rewards
/airdrop/claim POST Claim airdrop tokens
/ai/verify-impact POST Verify social impact with AI chatbots
/ai/generate-nft-art POST Generate Peace NFT art with AI
/ai/detect-fraud POST Detect fraudulent activities
/ai/generate-meme POST Generate AI-powered memes
/iot/register-donation-box POST Register a new smart donation box
/iot/record-donation POST Record a donation to a box
/iot/register-wristband POST Register an NFC wristband
/iot/add-funds-wristband POST Add funds to a wristband
/iot/create-food-qr POST Create a food distribution QR code
/iot/claim-food-qr POST Claim food using a QR code
/web2/create-donation-widget POST Create a social media donation widget
/web2/generate-widget-html POST Generate embeddable donation widget HTML
/web2/process-social-donation POST Process donation from widget
/web2/process-youtube-tip POST Process a YouTube tip transaction
/web2/create-youtube-tip-config POST Configure YouTube tipping options
/web2/register-messaging-bot POST Register a messaging platform bot
/web2/process-bot-command POST Process a bot command (generic)
/web2/telegram/webhook POST Telegram webhook (token-gated)
/web2/discord/webhook POST Discord webhook (token-gated)
/game/complete-mission POST Report mission completion (protected)
/game/record-behavior POST Record positive behavior for tokens
/game/balance/:player_id GET Query a player's in-game balance
/game/register-mission POST Register a peaceful mission (admin)
/credit/register-ngo POST Register an NGO partner to underwrite micro-loans
/tokenomics/summary GET Get parsed tokenomics & price model summary
/credit/add-impact-event POST Record a verified social impact event for scoring
/credit/request-loan POST Request a P-Coin-collateral micro-loan
/credit/repay-loan POST Repay an active micro-loan
/credit/loan/:loan_id GET Inspect a micro-loan
/credit/score/:user_id GET Query a user's credit score

🤝 Community & Social

Join our vibrant community:

Marketing & Community Controls

Marketing budgets and community programs are enforced on-chain and via the Rust services:

  • Marketing Budget (5% supply): Tracks user-growth spend, schedules content, and enforces caps.
  • Community Rewards (2% supply): Gamified rewards ledger for early adopters, protected from over-distribution.
  • Organic Marketing: Logs community-persistent initiatives and prioritizes long-term trust.
  • Influencer Strategy: Supports low-cost micro-influencer campaigns with budget approvals.
  • Community DAO Fund: Proposals can request funds and only pass if there is quorum and DAO budget remains.

📈 Roadmap

Phase 1: Foundation ✅

  • Core token contract development
  • API server implementation
  • Database integration
  • Basic web interface

Phase 2: Expansion ✅

  • DAO governance launch
  • Staking platform release
  • Cross-chain bridge deployment
  • Mobile app development
  • Advanced Use Cases Implementation:
    • AI + P-Coin Integration (Impact verification chatbots, Peace NFT art generation, Fraud detection)
    • IoT + P-Coin Integration (Smart donation boxes, NFC wristbands, QR-code food distribution)
    • Web2 Integration (Social media widgets, YouTube tips, Messaging platform bots)

Phase 3: Innovation 🚧

  • NFT marketplace integration
  • DeFi yield farming pools
  • AI-powered meme generator
  • Layer 2 blockchain solution

🛡️ Security

P-Project prioritizes security through:

  • Audited Code: Regular third-party security audits
  • Liquidity Lock: LP tokens locked for 1-2 years
  • Renounced Ownership: Optional for full decentralization
  • Transparency Dashboard: Live token distribution and burn tracking

Security and Auth Setup

  • Set required environment variables (see .env.example) and copy to .env.
  • JWT auth is required for sensitive endpoints. Generate a token offline:
    • cargo run -p p-project-api --bin dev_token -- sub=<user_id_or_wallet> hours=24 role=admin
    • Use the token with Authorization: Bearer <token>.
  • Configure CORS with CORS_ALLOWED_ORIGINS and CORS_ALLOW_CREDENTIALS.
  • Request guardrails (enabled by default): 128 concurrent requests, 30s timeout, 1MB body limit.
  • Additional safety controls:
    • Security headers: HSTS, X-Frame-Options, Referrer-Policy, CSP added to all responses.
    • Admin IP allowlist: set ADMIN_IP_ALLOWLIST (comma-separated) to restrict admin routes.
    • Token-gated webhooks: set WEBHOOK_TOKEN or per-platform TELEGRAM_WEBHOOK_TOKEN / DISCORD_WEBHOOK_TOKEN and include X-Webhook-Token header or ?token= query.
    • Compliance blocklists: set WALLET_BLOCKLIST and USERNAME_BLOCKLIST to prevent account creation and transfers involving blocked values.

🤓 Meet Professor P

Our mascot, Professor P, is the genius social scientist who accidentally created the most sophisticated social impact ecosystem ever conceived. With his sarcastic wit and community-first approach, he guides P-Project's development while keeping the fun in DeFi and the purpose in profit.

Our mascot

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙌 Contributing

We welcome contributions from the community! Please see our Contributing Guidelines for more information.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

📞 Support

For support, please open an issue on GitHub or contact us on our Telegram or Discord channels.


Proof of Impact – Powered by the People

About

p-project

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages