# Cellframe SDK Documentation Comprehensive documentation for the Cellframe SDK - a powerful blockchain development framework with post-quantum cryptography support and complete service ecosystem. ## Quick Navigation ### 📚 **Documentation Sections** - **[[#Foundation Layer|Foundation Layer]]** - DAP SDK foundation and core infrastructure - **[[#Module Documentation|Module Documentation]]** - All 23 SDK modules with detailed documentation - **[[#Getting Started|Getting Started]]** - Installation, setup, and first application tutorial - **[[#Architecture & Design|Architecture & Design]]** - System architecture and core concepts - **[[#Development Resources|Development Resources]]** - Development guides, best practices, and advanced topics - **[[#Support & Resources|Support & Resources]]** - Troubleshooting, reference, and community resources --- ## Foundation Layer ### **[[../5. DAP SDK Documentation/DAP SDK Reference|DAP SDK Documentation]]** - Foundation platform underlying Cellframe SDK Complete documentation for DAP SDK (Decentralized Application Platform Software Development Kit), the foundational layer that provides low-level libraries, core infrastructure, and essential services for Cellframe SDK. **Key DAP SDK Modules:** - **[[../5. DAP SDK Documentation/Modules/Module DAP Core|DAP Core]]** - System initialization, memory management, logging, configuration - **[[../5. DAP SDK Documentation/Modules/Module DAP Crypto|DAP Crypto]]** - Cryptographic operations, post-quantum algorithms, digital signatures - **[[../5. DAP SDK Documentation/Modules/Module DAP IO|DAP I/O]]** - Asynchronous I/O, event processing, worker threads - **[[../5. DAP SDK Documentation/Modules/Module DAP Net|DAP Network]]** - Network protocols, socket management, communication layer - **[[../5. DAP SDK Documentation/Modules/Module DAP Global DB|DAP Global DB]]** - Database operations, storage management - **[[../5. DAP SDK Documentation/ETC/Glossary|DAP SDK Function Reference]]** - Complete alphabetical index of DAP SDK functions **Architecture Relationship:** ``` ┌─────────────────────────────────────────────────────────┐ │ CELLFRAME SDK │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Services │ │ Blockchain │ │ Consensus │ │ │ │ Layer │ │ Layer │ │ Layer │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ ├─────────────────────────────────────────────────────────┤ │ DAP SDK │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ DAP Core │ │ DAP Crypto │ │ DAP I/O │ │ │ │ Foundation │ │ Security │ │ Network │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ └─────────────────────────────────────────────────────────┘ ``` --- ## Module Documentation ### **[[Modules/Module Overview|Module Overview]]** - Complete modules reference and navigation hub Navigate all 23 Cellframe SDK modules organized by functional categories with architecture overview and cross-references. ### **Core Infrastructure Modules** - **[[Modules/Module Common|Module Common]]** - Foundation data structures, serialization, shared utilities - **[[Modules/Module Chain|Module Chain]]** - Core blockchain infrastructure, transaction processing - **[[Modules/Module Chain Network|Module Chain Network]]** - P2P network management, topology - **[[Modules/Module Channel|Module Channel]]** - Communication protocols, packet structures ### **Consensus Mechanisms** - **[[Modules/Module Consensus|Module Consensus]]** - Consensus mechanisms overview and management - **[[Modules/Module Consensus - DAG PoA|Module Consensus - DAG PoA]]** - Directed Acyclic Graph Proof of Authority - **[[Modules/Module Consensus - ESBOCS|Module Consensus - ESBOCS]]** - Enhanced Scalable Byzantine Consensus - **[[Modules/Module Consensus - CS None|Module Consensus - CS None]]** - No-validation development consensus ### **Network & Discovery** - **[[Modules/Module DHT|Module DHT]]** - Distributed Hash Table for peer discovery - **[[Modules/Module Wallet|Module Wallet]]** - Cryptocurrency wallet management ### **Transaction & Memory Management** - **[[Modules/Module Mempool|Module Mempool]]** - Transaction memory pool management - **[[Modules/Module Mining|Module Mining]]** - Mining algorithms and CryptoNote functions ### **Service Architecture & Management** - **[[Modules/Module Service|Module Service]]** - Network services overview - **[[Modules/Module Service - Mining Pool|Module Service - Mining Pool]]** - Mining pool infrastructure ### **Decentralized Services** - **[[Modules/Module Service - Application|Module Service - Application]]** - dApp hosting platform - **[[Modules/Module Service - App Database|Module Service - App Database]]** - Database service for dApps - **[[Modules/Module Service - Bridge|Module Service - Bridge]]** - Cross-chain bridging protocols - **[[Modules/Module Service - Data|Module Service - Data]]** - Distributed data storage - **[[Modules/Module Service - Exchange|Module Service - Exchange]]** - Decentralized exchange functionality - **[[Modules/Module Service - Staking|Module Service - Staking]]** - Token staking and PoS delegation - **[[Modules/Module Service - Voting|Module Service - Voting]]** - Governance polls and voting systems - **[[Modules/Module Service - VPN|Module Service - VPN]]** - Decentralized VPN service --- ## Getting Started ### **[[ETC/Installation Guide|Installation Guide]]** - Complete installation instructions for all platforms Step-by-step installation guide for Ubuntu, Debian, CentOS, Arch Linux, macOS, and Windows with package managers, binary downloads, and dependency management. ### **[[ETC/Building from Source|Building from Source]]** - Build the SDK from source code Comprehensive build automation with cross-platform scripts, dependencies, compilation options, CMake configuration, and advanced build procedures. ### **[[ETC/First Application|First Application]]** - Step-by-step comprehensive tutorial Complete tutorial covering project setup, basic operations, transaction creation, wallet management, service integration, and deployment with working code examples. --- ## Architecture & Design ### **[[ETC/Architecture Overview|Architecture Overview]]** - High-level system architecture Detailed system architecture with layer diagrams, module dependencies, design patterns, integration guidelines, and component interaction models. ### **[[ETC/Core Components|Core Components]]** - Essential system components Documentation of fundamental data types, structures, algorithms, and components that form the foundation of all Cellframe SDK applications. --- ## Development Resources ### **[[ETC/Services Overview|Services Overview]]** - Service architecture and management Complete guide to Cellframe SDK service ecosystem including staking, voting, bridges, exchanges, VPN, mining, and DHT with configuration and integration patterns. ### **[[ETC/Development Guide|Development Guide]]** - Development methodology and best practices Comprehensive development guide covering coding standards, design patterns, error handling, memory management, testing strategies, performance optimization, and debugging techniques. --- ## Support & Resources ### **[[ETC/Glossary|Glossary]]** - Alphabetical function reference and API index Complete alphabetical index of all documented SDK functions with verified links to module documentation for quick reference during development. ### **[[ETC/Troubleshooting|Troubleshooting]]** - Comprehensive problem resolution Extensive troubleshooting guide covering installation issues, build problems, runtime errors, network connectivity, service configuration, and platform-specific solutions with step-by-step diagnostic procedures. ### **[[Other Languages/README|Other Languages]]** - Documentation in multiple languages Access to documentation translations in multiple languages including Russian, Chinese, Spanish, French, German, Japanese, and more with complete module coverage. --- ## About Cellframe SDK Cellframe SDK is a comprehensive blockchain development framework that provides: - **🔐 Post-quantum cryptography** - Future-proof security with quantum-resistant algorithms - **🧩 Modular architecture** - Flexible, plugin-based design for easy customization - **⚖️ Multiple consensus mechanisms** - DAG-PoA, ESBOCS, and development modes - **🌐 Cross-platform support** - Linux, macOS, and Windows compatibility - **🔗 Complete service ecosystem** - Built-in services for staking, voting, bridges, exchanges, and VPN - **👨‍💻 Developer-friendly APIs** - Well-documented interfaces for immediate productivity ### Key Features **Advanced Cryptographic Security:** - Post-quantum signatures: Dilithium, Falcon, SPHINCS+, Picnic - Post-quantum key exchange: Kyber, NewHope, Frodo, NTRU - Classical cryptography: ECDSA, AES, various hash functions - Multi-signature support with chained and threshold signatures **Comprehensive Blockchain Infrastructure:** - Flexible transaction system with multiple input/output types - Native token creation and management with decimal precision - Smart contract support (WebAssembly and EVM compatibility) - On-chain governance with voting and parameter updates - Mining support with multiple proof-of-work algorithms - DHT network for efficient peer discovery and data routing **Production-Ready Service Layer:** - **Staking services** for proof-of-stake consensus and delegation rewards - **Governance system** through decentralized voting and proposal management - **DEX functionality** with automated market makers and token swapping - **Cross-chain bridges** for asset transfers and blockchain interoperability - **VPN services** for secure, monetized networking with bandwidth trading - **Mining pools** for collaborative mining with reward distribution - **Data storage** for decentralized file storage and data management - **dApp hosting** for application deployment and execution ### Quick Start ```bash # Clone the repository git clone --recursive https://gitlab.demlabs.net/cellframe/cellframe-sdk.git cd cellframe-sdk # Build and install (see Building from Source for details) mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j$(nproc) sudo make install ``` ### Basic Usage Example ```c #include "dap_common.h" // DAP SDK Core #include "dap_enc_key.h" // DAP SDK Crypto #include "dap_chain.h" // Cellframe Chain Module #include "dap_chain_wallet.h" // Cellframe Wallet Module int main() { log_it(L_INFO, "=== Starting Cellframe SDK Application ==="); // Initialize DAP SDK foundation if (dap_common_init("MyApp", "/var/log/myapp.log") != 0) { log_it(L_ERROR, "Failed to initialize DAP Core"); return -1; } log_it(L_DEBUG, "✓ DAP Core initialized"); // Initialize cryptographic subsystem if (dap_enc_key_init() != 0) { log_it(L_ERROR, "Failed to initialize cryptography"); dap_common_deinit(); return -1; } log_it(L_DEBUG, "✓ Cryptography initialized"); // Create a post-quantum signature key dap_enc_key_t *key = dap_enc_key_new(DAP_ENC_KEY_TYPE_SIG_DILITHIUM); if (!key) { log_it(L_ERROR, "Failed to create signature key"); goto cleanup; } log_it(L_INFO, "✓ Post-quantum signature key created"); // Initialize wallet system if (dap_chain_wallet_init() != 0) { log_it(L_ERROR, "Failed to initialize wallet system"); goto cleanup_key; } log_it(L_INFO, "✓ Wallet system initialized"); // Your Cellframe application logic here log_it(L_INFO, "Application ready for blockchain operations"); // Cleanup resources (reverse order) dap_chain_wallet_deinit(); log_it(L_DEBUG, "✓ Wallet system cleaned up"); cleanup_key: if (key) { dap_enc_key_delete(key); log_it(L_DEBUG, "✓ Signature key deleted"); } cleanup: dap_enc_key_deinit(); dap_common_deinit(); log_it(L_INFO, "✓ Application shutdown complete"); return 0; } ``` *Function references: See **[[ETC/Glossary|Glossary - Function Reference]]** and **[[../5. DAP SDK Documentation/ETC/Glossary|DAP SDK Function Reference]]** for detailed documentation of all functions used above.* ### Platform Support **Fully Supported Platforms:** - **Linux** - Ubuntu 18.04+, Debian 10+, CentOS 7+, Arch Linux, Fedora 30+ - **macOS** - macOS 10.14+ (Complete support including all VPN services) - **Windows** - Windows 10+ with Visual Studio 2019+ (VPN service limitations) **Service Availability by Platform:** - **All Services Available:** Linux, macOS - **Limited VPN Support:** Windows (basic functionality only) - **Cross-Platform Services:** Staking, Voting, Bridge, Exchange, Data, Mining Pool ### Development Workflow 1. **Setup:** Follow **[[ETC/Installation Guide|Installation Guide]]** or **[[ETC/Building from Source|Building from Source]]** 2. **Learn:** Start with **[[ETC/First Application|First Application]]** tutorial 3. **Architecture:** Understand system design with **[[ETC/Architecture Overview|Architecture Overview]]** 4. **Development:** Apply best practices from **[[ETC/Development Guide|Development Guide]]** 5. **Integration:** Implement services using **[[ETC/Services Overview|Services Overview]]** 6. **Reference:** Use **[[ETC/Glossary|Glossary]]** for quick function lookup 7. **Support:** Resolve issues with **[[ETC/Troubleshooting|Troubleshooting]]** ### Community and Support - **📖 Documentation:** This comprehensive documentation wiki - **💬 Forum:** [Cellframe Community Forum](https://forum.cellframe.net) - **🔧 GitLab:** [Source code and issue tracking](https://gitlab.demlabs.net/cellframe/cellframe-sdk) - **🌐 Website:** [Official Cellframe website](https://cellframe.net) - **📧 Support:** Technical support through community channels ---