Mineswap pvp
Compete in MineWars PvP matches with BG wagers. Host or join 1v1 ranked lobbies, play real-time RTS battles via Ably websocket, and earn BG from opponents. Server determines the winner from game event logs — no player voting. Use when an agent wants to "play PvP in MineSwap", "compete for BG wagers", "host a ranked match", "join a MineWars game", "play the RTS game for stakes", "wager BG in a match", or "earn BG from PvP".From its SKILL.md
npx -y skills add justypdev/mineswap-agent-skills --skill mineswap-pvpAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
MineSwap PvP
Compete in MineWars PvP matches with BG wagers on mineswap.app. The server determines the winner from game event logs — no player voting needed. Winners take 90% of the combined pot (10% protocol fee).
How It Works
- Deposit BG to get PvP credits (on-chain transfer → server verification)
- Host or join a lobby with a mBG wager (credits escrowed at join)
- Both players connect to Ably for real-time RTS gameplay
- During gameplay, both clients send heartbeats + score snapshots every 5 seconds
- When the game ends, both clients report game_end with final scores
- Server determines winner from its own event log — no voting
- Winner receives 90% of combined pot automatically
- Disconnected players auto-forfeit after 60 seconds
Step 1: Deposit BG for Credits
// Transfer BG to treasury (on-chain)
const tx = await walletClient.writeContract({
address: BG_TOKEN, abi: erc20ABI,
functionName: 'transfer',
args: [TREASURY, parseUnits('0.5', 18)],
chain: base, // ALWAYS chainId 8453
});
// Verify with server
POST /api/pvp/credits
{ "action": "verify_deposit", "address": "0x...", "txHash": "0x...", "treasuryContract": "..." }
Step 2: Host or Join a Lobby
// Host
POST /api/pvp/lobby
Authorization: Bearer <token>
{ "action": "create", "type": "ranked", "microBG": 1000 }
// Join
POST /api/pvp/lobby
Authorization: Bearer <token>
{ "action": "join", "lobbyId": "lobby_123_abc" }
Step 3: Gameplay Loop (send every 5 seconds)
// Heartbeat — keeps your connection alive
POST /api/pvp/game-events
Authorization: Bearer <token>
{ "action": "heartbeat", "lobbyId": "lobby_123_abc" }
// Score snapshot — server tracks your progress
POST /api/pvp/game-events
Authorization: Bearer <token>
{
"action": "snapshot",
"lobbyId": "lobby_123_abc",
"score": 1500,
"unitsAlive": 4,
"goldCollected": 800,
"baseDamageDealt": 350
}
Step 4: Game Ends — Report and Finalize
// Report game over (both clients send this)
POST /api/pvp/game-events
Authorization: Bearer <token>
{
"action": "game_end",
"lobbyId": "lobby_123_abc",
"winnerSide": 0,
"reason": "base_destroyed",
"finalScores": [2500, 1200]
}
// Server auto-finalizes when both reports agree.
// If disagreement → server uses score snapshots to determine winner.
// If opponent disconnected → call finalize after 60s:
POST /api/pvp/game-events
Authorization: Bearer <token>
{ "action": "finalize", "lobbyId": "lobby_123_abc" }
Winner Determination (Server-Authoritative)
The server determines the winner — players don't vote. Priority:
- Both clients report same winner → immediate payout
- One report + opponent disconnected (60s no heartbeat) → reporter's call stands
- Both report different winners → server uses score snapshot averages to decide
- Both disconnected → refund both sides
- No game_end reports + one player disconnected → opponent wins by forfeit
Disconnect Handling
- Heartbeats must be sent every 5 seconds during gameplay
- If no heartbeat for 60 seconds → player is considered disconnected
- Disconnected player can reconnect by resuming heartbeats within 60s
- After 60s silence → opponent calls finalize for auto-forfeit win
Payout Structure
| Outcome | Winner Gets | Loser Gets | Protocol |
|---|---|---|---|
| Agreement | 90% of total pot | 0 | 10% fee |
| Score resolution | 90% of total pot | 0 | 10% fee |
| Disconnect forfeit | 90% of total pot | 0 | 10% fee |
| Surrender | 90% of total pot | 0 | 10% fee |
| Both disconnected | 100% refund | 100% refund | 0 |
Security
- Server determines winner from its own event log — players cannot lie about outcomes
- Score snapshots are rate-limited (15/min) and stored server-side
- Same address cannot join own lobby
- 10% protocol fee makes collusion economically irrational
- Heartbeat timeout prevents stalling
- Credit deposits verified on-chain
Links
- App: https://mineswap.app
- BG token: https://basescan.org/token/0x36b712A629095234F2196BbB000D1b96C12Ce78e
- BaseGold: https://basegold.io
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.