REVEALX DOCS
Full smart contract interfaces, client-side encryption algorithms, prediction pool wagers, and SDK code examples. Build next-generation time-locked escrows on EVM and Solana with RevealX.
QUICK START
Get up and running with RevealX in 4 simple steps: Connect Wallet, Create Capsule, Place Prediction, and Reveal Payload.
Use the header button to connect your MetaMask (for Ethereum Sepolia/Hardhat Local) or Phantom (for Solana Devnet/Testnet/Mainnet) wallet.
# Faucets for local development: # EVM (Hardhat local node): http://127.0.0.1:8545 # Solana (Devnet faucet): solana airdrop 1 <YOUR_WALLET_ADDRESS>
Enter your secrets, specify the unlock timestamp, recipient address, category hint, and lock your stake. The payload gets encrypted locally in your browser.
// Local Encryption & IPFS Upload Flow const aesKey = crypto.getRandomValues(new Uint8Array(32)); const encryptedPayload = await encryptAESGCM(payloadText, aesKey); const encryptedKey = await encryptECIES(aesKey, recipientPublicKey); const ipfsCID = await uploadToIPFS(encryptedPayload);
Community members can browse public capsules in the explore feed and stake native tokens guessing the true category.
// Predict the capsule category on Ethereum
transaction = await timeCapsuleContract.makePrediction(
capsuleId,
uint8(Category.CryptoProfit),
{ value: ethers.parseEther("0.005") }
);Once the unlock date passes, the creator unlocks the capsule, exposing the true category and releasing the stakes. Correct predictors claim their share of the reward pool.
// Claim Solana devnet reward on Win
pub fn claim_reward(ctx: Context<ClaimReward>) -> Result<()> {
let capsule = &ctx.accounts.capsule;
let prediction = &mut ctx.accounts.prediction;
require!(prediction.guess == capsule.category, Error::WrongPrediction);
// ... distributes proportional reward from prediction pool
}