Karma Sneak-Peak. What's Under The Hood?

Karma Project
KarmaRed
Published in
4 min readSep 20, 2018

Hello dear friends,

Previously, we’ve discussed Graphene TPS measurement test.

100,000 transactions per second (TPS) in reality could not be achieved: the real performance of the Karma Core 1.0 blockchain reaches only 2 000 tps.

This completely was covering our current needs at that stage. However, when we started to develop the platform, we faced a number of Graphene limitations, which led to the idea of developing our own blockchain with a different architecture and different working principles.

Used technologies

Karma Core / Karma Blockchain

Karma Core — is a fork of the Bitshares blockchain, based on the Graphene protocol. The core of the current version is developed in C++. Devnet, testnet and mainnet are launched. Any user or developer can also run their node and use the Karma network to work with blockchain assets directly.

API for working with Karma network is implemented on top of the JSON-RPC

RC protocol and supports high level wrappers for Python, JS and Node.js. The source code of the blockchain and tools for working with it are published on GitHub Karma.

We are currently working on our own Karma blockchain, which will replace the blockchain based on Graphene. Own blockchain will provide the following opportunities:

  1. become node-holders for up to 10,000 nodes (in the current version up to 20);
  2. working with wallets of several types: system, notary, scoring agency, investor and borrower (in the current version of the blockchain it is impossible to divide the roles by the type of wallets);
  3. to implement the workflow with credit applications as a property of the blockchain, not the smart contract (the principles of operation of the blockchain on the basis of Graphene imply the extension of the functionality of the blockchain, but not the protocol or its properties);
  4. delegate and revoke the authority of system wallets such as notary and scoring agency (in the case of Graphene it is not provided the powers over wallets and their management, and it is an ideologically driven property);
  5. enable full tracking on credit operations (in Graphene it is impossible to implement status tracking for applications);
  6. support the function of collective crediting of the borrower by a group of investors with different investment shares and make individual repayment schedules with the help of blockchain functions (in the current implementation, a single centralized wallet for collecting transfers has been launched);

So, in the current development cycle, we have launched a working prototype platform based on Karma Core blockchain, based on the Graphene Protocol, and will form the basic functionality on the basis of this scheme for the implementation of business needs. In parallel, we are developing a new Karma blockchain (draft name is Karmus), which will allow the removal of restrictions on work with the current version of Karma Core blockchain.

However, it should be understood that working with blockchain is a rather complex technological exercise, not only for a technically competent user, but even for a developer.

Also, technologically, and sometimes legally, the blockchain can not fully cover the entire set of necessary functionality, for example, storage of personal data, legal documents (contracts, guarantees, etc.), large media files, etc.

Therefore, we in Karma are working not just on the development of another blockchain, but on an integration platform that allows, on the one hand, to hide the complexity of the use of the blockchain, as well as to provide transparent interaction of the blockchain with off-chain modules.

Main modules of the platform:

  1. Blockchains (can be multiple): Karma Core, Karma Core 2.0, Ethereum, Bitcoin;
  2. Karma Microservices;
  3. Karma Multiplexer;
  4. Karma Backend;
  5. Karma CRM (Backoffice).

The main point of assembly of all services of the platform is the data multiplexer based on Apache Kafka: Karma Multiplexer. All interaction with the platform’s microservices is carried out through a distributed service of several geographically distributed platforms, where blockchain nodes API and microservices are launched, integrating the functionality of different blockchains with off-chain services: internal scoring, settlement service, gateways to various external blockchains, etc.

In the new Karma Core 2.0, the services API will be public to external developers, as well as the Graphene API in the current version, which will add even more flexibility to connect to the external developers platform.

Microservices are developed in Python 3, Node.js and C++. The intermediate layer uses AWS, Rethinkdb, Mongodb, and Postgresql databases.

To simplify and unify the development of both internal systems and systems potentially useful to external developers, the entire public API integrates the internal functionality of microservices and blockchain on the Backend, based on the Node.js. The Karma 2.0 API supports the GraphQL specification. You can already connect to the platform to develop your own services or applications: GraphQL API Karma 2.0.

Karma is actively developing. Sources are available on karma.red team Bitbucket. For example, the source code of the main user application of the p2p lending platform: my.karma.red.

Technological platforms

  1. Digital Ocean — hosting API Nodes, Karma Multiplexer, databases, backend and microservices;
  2. Aliyun — hosting services for Chinese audience;
  3. Cloudflare — CDN provider;
  4. Heztner — territorial hosting of some Karma 2.0 platform services;
  5. Bitbucket -version control and support for Continuous Integration
  6. Github — version control of public source code
  7. Jenkins — platform for software development and Devops
  8. Prometheus — monitoring system of the services and platform services
  9. Jira — project management system

Supported OS

  1. Ubuntu 17.4
  2. Centos 7

Cheers ^_^

--

--