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 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.
Eclipse
PostgreSQL
Docker
Ethereum
Unity
The power of a blockchain combined with a relational database.
Chromia Explorer is a fully decentralized blockchain explorer, which allows users to visualize transactions and activities on different chains.
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.
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.
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 by doing a public chat, with users, messages and tokens. Blockchain and client code, and some beautiful one-line queries.
See codeCreate a token and manage accounts with the FT4 module. Get easy management of accounts, assets and transaction history, and SSO.
Read the docsMines 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 dappChromunty 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 dappGetting started or want to create together? Join us!
Join our developer chat on Telegram!
Join developer Telegram