Terms and definitions using in Cellframe SDK
Atom - a structural unit of a blockchain. Each subsequent atom is related to the previous through its hash (the hash of the previous atom is included in the data structure of the next atom or several atoms). Atom is a block, if it is applied at the blockchain level, or event – if used in a DAG.
Basic transaction - the initial transaction in the chain of transactions, which, unlike the others, does not have an entrance, but has an associated token and emission.
Transaction types:
TX_ITEM_TYPE_IN
TX_ITEM_TYPE_OUT
TX_ITEM_TYPE_OUT_EXT
TX_ITEM_TYPE_PKEY
TX_ITEM_TYPE_SIG
TX_ITEM_TYPE_TOKEN
TX_ITEM_TYPE_TOKEN_EXT
TX_ITEM_TYPE_IN_COND
TX_ITEM_TYPE_OUT_COND
TX_ITEM_TYPE_RECEIPT
TX_ITEM_TYPE_OUT_ALL
TX_ITEM_TYPE_ANY
Block - a single indivisible logical data partition. Blocks usually contain transactions, but they can also contain certificates, smart contract code, and any other data.
Blockchain - a continuous sequential chain of blocks (linked list), building according certain rules and containing information. The connection between blocks is ensured not only by numbering, but also by the fact, that each block contains its own hash-sum and hash-sum of the previous block. In the case of cellframe sdk, these are tokens, transactions, emissions, certificates
typedef enum dap_chain_type
{
CHAIN_TYPE_FIRST,
CHAIN_TYPE_TOKEN,
CHAIN_TYPE_EMISSION,
CHAIN_TYPE_TX,
CHAIN_TYPE_CA,
CHAIN_TYPE_SIGNER,
CHAIN_TYPE_LAST
} dap_chain_type_t;
Cell (shard) - set of nodes and chains. Any transaction tree for a given specific address is contained entirely within the cell. In the case of a transaction between cells, there are two transactions, one inside the cell, the other outside. Nodes are linked by links both inside the cell and outside. Full nodes can be limited to links within cells, while master nodes can create external links.
Chain - blockchain, DAG or "clean" ledger without blocks and events. It can be split into subchains, if subchains are sharded, then for each sub-shard (cell) there will be its own chain.
Consensus - the task of consensus is to help the nodes of a peer-to-peer network come to a consensus about what its new state should be - that is, to choose the next block in the blockchain chain. Algorithm of interaction of distributed ledger nodes for making decisions on changing and synchronizing information.
Types of consensus:
Proof of Work (PoW) is a consensus algorithm in which the probability of obtaining the right to validate a block depends on the share of the network's computing power owned by the node. The algorithm is one of the earliest and most widespread, it is underlies the Bitcoin network. Nodes are not required to provide opinions before a consensus is reached. Instead, the nodes use the hash function on the block repeatedly, changing one of its elements (NonCE field) in order to fulfill a certain condition, for example, so that the hash sum of the block begins with a certain number of zeros. The algorithm by which the Bitcoin mining network comes to a consensus, determining which of the mining nodes will write the formed block to the blockchain. PoW boils down to two main points:
a) The need to perform a certain rather complex and time-consuming computational task.
b) Possibilities to quickly and easily check the result
Proof-of-Authority (PoA) - when there is a limited set of keys whose signatures are considered valid for consensus. Consensus procedure based on the differentiation of user rights.
Proof-of-Stake (PoS) - The procedure for reaching a consensus with a proof of stake - when a valid block signature is considered to be a signature by a wallet (or a delegated key from a wallet), which contains a certain amount of tokens.
Unlike PoW, the Proof-of-Stake (PoS) algorithm does not rely on hashing algorithms. Digital signatures are used in the blockchain to prove ownership of their stake (coins or tokens). Each participant has a chance to be randomly chosen as the creator of a new block, that is, a validator, and this chance can increase in proportion to his share. In this case, the consensus has lottery features. The reward in this case is also the project coins. In this case, the consensus algorithm must have the following criteria:
Proof-of-Service is part of the verification of a node based on Proof-of-Stake, before launching it into the network. In fact, this is just an additional condition to Proof-of-Stake, that the node does not just provide some kind of service.
DAG (directed acyclic graph) - the most commonly used variant of chains in a cellframe. DAG consists of events (events), each event contains at least one data item (datum), usually several data items (datums) and other events. Events are added in sets, form connected graphs, and are called a round. The round on forming stage placed in the GDB, not in the chains, then is carried from GDB to the chains after the minimum time has passed, if it becomes connected.
The DAG, instead of a clear sequence of blocks, writes information non-linearly, without a sequential chain of blocks. The robustness of the algorithm is mathematically described as Asynchronous Byzantine Error Tolerance (ABFT). Algorithm is very difficult to hack, and more than two-thirds of the participants need to agree to make a decision at the network level. Due to DAG, the hashgraph has all the advantages of the blockchain, while demonstrating a higher transaction performance. In general, the hashgraph works as follows: network participants (nodes) exchange data over the network, information about the transaction is sent to two random nodes, transmitting them, in turn, to two other nodes - and so on exponentially, until the volume of informed nodes becomes sufficient for verification of the transaction; nodes exchange with each other only transaction data, and not all information about the network; transactions are recorded in chronological order - you can track their history.
In the hashgraph, each node knows the entire transaction history, therefore, to achieve consensus, “virtual voting” is used - there is no need to coordinate all the nodes with each other: each of them already knows how other node will “vote”. Other advantages of DAG are: scalability and performance - up to 500 thousand transactions per second (potentially - up to a million); an increase in the number of network participants increases the bandwidth; low resource consumption and high resistance to DDos attacks and botnets; no need for mining and proof of work (PoW); commissions close to zero.
Data element (datum) - data stored in the blockchain. Data types: certificate (ca), transaction, token, emission, shard and token update (token_update).
DAP_DATUM_TYPE_STR
DAP_CHAIN_DATUM_TX
DAP_CHAIN_DATUM_TX_REQUEST
DAP_CHAIN_DATUM_WASM_CODE
DAP_CHAIN_DATUM_WASM_DATA
DAP_CHAIN_DATUM_EVM_CODE
DAP_CHAIN_DATUM_EVM_DATA
DAP_CHAIN_DATUM_CA
DAP_CHAIN_DATUM_CUSTOM
DAP_CHAIN_DATUM_TOKEN_DECL
DAP_CHAIN_DATUM_TOKEN_EMISSION
Emission (emissions) – data, leading up to the chain of transactions, the basis transaction creation.
Emission types:
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_UNDEFINED
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_AUTH
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_ALGO
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_ATOM_OWNER
DAP_CHAIN_DATUM_TOKEN_EMISSION_TYPE_SMART_CONTRACT
Event - events can be single-line, for example, a blockchain with a single hash link, or multi-line with more than one link between events. Inside the event there are links, signatures and data items (datum). The signature is usually the signature of the delegated key from the PoS.
Genesis block – first block or event in the chain.
Global database (GDB - global database) - datastore group (usually key-value) with atomic changes, that can be synchronized over the network.
Hash - result of one-way cryptographic transformation, that allows identify the original data, but doesn’t allow or very difficult to recover that original data.
Hardfork - procedure of new blockchain version creation. Usually that changes are agreed with comunity
Ledger - a single distributed ledger of transactions. A distributed ledger is a database that is distributed across multiple network nodes or computing devices. Each node receives data from other nodes and maintains a complete copy of the ledger. The nodes are updated independently of each other.
Mempool - is a special partition of the GDB (global database), that stores data items (datums), that require a consensus check. After checking, events (for example, transactions) go to the chain.
Node - a device that is part of the blockchain network. In our case, there is also an application for creating a blockchain Cellframe network. There are the following types:
Light - stores only its transactions of its shard
Full - stores only its own shard
Archive - keep all hardforks in network
Master - stores only his own shard and shards-responders of external transactions inside his shard
Root - storage of all blockchains of all subchains and shards
typedef union dap_chain_node_role{
enum {
NODE_ROLE_ROOT_MASTER=0x00,
NODE_ROLE_ROOT=0x01,
NODE_ROLE_ARCHIVE=0x02,
NODE_ROLE_CELL_MASTER=0x10,
NODE_ROLE_MASTER = 0x20,
NODE_ROLE_FULL=0xf0,
NODE_ROLE_LIGHT=0xff } enums;
uint8_t raw[DAP_CHAIN_NODE_ROLE_SIZE];
} DAP_ALIGN_PACKED dap_chain_node_role_t;
Number of confirmations - the number of records in the blockchain, after transaction was placed.
Order - public announcement of the price list for the providing services. Without creating an order, the price is known only to the node itself. Orders not only "pass through the node", they are also synchronized in the network. It is part of the network along with chains and other global structures. Stored in the GDB.
Round (Rounds forming) - data processing process. Each new data coming from the mempool creates a new event in a new round of formation. New rounds are stored in the GDB.
Threshold - is a hash table for temporary storage of data, usually in synchronization. In the thresholds, the "lost" elements are dug up - atoms/transactions that are tied to other atoms/transactions, but the latter, to which they are tied, are not found in the chains/ledger.
Token - is data at the beginning of a transaction chain, that describes common characteristics for the entire chain. For example, name, emission limit, restrictions on use. For the user, a token is similar to the concept of a cryptocurrency. Tokens can be used to purchase goods and services (for example, paying for VPN).
Transaction - transfer of money between two addresses. Transactions can be written or not written to the ledger. A transaction that is not written to the ledger is called an unconfirmed transaction, transaction written in the ledger is called confirmed.
Transaction fee - fee for any transaction with currency. It can also be applied to the commission for placing any other data in the chains.
Wallet - file with a private key inside. Addresses of same wallet are different in different networks
Wallet address structure:
Fields offsets (in bytes):
0 - Version
1-8 - Network ID
9-12 - Signature ID
13-44 - Public key hash
45-76 - Hashsum of all previous data
typedef struct dap_chain_addr{
uint8_t addr_ver;
dap_chain_net_id_t net_id;
dap_sign_type_t sig_type;
union{
struct {
uint8_t key_spend[sizeof(dap_chain_hash_fast_t)/2];
uint8_t key_view[sizeof(dap_chain_hash_fast_t)/2];
} key_sv;
uint8_t key[sizeof(dap_chain_hash_fast_t)];
uint8_t hash[sizeof(dap_chain_hash_fast_t)];
dap_chain_hash_fast_t hash_fast;
} data;
dap_chain_hash_fast_t checksum;
} DAP_ALIGN_PACKED dap_chain_addr_t;