Skip to main content
Privora provides client SDKs for both Rust and TypeScript, enabling you to build applications that interact with FHE-enabled Solana programs.

SDK Comparison

FeatureRust SDKTypeScript SDK
Packageprivora-sdk-client@privora/sdk
EnvironmentNative, CLI, BackendBrowser, Node.js
AsyncTokio async/awaitPromise-based

Quick Start

[dependencies]
privora-sdk-client = { git = "https://github.com/privora-xyz/privora" }
tokio = { version = "1", features = ["full"] }
use privora_sdk_client::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    let privora = PrivoraClient::new("http://localhost:8899").await?;
    let encrypted = privora.encryptor().encrypt(100u8)?;
    let hash = privora.submit(&encrypted).await?;
    println!("Submitted: {:?}", hash);
    Ok(())
}

Core Functionality

1. FHE Encryption

Encrypt values with the network’s FHE public key:
let price: ClientEncrypted<u8> = encryptor.encrypt(100u8)?;

2. Data Submission

Submit encrypted data to the sequencer:
let hash = privora.submit(&encrypted).await?;

3. User Recovery

Add user-recoverable encryption:
let with_recovery = user_crypto.add_recovery(encrypted, &plaintext_bytes)?;

4. Transaction Building

Build and send transactions with FHE data:
let signature = privora
    .transaction()
    .instruction(my_instruction)
    .with_fhe_data(&[hash])
    .sign(&keypair)
    .send()
    .await?;

Next Steps