How saksham-tomer/solxpass works
Project Overview
• This project is a full-stack decentralized identity and rewards platform built on the Solana blockchain.
• Its core purpose is to allow users to generate verifiable identity proofs (Proof of Person) across multiple categories, verify them on-chain using Zero-Knowledge Proofs and the Reclaim Protocol, and interact via a rewards and community system.
• The system also provides an SDK/npm package for dApp developers to integrate identity verification and rewards features.
Main Components
a. Frontend:
• The “app” directory houses the Next.js application with pages like dashboard, connect, explore, and feeds.
• UI components across directories (e.g., components/3D, components/Auth, components/Dashboard, etc.) indicate a rich user experience that includes 3D elements and interactive layouts.
• The navigation, authentication, and session management components found under components/Nav and lib contain logic for wallet connections (e.g., Phantom) and session providers.
b. Backend and API Layer:
• API routes under “app/api” implement endpoints for authentication, proof generation, balance checking, and updating user data.
• These endpoints serve as the glue between the frontend and the blockchain layer, handling interactions and business logic before triggering on-chain verification.
c. Blockchain Layer:
• The “blockchain” directory contains Rust projects and configurations (e.g., Cargo.toml, migrations, and programs under “programs/reclaim”).
• This part represents the on-chain smart contract (program) layer that handles identity proofs, validation, and rewards issuance on the Solana blockchain.
• The presence of a separate tests folder (blockchain/tests) shows dedicated testing of blockchain functionality.
d. Database & Data Management:
• The “prisma” directory indicates that the project uses Prisma ORM with defined migrations and schema for managing off-chain data (user records, proofs, reward tracking, etc.).
• This serves as the persistent layer for data not stored on-chain.
e. Configuration & Utility Libraries:
• The “config” and “lib” directories hold configuration files and utility functions (such as authentication, NFT minting, session management, and integration with Metaplex) that bridge components.
• These files indicate integration with external libraries/frameworks and centralize shared logic.
Relationships and Interactions
• Users interact with the frontend UI (Next.js app) which communicates with backend API endpoints for tasks such as submitting identity proofs, fetching reward data, and updating user profiles.
• The backend APIs process requests before:
• Interacting with the blockchain layer to submit and verify proofs through smart contracts.
• Accessing/storing additional user data via Prisma-managed databases.
• The blockchain smart contracts implement the core on-chain logic for decentralized verification, recording proofs, and rewards, all while interfacing with the Reclaim Protocol and Zero-Knowledge Proof systems.
• The SDK or npm package enables third-party dApp developers to hook into this flow.
Key Architectural Patterns and Design Principles
• Use of Next.js for routing and API endpoint creation (separation of frontend and backend concerns).
• Modular design with clear separation: UI components, API endpoints, blockchain programs, and data persistence.
• Integration of decentralized components (blockchain smart contracts) with traditional server-side resources (Prisma-backed database and REST-ish API endpoints) to achieve both on-chain security and off-chain performance.
• Emphasis on privacy and security via Zero-Knowledge Proofs and the Reclaim Protocol.