Datum is an elementary data container for storing different types of data.

All kinds of data in Cellframe Network have their corresponding datum.

Datum consists of the following fields

FieldTypeLength, bytesDescription
version_iduint8_t1Datum version
type_iduint16_t2Datum type
data_sizeuint32_t4Datum content length
ts_createuint64_t8Datum creation time (timestamp)
datauint8_tvariableDatum content of length data_size

TRANSACTION

Transaction DATUMX_TX has its own article.

DECREE

Decree is a special datum type used to inform the blockchain network about particular system changes.

This datums stores the following data:

hash - hash of the datum string size - size of the datum uint64

DECREE TSD SECTIONS

VALUE contains: value - some value uint256_t

FEE contains: fee - some fee value uint256_t

OWNER contains: Owner fingerprint - owner public key dap_pkey_t

MIN_OWNER contains: Owner min - minimal owners quantity for the specified essence uint256_t

FEE_WALLET contains: Wallet for fee - address of the wallet for fee collection dap_chain_addr_t

HASH contains: Stake tx - hash of the stake transaction dap_hash_fast_t

STAKE_VALUE contains: Stake value - amount of staked tokens uint256_t

SIGNING_ADDR contains: Signing addr - hash of the signing address dap_chain_addr_t

NODE_ADDR contains: Node addr - address of the node dap_chain_node_addr_t

STAKE_MIN_VALUE contains: Min value - minimum stake amount in tokens uint256_t

MIN_SIGNERS_COUNT contains: Min signers count - minimum quantity of signers required uint256_t

STRING contains: Host address - address of the host string

ACTION contains: Action - type of the action (add or delete in scalar) uint8_t

SIGNATURE_TYPE contains: Signature type - type of the signature uint32_t

ANCHOR

Anchor is a special kind of datum which contains a hash of event (decree). It serves as a synchronization event (point) between zerochain and mainchain.

This datums stores the following data:

hash - hash of the datum string size - size of the datum uint64 decree hash - hash of the corresponding decree string

TOKEN DECLARATION

This datum stores informations about token declaration.

TOKEN_SUBTYPE_PRIVATE

hash - hash of the datum string ticker - ticker (name) of the token string size - size of the datum uint64 version - token version int

subtype - subtype of the token (PRIVATE in this case) string decimals - number accuration after comma (18 by default) unit64 auth signs valid - quantity of authorized token signatures required fot it’s emission unit64 auth signs total - total quantity of authorized token signatures unit64 total_supply - maximum sum limit of all token emissions (if 0 - there is no limit) string flags - different token properties (ALL_ALLOWED by default) string

TOKEN_SUBTYPE_NATIVE

hash - hash of the datum string ticker - ticker (name) of the token string size - size of the datum uint64 version - token version int

subtype - subtype of the token (CF20 in this case) string decimals - number accuration after comma (18 by default) unit64 auth signs valid - quantity of authorized token signatures required fot it’s emission unit64 auth signs total - total quantity of authorized token signatures unit64 total_supply - maximum sum limit of all token emissions (if 0 - there is no limit) string flags - different token properties (ALL_ALLOWED by default) string

FLAGS

NO_FLAGS - no specified flags

ALL_BLOCKED - blocks all permissions ALL_ALLOWED - allows all permissions unless they are blocked (be careful with this mode) ALL_FROZEN - temporarily freezes all permissions ALL_UNFROZEN - unfreezes all frozen permissions

STATIC_ALL - blocks manipulations with a token after declaration (tokens are declared statically) STATIC_FLAGS - blocks manipulations with token flags after declaration STATIC_PERMISSIONS_ALL - blocks all manipulations with permissions list after declaration STATIC_PERMISSIONS_DATUM_TYPE - blocks all manipulations with datum permissions list after declaration STATIC_PERMISSIONS_TX_SENDER - blocks all manipulations with transaction senders permissions list after declaration STATIC_PERMISSIONS_TX_RECEIVER - blocks all manipulations with transaction receivers permissions list after declaration

ALL_SENDER_BLOCKED - adds specified wallet address to the list of blocked receivers ALL_SENDER_ALLOWED - adds specified wallet address to the list of allowed receivers

ALL_RECEIVER_BLOCKED - adds specified wallet address to the list of blocked senders ALL_RECEIVER_ALLOWED - adds specified wallet address to the list of allowed senders

DATUM TOKEN TSD SECTIONS

MIN_OWNER contains: Owner min - minimal owners quantity for the specified essence uint256_t

SET_FLAGS contains: flags_set - flags which were set uint16

UNSET_FLAGS contains: flags_unset - flags which were unset uint16

TOTAL_SUPPLY contains: total_supply - token total supply uint256

TOTAL_SIGNS_VALID contains: total_signs_valid - total quantity of valid signatures uint16

TOTAL_PKEYS_ADD contains: total_pkeys_add - added public keys string

TOTAL_PKEYS_REMOVE contains: total_pkeys_remove - removed public keys string

DELEGATE_EMISSION_FROM_STAKE_LOCK contains: ticker_token_from - ticker of the token which was locked string emission_rate - percent part of funds being emitted string

ALLOWED_ADD contains: datum_type_allowed_add - datum types allowed to be added string

ALLOWED_REMOVE contains: datum_type_allowed_remove - datum types allowed to be removed string

BLOCKED_ADD contains: datum_type_blocked_add - datum types which were blocked to add string

BLOCKED_REMOVE contains: datum_type_blocked_remove - datum types which were blocked to remove string

TX_SENDER_ALLOWED_ADD contains: tx_sender_allowed_add - add allowed tx senders string

TX_SENDER_ALLOWED_REMOVE contains: tx_sender_blocked_add - remove allowed tx senders string

TX_SENDER_BLOCKED_REMOVE contains: tx_receiver_allowed_add - add blocked tx senders string

TX_RECEIVER_ALLOWED_REMOVE contains: tx_receiver_allowed - remove allowed tx senders string

TX_RECEIVER_BLOCKED_ADD contains: tx_receiver_blocked_add - add blocked tx receivers string

TX_RECEIVER_BLOCKED_REMOVE contains: tx_receiver_blocked_remove - remove blocked tx receivers string

TSD_TOKEN_DESCRIPTION contains: description - token description string

Every TSD section has the following fields:

tsd_type - type of the TSD section string tsd_size - size of the TSD section in bytes int

TOKEN UPDATE

TOKEN UPDATE has the same fields as TOKEN DECLARATION datum.

TOKEN EMISSION

This datum is designed for storing information about token emission.

emission hash - hash of the corresponding emission string coins - emission value in coins string value - emission value in datoshi stirng ticker - ticker of the emitted token string type - type of the emission string version - emission version uint64 to addr - target address where funds were emitted string

TYPE_AUTH

signs_count - quantity of signatures uint64 tsd_total_size - total memory size of TSD sections uint64

EMISSION TYPE AUTH TSD SECTIONS

DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_TIMESTAMP        
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_ADDRESS           
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_VALUE        
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_CONTRACT         
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_NET_ID     
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_BLOCK_NUM         
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_TOKEN_SYM      
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_OUTER_TX_HASH   
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_SOURCE        
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_SOURCE_SUBTYPE   
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_DATA        
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_SENDER          
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_TOKEN_ADDRESS     
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_SIGNATURS        
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_UNIQUE_ID      
DAP_CHAIN_DATUM_EMISSION_TSD_TYPE_BASE_TX_HASH     

TYPE_SMART_CONTRACT

flags - smart contract flags string lock_time - time for which funds will be locked string addr - address of the smart contract string