The AGE Protocol gives you provably fair mechanics, HD wallet derivation, real-time escrow, and ELO matchmaking — all production-tested on the Litecoin mainnet. Ship in hours, not months.
# Via npm npm install @age-protocol/sdk # Or import directly import { AGEProtocol } from 'https://sdk.ancestralgaming.com/v1/age.min.js'
const age = new AGEProtocol({ apiKey: 'age_live_xxxxxxxxxxxxxxxx', network: 'litecoin', // 'litecoin' | 'litecoin-testnet' platformFee: 0.04, // your take: 0–10% webhookUrl: 'https://yourdomain.com/age-webhook' }) // Test connectivity const health = await age.health() console.log(health.status) // → 'operational'
// Commit-reveal provably fair protocol — automatic // age.matches.create — age.matches.settle const match = await age.matches.create({ game: 'your-game-id', wagerLtc: 0.05, player1: { username: 'alice', ltcAddress: 'ltc1q...' }, player2: { username: 'bob', ltcAddress: 'ltc1q...' }, }) console.log(match.matchId) // → 'M-1775512345-A3F2' console.log(match.escrowId) // → 'ESC-B7C4F1A2' console.log(match.seedHash) // → 'sha256: 8a3f...' (committed) console.log(match.prizePool) // → 0.096 LTC (after 4% fee)
// Called from your game engine when match ends const result = await age.matches.settle({ matchId: match.matchId, winner: 'alice', gameStats: { score: 7, duration: 142, moves: 23 }, clientSeed: playerSeed // reveals the committed seed }) // Litecoin sent to winner automatically console.log(result.txid) // → 'a1b2c3...' (mainnet tx) console.log(result.outcomeHash) // → verifiable proof of fairness
Six production-hardened systems, available as a single SDK. Each is independently auditable on-chain.
SHA-256 commit-reveal protocol. Server commits to a seed hash before the match. Seed revealed post-game. Any player can independently verify any outcome. Zero trust required.
BIP32/BIP44 deterministic address derivation. Every user gets a unique LTC address from a single master seed. No key management overhead. PBKDF2-SHA256 auth.
HMAC-signed escrow creation, lock, and release. Funds are escrowed on-chain at match start, released to winner in a single transaction. Automatic refunds on disconnect.
Production ELO rating system with K-factor calibration. Match players within configurable ELO bands. Anti-smurf protection. Configurable for your skill distribution.
Single elimination, round robin, and Swiss brackets. Prize pool split configuration. Anti-collusion lock intervals. Up to 256 players per tournament.
3-tier KYC system. Tier 0: anonymous play. Tier 1: email verified. Tier 2: ID verified. Each tier unlocks higher wager limits. Pluggable into any KYC provider.
| Method | Endpoint | Description |
|---|---|---|
| POST | /match/create | Create a new wagered match, lock escrow |
| POST | /match/settle | Settle outcome, release prize to winner |
| POST | /match/queue | Enter matchmaking queue with wager + ELO |
| GET | /match/:id | Retrieve match state + provably fair proof |
| POST | /wallet/address | Get or derive LTC address for a user |
| GET | /wallet/balance | Live LTC balance from mainnet |
| POST | /escrow/create | Lock funds in escrow for a match |
| POST | /escrow/settle | Release escrow to winner address |
| POST | /auth/register | Create player account, issue session token |
| POST | /auth/login | Authenticate, return HMAC signing key |
| POST | /tournament/create | Create bracket, set prize split |
| GET | /stats/public | Platform-wide stats: players, volume, matches |
All 6 certified AGE engines are available as iframe embeds. Each sends AGE_RESULT via postMessage on match end — your platform collects it and calls /match/settle.
// Load engine in your iframe ifrm.src = `https://engines.ancestralgaming.com/CueLTC?` + new URLSearchParams({ apiKey: 'age_live_xxx', matchId: match.matchId, wager: match.wagerLtc, player: 'alice', seed: match.seed }) // Listen for result window.addEventListener('message', async (e) => { if (e.data.type !== 'AGE_RESULT') return await age.matches.settle({ matchId: match.matchId, winner: e.data.outcome === 'win' ? 'alice' : 'bob', gameStats: e.data }) })
AGE Protocol charges a small protocol fee per settled match. No monthly minimums. No user caps. Scale to zero, scale to millions.