/
Symbiosis

A Blockchain Library on KMM, or How We Transferred The Code from React JS to Kotlin

Symbiosis is a showcase app for exchanging cryptocurrencies between different networks. To build this app, we have developed a custom open-source KMM library.

Financed by Binance

Supports 11 crypto networks

Market value USD 13M

Задача

Task

Migrate a library from React to Kotlin Multiplatform to improve the performance of crypto apps on mobile devices.

Решение

Solution

We have developed a library on Kotlin Multiplatform for crypto wallets. Such a library performs better on mobile devices.

We have built an open-source showcase app, so that third-party developers can take a look at the principles behind the library and integrate it into their own projects.

Development Process

Why this library was required. Originally, Symbiosis Labs Ltd reached out to us with a task to build an app to freely exchange cryptocurrencies. But during the development process, the priorities shifted and creation of a KMM library for crypto wallets became the key objective.

Blockchain systems were originally created in JavaScript, so the majority of the tools for them were written in JS as well. In this particular case, the customer used a React JS library. However, mobile devices do not support this language natively, so every JS app for smartphones has to use an emulator. This redundant intermediate step means the instructions are executed slower and the process requires more computational resources.

How we built the library. The process included two stages: reading specifications and migrating from React to Kotlin.

The specs required a bit of tidying up, so the reading stage took us several days. Yet, it still allowed us to save some time, compared to simply converting React code.

At the latter stage, we took the customer’s JS code and rewrote it in Kotlin. Another challenge was that the JS library was heavily based on React, so we had to rewrite idiomatic React code in Kotlin, namely, get rid of hooks.

Where can you see the library in action? As a follow-up to the library, we have built an app for exchanging cryptocurrencies between different blockchain networks. The app is open-source, which means third-party developers can take a look at the principles behind the library and integrate it into their own crypto wallets.

The Hardest Part

The customer’s original library used React. We needed to take great care with migrating the code from one framework to another to preserve all the features and keep it functioning properly.

How we solved these tasks

We had to take a deep dive into the code, rewrite it, and then double- and triple-check it. Yet, we still ended up with some minor errors that were really hard to pinpoint later, since the final code was so different from the original.

Technology Stack

Kotlin Multiplatform Mobile
Kotlin
Swift
Ktor

Results

We have developed a KMM library for crypto wallets. Such library performs better than a comparable library in JavaScript. There are no intermediate components between an instruction and its execution, which means the software runs faster and requires less computational resources.

We have built an app to showcase the library in action. Third-party developers can review its inner workings and integrate it into their crypto wallets.

Now we have a ready-made solution for such tasks, which is already functional and ready for integration.

What can you do with the library:

  1. Its code is public, so you can integrate it into your own app for cryptocurrencies. Download it from our GitHub.
  2. Have us implement the integration for you, if you don’t have a team or experience working with KMM. Get a free consultation using a link at the bottom of the page.

Android
Android

Since the blockchain was originally created in JavaScript, everything for it was written in JS as well. Now there is an alternative solution.

The first crypto library in KMM

Since the blockchain was originally created in JavaScript, everything for it was written in JS as well. Now there is an alternative solution.

Let’s discuss your project!

It is free. We will tell you how the application will solve your problems.

Similar projects

APATRIS

2018

Cashier

2022

Credit Broker

2022

JJO

2021

UPSTOX

2022