Lux Docs
Fhe

FHE SDK

JavaScript SDK for client-side encryption

Installation

npm install @luxfi/fhe-sdk

Encrypt Data

import { createInstance } from '@luxfi/fhe-sdk';

const fhe = await createInstance({ networkUrl: 'https://api.lux.network/mainnet' });

// Encrypt a value
const encrypted = fhe.encrypt32(42);

// Submit to contract
const tx = await contract.processEncrypted(encrypted);

Decrypt Results

const result = await fhe.decrypt(contract.address, ciphertext);

On this page