A Decentralized Time-Locked Prediction Protocol
A decentralized social platform where future posts are locked on-chain, audiences stake on predictions, and truth is revealed at a fixed time.
Social media today is reactive. People share opinions after events unfold, often rewriting history to fit narratives. There's no accountability for predictions, no skin in the game, and no trustless way to prove what someone said before an outcome occurred.
Why this matters:
- Influencers make bold claims with zero accountability
- "I told you so" culture lacks cryptographic proof
- Prediction markets are complex and inaccessible to mainstream users
- No social layer exists for time-locked content with community engagement
RevealX transforms how predictions and time-sensitive content are shared. Users create encrypted "capsules" locked until a specific future date. The community stakes ETH to predict the capsule's category (e.g., "Startup Success", "Crypto Price Prediction"). When time unlocks the capsule, winners split the prediction pool—creating a gamified, trustless social prediction market.
- 🔒 Time-Locked Capsules — Content encrypted client-side and locked on-chain until unlock time
- 💰 Socializd Staking — Creators stake ETH as commitment; predictors stake to guess outcomes
- 🎯 Prediction Markets — Guess capsule categories and earn rewards for correct predictions
- ⭐ Social Layer — Like capsules, star users, build reputation through accuracy
- 🏆 Leaderboards — Compete for the top predictor spot
- 🔐 Zero-Knowledge Privacy — Content never leaves your browser unencrypted
- 🚫 No Admin Keys — Fully immutable smart contracts with no backdoors
RevealX follows a decentralized architecture with clear separation between on-chain and off-chain components:
┌─────────────────────────────────────────────────────────────────┐
│ FRONTEND │
│ Next.js 14 + TypeScript + TailwindCSS + Shadcn UI │
│ Client-side AES-256 encryption + Wallet integration │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ SMART CONTRACTS (Ethereum) │
│ • Capsule creation & time-lock enforcement │
│ • Prediction staking & reward distribution │
│ • Social interactions (likes/stars) │
│ • ReentrancyGuard + No admin privileges │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ DECENTRALIZED STORAGE │
│ IPFS via Pinata — Encrypted content storage │
└─────────────────────────────────────────────────────────────────┘
| Category | Technologies |
|---|---|
| Blockchain | Ethereum, Solidity 0.8.20, Hardhat |
| Smart Contracts | OpenZeppelin (ReentrancyGuard), Custom prediction logic |
| Frontend | Next.js 14, TypeScript, TailwindCSS, Shadcn UI |
| Wallet | Ethers.js v6, MetaMask, RainbowKit |
| Storage | IPFS (Pinata) |
| Encryption | CryptoJS (AES-256), Signature-based key derivation |
| Tooling | ESLint, Prettier, Hardhat |
- Node.js 18+
- npm or yarn
- MetaMask browser extension
- Git
# Clone the repository
git clone https://github.com/iamomm-hack/revealx.git
cd revealx
# Install frontend dependencies
npm install
# Install smart contract dependencies
cd smart-contracts
npm install
cd ..Create a .env.local file in the project root:
NEXT_PUBLIC_CONTRACT_ADDRESS="<deployed_contract_address>"
NEXT_PUBLIC_PINATA_JWT="<your_pinata_jwt_token>"
NEXT_PUBLIC_GATEWAY_URL="https://gateway.pinata.cloud"# Start local blockchain (Terminal 1)
cd smart-contracts
npx hardhat node
# Deploy contracts (Terminal 2)
npx hardhat run scripts/deploy.js --network localhost
# Start frontend (Terminal 3)
cd ..
npm run devOpen http://localhost:3000 in your browser.
| Contract | Purpose |
|---|---|
TimeCapsule.sol |
Core protocol logic: capsule creation, time-lock enforcement, predictions, rewards |
// Create a time-locked capsule with ETH stake
function createCapsule(address _recipient, uint256 _unlockTime, string calldata _ipfsCid, ...) external payable
// Predict capsule category by staking ETH
function makePrediction(uint256 _id, uint8 _guess) external payable
// Unlock capsule after time expires (triggers reward calculation)
function unlockCapsule(uint256 _id) external
// Winners claim their share of the prediction pool
function claimReward(uint256 _id) external- ReentrancyGuard — All state-changing functions protected
- No Admin Keys — Contract is fully immutable post-deployment
- Time Enforcement —
block.timestampused for trustless unlock logic - Stake Validation — Minimum stakes enforced to prevent spam
- Connect your MetaMask wallet
- Click "Create Capsule"
- Enter your message, select category, set unlock date
- Stake ETH as commitment
- Content is encrypted and uploaded to IPFS
- Capsule metadata stored on-chain
- Browse public capsules in the Explore page
- Read the hint provided by the creator
- Stake ETH and guess the category
- Wait for unlock time
- If correct, claim your share of the reward pool
- Like Capsules — Show appreciation (on-chain)
- Star Users — Follow top predictors
- Leaderboard — Compete for rankings
✅ Unauthorized early access to capsule content
✅ Manipulation of unlock times after creation
✅ Prediction pool theft or admin rug pulls
✅ Content tampering (IPFS + encryption)
✅ Replay attacks (ReentrancyGuard)
- Users trust the Ethereum network consensus
- Users trust their browser environment for encryption
- IPFS pinning is reliable via Pinata
- Core smart contract development
- Frontend MVP with create/predict/unlock flows
- Social features (likes, stars, profiles)
- Mainnet deployment
- Multi-chain support (Polygon, Arbitrum)
- NFT integration for capsule ownership
- Mobile-responsive PWA
- Advanced analytics dashboard
- DAO governance for protocol upgrades
- Token launch (governance + staking rewards)
- SDK for third-party integrations
- Enterprise API
We welcome contributions from the community!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use ESLint and Prettier for formatting
- Follow existing naming conventions
- Write meaningful commit messages
- Add tests for new features
- Ensure all tests pass
- Update documentation if needed
- Request review from maintainers
- Squash commits before merge
This project is licensed under the MIT License — see the LICENSE file for details.
You are free to use, modify, and distribute this software for any purpose.
- OpenZeppelin — Secure smart contract libraries
- Pinata — IPFS pinning service
- Shadcn UI — Beautiful React components
- Ethers.js — Ethereum library
Built with ❤️ for the decentralized future
