Understanding the Nervos DAO and Cell Model
By: Nervos Network
Tags: Cryptocurrency, Editorials And Comments, Blockchain, Decentralization, Bitcoin

Thanks to Stitch, one of our community members based in China, for this content!

Photo by Christian Fregnan on Unsplash

The Cell Model

Before understanding the reward system of the Nervos DAO, it is necessary to briefly introduce the Cell model of CKB. Here is a simple explanation:



We can think of a cell on the Nervos CKB blockchain as a box, which stores CKByte tokens, smart contracts, custom tokens or any other data. All data on the blockchain is stored in these boxes.

To keep it simple, whenever you read cell, think box.

So what is a cell made of? CKBytes!

1 CKByte token allows an owner to store 1 byte of data on the blockchain.

Let’s look at an example: Suppose you have 1,000 CKBytes in one address—61 of which are required to create the cell, which can then hold the remaining 939 CKBytes. (The minimum required to create a cell is 61 CKBytes).



There are a few more things to understand :

There is not currently a case where a cell would be more than 0 and less than 61 CKBytes — this would not meet the minimum requirement

At present, whether you store 100 CKBytes or 10,000 CKBytes, you are using a cell comprised of 61 CKBytes

The process of transferring CKBytes involves opening (destroying) a cell and creating a new cell. Transfers can open several cells, as well as create several new cells

The 61 CKB that is used to create the cell can also be transferred — just open (destroy) the cell and transfer the CKB

This cell model is similar to Bitcoin’s UTXO model, however, on CKB, the native token is used to store data on-chain. Though this may be a bit tricky to understand at first, give it some time to sink in. Once you understand the whole process, you will also understand why CKBytes will be scarce in the future.

Locks and Types

To understand the operation of the Nervos DAO, we need to add two things to this cell, one is called a “lock” and the other is called a “type”.



Locks

The “lock” is very easy to understand. Since CKBytes are a digital asset, it makes sense that a lock would be needed to prevent others from stealing its contents. With this “lock”, only the owner can open/destroy the cell, unless of course their private key is leaked.



Types

Moving on to the “type” — this marks what the cell is used to store, and this designation allows the CKB virtual machine to find logic that controls the cell’s operation. Remember the cell we used to store the CKBytes above? The “type” of this cell is CKBytes, and it takes 61 CKBytes to create such a cell.



So what about the “type” on a cell used to store CKBytes in the Nervos DAO? To make a cell with a “type” of Nervos DAO, 61 CKBytes is not quite enough— 102 CKBytes will be required (for now it’s not important to understand why 102 CKBytes is required, just that this is the minimum value for Nervos DAO cells).

Nervos DAO Deposits

Let’s look at the process for depositing CKBytes into the Nervos DAO: first, open (destroy) a cell with the type “CKB” and then create a cell with the type “Nervos DAO.”



Though the amount of CKB required to create the cell has changed (from 61 to 102) and the “type” value of the cell has changed as well, the logic of the cell model is still the same. The “lock” is still there, and the key to the cell remains only in your control.



102 CKBytes was used to create a cell with “type” of “Nervos DAO.” Suppose you put 1000 CKBytes in a cell with “type” of “Nervos DAO.” You will receive rewards for CKBytes locked in the DAO, but 102 CKBytes is being used to store the cell. Rewards will be calculated based on 1000–102 = 898 CKBytes, not 1000 CKBytes.



Similarly, if you deposit 10,000 CKBytes, rewards will be calculated on 10,000–102 = 9,898 CKBytes.

Nervos DAO in Practice

We have observed one address that has been making consistent deposits of 100,000 CKBytes into the Nervos DAO: https://explorer.nervos.org/address/ckb1qyqpglresc88v97pqsmurcahz5gyflyqfn9sufygk9



The way this user has structured the deposits, each deposit creates a separate cell. For each deposit, the user is creating a cell with a “lock” that only their key can open and a “type” of Nervos DAO.



This approach will allow the user to withdraw each of these deposits independently (more information about Nervos DAO deposit and withdrawal can be found here).

Network Stats