# ZKP and IoT Device Firmware Integration (zk-Device Design)

## Solution 1: C++ Library <a href="#c-library" id="c-library"></a>

The FidesInnova C++ Library offers a proof generation function specifically designed for IoT firmware developers. This function can be seamlessly integrated into IoT firmware to generate proofs whenever necessary.

<figure><img src="/files/2yrVwtJq03aUHWTTjBDF" alt=""><figcaption></figcaption></figure>

The IoT developer should insert their program file into the FidesInnova Commitment Generator. This tool creates a new file to be compiled and uploaded to the IoT devices and a Commitment to be uploaded to the blockchain.

#### Hardware implementation of C++ library using ESP32-C6:

* Microcontroller: ESP32-C6
* Processor Architecture: RV32IMAC
* Program storage space: 400KB
* Dynamic memory: 20KB
* Clock Speed: 160MHz

#### Average result time:

* Commitment generation time in C++: 0.5\~1 sec
* ZKP generation time in C++: 0.5\~1.5 sec
* Verification time in C++: 0.5\~1 sec

#### To integrate with new hardware, we need the following information:

* Microcontroller
* Processor Architecture
* Clock Speed (MHz)
* RAM (SRAM) Size
* Flash Memory
* Hardware Cryptographic Support
* Random Number Generation (RNG)
* Hardware Cryptographic Support
* Cryptography Libraries

#### GitHub

<https://github.com/FidesInnova/zk_iot_c>

To access the GitHub, please email <info@fidesinnova.io>

## Solution 2: Rust Crates

Similar to the C++ library, FidesInnova's Rust Crates offer a proof generation function for Rust programs. This functionality allows developers to seamlessly integrate proof generation into their Rust applications, ensuring robust and secure performance.

#### GitHub

<https://github.com/FidesInnova/zk_iot_rust>

To access the GitHub, please email <info@fidesinnova.io>

## Solution 3: FidesInnova ZKP Mini Board

<figure><img src="/files/P8GFTVtsqUpgUD15SWKH" alt=""><figcaption></figcaption></figure>

Using a JTAG connection, the ZKP Mini Board connects to the IoT board and extracts the register values of the device's processor during firmware execution. This process enables real-time monitoring and verification of firmware behavior.

<figure><img src="/files/Jpo55OgvYckgHfPpHvt4" alt=""><figcaption></figcaption></figure>

The extracted register values are used to generate zero-knowledge proofs (ZKPs), providing verifiable evidence of the firmware's integrity without disclosing sensitive information. These ZKPs are then made available for the IoT device to use.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fidesinnova.gitbook.io/docs/zkp-and-iot-device-firmware-integration-zk-device-design.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
