Search projects, hackathons, sponsors and tech

    ← All projects

    n0tte

    enabling private on-chain FHE-ML inference on one-layer MLP models.

    About

    The problem it solves The current machine learning (ML) landscape is controlled by a few major players who keep their high-quality trained models proprietary to maintain their dominance in the industry. This creates a significant obstacle for individuals, such as researchers, students, and small institutions, who want to leverage these high-quality models to analyze their own data. [n0tte](https://github.com/ocskiurity/n0tte) addresses this issue by facilitating ML inference through Fully Homomorphic Encryption (FHE) within Ethereum Smart Contracts. This approach allows model owners to set the encrypted weights and biases of a pre-trained general-purpose 1-layer MLP model on a smart contract. Using the provided [initiator](https://github.com/ocskiurity/initiator) set of Python scripts, model owners can train and quantize ML models and data off-chain. Consequently, any user can perform inference on their encrypted data directly on-chain, ensuring the privacy and security of user data.

    How it's made

    Challenges we ran into We encountered several challenges due to the novelty of the library & strictness of the EVM. We are limited to shallow 1L MLP models on-chain. For example, we can use the model to perform regression and/or classification on a limited set of features with a drop in performances, due to the post-training quantization process. We could have represented MLP with multiple layers (or even deeper) but it would have been computationally burdensome. Transaction space is limited resulting in a multi-txs fashion for setting the quantized & FHE encrypted weights, biases and data on the smart contract. FHE is still cutting-edge research, experimental and slow compared to the state-of-the-art solutions. Thus, doing this on-chain, adds another layer of complexity (for now) due to limited nodes / validators computational resources & constraints of the EVM architecture. The FHENIX [FHE.sol](https://github.com/FhenixProtocol/fhenix-contracts/blob/main/contracts/FHE.sol) represents unsigned integers from 8 to 32 bits (exclusively) - making impossible to represent negatives numbers significatively on-chain (we don't have space for fixed/float point math) - resulting in a huge problem since you cannot represent the entire range of fully-precision weights. We found out that calling 'FHE.mul()' and / or 'FHE.add()' breaks the smart contract state. Therefore, we opt in favor of the binary operators '*' and '+' (working on encrypted data).