On-chain Accounts

Race Protocol utilizes several types of on-chain accounts to store game data, manage game bundles, and track player profiles and registrations. These accounts play a crucial role in ensuring transparency and immutability within the Race ecosystem.

Game Account

A Game Account represents a specific game or game room on the blockchain. It holds essential information about the game, including:

  • Game Data: This includes immutable properties specific to the game, such as the game title, the address of the associated game bundle, the token used for gameplay, and other game-specific parameters.

  • Player Information: This includes details about the players who have joined the game, such as their wallet addresses, balances, positions in the game, and access versions (indicating the order they joined).

  • Server Information: This includes details about the servers serving the game, such as their addresses, endpoints, access versions, and the designated Transactor server.

  • Deposits: This tracks deposits made by players during the game, along with the corresponding settle versions (indicating when the deposit will be processed).

  • Votes: This records votes cast by players and servers, typically used to signal Transactor inactivity or misbehavior.

  • Unlock Time: This specifies a timestamp when the game account becomes unlocked after being temporarily locked due to events like voting or disputes.

  • Entry Type: This defines how players can join the game, such as through cash deposits, ticket purchases, or NFT ownership.

  • Recipient Address: This specifies the address of the recipient account that receives payments from the game, used for complex payment structures or commission fees.

  • Checkpoint: This stores the latest game state as a snapshot, allowing for efficient reconstruction of the game state in case of server failures or disputes.

The Game Account is frequently updated throughout the game lifecycle as players join, events occur, and settlements are made. This on-chain record ensures transparency and allows anyone to verify the game's progress and outcome.

Game Bundle Account

A Game Bundle Account represents ownership of a specific game bundle (WASM package containing the game logic). It serves as an on-chain reference to the actual WASM data stored off-chain in decentralized storage.

The Game Bundle Account typically holds information such as:

  • URI: This is the address or URL pointing to the WASM data stored in the decentralized storage solution (e.g., IPFS or Arweave).

  • Name: This is the name associated with the game bundle.

  • Data: This may include additional metadata or information related to the game bundle.

By publishing the game bundle as an NFT, developers can:

  • Establish Ownership: The NFT serves as proof of ownership for the game logic, allowing developers to control access and potentially earn royalties.

  • Link to Off-chain Data: The URI within the Game Bundle Account provides a link to the actual WASM data stored in the decentralized storage, enabling efficient retrieval and execution of the game logic.

Player Profile Account

A Player Profile account stores information and assets associated with a specific player wallet. It typically includes:

  • Nickname: The player's chosen display name within Race games.

  • PFP: The address of the NFT used as the player's avatar (optional).

  • Balances: This tracks the player's token balances for various tokens used within Race games.

  • NFTs: This may store information about the player's owned NFTs, including game bundles and other relevant NFTs.

The Player Profile serves as a central hub for managing a player's identity and assets within the Race ecosystem.

Registration Account

A Registration account acts as a public or private "lobby" where games can be registered and discovered by players and servers. It typically contains:

  • List of Games: This includes information about the games registered within the lobby, such as their titles, addresses, registration times, and associated game bundles.

  • Ownership Information: This indicates whether the registration is public or private and, if private, the owner's address.

  • Capacity: This specifies the maximum number of games that can be registered within the lobby.

Public registrations allow anyone to create and register games, while private registrations require permission from the owner. Servers use registration accounts to discover available games and load them into their runtime environment.

These on-chain accounts work together to provide a transparent, secure, and decentralized foundation for Race Protocol. They ensure that game data, player information, and game logic are all accessible and verifiable on the blockchain, fostering trust and fair play within the Race ecosystem.

Last updated