Game records (GAME)
Protocol and consensus12.5.11+

Game records (GAME)

Records of on-chain games: the common layout and the records of BetBet.

Every game on Lotus writes its records under one LOKAD id. A record is a claim: the games module checks what the scripts enforce before it calls a transaction a game. It changes no consensus rule.

Byte layout #

An eMPP push:

SizeField
4LOKAD GAME (47 41 4d 45)
1record version, 1
4game id, 4 bytes (BETB is BetBet)
1record type
...fields of the game

The node keeps every record, decoded or not: GET /api/v1/games/records.

BetBet #

Type 1 is OPEN, the creation of a game. The first byte after it, the flags, gives the mode. Integers are little-endian.

FlagsModeRecord
01 vs 1112 bytes: stake (8), commit (32), creator public key (33), refund delay (2), reveal delay (2), fee (4), author key hash (20)
1Creator vs all124 bytes: stake (8), seats (2), commit (32), creator public key (33), close height (4), deadline (4), reveal delay (2), fee (4), floor (4), author key hash (20)
2Crowd pot121 bytes; see doc/games/betbet.md section 11.4
3Big pot65 bytes: cap (8), minimum stake (8), window end (4), k (2), pay fee (4), seal fee (4), draw fee (4), author key hash (20)

A record is a game only if the output it describes pays exactly what its parameters give (1 vs 1: stake + fee to output 1). The joins, the results and the payouts need no record: they are read from the scripts and the outputs.

Type 0x42 holds the marks of automated players: kind 1 is a signed declaration, kind 2 the mark of one creation (doc/games/bots.md).

Source files #

  • src/modules/games/, doc/games/node.md, doc/games/betbet.md
Source doc/protocols/game.md in the lotusd repository