Skip to content

Latest commit

 

History

187 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polychain

A multi-chain cryptocurrency checkout platform that enables simple link-based transfers and embeddable merchant widgets across multiple blockchain networks.

Demo

Watch the platform in action: https://www.loom.com/share/133fea097d354ea6ae44d82c86f5bdb8?sid=33a8f195-685e-4dd9-a39c-ba4a80c879df

Overview

Polychain is a comprehensive cryptocurrency payment platform that simplifies cross-chain transactions and provides merchants with easy-to-integrate payment solutions. The platform supports multiple blockchain networks including Ethereum, Solana, Polygon, Bitcoin, and DeSo, enabling users (consumers and merchants both) to send and receive payments through simple, shareable links.

Key Features

Multi-Chain Support

  • Ethereum (ETH): Full support for Ethereum mainnet transactions
  • Solana (SOL): Native Solana blockchain integration
  • Polygon (MATIC): Layer 2
  • Bitcoin (BTC): QR code-based Bitcoin payments
  • DeSo: Social blockchain integration

Core Functionality

  • Link-Based Payments: Generate your custom crypto home page, which you can share with others (as opposed to long addresses), who can then use that to send crypto to you.
  • Embeddable Widgets: Merchant integration tools for websites and applications
  • NFT Showcase: Display and manage NFT collections
  • Wallet Integration: Support for MetaMask, WalletConnect, and Phantom wallets
  • Real-time Exchange Rates: Live cryptocurrency price feeds via Coinbase API
  • User Profiles: Customizable user profiles with bio and profile pictures

Technical Features

  • Merkle Tree Distribution: Efficient token distribution system
  • Promo Code System: Built-in promotional code functionality
  • JWT Authentication: Secure user authentication and session management
  • Responsive Design: Mobile-first, responsive user interface
  • Real-time Notifications: Toast notifications for transaction status

Architecture

Frontend

  • Framework: Next.js 12 with React 17
  • Styling: Tailwind CSS with custom components
  • State Management: React Context API
  • Wallet Integration: Web3Modal, WalletConnect, MetaMask
  • UI Components: Headless UI, Heroicons

Backend

  • Runtime: Node.js with TypeScript
  • Framework: Express.js
  • Database: MongoDB with Mongoose ODM
  • Authentication: JWT with cookie-based sessions
  • Blockchain Integration: Ethers.js, Solana Web3.js
  • API Integration: Coinbase API for exchange rates

Smart Contracts

  • ERC-20 Token: Standard Ethereum token implementation
  • Merkle Distributor: Gas-efficient token distribution contract
  • OpenZeppelin: Security-audited contract libraries

Infrastructure

  • Cloud Platform: AWS with EC2 Auto Scaling
  • Containerization: Docker for consistent deployments
  • CI/CD: Automated deployment pipelines
  • Monitoring: Prometheus and Grafana for system monitoring
  • CDN: CloudFront for global content delivery

Project Structure

Polychain/
├── frontend/          # Next.js React application
│   ├── pages/         # Application routes and components
│   ├── lib/           # Utility functions and blockchain integrations
│   └── public/        # Static assets and contract ABIs
├── backend/           # Node.js Express API server
│   ├── src/           # TypeScript source code
│   ├── models/        # MongoDB data models
│   └── utils/         # Server-side utilities
├── erc20/             # Smart contract implementations
│   └── contracts/     # Solidity smart contracts
└── embed/             # Embeddable widget system
    └── src/           # Widget JavaScript bundle

Getting Started

Prerequisites

  • Node.js 18.0.0 or higher
  • MongoDB database
  • Ethereum wallet (Phantom recommended)
  • Solana wallet (Phantom recommended)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/polychain.git
    cd polychain
  2. Install frontend dependencies

    cd frontend
    npm install
  3. Install backend dependencies

    cd ../backend
    npm install
  4. Install smart contract dependencies

    cd ../erc20
    npm install
  5. Install embed widget dependencies

    cd ../embed
    npm install

Environment Setup

  1. Backend Environment Variables Create a .env file in the backend directory:

    MONGODB_URI=your_mongodb_connection_string
    COOKIE_SECRET=your_jwt_secret
    NODE_ENV=development
    JWT_SECRET=123123
    TWITTER_ACCESS_TOKEN=your_twitter_api_token
    ETHERSCAN_API_KEY=your_etherscan_api_key
    POLYGONSCAN_API_KEY=your_polygonscan_api_key
  2. Frontend Environment Variables Create a .env file in the frontend directory:

    NEXT_PUBLIC_BACKEND_URL=http://localhost:3001
    NEXT_PUBLIC_NFTPORT_API_KEY=your_nftport_api_key_here

Running the Application

  1. Start the backend server

    cd backend
    npm run start
  2. Start the frontend development server

    cd frontend
    npm run dev
  3. Build the embed widget

    cd embed
    npm run build

The application will be available at http://localhost:3000 and the API at http://localhost:3001.

Security

  • JWT-based authentication with secure cookie storage
  • Input validation and sanitization
  • Rate limiting on API endpoints
  • Secure wallet integration with signature verification
  • Smart contract security audits

Contributing

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

License

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

Support

For support and questions:

  • Create an issue in the GitHub repository
  • Contact the development team
  • Check the documentation wiki

Built with ❤️ by the Spindl team

About

A multi-chain cryptocurrency checkout platform that enables simple link-based transfers and embeddable merchant widgets across multiple blockchain networks.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages