Xaya Architecture — Under the Hood

The Xaya architecture strives for elegance through simplicity.

The Xaya Blockchain

The Xaya blockchain is a fork of Namecoin. Namecoin was the first official fork (and altcoin) of Bitcoin.

“Namecoin is an experimental open-source technology which improves decentralization, security, censorship resistance, privacy, and speed of certain components of the Internet infrastructure such as DNS and identities.

(For the technically minded, Namecoin is a key/value pair registration and transfer system based on the Bitcoin technology.)

Bitcoin frees money — Namecoin frees DNS, identities, and other technologies.”

Additional RPCs/features have been added that are more focused on gaming.

In a nutshell, it allows for unique human readable names to be stored on the blockchain, and those names can have values attached to them. These names are essentially accounts and the values are actions or moves in a game. Only the person who created the name has the private key to modify it. The following is an example of a simple JSON-RPC move:

name_update p/name {“g”:{“chess”:”e4″}}

“name_update” is the RPC call.

“p/name” is the users account (the “p/” namespace must be prefixed for all account names).

“chess” is the game.

“e4” is the move.

To understand how Xaya works you can follow this tutorial (you don’t need to perform the actions):

https://github.com/xaya/xaya_tutorials/wiki/First-steps

On a more technical level you can checkout these docs:

https://github.com/xaya/xaya/tree/master/doc/xaya

How do games work?

The Xaya platform enables computationally complex games (or applications) to run fully decentralised, trustless and permissionless.

To understand how this works on a high level please watch this video of tech lead Daniel Kraft:

https://www.youtube.com/watch?v=wMd9mvc8pqA

The Architecture

Games that run on the Xaya platform in a fully decentralised way have the following software components:

  • Xaya node / daemon (xayad)
    — Also normally the users wallet
  • Game State Processor (GSP)
    — This computes the state of the game from moves it requests in blocks for a particular game
    — The developers game logic sits here and utilizes the libxayagame library:
    https://github.com/xaya/libxayagame
    — libxayagame handles all blockchain complexity so that the developer only needs to consider coding the game’s logic
  • Game front end

By keeping these components separate this allows for greater flexibility as will be shown later.

It follows this basic diagram:

There is of course a drawback to this. Running a full node can be difficult or off putting for most people due to the time to sync the chain and the size of it, and also the added complexity of having to run a separate wallet as well as the game. Although at the time of writing the Xaya blockchain is only around 2GB, this will expand as more blocks and transactions are mined over time.

Also, it’s not possible to run a full node on most mobile phones, which limits the platforms Xaya games can run on given the above configuration.

As a solution to this, we have developed and utilise open source applications and components so that players need not download the blockchain (for lite clients).

These include:

  • Electrum SPV wallet: https://github.com/xaya/electrum-chi
    — A fork of the Bitcoin (or namecoin) Electrum wallet.
    — Very light, yet secure
    — It has been modified to allow name (account) functionality as with the xayad full node daemon
  • Charon: https://github.com/xaya/charon/blob/master/doc/protocol.md
    — “Charon allows users to access game-state data from a GSP running on a remote server through XMPP. In other words, one or more GSP processes can connect to an XMPP server and listen there for requests, and players can connect as well using a custom XMPP client, which is then able to send requests to the GSP connections.”
  • XID: https://github.com/xaya/xid
    — “Xaya ID (XID) is an application built on the XAYA platform that turns each Xaya name into a secure digital identity.”
    — “These identities are meant to be used inside the Xaya ecosystem, e.g. on chat systems or market places in Xaya games. They can, however, be used by any other application as well. For instance, websites can enable “login with Xaya” to use secure, password-less authentication. Or messaging systems can use Xaya identities for the secure exchange of key fingerprints for end-to-end encryption.”
    — Find out more about
    XID here
  • XMPP Server (Ejabberd) > https://ejabberd.im/
    — A high performance messaging application
    — Utilises a plugin for external authentication with XID name associations for users to login to the system without requiring the server to save any username or passwords. Essentially Xaya accounts can log in securely onto the XMPP server.
    — https://github.com/xaya/xid/tree/master/ejabberd

All of the components are open source.

By utilizing these components, we allow users to be able to play and run games with one click of the shortcut whilst also allowing the user to keep possession of their private keys. This scalable architecture is illustrated in the diagram below:

Sacrificing Decentralisation?

For games being developed (or co-developed) by the Xaya team, we provide the servers (remote GSPs and XMPP) that provide the state of the game to the lite clients. This adds a level of trust in that the player needs to trust that we will send them the correct state of the game.

This is essentially sacrificing some trustlessness for convenience. We believe that at least initially this will be the preferred choice for most users.

However, due to how this architecture has been designed, it is possible for users/players to deploy their own “remote GSPs” to allow for trustless light clients.

With a little technical knowledge it is possible to set up the “remote GSPs” with 1 command using the provided docker containers. This can be done on a <$5 VPS.

What if you don’t have the motivation or technical know-how to do this?

Anyone can run a remote GSP and provide the service (paid or for free), so it’s possible to have multiple independent providers (or even friends). And it’s also possible to receive the states from multiple independent sources at the same time to “compare”.

This is all developed and available now.

Can we make it more trustless and secure, and still be lite?

Yes, this can be done using a system not dissimilar to DPoS style blockchains.

As part of the game logic (in a GSP) it’s possible to delegate service providers to distribute signed states of the game and be rewarded for doing so (e.g. through staking in-game currency).

Validators (or those also running a full node) can check/verify that these states provided are correct.

If a provider is found to be malicious (sending incorrect game states) then the validator can prove this as he was sent a signed state of the game. The provider can then be punished by taking some of their staked in-game currency.

What about Game Channels?

Game Channels allow for decentralised, trustless, real-time gameplay while also reducing blockchain bloat.

If you didn’t already watch the video, watch that here:

https://www.youtube.com/watch?v=wMd9mvc8pqA

The original paper is here:

https://ledger.pitt.edu/ojs/ledger/article/view/15

A tech demo of this has been developed and is working here:

https://github.com/xaya/libxayagame/tree/master/ships

And a video explanation and demo here:

https://www.youtube.com/watch?v=y-qB5uMALJc

We’ll be publishing a new paper soon with regards to real-time (smooth) gameplay and explain the architecture with regards to game channels then.

Games in development

Two games that are currently under development by Autonomous Worlds Ltd (the company that maintains the Xaya project) are Taurion and Soccer Manager Elite. Both games are decentralised, trustless, and permissionless. (There are other games under development on the Xaya platform.)

Taurion is an MMORTS where players mine and refine resources to build and upgrade their vehicles and buildings. Trade and commerce play a large role, but you can equally well decide to play the role of a raider and go the PvP route to make your fortune.

Taurion is the most complex blockchain game ever built (or at least on par with Soccer Manager Elite). It encompasses the complexity of player driven economies in the most successful MMORPGs, yet is fully decentralised and runs on the Xaya blockchain.

https://taurion.io/

Soccer Manager Elite is the next evolution of the Soccer Manager franchise of soccer management games. SM Elite adds in a new economic dimension to the game. Only a limited number of clubs are available, so competition to be a manager will be tough. All clubs are owned by shareholders (other users) who appoint managers. This allows the game to be played by the thousands.

Each club and agency in players is a decentralised autonomous organisation (DAO) where shareholders can vote and have a say in what happens. Shares in them can be bought and sold in the in-game decentralised exchanges (DEX).

The game is fully decentralised, censorship resistant, trustless, provably fair, and most of all, fun.

https://soccermanagerelite.com/

Want to know more about the benefits of blockchain for gaming?

Visit https://xaya.io

Join the conversation:

https://taurion.io/
https://twitter.com/XAYA_tech
https://www.facebook.com/XAYAtech/
https://discord.gg/d3KwbWu

Find out more about the Xaya platform and its components:

Xaya GitHub
Tutorials & Documentation
XID
Game Channels
Game Channels demo (2)
Ephemeral Timestamps

Chinese (Simplified)EnglishJapaneseKorean

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!