Hi, at a high level there's a few parts to how the system deals with Immutable X. We imagine other platforms could be integrated in a roughly similar way.
I'm afraid we don't have a great design document ready to go, but below is some information about what the thing entails. See also attached an old internal planning document from back when we were implementing this.
- The client needs to prove to the server that it controls a specific Immutable X account. This happens with a cryptographic challenge. After this is done, the server associates the Immutable X and Ethereum accounts with the game player account. This association uses the server's general "social platform" system (this "social" terminology is a bit of historical jargon, originally for associating game player accounts with third-party "social platform" accounts such as Facebook login; nowadays the "social" aspect of it is less relevant).
- The server queries information from Immutable X, related to NFT ownership (so it can what NFTs a game player account is supposed to own). It does a few kinds of queries (seen in ImmutableXApi.cs), such as:
- Get NFT ownership updates in a given time-range (used by ImmutableXNftObserver.cs for getting NFT ownership changes in best-effort real time, without needing to explicitly trigger refreshes)
- Get owner of a given NFT; get NFTs of a given owner (explicitly refreshed in some circumstances, such as when a player logs in)
- Get Immutable X accounts associated with an Ethereum address (used in the auth/login validation).
- The NFTs are managed per Immutable X "collection", that is, in order for the game/server to become properly aware of an NFT, the NFT collection needs to be configured in the
Web3
section in the game server's options yaml.