Comprehensive alphabetical function reference and API index for the complete Cellframe SDK ecosystem. This glossary provides quick access to all documented functions, structures, constants, and data types with direct links to detailed documentation and usage examples.
## Overview
This glossary serves as the definitive reference index for the entire Cellframe SDK, providing systematic access to all API functions, data structures, constants, and configuration parameters. Each entry includes function signatures, parameter descriptions, return values, and direct links to comprehensive documentation.
**Reference Organization:**
- **Alphabetical Function Index** - Complete API functions with signatures
- **Data Structures Index** - Core types and structures with descriptions
- **Constants and Enums** - System constants and enumeration values
- **Error Codes Reference** - Comprehensive error handling codes
- **Module Cross-Reference** - Links to detailed module documentation
- **Quick Navigation** - Fast access to specific API categories
**Coverage Scope:**
- All 22 documented Cellframe SDK modules with complete API coverage
- Foundation platform functions for core system operations
- Service-specific APIs for blockchain applications
- Consensus mechanism implementations and interfaces
- Cryptographic functions and security operations
- Network communication and protocol handling
## Quick Navigation
**Alphabetical Index:** [A](#a) | [B](#b) | [C](#c) | [D](#d) | [E](#e) | [M](#m) | [N](#n) | [S](#s) | [V](#v) | [W](#w) | [X](#x)
**Quick Access Categories:**
- **[[#Core System Functions|Core System]]** - Initialization, configuration, logging
- **[[#Blockchain Operations|Blockchain]]** - Chains, transactions, blocks, consensus
- **[[#Cryptographic Functions|Cryptography]]** - Keys, signatures, hashing, encryption
- **[[#Network Functions|Network]]** - P2P communication, DHT, synchronization
- **[[#Service Functions|Services]]** - Staking, voting, bridge, exchange, VPN, mining
- **[[#Wallet Functions|Wallet]]** - Key management, addresses, balances
- **[[#Data Structures|Structures]]** - Core types and data containers
---
## A
### Address Functions
#### `dap_chain_addr_check_sum()`
**Module:** [[Modules/Module Common#`dap_chain_addr_check_sum()`|Module Common]]
**Signature:** `bool dap_chain_addr_check_sum(const dap_chain_addr_t *addr)`
**Purpose:** Validate address checksum for integrity verification
**Returns:** `true` if checksum is valid, `false` otherwise
#### `dap_chain_addr_fill_from_key()`
**Module:** [[Modules/Module Common#`dap_chain_addr_fill_from_key()`|Module Common]]
**Signature:** `int dap_chain_addr_fill_from_key(dap_chain_addr_t *addr, const dap_enc_key_t *key, uint64_t net_id)`
**Purpose:** Generate blockchain address from cryptographic key
**Returns:** `0` on success, negative error code on failure
#### `dap_chain_addr_from_str()`
**Module:** [[Modules/Module Common#`dap_chain_addr_from_str()`|Module Common]]
**Signature:** `int dap_chain_addr_from_str(dap_chain_addr_t *addr, const char *str)`
**Purpose:** Parse address from string representation
**Returns:** `0` on success, negative error code on failure
#### `dap_chain_addr_to_str()`
**Module:** [[Modules/Module Common#`dap_chain_addr_to_str()`|Module Common]]
**Signature:** `char* dap_chain_addr_to_str(const dap_chain_addr_t *addr)`
**Purpose:** Convert address to human-readable string format
**Returns:** Allocated string (must be freed), NULL on error
## B
### Bridge Service Functions
#### `dap_srv_bridge_add_chain()`
**Module:** [[Modules/Module Service - Bridge#`dap_srv_bridge_add_chain()`|Module Service - Bridge]]
**Signature:** `int dap_srv_bridge_add_chain(dap_srv_bridge_t *bridge, dap_chain_t *chain)`
**Purpose:** Add blockchain to bridge configuration for cross-chain operations
**Returns:** `0` on success, negative error code on failure
#### `dap_srv_bridge_create()`
**Module:** [[Modules/Module Service - Bridge#`dap_srv_bridge_create()`|Module Service - Bridge]]
**Signature:** `dap_srv_bridge_t* dap_srv_bridge_create(const char *name)`
**Purpose:** Create new cross-chain bridge service instance
**Returns:** Bridge service pointer, NULL on error
#### `dap_srv_bridge_init()`
**Module:** [[Modules/Module Service - Bridge#`dap_srv_bridge_init()`|Module Service - Bridge]]
**Signature:** `int dap_srv_bridge_init()`
**Purpose:** Initialize bridge service subsystem and protocols
**Returns:** `0` on success, negative error code on failure
## C
### Chain Management Functions
#### `dap_chain_create()`
**Module:** [[Modules/Module Chain#`dap_chain_create()`|Module Chain]]
**Signature:** `dap_chain_t* dap_chain_create(const char *chain_name, dap_chain_net_t *net)`
**Purpose:** Create new blockchain with specified name and network configuration
**Returns:** Chain pointer, NULL on error
#### `dap_chain_datum_create()`
**Module:** [[Modules/Module Common#`dap_chain_datum_create()`|Module Common]]
**Signature:** `dap_chain_datum_t* dap_chain_datum_create(uint16_t type_id, const void *data, size_t data_size)`
**Purpose:** Create universal data container for blockchain storage
**Returns:** Datum pointer, NULL on error
#### `dap_chain_datum_tx_create()`
**Module:** [[Modules/Module Common#`dap_chain_datum_tx_create()`|Module Common]]
**Signature:** `dap_chain_datum_tx_t* dap_chain_datum_tx_create()`
**Purpose:** Create new transaction with empty item array
**Returns:** Transaction pointer, NULL on error
#### `dap_chain_init()`
**Module:** [[Modules/Module Chain#`dap_chain_init()`|Module Chain]]
**Signature:** `int dap_chain_init()`
**Purpose:** Initialize core blockchain subsystem and data structures
**Returns:** `0` on success, negative error code on failure
### Consensus Functions
#### `dap_chain_cs_dag_poa_init()`
**Module:** [[Modules/Module Consensus - DAG PoA#`dap_chain_cs_dag_poa_init()`|Module Consensus - DAG PoA]]
**Signature:** `int dap_chain_cs_dag_poa_init()`
**Purpose:** Initialize DAG Proof of Authority consensus mechanism
**Returns:** `0` on success, negative error code on failure
#### `dap_chain_cs_esbocs_init()`
**Module:** [[Modules/Module Consensus - ESBOCS#`dap_chain_cs_esbocs_init()`|Module Consensus - ESBOCS]]
**Signature:** `int dap_chain_cs_esbocs_init()`
**Purpose:** Initialize Enhanced Scalable Byzantine Ordered Consensus
**Returns:** `0` on success, negative error code on failure
#### `dap_chain_cs_none_init()`
**Module:** [[Modules/Module Consensus - CS None#`dap_chain_cs_none_init()`|Module Consensus - CS None]]
**Signature:** `int dap_chain_cs_none_init()`
**Purpose:** Initialize no-consensus mode for testing and development
**Returns:** `0` on success, negative error code on failure
### Cryptographic Functions
#### `dap_enc_key_new()`
**Module:** [[Modules/Module DAP Crypto#`dap_enc_key_new()`|Module DAP Crypto]]
**Signature:** `dap_enc_key_t* dap_enc_key_new(dap_enc_key_type_t type)`
**Purpose:** Create new cryptographic key of specified type
**Returns:** Key pointer, NULL on error
#### `dap_enc_key_new_generate()`
**Module:** [[Modules/Module DAP Crypto#`dap_enc_key_new_generate()`|Module DAP Crypto]]
**Signature:** `dap_enc_key_t* dap_enc_key_new_generate(dap_enc_key_type_t type, const void *seed, size_t seed_size)`
**Purpose:** Generate new cryptographic key with optional seed material
**Returns:** Generated key pointer, NULL on error
## D
### Datum Functions
#### `dap_chain_datum_calc_hash()`
**Module:** [[Modules/Module Common#`dap_chain_datum_calc_hash()`|Module Common]]
**Signature:** `void dap_chain_datum_calc_hash(dap_chain_datum_t *datum, dap_hash_fast_t *hash)`
**Purpose:** Calculate cryptographic hash of datum for integrity verification
**Returns:** Hash stored in provided parameter
#### `dap_chain_datum_size()`
**Module:** [[Modules/Module Common#`dap_chain_datum_size()`|Module Common]]
**Signature:** `size_t dap_chain_datum_size(const dap_chain_datum_t *datum)`
**Purpose:** Calculate total size of datum including header and payload
**Returns:** Size in bytes
### DHT Functions
#### `dap_dht_init()`
**Module:** [[Modules/Module DHT#`dap_dht_init()`|Module DHT]]
**Signature:** `int dap_dht_init()`
**Purpose:** Initialize Distributed Hash Table subsystem for peer discovery
**Returns:** `0` on success, negative error code on failure
#### `dap_dht_node_add()`
**Module:** [[Modules/Module DHT#`dap_dht_node_add()`|Module DHT]]
**Signature:** `int dap_dht_node_add(dap_dht_t *dht, const dap_chain_node_addr_t *node_addr)`
**Purpose:** Add node to DHT routing table for network discovery
**Returns:** `0` on success, negative error code on failure
## E
### Exchange Service Functions
#### `dap_srv_xchange_add_liquidity()`
**Module:** [[Modules/Module Service - Exchange#`dap_srv_xchange_add_liquidity()`|Module Service - Exchange]]
**Signature:** `int dap_srv_xchange_add_liquidity(dap_srv_xchange_t *xchange, const char *token_a, const char *token_b, uint64_t amount_a, uint64_t amount_b)`
**Purpose:** Add liquidity to automated market maker pool
**Returns:** `0` on success, negative error code on failure
#### `dap_srv_xchange_create()`
**Module:** [[Modules/Module Service - Exchange#`dap_srv_xchange_create()`|Module Service - Exchange]]
**Signature:** `dap_srv_xchange_t* dap_srv_xchange_create(const char *name)`
**Purpose:** Create new decentralized exchange service instance
**Returns:** Exchange service pointer, NULL on error
#### `dap_srv_xchange_init()`
**Module:** [[Modules/Module Service - Exchange#`dap_srv_xchange_init()`|Module Service - Exchange]]
**Signature:** `int dap_srv_xchange_init()`
**Purpose:** Initialize exchange service subsystem and trading engine
**Returns:** `0` on success, negative error code on failure
## M
### Memory Management Functions
#### `DAP_NEW()`
**Module:** [[Modules/Module DAP Core#`DAP_NEW()`|Module DAP Core]]
**Signature:** `#define DAP_NEW(type) ((type*)malloc(sizeof(type)))`
**Purpose:** Allocate memory for single instance of specified type
**Returns:** Pointer to allocated memory, NULL on failure
#### `DAP_NEW_Z()`
**Module:** [[Modules/Module DAP Core#`DAP_NEW_Z()`|Module DAP Core]]
**Signature:** `#define DAP_NEW_Z(type) ((type*)calloc(1, sizeof(type)))`
**Purpose:** Allocate zero-initialized memory for single instance
**Returns:** Pointer to zero-initialized memory, NULL on failure
#### `DAP_NEW_Z_SIZE()`
**Module:** [[Modules/Module DAP Core#`DAP_NEW_Z_SIZE()`|Module DAP Core]]
**Signature:** `#define DAP_NEW_Z_SIZE(type, size) ((type*)calloc(1, size))`
**Purpose:** Allocate zero-initialized memory block of specified size
**Returns:** Pointer to zero-initialized memory, NULL on failure
#### `DAP_DELETE()`
**Module:** [[Modules/Module DAP Core#`DAP_DELETE()`|Module DAP Core]]
**Signature:** `#define DAP_DELETE(ptr) do { free(ptr); ptr = NULL; } while(0)`
**Purpose:** Safely free memory and set pointer to NULL
**Side Effect:** Sets pointer to NULL after freeing
### Mining Functions
#### `dap_chain_mining_create()`
**Module:** [[Modules/Module Mining#`dap_chain_mining_create()`|Module Mining]]
**Signature:** `dap_chain_mining_t* dap_chain_mining_create(dap_chain_t *chain)`
**Purpose:** Create mining instance for specified blockchain
**Returns:** Mining instance pointer, NULL on error
#### `dap_chain_mining_start()`
**Module:** [[Modules/Module Mining#`dap_chain_mining_start()`|Module Mining]]
**Signature:** `int dap_chain_mining_start(dap_chain_mining_t *mining)`
**Purpose:** Start mining operations with configured parameters
**Returns:** `0` on success, negative error code on failure
#### `dap_chain_mining_stop()`
**Module:** [[Modules/Module Mining#`dap_chain_mining_stop()`|Module Mining]]
**Signature:** `int dap_chain_mining_stop(dap_chain_mining_t *mining)`
**Purpose:** Stop mining operations and cleanup resources
**Returns:** `0` on success, negative error code on failure
## N
### Network Functions
#### `dap_chain_net_by_id()`
**Module:** [[Modules/Module Chain Network#`dap_chain_net_by_id()`|Module Chain Network]]
**Signature:** `dap_chain_net_t* dap_chain_net_by_id(uint64_t net_id)`
**Purpose:** Find network instance by unique network identifier
**Returns:** Network pointer, NULL if not found
#### `dap_chain_net_by_name()`
**Module:** [[Modules/Module Chain Network#`dap_chain_net_by_name()`|Module Chain Network]]
**Signature:** `dap_chain_net_t* dap_chain_net_by_name(const char *net_name)`
**Purpose:** Find network instance by human-readable name
**Returns:** Network pointer, NULL if not found
#### `dap_chain_net_load_all()`
**Module:** [[Modules/Module Chain Network#`dap_chain_net_load_all()`|Module Chain Network]]
**Signature:** `int dap_chain_net_load_all()`
**Purpose:** Load all configured networks from configuration files
**Returns:** Number of networks loaded, negative on error
#### `dap_chain_net_start()`
**Module:** [[Modules/Module Chain Network#`dap_chain_net_start()`|Module Chain Network]]
**Signature:** `int dap_chain_net_start(dap_chain_net_t *net)`
**Purpose:** Start network operations and peer communication
**Returns:** `0` on success, negative error code on failure
## S
### Staking Service Functions
#### `dap_srv_stake_create()`
**Module:** [[Modules/Module Service - Staking#`dap_srv_stake_create()`|Module Service - Staking]]
**Signature:** `dap_srv_stake_t* dap_srv_stake_create(const char *name)`
**Purpose:** Create new staking service instance for PoS consensus
**Returns:** Staking service pointer, NULL on error
#### `dap_srv_stake_delegate()`
**Module:** [[Modules/Module Service - Staking#`dap_srv_stake_delegate()`|Module Service - Staking]]
**Signature:** `int dap_srv_stake_delegate(dap_srv_stake_t *stake, const char *validator_addr, uint64_t amount)`
**Purpose:** Delegate tokens to validator for staking rewards
**Returns:** `0` on success, negative error code on failure
#### `dap_srv_stake_init()`
**Module:** [[Modules/Module Service - Staking#`dap_srv_stake_init()`|Module Service - Staking]]
**Signature:** `int dap_srv_stake_init()`
**Purpose:** Initialize staking service subsystem and economics
**Returns:** `0` on success, negative error code on failure
#### `dap_srv_stake_validator_register()`
**Module:** [[Modules/Module Service - Staking#`dap_srv_stake_validator_register()`|Module Service - Staking]]
**Signature:** `int dap_srv_stake_validator_register(dap_srv_stake_t *stake, const char *validator_addr, uint64_t stake_amount)`
**Purpose:** Register validator node for participation in consensus
**Returns:** `0` on success, negative error code on failure
### Signature Functions
#### `dap_sign_create()`
**Module:** [[Modules/Module DAP Crypto#`dap_sign_create()`|Module DAP Crypto]]
**Signature:** `dap_sign_t* dap_sign_create(dap_enc_key_t *key, const void *data, size_t data_size, size_t signature_size)`
**Purpose:** Create digital signature for data using private key
**Returns:** Signature pointer, NULL on error
#### `dap_sign_verify()`
**Module:** [[Modules/Module DAP Crypto#`dap_sign_verify()`|Module DAP Crypto]]
**Signature:** `int dap_sign_verify(dap_sign_t *signature, dap_enc_key_t *key, const void *data, size_t data_size)`
**Purpose:** Verify digital signature against data using public key
**Returns:** `1` if valid, `0` if invalid, negative on error
## V
### VPN Service Functions
#### `dap_srv_vpn_connect()`
**Module:** [[Modules/Module Service - VPN#`dap_srv_vpn_connect()`|Module Service - VPN]]
**Signature:** `int dap_srv_vpn_connect(dap_srv_vpn_t *vpn, const char *node_addr)`
**Purpose:** Connect to VPN node for secure communication
**Returns:** `0` on success, negative error code on failure
#### `dap_srv_vpn_create()`
**Module:** [[Modules/Module Service - VPN#`dap_srv_vpn_create()`|Module Service - VPN]]
**Signature:** `dap_srv_vpn_t* dap_srv_vpn_create(const char *name)`
**Purpose:** Create new VPN service instance for bandwidth monetization
**Returns:** VPN service pointer, NULL on error
#### `dap_srv_vpn_init()`
**Module:** [[Modules/Module Service - VPN#`dap_srv_vpn_init()`|Module Service - VPN]]
**Signature:** `int dap_srv_vpn_init()`
**Purpose:** Initialize VPN service subsystem and network stack
**Returns:** `0` on success, negative error code on failure
### Voting Service Functions
#### `dap_srv_voting_create_proposal()`
**Module:** [[Modules/Module Service - Voting#`dap_srv_voting_create_proposal()`|Module Service - Voting]]
**Signature:** `int dap_srv_voting_create_proposal(dap_srv_voting_t *voting, const char *title, const char *description, uint64_t deposit)`
**Purpose:** Create governance proposal for community voting
**Returns:** Proposal ID on success, negative error code on failure
#### `dap_srv_voting_init()`
**Module:** [[Modules/Module Service - Voting#`dap_srv_voting_init()`|Module Service - Voting]]
**Signature:** `int dap_srv_voting_init()`
**Purpose:** Initialize voting service subsystem for governance
**Returns:** `0` on success, negative error code on failure
## W
### Wallet Functions
#### `dap_chain_wallet_close()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_close()`|Module Wallet]]
**Signature:** `void dap_chain_wallet_close(dap_chain_wallet_t *wallet)`
**Purpose:** Close wallet and clear sensitive data from memory
**Side Effect:** Clears private keys from memory
#### `dap_chain_wallet_create()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_create()`|Module Wallet]]
**Signature:** `dap_chain_wallet_t* dap_chain_wallet_create(const char *wallet_name, const char *password)`
**Purpose:** Create new wallet with password protection
**Returns:** Wallet pointer, NULL on error
#### `dap_chain_wallet_create_with_seed()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_create_with_seed()`|Module Wallet]]
**Signature:** `dap_chain_wallet_t* dap_chain_wallet_create_with_seed(const char *wallet_name, const char *password, const char *seed)`
**Purpose:** Create deterministic wallet from seed phrase
**Returns:** Wallet pointer, NULL on error
#### `dap_chain_wallet_get_addr()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_get_addr()`|Module Wallet]]
**Signature:** `dap_chain_addr_t* dap_chain_wallet_get_addr(dap_chain_wallet_t *wallet, dap_chain_net_t *net)`
**Purpose:** Get wallet address for specified network
**Returns:** Address pointer, NULL on error
#### `dap_chain_wallet_get_balance()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_get_balance()`|Module Wallet]]
**Signature:** `uint64_t dap_chain_wallet_get_balance(dap_chain_wallet_t *wallet, dap_chain_net_t *net, const char *token_ticker)`
**Purpose:** Get wallet balance for specific token on network
**Returns:** Balance in atomic units, 0 if not found
#### `dap_chain_wallet_open()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_open()`|Module Wallet]]
**Signature:** `dap_chain_wallet_t* dap_chain_wallet_open(const char *wallet_name, const char *password)`
**Purpose:** Open existing wallet with password authentication
**Returns:** Wallet pointer, NULL on error
#### `dap_chain_wallet_save()`
**Module:** [[Modules/Module Wallet#`dap_chain_wallet_save()`|Module Wallet]]
**Signature:** `int dap_chain_wallet_save(dap_chain_wallet_t *wallet)`
**Purpose:** Save wallet state to encrypted file storage
**Returns:** `0` on success, negative error code on failure
## X
### Exchange Operations
#### `dap_srv_xchange_swap_tokens()`
**Module:** [[Modules/Module Service - Exchange#`dap_srv_xchange_swap_tokens()`|Module Service - Exchange]]
**Signature:** `int dap_srv_xchange_swap_tokens(dap_srv_xchange_t *xchange, const char *token_from, const char *token_to, uint64_t amount)`
**Purpose:** Execute token swap using automated market maker
**Returns:** `0` on success, negative error code on failure
---
## Data Structures
### Core Blockchain Structures
#### `dap_chain_addr_t`
**Module:** [[Modules/Module Common#dap_chain_addr_t|Module Common]]
**Purpose:** Blockchain address with network ID and checksum
**Fields:** Network ID, address hash, validation checksum
#### `dap_chain_datum_t`
**Module:** [[Modules/Module Common#dap_chain_datum_t|Module Common]]
**Purpose:** Universal data container for blockchain storage
**Fields:** Version, type ID, data size, timestamp, payload data
#### `dap_chain_datum_tx_t`
**Module:** [[Modules/Module Common#dap_chain_datum_tx_t|Module Common]]
**Purpose:** Transaction structure with item-based architecture
**Fields:** Creation timestamp, items size, transaction items array
#### `dap_chain_t`
**Module:** [[Modules/Module Chain#dap_chain_t|Module Chain]]
**Purpose:** Core blockchain instance with consensus and storage
**Fields:** Chain ID, consensus type, block storage, transaction pool
#### `dap_chain_net_t`
**Module:** [[Modules/Module Chain Network#dap_chain_net_t|Module Chain Network]]
**Purpose:** Network configuration and peer management
**Fields:** Network ID, name, node list, protocol configuration
### Cryptographic Structures
#### `dap_enc_key_t`
**Module:** [[Modules/Module DAP Crypto#dap_enc_key_t|Module DAP Crypto]]
**Purpose:** Cryptographic key container with algorithm metadata
**Fields:** Key type, key data, key size, algorithm parameters
#### `dap_hash_fast_t`
**Module:** [[Modules/Module DAP Crypto#dap_hash_fast_t|Module DAP Crypto]]
**Purpose:** Fast hash result for general purpose operations
**Fields:** Hash bytes, algorithm identifier
#### `dap_sign_t`
**Module:** [[Modules/Module DAP Crypto#dap_sign_t|Module DAP Crypto]]
**Purpose:** Digital signature with algorithm information
**Fields:** Signature data, signature size, algorithm type
### Service Structures
#### `dap_srv_stake_t`
**Module:** [[Modules/Module Service - Staking#dap_srv_stake_t|Module Service - Staking]]
**Purpose:** Staking service configuration and state management
**Fields:** Validator list, delegation pool, economic parameters
#### `dap_srv_xchange_t`
**Module:** [[Modules/Module Service - Exchange#dap_srv_xchange_t|Module Service - Exchange]]
**Purpose:** Exchange service with trading engine and liquidity pools
**Fields:** Order book, liquidity pools, fee configuration
---
## Constants and Enums
### Size Constants
```c
#define DAP_CHAIN_ID_SIZE 8 // Chain identifier size
#define DAP_CHAIN_NET_ID_SIZE 8 // Network identifier size
#define DAP_CHAIN_TICKER_SIZE_MAX 10 // Maximum token ticker length
```
### Node Role Types
```c
typedef enum dap_chain_node_role {
NODE_ROLE_ROOT_MASTER = 0, // Root master node
NODE_ROLE_ROOT, // Root node
NODE_ROLE_ARCHIVE, // Archive node
NODE_ROLE_FULL, // Full node
NODE_ROLE_LIGHT // Light node
} dap_chain_node_role_t;
```
### Datum Types
```c
typedef enum dap_chain_datum_type {
DAP_CHAIN_DATUM_TX = 0x0100, // Transaction
DAP_CHAIN_DATUM_TOKEN = 0xf000, // Token declaration
DAP_CHAIN_DATUM_TOKEN_EMISSION = 0xf100, // Token emission
DAP_CHAIN_DATUM_DECREE = 0x0200, // Governance decree
DAP_CHAIN_DATUM_ANCHOR = 0x0a00, // Data anchor
DAP_CHAIN_DATUM_CA = 0x0c00, // Certificate
DAP_CHAIN_DATUM_CUSTOM = 0xffff // Custom type
} dap_chain_datum_type_t;
```
### Key Types
```c
typedef enum dap_enc_key_type {
DAP_ENC_KEY_TYPE_SIG_BLISS = 0x0001, // BLISS signature
DAP_ENC_KEY_TYPE_SIG_TESLA = 0x0002, // TESLA signature
DAP_ENC_KEY_TYPE_SIG_DILITHIUM = 0x0003, // Dilithium signature
DAP_ENC_KEY_TYPE_SIG_FALCON = 0x0004, // Falcon signature
DAP_ENC_KEY_TYPE_SIG_SPHINCS = 0x0005, // SPHINCS+ signature
DAP_ENC_KEY_TYPE_KEM_KYBER512 = 0x0101, // Kyber-512 KEM
DAP_ENC_KEY_TYPE_KEM_KYBER768 = 0x0102, // Kyber-768 KEM
DAP_ENC_KEY_TYPE_KEM_KYBER1024 = 0x0103 // Kyber-1024 KEM
} dap_enc_key_type_t;
```
---
## Error Codes
### General Error Codes
```c
#define DAP_CHAIN_COMMON_ERROR_SUCCESS 0 // Success
#define DAP_CHAIN_COMMON_ERROR_INVALID_PARAM -1 // Invalid parameter
#define DAP_CHAIN_COMMON_ERROR_NO_MEMORY -2 // Insufficient memory
#define DAP_CHAIN_COMMON_ERROR_NOT_FOUND -3 // Item not found
#define DAP_CHAIN_COMMON_ERROR_ALREADY_EXISTS -4 // Item already exists
#define DAP_CHAIN_COMMON_ERROR_PERMISSION -5 // Permission denied
#define DAP_CHAIN_COMMON_ERROR_TIMEOUT -6 // Operation timeout
```
### Wallet Error Codes
```c
#define DAP_CHAIN_WALLET_ERROR_SUCCESS 0 // Success
#define DAP_CHAIN_WALLET_ERROR_INVALID_PARAM -1 // Invalid parameter
#define DAP_CHAIN_WALLET_ERROR_WALLET_NOT_FOUND -2 // Wallet not found
#define DAP_CHAIN_WALLET_ERROR_WRONG_PASSWORD -3 // Incorrect password
#define DAP_CHAIN_WALLET_ERROR_FILE_READ -4 // File read error
#define DAP_CHAIN_WALLET_ERROR_FILE_WRITE -5 // File write error
```
### Network Error Codes
```c
#define DAP_CHAIN_NET_ERROR_SUCCESS 0 // Success
#define DAP_CHAIN_NET_ERROR_INVALID_PARAM -1 // Invalid parameter
#define DAP_CHAIN_NET_ERROR_NETWORK_NOT_FOUND -2 // Network not found
#define DAP_CHAIN_NET_ERROR_CONNECTION_FAILED -3 // Connection failed
#define DAP_CHAIN_NET_ERROR_PROTOCOL_ERROR -4 // Protocol error
```
---
## Module Reference
### Core Foundation Modules
- **[[Modules/Module DAP Core|Module DAP Core]]** - System initialization, configuration, and utilities
- **[[Modules/Module DAP Crypto|Module DAP Crypto]]** - Cryptographic primitives and post-quantum algorithms
- **[[Modules/Module Common|Module Common]]** - Blockchain data structures and operations
- **[[Modules/Module Chain Network|Module Chain Network]]** - P2P networking and communication
- **[[Modules/Module Wallet|Module Wallet]]** - Wallet operations and key management
- **[[Modules/Module Chain|Module Chain]]** - Core blockchain operations and coordination
- **[[Modules/Module Mempool|Module Mempool]]** - Transaction pool management
### Consensus Mechanisms
- **[[Modules/Module Consensus - DAG PoA|Module Consensus - DAG PoA]]** - DAG Proof of Authority consensus
- **[[Modules/Module Consensus - ESBOCS|Module Consensus - ESBOCS]]** - Enhanced Scalable Byzantine consensus
- **[[Modules/Module Consensus - CS None|Module Consensus - CS None]]** - No consensus mode for testing
### Infrastructure Modules
- **[[Modules/Module Mining|Module Mining]]** - Mining operations and proof-of-work algorithms
- **[[Modules/Module DHT|Module DHT]]** - Distributed hash table for peer discovery
### Service Modules
- **[[Modules/Module Service - Staking|Module Service - Staking]]** - Staking and proof-of-stake functionality
- **[[Modules/Module Service - Voting|Module Service - Voting]]** - Decentralized governance and voting
- **[[Modules/Module Service - Bridge|Module Service - Bridge]]** - Cross-chain bridges and interoperability
- **[[Modules/Module Service - Exchange|Module Service - Exchange]]** - Decentralized exchange and AMM
- **[[Modules/Module Service - VPN|Module Service - VPN]]** - Decentralized VPN with monetization
### Documentation Resources
- **[[Architecture Overview|Architecture Overview]]** - System architecture and design principles
- **[[Core Components|Core Components]]** - Essential data types and structures
- **[[Services Overview|Services Overview]]** - Service architecture and integration patterns
- **[[Development Guide|Development Guide]]** - Development methodology and best practices
- **[[First Application|First Application]]** - Step-by-step tutorial for beginners
- **[[Building from Source|Building from Source]]** - Complete build and compilation guide
- **[[Installation Guide|Installation Guide]]** - Installation and setup procedures
- **[[Troubleshooting|Troubleshooting]]** - Common issues and problem resolution
---
## Core System Functions
Foundation platform initialization, configuration management, logging infrastructure, and memory allocation utilities for system bootstrap and resource management.
## Blockchain Operations
Chain creation and management, transaction processing, block validation, consensus coordination, and state management for distributed ledger operations.
## Cryptographic Functions
Post-quantum cryptographic algorithms, digital signatures, hash functions, key generation and management for comprehensive security operations.
## Network Functions
P2P communication protocols, peer discovery, message routing, network topology management, and distributed hash table operations.
## Service Functions
High-level blockchain applications including staking, governance, cross-chain bridges, decentralized exchange, VPN services, and mining operations.
## Wallet Functions
Key management, address generation, balance queries, transaction signing, and wallet persistence for user asset management.
## Data Structures
Core types, blockchain data containers, network configuration, cryptographic structures, and service state management objects.
---
**See also:** [[Modules/Module Overview|Module Overview]], [[Architecture Overview|Architecture Overview]], [[Development Guide|Development Guide]], [[Services Overview|Services Overview]]