Anti-Duplication¶
Duplicating items is a massive problem. No matter how talented a Developer is, there is no such thing as a "perfect developer", and every developer will make mistakes. This means a glitch where an item can be duplicated is inevitable. It's happened to every Minercaft Server, even the largest server ever made, Hypixel. Any Minecraft server needs to have some form of anti-dupe, but it is especially important for us. Many people such as Youtubers SalC1 and TheDuperTrooper, who are extremely skilled at finding duplication glitches, will go onto servers that are considered "pay to win" to duplicate items on those servers and spread them around to the playerbase in order to ruin their economy. For Storyfire Oasis, this is a much more serious problem than other servers, for two reasons:
- 1: We have a serious target on our backs: Youtubers such as TheDuperTrooper and SalC1, who are very good at finding and exploiting duplication glitches specifically target servers they deem as "Pay to win", and will do everything they can to ruin their economies. Since we are using cryptocurrency, they are going to put a heavy target on us. We have to be prepared for this to happen.
- 2: A Duplication glitch is much more severe for us than other servers: On most Minecraft servers, the admins can simply rollback to a backup of the server from a few days ago after they patch the duplication glitch, in order to revert any effects it had on the servers economy. We cannot do this. Since we use the $BLAZE crypto integration, if we were to roll-back the server, all crypto wallets would remain the same, meaning if during this period a player traded some valuable item for a hundred dollars worth of $BLAZE, the user who bought it won't have the item anymore, but the $BLAZE won't return to their account. Using $BLAZE also means that if a duplication glitch ruins our economy, the $BLAZE coin will drop in value faster than usain bolt can run. This scenario would mean the end of Storyfire Oasis, and the end of the $BLAZE cryptocurrency.
Solution 1: SHA256 Hashes¶
In Storyfire Oasis, every time an item is created, it will be given a unique SHA256 Hash Signature to identify it. A Hash Signature is a widely-used security protocol, in where a piece of data, such as a file, an image, or text is put through a mathematical algorithm that compresses it down to a hash signature, a short string of text and numbers. This data can never be reverted back, however, if even one Byte of data of the original file is changed, and a new hash signature is generated, it will be completely different, for example, the string "The Storyfire Oasis", when put into a SHA256 encryption algorithm, will have the signature 32c115dea9b0de891e2ecedfdeceb48416ade58f9448612e66597019e293b407, every time you try to encrypt that text, it will always return exactly that signature. However, if we change even one character in that string, for example to "The Storyfire Oasit", its new signature will be, and will always be 8aa4cf9b6273da2675f42bd7fe9052c8554689f2007958c0be203ac963d1b50b. You can test this out yourself on emn178's SHA256 converter, try putting in those two strings I put earlier (without quotation marks), and compare your results to this page.
In giving each item a unique SHA256 signature, and then storing that signature in a database, we are able to confirm if an item has been duplicated, as no two items can have the same Hash Signature unless they are the exact same item, which can only happen from duplication glitches.
If an item is ever created, it will be given a unique SHA256 signature, which will update if the item is ever modified. However, dropping an item, trading it to another player, etc, will not change the signature, as the item is still the same item, its just in a different location. If two of the same items are crafted, they will technically be different, so they will have completely different signatures.
If two items are ever detected to have the same signature, those items will immediately become Blacklisted, meaning they cannot be dropped, put in chests, taken out of chests, removed, traded, or transfered in any way. Yes, this means if a player is holding one they are stuck with that until we un-blacklist it removing space from their inventory. This is so that nobody can spread these items around until we investigate the problem. Its important we do this manually rather than automatically, as we can't just slap this on as a band-aid to every problem, we do need to manually fix the problem that caused the duplication glitch in the first place, then delete the items after.
Solution 2: Data Logging¶
Every time anything happens on the server, and I truly mean everything, it will be logged. Walking half a block? Logged. Moving your camera by a single pixel? Logged. Trading with a player? Logged. Nothing, no matter how small will go unlogged. These logs will be stored in a database forever. It'll use a lot of data, likely gigabytes or potentially even terabytes of text, but it is worth it.
We will have a Web Panel for Admins to be able to search through this database. They can either search for an Item Name (every version of that item), a specific Items Hash, a Player Name/UUID, or a Server ID, to see all logs associated with it. If an item hash is searched up, it'll show each time that item is moved around. A player will return every time that player does something, an item name will return each time any copy of that item is moved around, and a server ID will return each time anything happens on a server.
Admins can use this web panel to figure out where items are being moved, so that once its been made clear an item has been duplicated, they can figure out exactly what the users did to duplicate the items, so that the Admin can replicate the glitch themselves, and a Developer can fix it.