Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

arcology-network/parallel-kitties

Repository files navigation

Parallelized CryptoKitties

1. Background

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.

2. Introduction

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.

3. Changes

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.

4. Summary

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

5. Quick Start

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.

6. Tests

About

Lightspeed version of CryptoKitties

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published