Technology

Decentralized Video Game White Paper

Why does a video game need to be decentralized? Why not?

Ben Stokman
OneTwentyEight Blog

--

Listen to the audio version

In a previous post, I wrote about weather or not a video game could be developed with no central authority. This post serves as an extension to the last one, going into more depth of the intricacies of a decentralized video game.

Note that I do not have the time or knowledge to actually program the decentralized video game, though if anyone does, feel free to. I will also, identical the preceding post, will create the game as a first person shooter, with items and trading.

Goal

The goal of the decentralized video game is to create a video game that has no central authority, and can still operate like a video game with a central authority. The video game must be able to have trading, inventories, updates, listed servers, craftable items, an uncraftable items. The video game must also be free to play.

Rounding

If the number is higer than five, the number will be rounded up. If the number is less than or equal to five, it will be rounded down.

Blockchain

Blockchains are almost synonymous with decentralization; but the reality is that very few systems that are decentralized are run on a blockchain. Language is a decentralized system to communicate ideas and thoughts. Right now, you are reading this white paper. The white paper is simply a collection of data stored on Medium’s server, that contains the letter, and the styling. Your device that you are reading this on converts that data into shapes, which you then convert into an idea. This process can be done without any of things mentioned above, Medium does not control language, your device does not control language, nor do you control language. Language is simply a system that works because everyone that uses it, generally knows how to convert the letters into ideas, because language does not change too quickly as to confuse the person decoding it.

Another decentralized system is the internet. Nobody controls the internet; not even the domain name system. The internet does not require everyone to know everything, so a blockchain isn’t required, but it is still a decentralized system, that can withstand apocalyptic circumstances.

Blockchains are only used in decentralized systems that require census. Bitcoin requires census so that it actually works. A decentralized video game does need a Blockchain because trading requires consensus.

For simplicity, the decentralized video game will have all of the rules of a normal blockchain, but with the exceptions stated here.

Accounts

Accounts will have to be a public key. There is no other way for trading to work without a way to have non forageable account names. There can be a way to have a profile name an picture, but at the base, there will have to be a way to have an non forageable identifier. The key will be 256 bit ECDSA.

Example 256 bit ECDSA private key

B80DC4FD4A7EBBA6CDF2483EB8AB2CCC88A0823AF3434312BEE9AE1A9DBA20E6

Example 256 bit ECDSA public key corresponding with the private key

38FFF6E2658C751E04424B3B556FDDE02553A06B0EF619334AF647ABA801906F

In games like Team Fortress Two, there are items, but there is also this item called metal. Metal has no use, it is used in crafting, but it is also used as a standard currency. Keys are used as a currency that is worth more, but keys can open crates. All blockchains without a central authority require transaction mining to keep people from spamming the blockchain. Transaction mining usually amounts as a very small fee taken out of the senders account. However, because the fee is so small, the fee will almost always have decimal points. Items cannot be split, so a decentralized video game that had trading would need to have a splitable token tied to an account, as well as the normal items. The splitable token must also be used in trades, and as a crafting material.

Trading implies that there can be items sent from one party, to another that the one party is receiving items from. In order to keep the decentralized video game trustless, the transaction must be signed by all parties engaged in the trade. The first party, designated by the lowest numerical value of their public key, is responsible for first signing the trade with their private key when they agree with it, the second party then receives the signed trade, and then signs it with their private key if they agree with it. The process repeats until all parties engaged in the trade agree with the trade, and the last party send the transaction, signed by all of the parties in order.

There are some things to note about this process.

1. is very easy for the first party to change the transaction, but the parties after that can still verify that they agree with the transaction, because they all know the order, and can easily decrypt the transaction with the public keys, and see what the transaction is, and if they agree with it.

2. Transaction fees will always be a certain multiple of the size of the transaction, distributed evenly among each party involved in the transaction, but any party involved in the transaction can always send one person a little more “metal” so they essentially bear more of the transaction fee.

3. For the most part, traders will have to trade through a server; there is no single way for them to communicate; though I highly would recommend a phone/radio/communication system that I will take about later.

4. All of the data will be exchanged via private-public key pairs. Whoever needs the data will have the data sent to them, encrypted with their public key, there will be no temporary key for the session.

Mining

Mining is so that a decentralized system can agree on an order of transactions, without it, a person could easily send out transactions at the same time that spend more than they have, and will cause an argument within the blockchain on which comes first.

There is usually a minimum fee required for the transaction to get accepted into the blockchain; or a certain multiple of the transaction size as long as it

Mining usually has a set amount of reward for mining a block, plus the transaction fees. Whoever unlocks the block will promote the next block; it the person who mined the block does not promote another block, an empty block must be mined to shift the promotion power over to someone else.

The decentralized video game shall have 1,048,576 (²²⁰) tokens mined for each block, and will never be halved because items will have to be crafted, and if the reward was halved, the blockchain will eventually have no tokens left. The tokens can be split into 100 thousandths (4 decimal points.)

Difficulty

On average, a block on a blockchain is mined every 20 minutes. The time it takes to mine a block depends on how low the target hash is, which is usually called difficulty.

Bitcoin has a block limit, but I think that the block limit is useless, I think that it should be unlimited.

The difficulty will be based off of an equation: sixty million times the number of addresses in the past 64 blocks, or approximately 20 hours

Empty Blocks

Empty blocks are mined in the case where the person who mined the previous block does not promote a new block.

Transaction Fee

The more people on the blockchain, the less tokens the transaction fee costs.

The transaction fee will be based off of the following equasion: 500,000 tokens devided by the ammount of addresses in the past 64 blocks, or approximately 20 hours

Updates

Updates in the decentralized video game will happen every 8192 (²¹³) blocks; on average, a block is unlocked every twenty minutes, so an update is set to happen every 3.79 months, or 3.16 times a year.

Whenever a block is unlocked, the person who unlocked it will send a file that detales what they want to be the next update to look like. The changes are as separated from one another as possible. If one group wants to add a weapon, and has forty percent of the votes, and another group wants to add the same weapon, but with a different look, and has thirty percent of the votes, the weapon will be added with the first group’s look, instead of the weapon not being added because more than 50 percent of the votes didn’t vote to add a single version of the weapon.

There is no way for a blockchain to automatically come to a consensus if a computer, which is what will automatically come to a consensus, cannot understand the intentions of the votes, or understands them differently than others. A certain and strict way to display the changes is needed.

I recommend a hierarchical system of four attributes, and then the value.The first attribute is the type of change, weather it is a class, a weapon, a cosmetic, an animation, a model, or something else. The second attribute is the ID for the change. The ID will be 256 bit, and can be anything. It is only used to compress the changes; if one person who mined a block submitted all of the fields for a change, the person who unlocked the current block would only have to include the ID in their update vote. The third attribute is what is being changed. If the item in question is already existent, the ID for the adding of the object, which is the ID for the change that added it; if the item is new, the field would be “NEW” without quotes. The fourth value is the data for the change. It could be a model, or an audio file, or whatever is suitable for the change.

The update vote is limited to 16 megabytes, and squares every 1,048,576 blocks in terms of megabytes.

Crafting

TF2 has a central authority that can administer items that are uncraftable for achievements and things. By nature, a decentralized video game does not. Every common item will have to be craftable. Crafting will be like a transaction. Every time someone wants to craft something, they will have to pay the amount of tokens required including the transaction fee, and wait for the “transaction” to be accepted into the blockchain. Each item that is crafted will be assigned an item ID, which is the hash of the original crafting transaction, to save storage space.

Once and item has been crafted, the tokens used to pay for it are gone forever, but crafting recipes can allow for uncrafting.

The cost for crafting is another equation; much like the transaction fee. Craftable items will have tiers for their crafting cost: basically any counting number. The equasion will be the tier number, multiplied by the amount of addresses in the past 64 blocks, divided by 20,000

My math may be wrong on the equations, so the main number can be changed via an update, though at least 55% of the blockchain must agree on a very specific number.

Block Reward

In a centralized video game, there can be items that are uncraftable. However, traditionally there needs to be a centralized authority to reward uncraftable items for a purchase or a crate, though that can be fixed with math.

Every time a block is mined, an uncraftable item will be rewarded to whoever mines the block. When the decentralized video game is originally made, there will be a list of uncraftable items that can be rewarded. Updates can add items to the bottom of this list, or remove them. The hash of the block is check summed to the minimum amount of binary digits to contain every uncraftable item. The value of the checksum is the item rewarded. If the value of the checksum checksum is not an uncraftable item, then the block hash (in binary, not hexadecimal) will be hashed again, and the process will repeat until the checksum is the value of an uncraftable item. The item ID will be the hash of the block. This will also include the

This process can also be for crates. Items may be made for a crate, and the process can repeat for a crate; though the person will have to pay to unlock the crate. I originally thought that the crate could be based off of the transaction hash, but that will lead to people adding random data to get them a certain item. The data checksummed for crates will be the transaction hash, with the block hash after it. The process is the same for the block reward.

The reason that miners wouldn’t skip successful mines to get a certain item is because they are not paying anything for the block reward item. If the miners did skip possibilities to get a certain item, they would be getting only the certain item, and would not be getting the other free items that they decided to ignore.

Servers

The server list will be kept by the nodes on the blockchain. There will be no reward, and nothing to make the nodes on the blockchain.

Classes and Items

I will not be creating weapons and items, that is for a different post; this post only serves to give a more in-depth explanation of how a decentralized video game would work.

--

--