Inspiration

The inspiration for DOTSAFE came from a simple yet profound question: "How do we prove we're trustworthy in the decentralized world?" In traditional systems, our identity and reputation are controlled by centralized entities—banks, social media companies, and governments. When we wanted to build on Web3, we realized that despite blockchain's promise of decentralization, users still lacked a unified way to carry their reputation across different chains and dApps.

We were particularly inspired by the Polkadot ecosystem's vision of interoperability. If blockchains can communicate seamlessly, why can't our digital identities? This sparked the idea of creating a cross-chain reputation protocol where users truly own their identity and can build verifiable, portable reputation scores based on actual on-chain activities—not just social media followers or self-proclaimed credentials.

What it does

DOTSAFE is a decentralized identity (DID) and reputation management platform built on Polkadot that empowers users to:

  • Create User-Owned Digital Identities: Generate blockchain-based DIDs that users control entirely, with no centralized authority
  • Build On-Chain Reputation Scores: Calculate reputation dynamically based on real blockchain activities:

    • $\text{Reputation} = f(\text{Balance}, \text{Transactions}, \text{Governance}, \text{Account Age})$
    • Balance contribution: Up to 200 points (scaled at $4 \times \text{DOT balance}$)
    • Transaction history: Up to 300 points ($1.5 \times$ transaction count)
    • Governance participation: Up to 200 points (20 points per referendum vote)
    • Account longevity: Up to 300 points (age-based calculation via Subscan API)
  • Generate Verifiable Reputation Passes: Create cryptographically signed passes (with QR codes) that prove identity and reputation

  • Verify Others' Credentials: Scan and verify reputation passes to ensure authenticity using signature verification

  • Track Progress with Achievements: Gamified system with 20+ achievements across 5 categories (balance, transactions, governance, social, special)

  • Climb the Leaderboard: Compete with other users across 6 reputation tiers: Newbie → Bronze → Silver → Gold → Platinum → Diamond

  • Monitor Activity: Real-time tracking of on-chain events across Polkadot, Acala, and Moonbeam

  • AI-Powered Insights: Get personalized recommendations to improve reputation using Google's Gemini AI

How we built it

We architected DOTSAFE using a modern tech stack focused on performance, security, and user experience:

Frontend Architecture:

  • React 19.2.0 with TypeScript for type-safe, component-based UI
  • Vite 6.2.0 for lightning-fast builds and Hot Module Replacement (HMR)
  • TailwindCSS for responsive, utility-first styling with custom dark theme

Blockchain Integration:

  • @polkadot/api (v16.5.2) for direct interaction with Polkadot relay chain
  • @polkadot/extension-dapp for seamless Polkadot.js wallet integration
  • @polkadot/util-crypto for cryptographic operations (signing, verification)
  • Connected to Polkadot via WebSocket: wss://rpc.polkadot.io

Key Technical Implementations:

  1. Custom Polkadot Hook (usePolkadot): Built a React hook managing WebSocket connections, wallet state, and API readiness

  2. Multi-Component Reputation Scoring: Real-time calculation using:

    // Balance score with BN (Big Number) precision
    balanceScore = min(floor(balanceInDOT × 4), 200)
    

// Governance scoring across all referendum tracks votingInfos = await api.queryMulti(tracksConst.map(...))


3. **Cryptographic Verification**: Implemented Ed25519 signature verification for reputation passes:
   ```typescript
   const { isValid } = signatureVerify(message, signature, publicKey)
  1. External API Integration: Subscan API integration for accurate account age calculation and transaction history

  2. QR Code Generation: Using qrcode library for shareable, scannable reputation passes

  3. Achievement System: Dynamic achievement checking with 4 rarity tiers and weighted point systems

  4. AI Integration: Google Gemini AI for personalized reputation improvement suggestions

Challenges we ran into

Building DOTSAFE presented several technical and conceptual challenges:

  1. Asynchronous Blockchain Queries: Managing multiple concurrent API calls for balance, governance, and transaction data while providing smooth UX with progress indicators required careful Promise orchestration and state management.

  2. Big Number Arithmetic: Handling Polkadot's token decimals (10^10) required using BN (Big Number) libraries to avoid JavaScript's floating-point precision issues: $\text{balance}{\text{DOT}} = \frac{\text{balance}{\text{raw}}}{10^{10}}$

  3. Governance Complexity: Polkadot's OpenGov has multiple tracks (Root, Whitelisted Caller, Staking Admin, etc.). Querying voting participation across all tracks required understanding the convictionVoting pallet and handling different voting types (Casting vs. Delegating).

  4. Cross-Chain Data Aggregation: Integrating activity from multiple chains (Polkadot, Acala, Moonbeam) with different API structures and data formats was challenging. We had to normalize data structures and handle various error states.

  5. Signature Verification Edge Cases: Ensuring robust verification with proper error handling for invalid addresses, malformed signatures, and mismatched public keys required extensive testing.

  6. Real-Time vs. Cached Data: Balancing the need for real-time reputation updates with API rate limits and performance constraints. We implemented progressive loading with status messages.

  7. UI/UX for Complex Data: Presenting technical blockchain data (transaction hashes, governance votes) in a user-friendly way required multiple design iterations and custom visualization components (ScoreGauge, SegmentProgressBar).

Accomplishments that we're proud of

  1. Fully Functional On-Chain Reputation System: Successfully created a working reputation algorithm that accurately reflects real blockchain activity—no mock data, all live from Polkadot.

  2. Seamless Wallet Integration: Achieved smooth connection with Polkadot.js extension with proper error handling and user feedback.

  3. Comprehensive Achievement System: Designed and implemented 20+ achievements with 4 rarity tiers, creating engaging gamification.

  4. Beautiful, Responsive UI: Crafted a polished dark-themed interface with smooth animations, gradients, and responsive design that works on all devices.

  5. Cryptographic Security: Implemented proper Ed25519 signature verification ensuring reputation passes are truly tamper-proof.

  6. Cross-Chain Vision: Laid groundwork for true cross-chain reputation with architecture supporting multiple parachains.

  7. Developer Experience: Created clean, typed TypeScript code with reusable components and custom hooks for maintainability.

  8. Complete Documentation: Wrote extensive README, deployment guides, feature roadmap, and contribution guidelines.

What we learned

This project was an incredible learning journey into the Polkadot ecosystem and decentralized identity:

  1. Polkadot's Power: Learned the depth of Polkadot's capabilities—from OpenGov's sophisticated voting mechanisms to the cross-chain messaging potential via XCM (for future implementation).

  2. Reputation is Multi-Dimensional: Realized that meaningful reputation can't be a single number—it needs context. Our 4-component scoring system (balance, transactions, governance, age) provides nuanced insights.

  3. User Experience in Web3: Discovered that blockchain UX requires different patterns than traditional apps—managing connection states, handling async blockchain queries, providing clear feedback for on-chain operations.

  4. The Importance of Verification: Built appreciation for cryptographic verification—how public-key cryptography enables trustless verification of credentials without centralized authorities.

  5. TypeScript's Value: Experienced firsthand how TypeScript's type system prevents bugs when working with complex blockchain data structures and multiple API responses.

  6. Performance Optimization: Learned techniques for optimizing blockchain queries—batching with queryMulti, progressive loading, and managing WebSocket connections efficiently.

  7. Community Building: Understood that a reputation system only works with network effects—the more users, the more valuable the reputation becomes.

What's next for DOTSAFE

We have an ambitious roadmap to make DOTSAFE the standard for cross-chain identity and reputation:

Immediate Priorities (Q1 2026):

  • 🔗 Multi-Parachain Expansion: Integrate with Astar, Bifrost, Moonbeam, Acala for true cross-chain scoring
  • 🌙 Dark/Light Theme Toggle: Complete the UI theme system
  • 📱 Mobile App: Native iOS/Android apps using React Native
  • 💾 IPFS Storage: Store DIDs and reputation history on decentralized storage

Medium-Term Goals (Q2-Q3 2026):

  • 🔐 Smart Contract Integration: Deploy reputation verification contracts on parachains
  • 🤝 Social Features: Follow users, reputation endorsements, trusted networks
  • 📊 Advanced Analytics: Reputation trends, peer comparisons, predictive scoring
  • 🎯 DAO Integration: Use reputation scores for voting weight in governance

Long-Term Vision (Q4 2026+):

  • 🌐 Cross-Chain DID Standard: Propose a Polkadot reputation standard (PRS - Polkadot Reputation Standard)
  • 🏦 DeFi Integration: Use reputation for under-collateralized lending, trust scores
  • 🎓 Credential Marketplace: Verifiable credentials for education, work experience, skills
  • 🔄 XCM Messaging: Enable reputation queries across chains via XCM
  • 🤖 Enhanced AI: Predictive reputation modeling, fraud detection, personalized growth paths

Mathematical Model for Future Scoring:

We plan to evolve our scoring to include network effects:

$$\text{Reputation}{\text{final}} = \alpha \cdot S{\text{activity}} + \beta \cdot S_{\text{social}} + \gamma \cdot S_{\text{temporal}}$$

Where:

  • $S_{\text{activity}}$ = Current activity-based score
  • $S_{\text{social}}$ = Endorsements and connections (weighted by endorser's reputation)
  • $S_{\text{temporal}}$ = Time-decay factor ensuring recent activity matters more
  • $\alpha, \beta, \gamma$ = Tunable weights ($\alpha + \beta + \gamma = 1$)

Our ultimate goal: Make DOTSAFE the universal identity layer for the Polkadot ecosystem, where your reputation truly belongs to you and follows you everywhere in Web3.

Built With

  • acala-parachain
  • big-number-(bn)-arithmetic-libraries
  • css3
  • custom-react-context
  • ed25519-cryptographic-signatures
  • eslint
  • git
  • github
  • google-gemini-ai-api
  • html5
  • javascript
  • json-web-standards
  • local-storage-api
  • moonbeam-parachain
  • node.js
  • npm
  • opengov-referendum-system
  • polkadot-relay-chain
  • polkadot.js-extension
  • polkadot/api-16.5.2
  • polkadot/extension-dapp-0.62.4
  • polkadot/util-12.6.2
  • polkadot/util-crypto-12.6.2
  • promise-based-async-patterns
  • qrcode-library-1.5.3
  • react-19.2.0
  • react-hooks
  • restful-apis
  • state-management-patterns
  • subscan-api
  • tailwindcss
  • typescript-5.8.2
  • vercel-(deployment-platform)
  • vite-6.2.0
  • vs
  • websocket-(wss://rpc.polkadot.io)
Share this project:

Updates