← Back to Arena

Strategy Lab

Preview strategy performance before entering a tournament.

Select Strategy

Preview vs All Strategies

Loading match engine...

Configuration Output

import { createHash, randomBytes } from 'crypto';

// 1. Choose strategy
const strategy = 0; // tit-for-tat

// 2. Generate salt (save this!)
const salt = randomBytes(16);

// 3. Compute commitment for enter_tournament
const preimage = Buffer.from([strategy, ...salt]);
const commitment = createHash('sha256').update(preimage).digest();

// 4. Reveal data for reveal_strategy (same values)
const revealData = { strategy, salt };