Datum is an elementary data container for storing different types of data.
All kinds of data in Cellframe Network have their corresponding datum.
- **[[Data element (Datum)#TRANSACTION|DAP_CHAIN_DATUM_TX]] - Transaction**
- **[[Data element (Datum)#DECREE|DAP_CHAIN_DATUM_DECREE]] - Decree**
- **[[Data element (Datum)#ANCHOR|DAP_CHAIN_DATUM_ANCHOR]] - Anchor**
- **[[Data element (Datum)#TOKEN DECLARATION|DAP_CHAIN_DATUM_TOKEN_DECL]] - Token Declaration**
- **[[Data element (Datum)#TOKEN UPDATE|DAP_CHAIN_DATUM_TOKEN_UPDATE]] - Token Update**
- **[[Data element (Datum)#TOKEN EMISSION|DAP_CHAIN_DATUM_TOKEN_EMISSION]] - Token Emission**
**Datum consists of the following fields**
|Field|Type|Length, bytes|Description|
|---|---|---|---|
|version_id|uint8_t|1|Datum version|
|type_id|uint16_t|2|Datum type|
|data_size|uint32_t|4|Datum content length|
|ts_create|uint64_t|8|Datum creation time (timestamp)|
|data|uint8_t|variable|Datum content of length data_size|
## TRANSACTION
Transaction **`DATUMX_TX`** has its own **[[5. Transactions Structure|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 [[Data element (Datum)|datum]] which contains a hash of event ([[Decree|decree]]).
It serves as a synchronization event (point) between [[Chain|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 [[Data element (Datum)#TOKEN DECLARATION|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
```actionscript
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`