Solidity Library ​
The Nox library is the developer-facing Solidity SDK for building confidential smart contracts. It provides type-safe wrappers around encrypted values, handles proof validation, manages access control, and triggers off-chain TEE computation, all through a single import.
Quick Overview ​
import {Nox, euint256, externalEuint256} from "@iexec-nox/nox-protocol-contracts/contracts/sdk/Nox.sol";
contract ConfidentialVault {
mapping(address => euint256) private _balances;
function deposit(externalEuint256 encryptedAmount, bytes calldata proof) external {
euint256 amount = Nox.fromExternal(encryptedAmount, proof);
euint256 balance = _balances[msg.sender];
if (!Nox.isInitialized(balance)) {
balance = Nox.toEuint256(0);
Nox.allowThis(balance);
}
euint256 newBalance = Nox.add(balance, amount);
Nox.allowThis(newBalance);
Nox.allow(newBalance, msg.sender);
_balances[msg.sender] = newBalance;
}
}Confidential Functions ​
The Nox library organizes its functions into three layers, each building on the previous one.

Core Primitives ​
The foundational building blocks for confidential computation. These low-level operations let you perform arithmetic, comparisons, and conditional logic directly on encrypted values.
- Plaintext to Encrypted: convert plaintext values to encrypted handles
- fromExternal: validate user-submitted handles with EIP-712 proofs
- Arithmetic:
add,sub,mul,divwith wrapping semantics - Safe Arithmetic:
safeAdd,safeSub,safeMul,safeDivwith overflow detection - Comparisons:
eq,ne,lt,le,gt,gereturningebool - select: encrypted conditional branching
- Access Control:
allow,allowThis,addViewer,allowPublicDecryptionand more
Advanced Functions ​
Higher-level operations composed from core primitives. These provide ready-to-use logic for common DeFi patterns with built-in safety guarantees (all-or-nothing semantics).
- Token Operations:
transfer,mint,burnfor confidential token contracts
Custom Functions ​
Coming Soon
Developers will be able to define their own confidential functions (e.g. swap, borrow, repay) by composing core primitives and advanced functions into custom on-chain logic executed inside TEEs.
Next Steps ​
- Getting Started: installation and project setup
