NFT applications make a sizeable proportion of popular DApps today. The first well-know NFT game is CryptoKitties by Dapper Labs. First launched in 2017, CryptoKitties is still the largest nonfinancial DApp on Ethereum. It caused serious network congestion blockchain during to limited scalability of Ethereum platform.
Parallel-Kitties is the parallelized version of the original CryptoKitties core developed by Dapper Labs (https://www.dapperlabs.com) using the concurrency framework. The original CryptoKitties can be downloaded from https://github.com/dapperlabs/cryptokitties-bounty. The main goal of ParallelKitties is to demonstrate how a typical, real-world application can benefit from our parallel execution to achieve dramatic performance gains.
The original implementation of KittyBase.sol
would save thekitty information in an array. The kitties' IDs are their index numbers. When a new kitty is born, some info needs to be appended to the back of the array. The length of the array will be used for the next kitty's ID. We replaced this native array with a map, since native Ethereum arrays don't support concurrent push back.
In the new implementation, kitty IDs are now the map keys that are generated by UUID generators. The map values are the kitty info. Since there is no way to get the length of a map Solidty as of 11/2022, we added a new variable totalBalance
to keep track of total kitties, which will be updated in a deferred call.
The new version achieved some astonishing results. Our version is about ~1000x faster than original on Ethereum.
- Functionally identical to the original one
- Minor changes to the data structure
- 48 EVM instances in parallel
- ~1000x faster than on Ethereum
If you are only interested in trying Arcology testnet out without diving into specific technical details, then please check this document out for an easy start.