Static Frontend + TN12 Node. No Backend.
The BlockDAG is the server.
Run The DAG Gate as a static frontend that connects directly to a Kaspa TN12 node via wRPC WebSocket. Game state lives on-chain as covenant-enforced UTXOs. No backend server. No database. No middleware. The browser talks to the BlockDAG.
GitHub Pages (static) TN12 Node ┌──────────────┐ ┌──────────────────┐ │ HTML/CSS/JS │ │ wRPC JSON :18310 │ │ kaspa-wasm │◄──WSS──►│ Covenant engine │ │ (tx build) │ │ ZK verification │ └──────────────┘ └──────────────────┘
Browser reads UTXOs, builds covenant txs via kaspa-wasm, signs locally, submits via wRPC.
Browser connects directly to our TN12 node via wRPC WebSocket. All covenant operations — UTXO lookups, transaction submission, block info — go through wRPC.
Running kaspad from the tn12 branch on a DigitalOcean droplet.
wRPC endpoint at wss://tn12.dagknight.xyz.
Fully synced, accepting covenant transactions that public APIs reject as "non-standard".
@kasdk/web WASM SDK runs in browser.
PrivateKey, ScriptBuilder, Transaction,
createInputSignature (Schnorr) all proven.
Custom covenant scripts built and submitted via wRPC.
Static site on GitHub Pages. Browser connects to TN12 node via WebSocket. Only infrastructure: the node itself and a CPU miner that funds new players from block rewards. The BlockDAG is the server.
Character state lives on-chain as a covenant-enforced UTXO. The browser builds, signs, and submits real covenant transactions through our TN12 node. Game rules are enforced by the L1.
player.sil compiled to 160-byte bytecode — single entrypoint, checkSig + validateOutputState
validateOutputState verified on-chain
checkSig verifies only the owner can update their character — proven on TN12
Self-preserving UTXO. 160 bytes compiled from SilverScript.
Holds owner pubkey, HP, gold, level. Every spend recreates the UTXO with updated state.
Owner-signed via Schnorr checkSig. State validated via validateOutputState.
Game rules enforced on L1: require(newLevel >= level).
Deterministic from BlockDAG. Combat seed derived from the node's tip block hash. Monster selection and all damage rolls use a seeded xorshift64 PRNG — deterministic and replayable. Anyone can verify combat outcomes given the seed + player stats. No separate covenant needed.
Persistent shared state. 56 bytes compiled from SilverScript. Tracks gold collected. ICC with Player covenant: atomic tx validates gold transfer in a single transaction. Two covenants, one tx, zero trust.
PvP NPC covenant. 80 bytes compiled from SilverScript. Tracks opponent HP and gold. ICC with Player covenant: atomic PvP resolution in a single transaction. Winner gains gold, loser loses gold. Three covenants deployed per player: 296 bytes total on-chain.
Complex combat math runs off-chain in a RISC Zero guest program. Input: player stats, monster stats, random seed from block hash. Output: valid state transition (new HP, XP, gold). The proof is submitted alongside the covenant spend — the L1 verifies without re-executing. For simpler math, inline SilverScript validation avoids proof overhead entirely.
Active Knights panel shows all players with name, class, and level. On-node indexer tracks registrations. Players register on character creation. Real-time leaderboard without scanning UTXOs.
Daily fight reset: require(this.age > 86400) on Player UTXO —
no server clock needed. Gold = locked test KAS (sompi).
PvP stakes: both players lock KAS, winner takes pot.
@kasdk/web v0.15.2, ScriptBuilder + Transaction confirmed workingapi-tn12.kaspa.org is public, includes tx submissionplayer.sil compiled to 160-byte P2SH bytecode via silverc
The Covenant Forge — how the magic works →
← Back to The DAG Gate