How ZK-Sniper works
ZK-Sniper is a two-sided guessing game on an 8x8 grid. A hider locks BNB behind one secret square. Snipers pay to guess squares. The hider answers every guess with a zero-knowledge proof, so the square stays secret until somebody guesses it.
ZK-Sniper is not deployed on any network, including BSC mainnet. This page describes the rules implemented in the repository. There are no addresses, no live rounds and no audit yet. See Security model.
The price curve rewards snipers with deep pockets, a hider whose answerer is down for a whole answer window loses by timeout, and a hider with a second wallet can exit without facing a hit and keep real snipers' fees for about 10% of the collateral. Read Economics and fairness and the known limitations before putting money in on either side. Rounds are meant to be hosted only by platform-approved addresses at launch (House rounds); that changes who the hider is, but the chain cannot prove the House does not shoot its own round.
Who can host a round
createRound is gated. It succeeds only if the contract's openCreation flag is true or the
caller is an approvedHider; otherwise it reverts HiderNotApproved. The intended launch is
House-only: openCreation is false and only approved addresses host rounds, because the chain
cannot tell a hider's second address from a real sniper. The gate applies only to creating a
round. It never touches shots, answers, timeouts, extraction, escape or withdrawals, and changing
it never affects a round that is already running. See House rounds.
The idea in one minute
- The hider picks a square (x, y) and a random secret salt, and publishes only a commitment: a Poseidon hash of the three values. The hider also locks collateral worth 64 times a chosen base fee.
- A sniper pays the current shot cost and names a square. That square is now pending, with its own answer deadline. Other snipers can keep firing at other squares while it waits: any number of shots can be pending at once.
- The hider's answerer sends a zero-knowledge proof that the sniper's square is a hit or a miss relative to the committed square. The contract checks the proof. The proof reveals nothing else about the square. This is automatic: all 64 proofs are built before the round goes live, so an answer is just a transaction, and it normally lands in about 1 to 3 seconds (Answer times).
- A miss clears that square's pending shot; its fee stays in the pool, which grows. A hit pays the whole pool (less the rake) to the sniper who hit it and ends the round.
- If nothing answers a shot before its deadline, that sniper takes the pool anyway (timeout). The deadline is a failure backstop, about 2 minutes by default, not the normal pace of the game.
- The hider can instead extract: start a short countdown and walk away with the pool (less a rake on the fees) if nobody hits first and every pending shot has been answered.
Timeline of a round
Time is counted in blocks, never seconds. The numbers below use the defaults and the BSC block time of about 0.45 s (since the Fermi hard fork), so they move if the chain's block time does. A shot is normally answered within a few seconds, long before any clock matters; the clocks describe what happens when an answer does not come.
If instead B had hit the hider's square and the hider answered with a hit proof, B would be paid
the pool less 10% and the round would end at once. If the hider never answered B, B would call
claimTimeout after B's own deadline and be paid the same way.
The clocks
| Clock | Starts | Length (default) | Real time at 0.45 s | Allowed range (blocks) |
|---|---|---|---|---|
| Answer window | When a shot is fired; one clock per pending shot | 267 blocks | about 2 minutes | 67 to 28,800 (about 30 seconds to 3.6 hours) |
| Extraction countdown | When the hider calls initiateExtraction | 100 blocks | about 45 seconds | 20 to 28,800 (about 9 seconds to 3.6 hours) |
The answer window is the failure backstop: answers are automatic and normally land in seconds, so the
window is how long a hider's answerer may be down, not how long the hider has to act. Both lengths
are copied into each round when it is created. The owner can change the settings
later, but only rounds created afterwards pick the change up: no running clock and no future clock
of a round that already exists can move. Read the two numbers from getRound (fields
answerWindowBlocks and extractionWindowBlocks) before you play.
Why shots are concurrent
An earlier design allowed only one pending shot at a time. That let a hider fire once from a second wallet, never answer, and so hold the only slot through the whole extraction countdown while real snipers were locked out, then answer their own shot and escape risk-free. A single slot also let anybody send a 1-wei sponsorship just before a duel shot and make the exact-fee transaction revert.
The contract now keeps one pending record per square. Firing needs only an unshot square, so a parked shot blocks nothing but its own square. The price still rises with every shot fired, answered or not. Concurrency does not remove the second-wallet limitations: a hider with a second wallet can still exit without facing a hit and keep real snipers' fees, as described under Timeout and the race between expired shots.
The board
- 8 columns (x = 0 to 7, shown as A to H) and 8 rows (y = 0 to 7, shown as 1 to 8), so 64 squares.
- Each square can be guessed once per round, even if the first guess was a miss. The contract
tracks fired squares in a 64-bit bitmap (bit
y * 8 + x) and, separately, the squares that are still waiting for an answer. - The proof circuit rejects coordinates of 8 or more, both for the hider's committed square and for a guess.
The commitment
The hider's commitment is
positionHash = Poseidon(x, y, salt) // BN254 Poseidon, 3 inputs
- Only the hash goes on-chain, in
createRound. - The salt is a random field element. It is what makes the hash impossible to guess: without it, anybody could hash all 64 possible squares and compare. Never use a memorable salt.
- The same hash can only be used for one round ever. The commitment contains no hider
address, so a front-runner can copy a hash from the mempool and take it first (squatting).
Your
createRoundthen reverts withPositionHashUsedand you retry with a fresh salt. The squatter cannot answer shots, so it only locks its own collateral. - The hash must be a valid field element (below the BN254 scalar field), as the proof system requires.
- Because the circuit only accepts squares on the grid, a hider cannot commit to a square that does not exist (which could never be hit). See the circuit reference.
Shot prices
Everything below is deterministic and can be recomputed by anyone. The SDK exports the same math
(sniperShotCost, sniperPricingMatrix, sniperHitPayout, sniperEscapePayout) and the contract
rounds down in exactly the same places.
Let baseFee be the hider's chosen base fee and remaining = 64 - shotsTaken.
| Rule | Value |
|---|---|
| Collateral (paid once at creation, no top-ups) | baseFee * 64 |
| Opening pool | the collateral |
Cost of the next shot when remaining > 2 | baseFee * 64 / remaining (rounded down) |
Cost of the next shot when remaining <= 2 (the final duel) | pool / 2 (rounded down) |
| Every shot | its fee is added to the pool when the shot is fired |
So the price of a shot goes up as squares run out: the first shot costs exactly the base fee,
the shot after 32 misses costs twice that, and the shot after 48 misses four times that. The pool
only grows, and shotsTaken goes up when a shot is fired, not when it is answered. With
several shots pending, each new shooter therefore already pays the higher price.
You must send at least the current shot cost. The contract keeps exactly the cost and
refunds the excess to you (through the same push that pays winners; if your address cannot
receive it, the refund is credited for withdraw). A pad protects you only against a price rise
smaller than the pad. A sponsorship, or another shot that takes the squares left from 3 to 2
(the price jumps to half the pool), can raise the price by more than any pad, and your shot then
reverts with InsufficientFee and charges nothing. The hider's own address cannot fire at its
round.
Worked table: base fee 0.01 BNB
The collateral is 0.64 BNB. Amounts are in BNB, rounded to four decimals; each row assumes every earlier shot was a miss and nobody sponsored the round. "Hit pays" is what the sniper receives if this shot hits (pool plus the shot fee, less the 10% rake). "Escape pays" is what the hider would receive by escaping with this pool, before this shot is fired.
| Shots taken | Squares left | Pool before | Shot cost | Hit pays | Rake on a hit | Hit return | Chance (random square) | Escape pays |
|---|---|---|---|---|---|---|---|---|
| 0 | 64 | 0.6400 | 0.0100 | 0.5850 | 0.0650 | 58.50x | 1.56% | 0.6400 |
| 1 | 63 | 0.6500 | 0.0102 | 0.5941 | 0.0660 | 58.49x | 1.58% | 0.6490 |
| 8 | 56 | 0.7247 | 0.0114 | 0.6626 | 0.0736 | 57.97x | 1.78% | 0.7163 |
| 16 | 48 | 0.8225 | 0.0133 | 0.7522 | 0.0836 | 56.42x | 2.08% | 0.8042 |
| 24 | 40 | 0.9378 | 0.0160 | 0.8584 | 0.0954 | 53.65x | 2.50% | 0.9080 |
| 32 | 32 | 1.0787 | 0.0200 | 0.9888 | 0.1099 | 49.44x | 3.12% | 1.0348 |
| 40 | 24 | 1.2595 | 0.0267 | 1.1575 | 0.1286 | 43.41x | 4.16% | 1.1975 |
| 48 | 16 | 1.5124 | 0.0400 | 1.3972 | 0.1552 | 34.93x | 6.25% | 1.4252 |
| 56 | 8 | 1.9367 | 0.0800 | 1.8150 | 0.2017 | 22.69x | 12.50% | 1.8070 |
| 60 | 4 | 2.3428 | 0.1600 | 2.2525 | 0.2503 | 14.08x | 25.00% | 2.1725 |
| 61 | 3 | 2.5028 | 0.2133 | 2.4445 | 0.2716 | 11.46x | 33.33% | 2.3165 |
| 62 | 2 | 2.7161 | 1.3580 | 3.6667 | 0.4074 | 2.70x | 50.00% | 2.5085 |
| 63 | 1 | 4.0741 | 2.0371 | 5.5001 | 0.6111 | 2.70x | 100.00% | 3.7307 |
The last two rows are the final duel: with two squares left the shot costs half the pool, and with one square left the shot is a certain hit if all the other 63 squares were answered misses. While other shots are still pending that does not hold, because the hider's square may be among them. A rational hider extracts before that.
All 64 rows (base fee 0.01 BNB)
| Shots taken | Squares left | Pool before | Shot cost | Hit pays | Rake on a hit | Hit return | Chance (random square) | Escape pays |
|---|---|---|---|---|---|---|---|---|
| 0 | 64 | 0.6400 | 0.0100 | 0.5850 | 0.0650 | 58.50x | 1.56% | 0.6400 |
| 1 | 63 | 0.6500 | 0.0102 | 0.5941 | 0.0660 | 58.49x | 1.58% | 0.6490 |
| 2 | 62 | 0.6602 | 0.0103 | 0.6034 | 0.0670 | 58.46x | 1.61% | 0.6581 |
| 3 | 61 | 0.6705 | 0.0105 | 0.6129 | 0.0681 | 58.41x | 1.63% | 0.6674 |
| 4 | 60 | 0.6810 | 0.0107 | 0.6225 | 0.0692 | 58.36x | 1.66% | 0.6769 |
| 5 | 59 | 0.6916 | 0.0108 | 0.6322 | 0.0702 | 58.28x | 1.69% | 0.6865 |
| 6 | 58 | 0.7025 | 0.0110 | 0.6422 | 0.0714 | 58.20x | 1.72% | 0.6962 |
| 7 | 57 | 0.7135 | 0.0112 | 0.6523 | 0.0725 | 58.09x | 1.75% | 0.7062 |
| 8 | 56 | 0.7247 | 0.0114 | 0.6626 | 0.0736 | 57.97x | 1.78% | 0.7163 |
| 9 | 55 | 0.7362 | 0.0116 | 0.6730 | 0.0748 | 57.84x | 1.81% | 0.7266 |
| 10 | 54 | 0.7478 | 0.0119 | 0.6837 | 0.0760 | 57.69x | 1.85% | 0.7370 |
| 11 | 53 | 0.7597 | 0.0121 | 0.6946 | 0.0772 | 57.52x | 1.88% | 0.7477 |
| 12 | 52 | 0.7717 | 0.0123 | 0.7056 | 0.0784 | 57.33x | 1.92% | 0.7586 |
| 13 | 51 | 0.7840 | 0.0125 | 0.7169 | 0.0797 | 57.13x | 1.96% | 0.7696 |
| 14 | 50 | 0.7966 | 0.0128 | 0.7285 | 0.0809 | 56.91x | 2.00% | 0.7809 |
| 15 | 49 | 0.8094 | 0.0131 | 0.7402 | 0.0822 | 56.67x | 2.04% | 0.7925 |
| 16 | 48 | 0.8225 | 0.0133 | 0.7522 | 0.0836 | 56.42x | 2.08% | 0.8042 |
| 17 | 47 | 0.8358 | 0.0136 | 0.7645 | 0.0849 | 56.14x | 2.12% | 0.8162 |
| 18 | 46 | 0.8494 | 0.0139 | 0.7770 | 0.0863 | 55.85x | 2.17% | 0.8285 |
| 19 | 45 | 0.8633 | 0.0142 | 0.7898 | 0.0878 | 55.53x | 2.22% | 0.8410 |
| 20 | 44 | 0.8775 | 0.0145 | 0.8029 | 0.0892 | 55.20x | 2.27% | 0.8538 |
| 21 | 43 | 0.8921 | 0.0149 | 0.8163 | 0.0907 | 54.84x | 2.32% | 0.8669 |
| 22 | 42 | 0.9070 | 0.0152 | 0.8300 | 0.0922 | 54.47x | 2.38% | 0.8803 |
| 23 | 41 | 0.9222 | 0.0156 | 0.8440 | 0.0938 | 54.07x | 2.43% | 0.8940 |
| 24 | 40 | 0.9378 | 0.0160 | 0.8584 | 0.0954 | 53.65x | 2.50% | 0.9080 |
| 25 | 39 | 0.9538 | 0.0164 | 0.8732 | 0.0970 | 53.21x | 2.56% | 0.9224 |
| 26 | 38 | 0.9702 | 0.0168 | 0.8884 | 0.0987 | 52.75x | 2.63% | 0.9372 |
| 27 | 37 | 0.9871 | 0.0173 | 0.9039 | 0.1004 | 52.26x | 2.70% | 0.9524 |
| 28 | 36 | 1.0044 | 0.0178 | 0.9199 | 0.1022 | 51.75x | 2.77% | 0.9679 |
| 29 | 35 | 1.0222 | 0.0183 | 0.9364 | 0.1040 | 51.21x | 2.85% | 0.9839 |
| 30 | 34 | 1.0404 | 0.0188 | 0.9533 | 0.1059 | 50.65x | 2.94% | 1.0004 |
| 31 | 33 | 1.0593 | 0.0194 | 0.9708 | 0.1079 | 50.06x | 3.03% | 1.0173 |
| 32 | 32 | 1.0787 | 0.0200 | 0.9888 | 0.1099 | 49.44x | 3.12% | 1.0348 |
| 33 | 31 | 1.0987 | 0.0206 | 1.0074 | 0.1119 | 48.79x | 3.22% | 1.0528 |
| 34 | 30 | 1.1193 | 0.0213 | 1.0266 | 0.1141 | 48.12x | 3.33% | 1.0714 |
| 35 | 29 | 1.1406 | 0.0221 | 1.0464 | 0.1163 | 47.42x | 3.44% | 1.0906 |
| 36 | 28 | 1.1627 | 0.0229 | 1.0670 | 0.1186 | 46.68x | 3.57% | 1.1104 |
| 37 | 27 | 1.1856 | 0.0237 | 1.0883 | 0.1209 | 45.91x | 3.70% | 1.1310 |
| 38 | 26 | 1.2093 | 0.0246 | 1.1105 | 0.1234 | 45.11x | 3.84% | 1.1523 |
| 39 | 25 | 1.2339 | 0.0256 | 1.1335 | 0.1259 | 44.28x | 4.00% | 1.1745 |
| 40 | 24 | 1.2595 | 0.0267 | 1.1575 | 0.1286 | 43.41x | 4.16% | 1.1975 |
| 41 | 23 | 1.2861 | 0.0278 | 1.1826 | 0.1314 | 42.50x | 4.34% | 1.2215 |
| 42 | 22 | 1.3140 | 0.0291 | 1.2088 | 0.1343 | 41.55x | 4.54% | 1.2466 |
| 43 | 21 | 1.3431 | 0.0305 | 1.2362 | 0.1374 | 40.56x | 4.76% | 1.2728 |
| 44 | 20 | 1.3735 | 0.0320 | 1.2650 | 0.1406 | 39.53x | 5.00% | 1.3002 |
| 45 | 19 | 1.4055 | 0.0337 | 1.2953 | 0.1439 | 38.45x | 5.26% | 1.3290 |
| 46 | 18 | 1.4392 | 0.0356 | 1.3273 | 0.1475 | 37.33x | 5.55% | 1.3593 |
| 47 | 17 | 1.4748 | 0.0376 | 1.3612 | 0.1512 | 36.16x | 5.88% | 1.3913 |
| 48 | 16 | 1.5124 | 0.0400 | 1.3972 | 0.1552 | 34.93x | 6.25% | 1.4252 |
| 49 | 15 | 1.5524 | 0.0427 | 1.4356 | 0.1595 | 33.65x | 6.66% | 1.4612 |
| 50 | 14 | 1.5951 | 0.0457 | 1.4767 | 0.1641 | 32.30x | 7.14% | 1.4996 |
| 51 | 13 | 1.6408 | 0.0492 | 1.5210 | 0.1690 | 30.90x | 7.69% | 1.5407 |
| 52 | 12 | 1.6900 | 0.0533 | 1.5690 | 0.1743 | 29.42x | 8.33% | 1.5850 |
| 53 | 11 | 1.7434 | 0.0582 | 1.6214 | 0.1802 | 27.87x | 9.09% | 1.6330 |
| 54 | 10 | 1.8016 | 0.0640 | 1.6790 | 0.1866 | 26.23x | 10.00% | 1.6854 |
| 55 | 9 | 1.8656 | 0.0711 | 1.7430 | 0.1937 | 24.51x | 11.11% | 1.7430 |
| 56 | 8 | 1.9367 | 0.0800 | 1.8150 | 0.2017 | 22.69x | 12.50% | 1.8070 |
| 57 | 7 | 2.0167 | 0.0914 | 1.8973 | 0.2108 | 20.75x | 14.28% | 1.8790 |
| 58 | 6 | 2.1081 | 0.1067 | 1.9933 | 0.2215 | 18.69x | 16.66% | 1.9613 |
| 59 | 5 | 2.2148 | 0.1280 | 2.1085 | 0.2343 | 16.47x | 20.00% | 2.0573 |
| 60 | 4 | 2.3428 | 0.1600 | 2.2525 | 0.2503 | 14.08x | 25.00% | 2.1725 |
| 61 | 3 | 2.5028 | 0.2133 | 2.4445 | 0.2716 | 11.46x | 33.33% | 2.3165 |
| 62 | 2 | 2.7161 | 1.3580 | 3.6667 | 0.4074 | 2.70x | 50.00% | 2.5085 |
| 63 | 1 | 4.0741 | 2.0371 | 5.5001 | 0.6111 | 2.70x | 100.00% | 3.7307 |
The chance column assumes the hider's square is uniformly random among the squares not yet guessed. A hider who picked a predictable square (a corner, say) is easier to hit than that. Against a uniformly random square, a single shot's expected return (chance times hit return) is about 0.91x on the first shot and passes 1x from the seventh shot on, because the pool grows faster than the price. That is the heart of the economics: the game favours a sniper who can afford to keep shooting, and the hider's tools against that are a low base fee, an early extraction and an answerer that does not go down. Nothing here promises that hiding or sniping is profitable. See Risks.
The ten percent rake
The platform keeps 10% (1,000 basis points of 10,000). The rake is paid to the treasury address when a round settles:
| How the round ends | Who is paid | Rake base |
|---|---|---|
| Hit (a valid hit proof) | The sniper who fired the hit square gets pool minus rake | The whole pool, including every shot fee still in it |
| Timeout (a shot unanswered past its deadline) | The sniper who fired that unanswered shot gets pool minus rake | The whole pool |
| Escape (the hider extracts) | Hider gets pool minus rake | Only pool - collateral: the sniper fees and sponsorships. The hider's own collateral is never raked |
Rounding is always down, so the rake can be a wei lower than an exact 10%, and the payout plus the rake always equals the pool exactly. When a round ends in a hit or a timeout, every other shot that was still pending is void: its fee simply stays in the pool and is paid to the winner.
Hits, misses and answering
After fireShot(roundId, x, y) the square is pending and has its own deadline. The round
stays Open, so other snipers can fire at other squares while it waits. The hider's answerer (or
anybody holding a valid proof) calls answerShot(roundId, x, y, isHit, proof) for that square before
its deadline:
- Miss: the proof shows the guess is not the committed square. That square's pending record is cleared and the round stays Open. The square still counts as guessed and cannot be shot again. The fee stays in the pool.
- Hit: the proof shows the guess is the committed square. The sniper who fired it is paid and the round ends. Other pending shots are void.
- A proof that does not verify against the committed hash, the pending square and the claimed
result reverts with
InvalidProof. You cannot answer "miss" for a square that is a hit. The contract reports every verifier failure, including a verifier that runs out of gas, asInvalidProof. - Shots can be answered in any order. Only one hit can ever exist, because the circuit pins the hider's single square.
answerShot is permissionless: it is the proof, not the caller, that authorizes the outcome.
This is what lets the zk-pad responder or a session key
in the hider's browser answer for the hider without any power over the hider's funds.
Verifying one proof costs about 2.35 million gas as a direct transaction (the proof is 7,232
bytes). A tampered proof can make a bn254 precompile fail, and a failing precompile burns
all the gas it was given. Anything that sends answerShot must set an explicit gas limit of a few
million, never an open-ended one, and should only send proofs that were checked first. The
responder and the browser session key check every proof when it is built or loaded and then send
with a fixed 3M gas limit without simulating at shot time, because a proof that verified once
verifies again (the verifier is immutable in the game). A client that sends a proof it has not
checked should simulate first; the SDK helper simulateSniperAnswer does this with a 3.5M limit.
See the circuit reference.
Answer window and timeout
When a shot is fired the contract records a deadline for that square: the current block plus the
round's answerWindowBlocks. The default is 267 blocks, about 2 minutes on BSC at
roughly 0.45 s per block. The contract counts blocks, never seconds, so the real time moves with
the chain. The range the owner may set for new rounds is 67 to 28,800 blocks (about 30 seconds to
3.6 hours).
Why the window is short. The earlier default was 3,600 blocks (about 27 minutes) with a minimum of 1,800. That length existed to give a person time to notice a shot, open a tab and send a proof by hand for every shot. That is not a playable game: the hider cannot be at the screen the whole round and a sniper cannot wait minutes to learn whether a guess missed. Answers are now automatic and proofs are built before the round starts, so a normal answer lands in about 1 to 3 seconds and the window only has to cover a failure of the answerer. A short window is also what a sniper wants: their money is tied up for less. The price of a short window is that an answerer outage of about 2 minutes is enough for a sniper to claim a timeout, which is why the responder runs redundantly. That trade-off is spelled out under the responder and the first-shot-timeout bot.
An answer is accepted up to and including the square's deadline block. If the deadline passes with
no valid answer, anyone can call claimTimeout(roundId, x, y). The pool (less the rake) is
sent to the sniper who fired that square, regardless of who calls, and the round ends. A late
answer is rejected.
This is why a hider must have an answerer that works for the whole round: the zk-pad responder, or a funded session key in an open browser tab. See the hider guide.
How fast answers arrive
The service level the project tests for is a 95th percentile under 6 seconds and no answer over 10 seconds, with a typical answer in 1 to 3 seconds. That is measured on a local chain with 1 s blocks, with the real verifier and real proofs, including bursts of pending shots. It is not yet measured on BSC. The test, the budget and the numbers measured so far are on Answer times. The app shows each answer's measured time, and calls a shot "slow" only after 10 seconds.
Timeout and the race between expired shots
Every pending shot has its own timeout, and the first one that is claimed ends the round. That has two consequences you should understand before playing:
- If several shots are past their deadline, whoever calls
claimTimeoutfirst chooses which expired sniper is paid. The others get nothing. Expired snipers should claim promptly. - A timeout on one square ends the round and voids every other pending shot, including shots still inside their answer window. Their fees stay in the pool. Because all shots in a round use the same window, a shot fired earlier always expires earlier.
The second point is a known, unmitigated limitation. A hider with a second address can fire
a shot from it, leave it unanswered, and later let it time out first: the round ends in that
address's favour, any real sniper's shot fired in between is void, and the hider keeps the real
snipers' fees. The hider avoids losing to a hit at a cost of about 10% of the collateral
(0.1 x (C + F), 0.065 BNB at a 0.64 BNB collateral and a 0.01 BNB fee), plus gas. A second
version needs no timeout at all: the second address shoots the hider's own square and the hider
answers it as a hit, a self-hit exit that skips the extraction countdown, for the same cost.
The contract cannot tell whose shot is whose, so a pending shot older than yours is a risk to your own shot. This is an accepted property of a design with no identity, not something the contract mitigates, and no rule that ignores identity can fix it. Snipers in community rounds are exposed. At launch only platform-approved addresses are meant to host rounds (House rounds), which is the trust-minimised path available, but the chain still cannot prove that a House hider does not shoot its own round. See the known limitations, in particular the hider shooting their own round, and Economics and fairness.
Extraction and escape
A hider who has had enough can leave with the pool:
initiateExtraction(roundId). Allowed once per round, while the round is Open, with or without shots pending, and also while the contract is paused. The contract recordsextractionEndBlock = now + extractionWindowBlocks, using the round's own snapshot. The default window is 100 blocks, about 45 seconds on BSC.- During the countdown snipers can keep firing, up to and including the end block. A shot fired in time has to be answered, and a hit still ends the round for the sniper. Nobody can fire after the end block.
claimEscape(roundId). Once the end block has passed and no shot is pending, the hider is paidpool - rake, with the rake taken only onpool - collateral. Any pending shot blocks escaping until it is answered or the round ends by timeout.
Two points of honesty about step 3. First, the countdown is short, but a shot fired in its last block has a full answer window, so an escape can be delayed by up to an answer window (about 2 minutes by default) unless that shot is answered sooner, which normally takes seconds. Second, the hider must answer the shots of real snipers like anybody else; a sniper who fires a hit square during the countdown wins if the hider answers truthfully.
The extraction window is deliberately short on BSC: 100 blocks is the time snipers get to react once the hider announces the exit. The owner can change the setting within bounds (20 to 28,800 blocks), but a running round keeps the value it was created with.
Sponsorship
Anybody can add BNB to a live round with sponsorRound. Sponsorships go into the pool, so they
raise what a hit pays (and what an escape pays the hider), and they are raked like fees on an
escape. They never change the shot price (except in the final duel, where the price is
pool / 2). A sponsor cannot take the money back. The hook exists so that the protocol can
pour fees into game pools later; no such flow is built.
If a payout fails
The contract pays winners directly, forwarding a fixed gas allowance of 50,000. This applies to
the winner, the treasury and the refund of an overpaid shot. If the recipient is a contract that
reverts, uses more than that, or cannot accept BNB, the payout is credited to that address
instead (PayoutDeferred) and the round still settles. The recipient collects it with
withdraw(), or with withdrawTo(address) to send it somewhere that can receive it. A hostile
recipient, including the treasury, therefore cannot block a round from ending. The direct payment
is only attempted when the transaction has enough gas left to give the recipient the whole
allowance, otherwise the call reverts ("insufficient gas") so that nobody can force a deferral by
starving it; resubmit with more gas.
Pausing
The owner can pause the contract. Pausing stops entries only: createRound, fireShot and
sponsorRound. It never stops an exit. initiateExtraction, claimEscape, answerShot,
claimTimeout, withdraw and withdrawTo always work, so a hider can always start and finish an
extraction and a pending shot can always be answered or timed out. The owner also cannot renounce
ownership (renounceOwnership reverts with RenounceDisabled), so a paused game can always be
resumed. See the contract reference and
Security model.
One thing pause does change, and it is an admin-trust assumption: countdowns keep running
while fireShot is rejected. An owner (or a timelock) that pauses right after a hider calls
initiateExtraction removes the snipers' last-chance shots, and the hider escapes without facing
them. A pause is also ordinary incident response, so the chain cannot tell the two apart. The
owner cannot take funds this way, only withhold new shots.
Next
- House rounds and the launch model: who may host a round
- Economics and fairness: who the price curve favours, with an expected-value table
- Playing as the hider: choosing who answers, preparing proofs, your hider key
- Answer times: the latency budget, the 10 second ceiling and how it is tested
- Contract reference
- Circuit and proofs
- Security model and limitations