Gala Games Nodes Resume NFT Distribution!

Gala Games
4 min readDec 17, 2020

--

Starting tomorrow, TradeBot parts will start getting distributed to node owners’ Treasure Chests! In addition to this, you can expect to start to see some other MYSTERIOUS NFTs of unknown origin and purpose…strange items from a faraway land. You never know rewards might come from operating a node.

The reason we are able to restart this, is that we now have a PROVABLY RANDOM DISTRIBUTION!

Is a banana NFT on the way?

The TLDR Version of this is as follows:

  1. You no longer have to have you node online at the time of distribution…this should make life MUCH easier for people living in time zones that aren’t convenient to get up and run your nodes.
  2. When the distribution runs, after a node receives an item, it is removed from the list until all other nodes that were available at the beginning have received something.
  3. This is reset every day — we are aware that this is not a perfect system, but still a work in progress and far superior to the old method of distribution
  4. Again — this is still a work in progress and not a final implementation, but a step in the right direction

The last line feels like a repeat because we want people to understand that we are working every single day on advancing Gala Games and improving the way the network functions. While this is a MAJOR shift in the right direction, we are not going to pretend like it is a perfect solution.

For those interested in a somewhat more technical explanation, here are some basic details for how it works from one of the Gala Games engineers:

The item distribution will run at 2:15 GMT each day. The first significant thing it does is query for all eligible nodes. The query sums up the amount of time it was online the previous day (00:00 GMT to 23:59 GMT). It then filters out any nodes that weren’t on at least 6 hours and groups the remaining nodes by the node’s user id and then looks up how many licenses each user has. If a user had more nodes online than they have licenses, it will filter out the extra nodes so the max eligible nodes a user can have is the number of licenses they have. It saves this list in memory and then creates a list of hashes using the Daywiss Provable library.

That library creates a seed from which to generate the first hash. We use the UUIDjs library to generate a uuid to use as the seed for each of the eligible nodes. The library creates sha256 hashes starting with the seed and then hashing the previous hash until it has the correct number of hashes. It creates this list backwards so the hash of the seed is the last hash in the list. It also means that if you take a sha256 of the 5th hash in the list, it will equal the 4th hash in the list. The provable library uses these hashes to get a random 32 bit integer by splicing 8 characters of the end of the hash which gives you a 32 bit base-16 number.

The distributor then gets the items to distribute from the list provided by the game developers. These records include how many items go to the node network. It then iterates over the number of items that go to the node network. For each iteration, it gets the next hash in the list and gets the 32 bit integer for that hash. It then uses RandomJS to get a reproducible random number in a given range using that 32 bit integer. The range we’re trying to get a number in is 0 and the number of eligible nodes left in the list — 1. We use this number as the index to pull out of the list of eligible nodes and assign the item to this node. It then removes the node from the list and continues to the next iteration. If the list to pull from is empty, it repopulates with the entire list of eligible nodes and generates a new list of hashes using the last hash as the seed.

The assignments for each item are sent to each users treasure chest. The list of hashes, selections for each items and list of nodeIds (sha256 of machine guid) are then saved to s3 which can be used to reproduce the distribution and verify randomness. This will be made public for inspection shortly following the distribution in the app.gala.games distribution dashboard.

Thank you very much for reading this! Tomorrow, we also have a BIG piece of news coming about Gala Games Node Pricing. More info coming tomorrow, but node pricing is changing tomorrow as we switch to a tiered pricing model for new node issues in anticipation of the NFT-based node model. Stay tuned!

There is a LOT more coming for Gala Games, so make sure to keep in touch, watch the Discord (http://galagames.chat) and get ready for more interesting news! Follow Gala Games on Twitter, Facebook, Instagram or in our Discord!

--

--

No responses yet