Chromia Logo

The Chromia Platform

Chromia is a Relational Blockchain, a combination of a relational database and a blockchain. It is here to give power to developers, and power to the public.

Rell Logo

Superpowered by Rell

Rell is the new blockchain and database language that gives static typing, expressiveness and more security to databases, and 10x less lines of codes compared to other blockchains.

GOES WELL WITH
Eclipse Logo

Eclipse

Post SQL Logo

PostgreSQL

Docker Logo

Docker

Ethereum Logo

Ethereum

Unity Logo

Unity

Chromia Rell Icon
Relational blockchain

The power of a blockchain combined with a relational database.

Chromia Block Explorer Icon
Block Explorer

Chromia Explorer is a fully decentralized blockchain explorer, which allows users to visualize transactions and activities on different chains.

Free/Libre
and Open Source

The Chromia software stack is hosted on bitbucket.

Avoid
monopolies

Chromia is Free/Libre Open Source software. The core software is GPLv3 licensed, with some components and libraries under the MIT license.

We share values such as freedom and justice with the free software movement, but we also try to improve on some of its problems with a new way of hosting public applications.

A soft start into the Chromia universe

Blockchain development does not have to be complex.Working with data structures is easier because of Chromia’s built-in database.

Check a small example to the right for an account-based token system. Or if you want to do a UTXO bitcoin like token system, you can do that too, in around 15 lines of code. Or maybe you want to do a chat.

Rell in action

A demo of a token system

This is an example of an account-based token system. Users can send money to each other, and we keep track of payments. One neat feature is that we have built-in indexing to keep track of payment history. Other blockchains systems might resort to third-party tools and complex protocols to handle this. The first picture shows the data structures. Click on Transfer to the right to show the logic.

Transfering an amount is easy to do. First we check that it is actually the sender, the from_user, that is calling the transfer operation (and it is cryptographically signed). Then we do some basic checks, such that the sender has enough money. We update two balances, the senders and the receivers, and create a history of payments. These updates are atomic and can never be out of sync. Note that create payment can infer the types of arguments from the data types.

Every chromia node has a REST server that clients can connect to. But in the blockchain world transactions needs to be cryptographically signed, and we provide easy to use client libraries for this. In the example below you can see how to do it in javascript. The sendTokensToFriend function shows the common pattern, four lines to call the server with a signed message.


entity user { key pubkey; }

entity balance {
    key user;
    mutable amount: integer;
}

entity payment {
    index from_user: user;
    index to_user: user;
    amount: integer;
    timestamp;
}

operation transfer(from_pubkey: pubkey,
                   to_pubkey: pubkey,
                   xfer_amount: integer) {
    require( op_context.is_signer(from_pubkey) );
    require( xfer_amount > 0 );
    val from_user = user@{from_pubkey};
    val to_user = user@{to_pubkey};
    require( balance@{from_user}.amount >= xfer_amount);
    update balance@{from_user} (amount -= xfer_amount);
    update balance@{to_user} (amount += xfer_amount);
    create payment (
        from_user,
        to_user,
        amount=xfer_amount,
        timestamp=op_context.last_block_time
   );
}

const pcl = require('postchain-client'); 
const node_api_url = "http://YOUR_NODE:YOUR_PORT";
const blockchainRID = "YOUR_BLOCKCHAIN_ID";
const rest = pcl.restClient.createRestClient(
    node_api_url, blockchainRID, 1);
const gtx = pcl.gtxClient.createClient(rest,
    Buffer.from(blockchainRID, 'hex'), [] );
const myself = pcl.util.makeKeyPair(); 

async function sendTokensToFriend(friend, amount) {
    const tx = gtx.newTransaction([myself.pubKey]); 
    tx.addOperation('transfer', myself.pubKey,
                    friend.pubKey, amount); 
    tx.sign(myself.privKey, myself.pubKey); 
    await tx.postAndWaitConfirmation(); 
}

Learn RELL with Chromia CEO Henrik Hjelte and Lead Developer Riccardo Sibani
An Introduction to the Chromia Vault & Explorer with Riccardo Sibani
Why NFTs are Not Truly Yours
Chat Icon

Create a chat

Learn by doing a public chat, with users, messages and tokens. Blockchain and client code, and some beautiful one-line queries.

See code
FT3 Icon

Explore FT4

Create a token and manage accounts with the FT4 module. Get easy management of accounts, assets and transaction history, and SSO.

Read the docs
Built on Chromia

Mines of Dalarnia

Mines of Dalarnia is an action-adventure platform-mining game in which the player controls a character and guides them through various blocks of earth, to discover and collect minerals of multiple rarities. The game also includes a blockchain based real-estate market.

View dapp
Mod Miner Image

Chromunity

Chromunty is a fully decentralized social media platform where users engage on their own terms by voting mechanisms and other cool features. The first version was done by a single developer in a week. With Chromia, it should be possible to make decentralized applications just as easy as it is to do normal web applications.

View dapp

Latest posts for developers

To the Chromia Blog Arrow

Join the Chromia developer community

Getting started or want to create together? Join us!

Join our developer chat on Telegram!

Join developer Telegram