> For the complete documentation index, see [llms.txt](https://jungle-toolkit.gitbook.io/evm-xcm-jungle-toolkit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jungle-toolkit.gitbook.io/evm-xcm-jungle-toolkit/examples-of-working-cross-chain-dapps-made-using-the-jungle-toolkit/case-study-the-great-escape/the-xregister-function.md).

# The xRegister Function

How we are allowing players to register to the game without having to pay gas

Goals:

* Being able to register on any chain
* Being able to register without paying gas
* Being able to register without a wallet
* Being able to register with the ecosystem wallets

```solidity
    /**
     * @notice Necessary to create the mirror wallet link
     * @dev Deployer Required
     * @param _playerWallet: real EOW of user
     * @param _internalWallet: walled used to relay txns
    */
    function createPlayer(address _playerWallet, address _internalWallet) public payable onlyOwner {
        require(players[_playerWallet].internalAddress == 0x0000000000000000000000000000000000000000, "Player already exists");
        players[_playerWallet].internalAddress = _internalWallet;
        players[_playerWallet].glmbAvailable = 0;
        players[_playerWallet].shakesAvailable = freeShakes;
        players[_playerWallet].gamesPlayed = 0;
        playersReversed[_internalWallet] = _playerWallet;
    }
```

As you can see, this function is callable only by the deployer. This allows us to relay the transaction as explained in the [Build a custodial solution to make your dApp wallet-less & gas-less using EIP-712](/evm-xcm-jungle-toolkit/build-a-custodial-solution-to-make-your-dapp-wallet-less-and-gas-less-using-eip-712.md)

The front-end is collecting the necessary information, especially the `playerWallet` that'll be used as the first argument.

The internal wallet (aka mirror wallet) is simply created by the backend using a simple ethers function:

```javascript
 const mirrorWallet = await ethers.Wallet.createRandom()
 newPlayer.insideWallet = await mirrorWallet.address
 newPlayer.insideKey = await mirrorWallet.privateKey
```
