Are you ready to scale?!

In order for Kin to be successful, it must support millions of transactions per day made by real users, real devices, and real production. Our blockchain infrastructure will need to support such a scale. However, as an industry leader doing something brand-new, we can’t test in a main environment (nor manufacture transaction volume out of nowhere).

To work around this issue and ensure we can support consumer volume, we created a custom approach to stress and load testing that is pretty advanced in the space. We are leveraging our relationship with Kik, our first Ecosystem partner, to demonstrate that Kin blockchain is ready for mainstream scale.

This Is How We Scale

Our first blockchain experience was with Ethereum back in November 2017 and since then we have learned a tremendous amount in the past several months. One of the main learnings from IPLv2 was that Ethereum would not be able to serve our needs in its current state (scale, fees, confirmation time, etc.).

With this knowledge, our next step toward our goal of becoming the most used cryptocurrency in the world required finding the best blockchain infrastructure that fit our needs among the ocean of blockchain solutions. We did blockchain comparisons taking into consideration our main requirements, and after some digging, we found that Stellar is the best fit for us at this time.

In order to ensure and verify that Stellar is indeed the best fit, our next step was to load test the Stellar network. Our goal was to reach the maximum transactions that are supported in Stellar. From a technical POV, the results showed Stellar was indeed the best candidate for the Kin Ecosystem. It met our most important requirements — namely predictable fees, network stability, and short confirmation times.

“This phase also brought forward a number of important new learnings. From a technical perspective, the most important was that Stellar will be able to — at least initially — scale for our needs. From a business perspective, we also learned about new challenges that we will need to overcome regarding subsidies of the network. The main issues we encountered with regard to MainNet (Stellar’s production environment) were how to handle subsidizing the fees of new accounts and transactions on Stellar, as well as the churn of users that stopped using the app after a wallet was already created.”

Kin Blockchain — Taking Fate Into Our Own Hands — Netanel Lev

Testing Infrastructure

Our initial tests started in March 2018 on Stellar’s public testnet. An experimental token called ATN (Attention Token) was sent when a selected group of Kik users sent and received messages. We reached more than 4M transactions, exceeding 200K daily transactions. The confirmation time was also super fast with 97% of the transactions occurring in less than 10 seconds. This proved that Stellar’s blockchain was scalable, had high transaction rates, and that we could build our own blockchain. But we realized that if we want more scale we need to subsidize more. In the words of Ted Livingston:

“While originally, the team had thought it could just subsidize the transaction fees, they soon realized that it would have to put lumens in people’s wallets to do that. As such, they theorized that bad actors could then just create a bunch of wallets and scrape up the lumens, in an effort to secure enough money to make an impact on the network.”

We learned that in order to support real transactions that are connected to real users we need to set up our own environment. So on May 9th, 2018 we set up our own testnet environment to run the experiment efficiently. In the beginning, we found a few issues and focused on fixing them before hitting production. This test allowed us to fix real production issues in the testnet environment, making this the first step towards a stable Kin blockchain.

Testing Approach and Analysis

How did we conduct this test? We integrated our Android ATN SDK into Kik’s messenger platform(basically it’s a wrapper of our Android core SDK). Kik users were picked at random for this test which was controlled through A/B testing.

Being our first test on Stellar’s public testnet, and not knowing how it will behave with real transactions, we opened the test to a small number of users (0.05% of Kik’s users). In this first iteration, we were able to reach 220K transactions per day, about 3.6 transactions per second. Besides scalability on Stellar, we also wanted to test stability, so we let the test run for 2 weeks. During this period we encountered various issues on the public testnet. Some of the issues were resolved by Stellar, while others remained unsolved. Since we found that some of our issues were not Stellar’s highest priority, we recognized the need to set up our own environment.

Once we set up and stabilized our own network, we began to gradually increase Kik’s users exposure to the test. Our first iteration brought us to 470K transactions per day, or about 8.3 transactions per second at the peak.

This continues to get higher and higher as we go. We have continued to gradually increase the users’ exposure while testing the scalability and stability of the network. Once we opened the test to 1% of the users we were able to reach more than 1.2M transactions per day — 20 per second! Amazing, right?

1.2 million transaction per day! 20 transactions per second

Conclusion

Launch, fail fast, and learn even faster! Taking an off-the-shelf blockchain solution and optimizing it per our needs wasn’t an easy decision, but we could only make it due to the fast pace of learning that has become a central part of Kin’s culture. The development of Kin’s blockchain is driven by product requirements, not by abstract technological considerations. So as new requirements arise, we will continue to seek out the best solutions for them in order to support mass adoption.

Stay tuned for further posts on learnings, traction, milestones, and more.