The Slickest Way to Add Player Wallets to your Blockchain Game
So you’ve decided to build a blockchain game.
Great, now what?
There’s surely a lot of design decisions to be made, and fun work to do.
In this article we will turn our attention to player wallets aka blockchain accounts.
Whether you’re adding utility tokens that players can earn, turning your assets into NFTs, or a mixture of both, you’ll need to make a decision about player wallets.
Spoiler: Playfix makes it super easy to create and manage custodial wallets for your players. We’ll get to that later in this article.
First, let’s take a look at what wallets are.
What are Ethereum Blockchain Accounts?
A blockchain account on the Ethereum blockchain is a cryptographic entity that allows users to interact with the Ethereum blockchain. An Ethereum account provides the user with an anonymous identity in the Ethereum ledger, as well as a pair of keys that allow the user to assess and transfer their wallet assets.
Unlike typical bank accounts, which store dollars, euros, or other physical currencies, Ethereum accounts store, send, and receive Ether, the native cryptocurrency of the Ethereum blockchain. Additionally, Ethereum accounts can store, transfer, and create other cryptocurrencies (tokens) on the Ethereum blockchain.
On the Ethereum blockchain, there are two kinds of accounts: externally owned accounts and contract accounts.
Externally Owned Accounts
Externally owned accounts (EOAs) are the most basic accounts that enable interaction with the Ethereum blockchain. EOAs are human-controlled Ethereum accounts that have a pair of public and private keys associated with them. These keys are used to validate the account ownership and approve the transaction. The public key is the address that enables querying of the Ethereum account balances and also allows other Ethereum accounts to send cryptocurrencies to the account. The private key validates ownership of the account and approves transactions.
Externally owned accounts are commonly known as “wallets.”
Contract accounts are Ethereum accounts that are controlled by code. They can send and receive Ethereum assets, but unlike externally owned accounts, they cannot initiate a transaction. They only receive and execute transactions initiated by an externally owned account. Contract accounts are created by an externally owned account. As a result, they only have a public key. To verify and execute transactions, they use the private key associated with the externally owned account that created them.
Creating a contract account incurs a transaction fee (gas fee) because it requires the use of valuable blockchain resources to deploy the account code to the Ethereum blockchain.
Types of Externally Owned Accounts
Externally owned accounts, or wallets, are classified into two categories: custodial and non-custodial wallets.
Wallets created using services like MetaMask or Trust Wallet are non-custodial wallets. Non-custodial wallets, also known as self-custodial wallets, are wallets that give you full ownership of your Ethereum account’s private and public keys. When you create a non-custodial wallet, your private key is displayed as a mnemonic (or seed, or recovery) phrase made up of 12–24 randomly generated words.
While you have complete access to your private keys and no need to rely on a third party when using a non-custodial wallet, this also means that you are solely responsible for not losing your keys, which necessitates extra precautions to safeguard your funds.
Custodial wallets are the polar opposite of custodial wallets. A non-custodial wallet means that you are entrusting the custody of your Ethereum account’s private key to a third-party service. Exchanges such as Binance and Coinbase offer custodial wallets. They are wallets that hold users’ crypto assets and the private key to their Ethereum account. Custodial wallets perform transactions on the Ethereum account on behalf of the account owner.
How are These Accounts Secured?
The Ethereum blockchain uses the private key linked to an account to secure the account and permit the transfer of the digital assets from it. Anyone who has access to the private key can validate transactions on the Ethereum account, making it essential to the security of a crypto account.
There are risks associated with any type of wallet you choose. A non-custodial wallet necessitates additional effort, such as making a backup, encrypting the seed phrase, and using other methods to ensure you do not lose your private key or expose it to an unauthorized third party. Similarly, a custodial wallet exposes you to the same risks as the third-party service that holds your private key. However, it shifts the responsibility of storing and securing your private key to the third-party service, which often has enough measures in place to assure its safety.
Playfix Wallet API and Custodial Wallets
The Wallet API is part of Playfix’s fleet of easy-to-use APIs for creating blockchain gaming utilities. It enables developers to easily create Ethereum wallets for their blockchain game projects.
Playfix understands the significance of private keys in the security of your crypto assets. To ensure that you do not lose your private key and that unauthorized third parties do not gain access to it, Playfix allows you to create custodial wallets with private keys encrypted with a 32-character long password entered when creating the wallet.
Creating an Ethereum Wallet with Playfix Console
Creating an Ethereum wallet with the Playfix console is as “easy as pie”. Let’s walk through the process.
Step 1: Create a Project
As with other blockchain game utilities such as tokens, NFTs, and wallets on the Playfix platform, you need to create a project that will contain them.
- Login to your Playfix account.
- Click on “Projects” from the sidebar.
- Click on “Create Project” in the top-right corner of the Projects interface.
- Enter a name and a brief description of the project, and upload a cover.
- Click on “Create” to create your Playfix project.
Step 2: Create a Wallet
- Navigate to the Wallets section of your newly created Playfix Project
- Click on New Wallet
- Enter a title for your wallet
- Enter a brief description stating the purpose of the wallet.
- Select “Polygon Mumbai Testnet” in the “Network” field
- Enter a 32-character long password that will be used to encrypt the private key to your wallet. Example: 32CharacterPassword2MoonarWallet
- Repeat the 32-character long password in the “Confirm Password” field.
- Click on “Create” to create your Ethereum wallet.
Playfix will automatically create an account for you on the Ethereum blockchain and encrypt the private key with the password you entered.
Step 3: View Wallet Details
To view the details of your wallet, click on “View” from the wallets list.
Your wallet address (public key) can be found in the upper right corner. If there have been any transactions in the wallet, they will be displayed in the transactions section. The non-fungible tokens that you have in your wallet are shown in the NFTs section.
Done! Now you can store game tokens and NFTs in wallets created and secured by Playfix. To test the activity of your wallet, copy the wallet address and send some testnet tokens from the Polygon faucet.
Playfix does the heavy lifting involved in creating a blockchain backend for your game; allowing you to create all you need for a blockchain gaming ecosystem in minutes instead of months.
To get started creating blockchain utilities for your game using the Playfix platform, contact us at email@example.com, and we’ll set you up with a Playfix account immediately.