How zondax/ledger-kadena works
Project type and purpose
• This is a firmware application (“app”) for Ledger hardware wallets (Nano S+, Nano X, Flex, Stax) that implements Kadena-blockchain transaction handling via the APDU protocol.
• It includes:
• C/C++ source under app/src implementing APDU handlers, JSON parsing, transaction logic, and UI flows
• Submodules in deps/ for cryptographic libs (BLAKE2), Ledger SDK (ledger-secure-sdk), and helper libs (ledger-zxlib)
• Build scripts (CMakeLists.txt, Makefile) to cross-compile firmware binaries
• Unit tests (C++), fuzz tests (C++/Python), and integration tests using the Zemu emulator with JS/TS
File structure
Top-level folders:
• app/
• app/src/: core modules—APDU handlers (apdu_handler.c), legacy handlers, buffering JSON, crypto, parser, transaction logic, item definitions, UI scripts (script_*.ld)
• app/glyphs, app/output, app/pkg: assets and build outputs
• cmake/: custom CMake helper scripts (Hunter package manager)
• deps/: vendored dependencies (crypto, SDK, libs)
• docs/: APDU Specification (APDUSPEC.md) and branding assets
• tests/: native C++ unit tests and test utilities
• fuzz/: fuzzing entry points and harness scripts (C++ and Python)
• tests_zemu/: JS/TS emulator tests, snapshots, and test cases powered by the Zemu framework
• CI workflows in .github/workflows/
README for additional insights
• Describes developer prerequisites (Docker, conan via make deps, Node.js for Zemu)
• Standard workflows: make to build firmware, make cpp_test and make rust_test for unit tests, make zemu_test for emulator tests, make test_all for full cross-device build & test
• APDU spec lives in docs/APDUSPEC.md
• Emphasis on not running in production on real funds
• Green for firmware modules
• Blue for external dependencies
• Orange for test harnesses
• Gray for build/CI infrastructure