Get a 10% discount when purchasing Tangem Wallet using the code!

Chia 🌱 - DataLayer, the large general purpose decentralized database

Allows you to create data repositories with any type of content and for it to be replicated to other nodes that have subscribed to said datastore

6 min read
Chia 🌱 - DataLayer, the large general purpose decentralized database

The Chia project not only surprises us with the future utility of the projects that are being built on the network, but also with the functionalities that it offers us natively for the chain of blocks itself .

A few months ago, Chia's team announced a feature that will open new horizons for the world of blockchain development.


Chia DataLayer is defined as a decentralized database that allows Chia users to create data repositories with any type of content and have it replicated to other nodes that have subscribed to said repository. The data travels between nodes using a peer-to-peer protocol but governed by the blockchain itself . In other words, the data does not travel within the blockchain, but it is in charge of controlling the authenticity and integrity of the data by storing hashes with the version and validation tests on the last published data.

By default we can already store small amounts of data through smart contracts as it is a coin-set model blockchain , but in general they are not enough for projects with a large data density and that need to move real-world data out of the chain. blocks. A block of transactions in Chia is generated every 52 seconds and generally weigh around 400KB. Being able to store more would compromise the performance of the blockchain and it would be inefficient for all the nodes to have to store and synchronize the huge amount of data from all the projects, since one of Chia's premises is that it be very efficient and lightweight and that can run on low-performance devices (such as raspberry pi).

chia datalayer diagram
Chia DataLayer architecture diagram


It is presented as a layer above the blockchain , which in this context the chain of blocks is responsible for storing in a singleton (a type of currency with a unique identifier and that can be spent and recreated multiple times) all the information related to the published data (metadata), which will be updated each time a new update is confirmed , thus offering a tree with the history of all updates.

The original data remains stored locally and when the hash of the data stored locally matches that stored in the chain, the original data is guaranteed to be accurate and ready to be synced. With this we get a shared data network without central government.

It allows off-chain data to be tested on the chain and provided to the Chialisp code , making it an active part of the transaction.

The most interesting part of this whole scenario is that the metadata published on the blockchain is accessible at the Chia smart contract level since Chialisp can read and write directly to the DataLayer, opening up an infinite range of possibilities for developments based on exchange or buying and selling data.
Chia DataLayer Replication Diagram


Publisher (Owner): is the one who has the original data and the only person responsible with the right to modify or update the data as of today.

Observer (Subscribers): is the one that observes the changes in the chain of blocks about a certain datastore to which it has previously subscribed. If you have specified the URL of a mirror accessible to that data when you subscribe, it will be downloaded and made available on that host.


One of the elements participating in this game are the chia wallets since they are the intermediary elements between the user, the blockchain and the data. It is necessary to use a special wallet of type data_layer that will be created automatically when enabling the Datalayer services in our Chia installation.


The mirrors (mirrors) are responsible for "making available" the data. In order for the data to be propagated to other hosts, it will always be necessary for there to be at least one mirror available. In general, the publisher also creates a mirror, since without it the observers could only consult the changes in the blockchain but could not access the data. A mirror raises an http server to perform the transmission, which is transmitted by default on port 8575.


A datastore is the data space that will be created and shared with the other hosts . To register it, it is necessary to "spend" 0.1 XCH (100000000000 Mojo ) which is the minimum value that a Singleton needs to be stored in the chain of blocks. When you destroy the datastore , that amount is returned to the original wallet.

When a datastore is created, a unique identifier will be generated that will always be used to refer to or subscribe to a particular data container. If at the time of subscribing to a datastore we specify the URL of a mirror, it is when we will really have the ability to replicate the data.

Main features


Subscribers can always review the immutable change history applied to data tables. Each change records a proof of the existence of the data at a given moment.


The data is only modifiable by the owner and all changes are immutable on the blockchain. The source of a change is public and undoubted and can be verified by anyone with access to the datastore .

Data persistence

The data in the Chia DataLayer will live as long as there is a host that provides a mirror of that data, provided by the original publisher of the data or other interested parties. Even if the original publisher of the data in Chia DataLayer decides to stop publishing the data, any other interested party can ensure the survival of the data by publishing another mirror.


It is a native Chia functionality and offers unique capabilities that only an integrated solution can provide. Some third-party solution providers "anchor" databases to the blockchain for auditing purposes , but these third-party solutions are not integrated into the blockchain itself.

Sovereignty and equality between peers

All participants in a Chia DataLayer-based application are equal. No entity can update the records of the others, creating a true and sovereign way of storing data. There is no central party to host data that can censor or change the data of other participants.


In conclusion, the Chia DataLayer revolutionizes the world of decentralized data storage and handling. It provides a new means for users to create, store, and share data repositories on the blockchain in a secure, transparent, and auditable way, thus making it an excellent solution for applications that require large-scale, reliable data handling. Chia's innovative approach also ensures a level of equality, as no single entity can modify the records of others, creating a truly sovereign and democratic data management system. This kind of functionality allows the blockchain to not just be a platform for financial transactions, but a robust system for diverse data-centric applications. As the blockchain technology continues to evolve, the Chia DataLayer serves as an example of how to seamlessly integrate off-chain data into blockchain operations, without compromising on speed or security, making it an exciting milestone in the future of blockchain development.

Thanks for taking the time to read this article. I hope you liked it and that you found useful and valuable information in it.

Creating and sharing quality content takes time and effort. If you appreciate my work and would like to see more of it, please consider making a small donation.

Every contribution, however small, makes a big difference and helps me continue this work that I enjoy so much.

If you have any kind of suggestion or would like me to talk about a specific topic, let me know!
XCH Donation Button

The donation button is not available on this device. Please use a desktop device to make a donation :)