cryptnox-sdk-arduino 1.0.0
Arduino library for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
examples Directory Reference

Directories

 
BasicUsage
 
Connect
 
Sign
 
UsdcSigning
 
VerifyPin

Detailed Description

cryptnox-sdk-arduino

Arduino library for managing Cryptnox Hardware Wallet

Examples

Standalone Arduino sketches that exercise the Cryptnox Hardware Wallet over NFC (PN532). Each sketch ships with its own focused README so a reader landing on a single example gets everything needed end-to-end.

Prerequisites

Component Details
Hardware Wallet Cryptnox Hardware Wallet (firmware ≥ v1.6.0), initialised with a PIN — and a seed loaded for the signing examples
NFC reader PN532 NFC module wired over SPI (default) or I²C — see hardware setup
Board Arduino UNO R4 Minima or Arduino UNO R4 WiFi (the WiFi variant is required for UsdcSigning)
IDE Arduino IDE 2.x with the Arduino UNO R4 Boards core installed
SDK Installed via setup.bat from the repository root — see installation

Provision a card from a host with a PC/SC reader and the Cryptnox CLI:

cryptnox init # sets the PIN + PUK
cryptnox seed generate # generates a BIP39 seed (required for signing)

Available examples

Example What it does
Connect Opens the secure channel and reads back the card owner's name & email. Safest first sketch — no PIN, no signing, can't lock the card.
VerifyPin Opens the secure channel and submits a PIN. Halts on a wrong PIN to protect the on-card retry counter.
Sign Signs a 32-byte hash with the card's secp256k1 key. Returns the raw r ‖ s signature ready to broadcast.
BasicUsage End-to-end walkthrough in one sketch: pick SPI or I²C, open the channel, sign a hash. Good reference for production wiring.
UsdcSigning Real-world flow on UNO R4 WiFi: build an EIP-1559 USDC transfer, sign it on the card, broadcast it on Sepolia.

How to run an example

  1. Install the library by running setup.bat from the repository root (Windows). The script clones every pinned third-party dependency, applies the required patches, and runs the memory-optimisation pass — without it the sketches may fail to compile or overflow flash. See installation.
  2. Restart the Arduino IDE.
  3. Open the sketch via File → Examples → CryptnoxWallet → <example>.
  4. Select the board: Tools → Board → Arduino UNO R4 Minima (or WiFi — required for UsdcSigning).
  5. Select the serial port: Tools → Port → ...
  6. (UsdcSigning only) copy config.template.h to config.h and fill in your Wi-Fi credentials, RPC endpoint, PIN, addresses and amount. config.h is gitignored — do not commit it.
  7. Compile and upload, then open the Serial Monitor at 115200 baud. Place the card on the PN532 antenna when prompted.
Note
All examples default to PIN 000000000 (nine zeros). If your card was initialised with a different PIN, edit the DEMO_PIN / DEFAULT_PIN / CARD_PIN macro at the top of the sketch before uploading.

Adding a new example

Follow the conventions used by the existing sketches:

  • Place each sketch in its own subdirectory under examples/, named in PascalCase (the Arduino IDE requires the .ino file to share the directory name).
  • Start every source file with the SPDX + copyright header used by the rest of the repository.
  • Add Doxygen tags (@file, @example, @brief) to the .ino so the sketch surfaces correctly on the generated docs site.
  • If the sketch needs external secrets (Wi-Fi credentials, API keys, recipient addresses), ship a config.template.h next to it and add the runtime config.h to .gitignore. Never commit credentials.
  • Ship a README.md next to the sketch and register it in the Available examples table above.

License

cryptnox-sdk-arduino is dual-licensed:

  • LGPL-3.0 for open-source projects and proprietary projects that comply with LGPL requirements
  • Commercial license for projects that require a proprietary license without LGPL obligations (see COMMERCIAL.md for details)

For commercial inquiries, contact: conta.nosp@m.ct@c.nosp@m.ryptn.nosp@m.ox.c.nosp@m.om