Developer Documentation

Build Skill Games
on Litecoin

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.

✓ Provably Fair SHA-256 Ł Litecoin Mainnet ⚡ <$0.01 Fees 🔒 HMAC-Signed Sessions
Getting Started

Ship Your First Match in 15 Minutes

1. Install the AGE SDKbash
# Via npm
npm install @age-protocol/sdk

# Or import directly
import { AGEProtocol } from 'https://sdk.ancestralgaming.com/v1/age.min.js'
2. Initialize with your API keyjavascript
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'
3. Create a wagered match — age.matches.create / age.matches.settlejavascript
// 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)
4. Settle the match and release escrowjavascript
// 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
Core Primitives

Everything You Need to Build

Six production-hardened systems, available as a single SDK. Each is independently auditable on-chain.

🔒
Provably Fair Engine

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.

HD Wallet System

BIP32/BIP44 deterministic address derivation. Every user gets a unique LTC address from a single master seed. No key management overhead. PBKDF2-SHA256 auth.

Escrow & Settlement

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.

📊
ELO Matchmaking

Production ELO rating system with K-factor calibration. Match players within configurable ELO bands. Anti-smurf protection. Configurable for your skill distribution.

🏆
Tournament Engine

Single elimination, round robin, and Swiss brackets. Prize pool split configuration. Anti-collusion lock intervals. Up to 256 players per tournament.

🔑
KYC Tiers

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.

API Reference

REST Endpoints

MethodEndpointDescription
POST/match/createCreate a new wagered match, lock escrow
POST/match/settleSettle outcome, release prize to winner
POST/match/queueEnter matchmaking queue with wager + ELO
GET/match/:idRetrieve match state + provably fair proof
POST/wallet/addressGet or derive LTC address for a user
GET/wallet/balanceLive LTC balance from mainnet
POST/escrow/createLock funds in escrow for a match
POST/escrow/settleRelease escrow to winner address
POST/auth/registerCreate player account, issue session token
POST/auth/loginAuthenticate, return HMAC signing key
POST/tournament/createCreate bracket, set prize split
GET/stats/publicPlatform-wide stats: players, volume, matches
Certified Game Engines

Drop-In Game Engines

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.

Embed any certified enginejavascript
// 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
  })
})
Protocol Pricing

Pay Per Match, Not Per Seat

AGE Protocol charges a small protocol fee per settled match. No monthly minimums. No user caps. Scale to zero, scale to millions.

Starter
0.5%
per settled match · first $10K volume free
  • All 6 game engines
  • Provably fair protocol
  • HD wallet per user
  • ELO matchmaking
  • Community support
Enterprise
0.1%
per settled match · $1M+ monthly volume
  • Everything in Growth
  • Custom game engines
  • Dedicated infra
  • 99.99% SLA
  • On-call support
  • White-label SDK
  • Revenue share options
Humanitarian
Free
for verified NGOs · refugee programs · education
  • Full protocol access
  • AGE Foundation co-branding
  • Impact reporting
  • Grant writing support
  • UNHCR referral network
Start Building Today

API keys issued within 24 hours. Full sandbox environment included. No credit card required to start.

Get Your API Key → View Live Platform