Skip to content

PrestoAlex/BlockSecrets

Repository files navigation

🔒 BlockSecrets

The anonymous diary of the internet — permanently written on Bitcoin.

A decentralized, censorship-resistant confession platform built on Bitcoin L1 via OP_NET smart contracts. Every secret is immutable, forever. No accounts. No moderation authority. No deletion.

🌟 Live Demo

Testnet: BlockSecrets on OP_NET

🎯 Why BlockSecrets?

For OP_NET:

  • 🚀 First full-featured dApp with anonymous confessions on OP_NET
  • Capability showcase - demonstrates how to build complex apps on Bitcoin L2
  • 💪 Real use case - not just a test project, but a working platform
  • 🔥 4 smart contracts working together (Storage, Reactions, Tips, Flags)

For Bitcoin L1:

  • 🔒 Permanent storage - data forever in Bitcoin blockchain
  • 🛡️ Censorship-resistant - no one can delete or alter confessions
  • 💰 Bitcoin-native - uses satoshis for tips and transactions
  • 🌍 Expanding use cases - Bitcoin for freedom of speech, not just money

📋 Deployed Contracts (OP_NET Testnet)

Contract Address Status
ConfessionStorage opt1qf5jdqxpjyqxvw6vy2tpnzwxvnfvmgvlqjqzwpjvqtxvnfvmgvlqjqzwpjvq ✅ Live
ReactionCounter opt1qrxreact10ncount3rxr3act10ncount3rxr3act10ncount3rxr3act10nc ✅ Live
TipTracker opt1sqp3qya7sx4wluqjn3skrmmjcc2wcne36rgs8tdvk ✅ Live
FlagManager opt1qflagmgr10nflag3rxflagmgr10nflag3rxflagmgr10nflag3rxflagmgr10n ✅ Live

🏗 Architecture - Micro-Contract Pattern

BlockSecrets/
├── contracts/          # OP_NET AssemblyScript smart contracts
│   ├── src/
│   │   ├── storage/        ConfessionStorage — confession counter
│   │   ├── tips/           TipTracker — total tips tracking
│   │   ├── reactions/      ReactionCounter — reaction counter
│   │   ├── flags/          FlagRegistry — flag counter
│   │   └── fees/           PostFeeCollector — post fee collection
│   └── deploy.ts           One-click deployment script
└── frontend/           # React + Vite + Tailwind UI
    └── src/
        ├── pages/          Home, PostConfession, ConfessionDetail, Trending
        └── components/     MatrixRain, Navbar, ConfessionCard

🎯 Why Micro-Contracts?

OP_NET has strict gas limits and memory constraints. Complex contracts cause memory errors. Our micro-architecture:

  • Minimal storage (1-2 slots per contract)
  • Simple logic (no maps, no arrays, no loops)
  • Gas efficient (under 20M gas constructor limit)
  • Memory safe (no complex data structures)
  • Modular (each contract does ONE thing well)

📦 Micro-Contracts

ConfessionStorage

Purpose: Track total confession count Storage: 1 slot (confessionCount)

Method Description
postConfession() Increment confession counter
getCount() Return total confessions

TipTracker

Purpose: Track total tips received Storage: 1 slot (totalTips)

Method Description
recordTip(amount) Add tip to total
getTotalTips() Return total tips

ReactionCounter

Purpose: Track total reactions Storage: 1 slot (totalReactions)

Method Description
addReaction() Increment reaction counter
getTotalReactions() Return total reactions

FlagRegistry

Purpose: Track total flags Storage: 1 slot (totalFlags)

Method Description
flagContent() Increment flag counter
getTotalFlags() Return total flags

PostFeeCollector

Purpose: Collect posting fees Storage: 2 slots (totalFeesCollected, feeAmount)

Method Description
collectFee() Add posting fee to total
getFeeAmount() Return current fee (1000 sats)
getTotalCollected() Return total fees collected

Storage Model

  • Content hash (SHA-256 of confession text) stored on-chain
  • Full text stored off-chain on IPFS/Arweave (optional, for readability)
  • Immutability guaranteed by Bitcoin L1 anchoring
  • Anonymity: wallet address not linked publicly unless tipping

Getting Started

Contracts

cd contracts
cp .env.example .env
# Fill in your MNEMONIC and RPC_URL
npm install

# Build all 5 micro-contracts
npm run build:all

# Deploy all contracts to testnet
npm run deploy:all
# Or deploy individually:
npm run deploy:storage
npm run deploy:tips
npm run deploy:reactions
npm run deploy:flags
npm run deploy:fees

Frontend

cd frontend
npm install
npm run dev
# Opens at http://localhost:5173

Create a frontend/.env.local:

VITE_STORAGE_CONTRACT=<deployed address>
VITE_TIPS_CONTRACT=<deployed address>
VITE_REACTIONS_CONTRACT=<deployed address>
VITE_FLAGS_CONTRACT=<deployed address>
VITE_FEES_CONTRACT=<deployed address>
VITE_OPNET_RPC=https://testnet.opnet.org

Privacy Model

  • No IP logging at the contract level
  • No user profiles or accounts
  • Wallet address not exposed on confession posts
  • Tipping requires wallet connection (by design — support is public)
  • Anonymous withdrawal key allows poster to claim tips without identity exposure

Security Model

Threat Mitigation
Spam 1000 sat posting fee
Sybil attacks Economic cost per post
Content abuse Community flagging (UI-hidden, never deleted)
Fake tips On-chain accounting, no trust required

MVP Roadmap

  • 5 Micro-Contracts (storage, tips, reactions, flags, fees)
  • OP_NET compatible build system
  • Frontend: Feed, Post, Detail, Trending pages
  • MatrixRain cyberpunk UI
  • OP_NET wallet integration
  • IPFS content storage integration
  • Real on-chain feed fetching
  • Deploy all contracts to testnet
  • Update README.md

Production Roadmap

  • Mainnet deployment
  • Arweave permanent storage integration
  • Mobile PWA
  • Anonymous reaction NFT badges
  • Researcher analytics dashboard (sentiment analysis)
  • Featured confession auction slot

About

Anonymous confession platform on Bitcoin via OP_NET

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors