Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 TruthStamp - Decentralized Fact-Checking Platform

A blockchain-based fact-checking system built on Stellar's Soroban smart contract platform

Stellar Rust React TypeScript License

πŸ“‹ Table of Contents

🌟 Overview

TruthStamp is a decentralized fact-checking system that incentivizes expert verification through economic stakes and reputation management. Built on Stellar's Soroban platform, it uses three interconnected smart contracts to create a transparent, incentivized ecosystem for claim verification.

Key Principles:

  • πŸ’° Economic stakes ensure accountability
  • πŸ† Reputation-based expert system
  • 🎯 Consensus-driven verification
  • πŸ“Š Transparent on-chain records
  • ⚑ Fast, low-cost transactions on Stellar

✨ Features

For Users

  • πŸ“ Submit Claims - Post any factual claim for expert verification (0.5 XLM fee)
  • πŸ” Browse Verified Claims - View all claims with verification status
  • πŸ’° Stake on Claims - Add economic weight to claims you believe in
  • πŸ“Š Track Consensus - See real-time expert consensus on claims

For Experts

  • πŸ‘¨β€πŸ”¬ Register as Expert - Three-tier system (General/Specialized/Professional)
  • ⭐ Review Claims - Provide professional verdicts with confidence ratings
  • πŸ’Ž Earn Rewards - Receive 80% of claim pools for correct reviews
  • πŸ† Build Reputation - Dynamic reputation system with 5 levels
  • πŸ“ˆ Track Performance - Monitor accuracy rate and earnings

System Features

  • πŸ”— Freighter Wallet Integration - Seamless blockchain transactions
  • βš–οΈ Stake-Weighted Voting - Higher stakes = more influence
  • 🎯 Automatic Consensus - Smart contract calculates final verdict
  • πŸ’Έ Reward Distribution - Automatic payouts to accurate experts
  • ⚠️ Slashing Mechanism - 10% penalty for incorrect reviews

πŸ—οΈ Architecture

TruthStamp consists of three interconnected smart contracts:

1. Claim Registry Contract

Contract ID: CDJDSL4LO3442NKVWAQIXGZLJOR7IKIZWFAQZUERPKEFSUETJLZFNUAY image

Manages claim lifecycle and verification status.

Key Functions:

  • submit_claim() - Submit new claims with 0.5 XLM fee
  • get_claim() - Retrieve claim details
  • update_claim_status() - Update verification status
  • add_to_stake_pool() - Add stakes to claims

2. Expert Registry Contract

Contract ID: CCLPI23VX3PVWBMPGDOYJZTKS4XMUWPWIPEOKSTZYK2WDQ6OEFQUJHUC image

Handles expert registration and reputation management.

Key Functions:

  • register_expert() - Register with tiered stakes (100/500/1000 XLM)
  • get_expert() - Retrieve expert profile
  • update_reputation() - Update expert reputation after reviews
  • add_earnings() - Distribute rewards to experts
  • slash_stake() - Penalize incorrect reviews

3. Review Consensus Contract

Contract ID: CBQOIHPAZMEZDGAPQRPPB3WCXL5YHWKVQ6SUVU5CUJUSEHCDLVER67M4 image

Calculates consensus and manages reward distribution.

Key Functions:

  • submit_review() - Submit expert reviews
  • get_consensus() - Calculate stake-weighted consensus
  • distribute_rewards() - Payout to accurate experts

πŸš€ Getting Started

Prerequisites

  • Rust 1.91.0 or higher
  • Node.js 16+ and npm
  • Stellar CLI (replaces soroban-cli)
  • Freighter Wallet browser extension

Installation

  1. Clone the repository
git clone <repository-url>
cd truthstamp
  1. Install Rust dependencies
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --release
  1. Install frontend dependencies
cd truthstamp-app
npm install

Quick Start

  1. Build contracts
./build.sh
  1. Deploy to testnet (Optional - already deployed)
./deploy.sh
  1. Start the frontend
cd truthstamp-app
npm start
  1. Open browser
http://localhost:3000

πŸ“‘ Deployed Contracts

All contracts are live on Stellar Soroban Testnet:

Contract Address Explorer
Claim Registry CDJDSL4LO3442NKVWAQIXGZLJOR7IKIZWFAQZUERPKEFSUETJLZFNUAY View
Expert Registry CCLPI23VX3PVWBMPGDOYJZTKS4XMUWPWIPEOKSTZYK2WDQ6OEFQUJHUC View
Review Consensus CBQOIHPAZMEZDGAPQRPPB3WCXL5YHWKVQ6SUVU5CUJUSEHCDLVER67M4 View

Network Details:

πŸ’» Usage

Using the Web Interface

  1. Connect Wallet

  2. Get Testnet XLM

  3. Submit a Claim

    • Go to "Submit Claim" page
    • Enter claim text, category, and sources
    • Pay 0.5 XLM fee
    • Sign transaction in Freighter
  4. Register as Expert

    • Go to "Expert Dashboard"
    • Fill registration form
    • Choose expertise level and stake amount
    • Sign transaction
  5. Review Claims

    • Browse claims on "Browse Claims" page
    • Click on a claim to review
    • Submit your verdict with confidence rating

Using the CLI

We provide a convenient script for contract invocation:

# View help
./invoke_contracts.sh help

# Submit a claim
./invoke_contracts.sh submit-claim <address> "Claim text" "Category" '["source1"]'

# Get claim details
./invoke_contracts.sh get-claim 1

# Register as expert
./invoke_contracts.sh register-expert <address> "Name" "Bio" '["Category"]' 1000000000

# Get expert profile
./invoke_contracts.sh get-expert <address>

# Check claim count
./invoke_contracts.sh claim-count

πŸ› οΈ Development

Building Contracts

# Build all contracts
cargo build --target wasm32-unknown-unknown --release

# Or use the build script
./build.sh

Testing Contracts

# Run tests
cargo test

# Or use the test script
./test.sh

Running Frontend Locally

cd truthstamp-app
npm start

The app will open at http://localhost:3000

Contract Invocation Examples

# Initialize contracts
stellar contract invoke --id <CONTRACT_ID> --source deployer --network testnet -- initialize --admin <ADDRESS>

# Submit claim
stellar contract invoke --id <CLAIM_CONTRACT> --source deployer --network testnet -- submit_claim --submitter <ADDRESS> --text "Claim" --category "Science" --sources '["url"]'

# Register expert
stellar contract invoke --id <EXPERT_CONTRACT> --source deployer --network testnet -- register_expert --expert <ADDRESS> --name "Name" --bio "Bio" --expertise_categories '["Science"]' --stake_amount 1000000000

πŸ“ Project Structure

truthstamp/
β”œβ”€β”€ contracts/                  # Smart contracts (Rust)
β”‚   β”œβ”€β”€ claim_registry/        # Claim management contract
β”‚   β”‚   └── src/lib.rs        # Main contract logic (650 lines)
β”‚   β”œβ”€β”€ expert_registry/       # Expert registration contract
β”‚   β”‚   └── src/lib.rs        # Main contract logic (420 lines)
β”‚   └── review_consensus/      # Consensus calculation contract
β”‚       └── src/lib.rs        # Main contract logic (630 lines)
β”œβ”€β”€ truthstamp-app/            # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.tsx           # Main app component
β”‚   β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SubmitClaim.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ BrowseClaims.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ClaimDetail.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ExpertDashboard.tsx
β”‚   β”‚   β”‚   └── Leaderboard.tsx
β”‚   β”‚   └── utils/            # Utility functions
β”‚   β”‚       β”œβ”€β”€ contracts.ts  # Contract interaction
β”‚   β”‚       └── wallet.ts     # Wallet connection
β”‚   └── package.json
β”œβ”€β”€ build.sh                   # Build script for contracts
β”œβ”€β”€ deploy.sh                  # Deployment script
β”œβ”€β”€ invoke_contracts.sh        # CLI helper script
β”œβ”€β”€ Cargo.toml                 # Rust workspace config
└── README.md                  # This file

πŸ“š Documentation

πŸ”§ Tech Stack

Smart Contracts

  • Language: Rust 1.91.0
  • Platform: Stellar Soroban SDK 21.7.7
  • Build: Cargo, WASM target
  • Network: Stellar Soroban Testnet

Frontend

  • Framework: React 18.2.0
  • Language: TypeScript 4.9.5
  • Routing: React Router DOM 6.20.0
  • Blockchain: Stellar SDK, Freighter Wallet
  • Styling: CSS3 with gradients and animations

Tools

  • CLI: Stellar CLI (stellar-cli)
  • Wallet: Freighter Browser Extension
  • Explorer: Stellar Expert
  • Testing: Cargo test, React Testing Library

🎯 Economic Model

Fee Structure

  • Claim Submission: 0.5 XLM
  • Expert Stakes:
    • General: 100 XLM minimum
    • Specialized: 500 XLM minimum
    • Professional: 1000 XLM minimum

Reward Distribution

  • Correct Reviews: 80% of claim pool
  • Incorrect Reviews: 10% stake slashing
  • Stake Pool: Accumulates from submission fees

Reputation Levels

  1. Seedling (0-99 points)
  2. Sprout (100-499 points)
  3. Established (500-999 points)
  4. Expert (1000-4999 points)
  5. Master (5000+ points)

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  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

πŸ“ License

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

πŸ™ Acknowledgments

  • Stellar Foundation - For the Soroban smart contract platform
  • Freighter Team - For the excellent wallet integration
  • Rust Community - For the amazing tooling

πŸ“ž Contact

  • Project: TruthStamp
  • Network: Stellar Soroban Testnet
  • Deployment Date: November 2, 2025

πŸ”— Links


Built with ❀️ on Stellar Soroban

About

Decentralized fact-checking platform on Stellar Soroban

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages