A decentralized Reddit-like platform for conspiracy discussions built on the Solana blockchain.
This project creates a decentralized discussion platform where:
- Users authenticate with their Solana wallets
- Content is stored on IPFS (decentralized storage)
- Reputation, votes, and content verification happen on-chain
- The experience remains user-friendly and familiar
- Frontend: Next.js
- Backend: FastAPI
- Blockchain: Solana + Anchor framework
- Storage: IPFS (with Pinata free tier)
- Database: PostgreSQL (for indexing and caching)
-
User Identity
- Wallet addresses serve as user IDs
- Reputation/karma scores
-
Content Verification
- Hashes of content stored in IPFS
- Timestamps of posts/comments
-
Platform Mechanics
- Upvotes/downvotes
- Community governance votes
- Moderation actions
-
Actual Content
- Text of posts/comments (stored on IPFS)
- Images and other media (stored on IPFS)
-
Application Data
- UI preferences
- Temporary states
- Notification settings
Blockchain Responsibilities:
- Connect to user's Solana wallet (via Phantom)
- Display on-chain data (reputation, votes)
- Get transaction signatures from users
- Submit signed transactions to Solana
Implementation:
// Example wallet connection
import { useWallet } from '@solana/wallet-adapter-react';
function LoginButton() {
const { connect, connected } = useWallet();
return !connected && (
<button onClick={connect}>Connect Wallet</button>
);
}Blockchain Responsibilities:
- Prepare complex transactions
- Deploy and update Solana programs
- Index blockchain data for faster queries
- Manage IPFS content storage
Implementation:
# Example transaction preparation
@app.post("/api/posts/create")
async def create_post(post_data: PostCreate):
# Store content on IPFS
ipfs_hash = await store_on_ipfs(post_data.content)
# Prepare Solana transaction for frontend signing
transaction = prepare_post_transaction(
ipfs_hash=ipfs_hash,
user_wallet=post_data.wallet_address
)
return {"transaction": transaction.to_json()}Responsibilities:
- Define on-chain data structures
- Implement platform rules and logic
- Process transactions
Implementation:
// Example Anchor program (simplified)
#[program]
pub mod conspiracy_board {
use super::*;
pub fn submit_post(ctx: Context<SubmitPost>, ipfs_hash: String) -> Result<()> {
let post = &mut ctx.accounts.post;
post.author = ctx.accounts.user.key();
post.ipfs_hash = ipfs_hash;
post.timestamp = Clock::get()?.unix_timestamp;
post.upvotes = 0;
post.downvotes = 0;
Ok(())
}
pub fn upvote(ctx: Context<Vote>) -> Result<()> {
let post = &mut ctx.accounts.post;
post.upvotes += 1;
// Update author's reputation
let author = &mut ctx.accounts.author;
author.reputation += 1;
Ok(())
}
}-
Setup Development Environment
- Install Solana CLI
- Set up local Solana validator
- Configure Anchor framework
- Set up IPFS node or Pinata account
-
Blockchain First Approach
- Develop and test basic Solana programs
- Create post, upvote, user reputation mechanics
-
Backend Development
- Create API endpoints to interact with Solana
- Implement IPFS storage functionality
- Build indexing system for on-chain data
-
Frontend Implementation
- Integrate Solana wallet adapter
- Build UI for creating/viewing posts
- Implement transaction signing flow
- User writes content (Frontend)
- Content stored on IPFS (Backend)
- IPFS hash recorded on Solana (Frontend gets signature, Backend submits)
- Post appears in feed (Frontend fetches from Backend)
- User clicks upvote (Frontend)
- Transaction prepared (Frontend/Backend)
- User signs transaction (Frontend)
- Vote recorded on-chain (Solana)
- Post and user reputation update (Solana)
- Clone this repository
- Install dependencies:
npm install # Frontend dependencies pip install -r requirements.txt # Backend dependencies - Set up local Solana validator:
solana-test-validator - Deploy Anchor programs:
anchor deploy - Start the backend:
uvicorn app.main:app --reload - Start the frontend:
npm run dev