bet

Identity keys reference

bet stores all between-actor game state on Verus identities. Each piece of state lives at a specific key on a specific identity, written by one specific actor and read by the others. This document is the reference for every key the current build uses — what it’s called, where it lives, what it carries, who writes it, and when.

For the architectural rationale behind the per-identity layout (why each actor writes only to its own identity, why some keys exist twice in cashier-side and table-side variants, what the 5872-byte size limit means), see verus-overview.md. For how each identity is created in the first place see id_creation_process.md. For the game state machine that drives these writes see game_state.md.

The macro names below are defined in poker/include/vdxf.h. The literal namespace string each macro expands to is given in parentheses; it is hashed to a 32-byte VDXF id at runtime (get_vdxf_id in vdxf.c) before being placed on-chain.


Conventions

Namespace prefix. Every key uses chips.vrsc::poker. as its readable prefix, defined once as the VDXF_POKER_KEYS_PREFIX macro in vdxf.h and composed by every *_KEY macro listed below. The prefix is the same on VRSCTEST and on production builds — it is decoupled from the chain name on purpose so the same key macros stay portable when the deployment moves chains. Renaming it to match the VRSCTEST parent is cosmetic and would require an on-chain migration; see docs/TODO.md.

<game_id> suffix. Keys whose comment description says they are per-game are written under <base_key>.<game_id> rather than the base key alone. <game_id> is the 32-byte hex string in the table identity’s T_GAME_ID_KEY. The helper get_key_data_vdxf_id(BASE_KEY, game_id_str) (in vdxf.c) builds the suffixed form. Keys without this suffix are written once per identity lifecycle (e.g. an aggregator listing) or carry their own internal game_id field (e.g. P_JOIN_REQUEST_KEY).

Value type. The CMM stores hex-encoded values tagged by VDXF data type id. Three types are in use:

#define STRING_VDXF_ID     "iK7a5JNJnbeuYWVHCDRpJosj3irGJ5Qa8c"   // vrsc::data.type.string
#define BYTE_VDXF_ID       "iBXUHbh4iacbeZnzDRxishvBSrYk2S2k7t"   // vrsc::data.type.byte
#define BYTEVECTOR_VDXF_ID "iKMhRLX1JHQihVZx2t2pAWW2uzmK6AzwW3"   // vrsc::data.type.bytevector

Almost every key in bet uses bytevector carrying a JSON blob; the schema column below shows the JSON shape, not the wire bytes.

Single-writer-per-identity. No two actors write to the same identity. The “Written by” column below names exactly one actor per row, which is what makes the writes serialize without coordination.


Aggregator identities

cashiers.sg777z.VRSCTEST@ and dealers.sg777z.VRSCTEST@ are list identities. Their contentmultimap holds one key each, naming the short identifiers of registered cashiers and dealers respectively. Neither identity holds funds; both are pure discovery surfaces.

CASHIERS_KEY (chips.vrsc::poker.cashiers)

DEALERS_KEY (chips.vrsc::poker.dealers)


Dealer identity keys

A dealer identity (dealer.sg777z.VRSCTEST@ or d1.…, etc.) holds the dealer’s table-template advertisement and its registration record.

T_TABLE_INFO_KEY (chips.vrsc::poker.t_table_info)

When written on a dealer identity (unsuffixed), this key advertises the dealer’s table parameters from poker/config/dealer.ini. The same macro is reused on the table identity (suffixed by <game_id>) to record the parameters of the specific game in progress — see the Table identity section below.

"registration_info" (literal key, not vdxfid-hashed)


Table identity keys

The table identity (t1.sg777z.VRSCTEST@, etc.) is the most key-heavy identity in the deployment. Every key here is dealer-owned under the single-writer rule. Most keys are suffixed by <game_id> so multiple hands on the same table identity don’t collide.

T_GAME_ID_KEY (chips.vrsc::poker.t_game_ids)

T_TABLE_INFO_KEY.<game_id> (chips.vrsc::poker.t_table_info.<game_id>)

Same payload shape as the dealer-id version above, but written on the table identity and suffixed by the current game id. Acts as the authoritative table-parameter snapshot for the game.

T_PLAYER_INFO_KEY.<game_id> (chips.vrsc::poker.t_player_info.<game_id>)

T_BETTING_STATE_KEY.<game_id> (chips.vrsc::poker.t_betting_state)

T_BOARD_CARDS_KEY.<game_id> (chips.vrsc::poker.t_board_cards)

T_GAME_INFO_KEY.<game_id> (chips.vrsc::poker.t_game_info)

This is the canonical home of the game-state machine value documented in game_state.md.

T_SETTLEMENT_INFO_KEY.<game_id> (chips.vrsc::poker.t_settlement_info)

Dealer-shuffled deck family

The dealer writes its shuffled+blinded output for each player seat into one of these per-player keys. See deck_shuffling.md for the cryptographic pipeline.

Cashier-canonicalized deck family

The cashier writes its reblinded output to its own identity (C_B_P<n>_DECK_KEY, below). The dealer reads from there and canonicalizes onto the table identity under the corresponding T_B_* key, giving players a single canonical place to read the fully-blinded deck. The split is the single-writer migration in action — docs/TODO.md items 1.1 and 1.2 reference it.

T_CARD_BV_KEY.<game_id> (chips.vrsc::poker.card_bv)


Cashier identity keys

The cashier identity (cashier.sg777z.VRSCTEST@) holds the cashier’s work products and the response records for settlement and disputes.

Cashier-shuffled deck family

Same shape as the T_B_* family above, but on the cashier identity. This is where the cashier’s output is originally written; the dealer later canonicalizes it onto the table.

C_CARD_BV_KEY.<game_id> (chips.vrsc::poker.c_card_bv)

C_SETTLEMENT_RESULT_KEY.<game_id> (chips.vrsc::poker.c_settlement_result)

C_DISPUTE_RESULT_KEY (chips.vrsc::poker.c_dispute_result)


Player identity keys

Each player identity (p1.sg777z.VRSCTEST@ through p9.…) is the player’s sole writeable surface. Per the single-writer rule the player owns all writes to its own identity; the dealer and cashier only read.

P_JOIN_REQUEST_KEY (chips.vrsc::poker.p_join_request)

P_BETTING_ACTION_KEY (chips.vrsc::poker.p_betting_action)

PLAYER_DECK_KEY.<game_id> (chips.vrsc::poker.player_deck)

P_DECODED_CARD_KEY.<game_id> (chips.vrsc::poker.p_decoded_card)

P_HOLECARDS_REVEAL_KEY.<game_id> (chips.vrsc::poker.p_holecards_reveal)

P_GAME_HISTORY_KEY (chips.vrsc::poker.p_game_history)

P_DISPUTE_REQUEST_KEY (chips.vrsc::poker.p_dispute_request)

DISPUTE_TIMEOUT_BLOCKS (currently 100, in vdxf.h:332) is the window after which a pending game is considered aborted and the dispute path becomes valid.


Reading these keys from the CLI

cli-print.md documents the ./bet print_id, print, print_keys, and show commands that decode and pretty-print keys from any identity. Most of the keys above are covered by ./bet print_id <id> table (for the table identity), dealer, player, cashier, or dealers — see cli-print.md for the per-command key list.

For programmatic reads, poker_get_key_json / poker_get_key_str (declared in poker/include/poker_vdxf.h) take a base key macro and optionally a game_id_str and return the parsed value; they handle the namespace prefix and the vdxfid hashing internally.