Skip to main content

Rust Crate Overview

The Inco Lightning SDK provides encrypted computation primitives for Solana programs built with Anchor. It enables confidential smart contracts where sensitive data remains encrypted throughout computation. Program ID: 5sjEbPiqgZrYwR31ahR6Uk9wf5awoX61YGg7jExQSwaj

Installation

Add to your Cargo.toml:
[dependencies]
inco-lightning = { version = "0.1.4", features = ["cpi"] }

Setup

1. Add the program to your Anchor.toml

[programs.devnet]
inco_lightning = "5sjEbPiqgZrYwR31ahR6Uk9wf5awoX61YGg7jExQSwaj"

2. Import the crate in your program

use anchor_lang::prelude::*;
use inco_lightning::cpi::accounts::Operation;
use inco_lightning::cpi::{e_add, e_sub, e_ge, e_select, new_euint128};
use inco_lightning::types::{Euint128, Ebool};
use inco_lightning::ID as INCO_LIGHTNING_ID;

3. Add Inco Lightning program to your account struct

#[derive(Accounts)]
pub struct MyInstruction<'info> {
    #[account(mut)]
    pub authority: Signer<'info>,

    /// CHECK: Inco Lightning program for encrypted operations
    #[account(address = INCO_LIGHTNING_ID)]
    pub inco_lightning_program: AccountInfo<'info>,
}

Key Concepts

ConceptDescription
Handles128-bit references to encrypted values stored off-chain
Encrypted TypesEuint128 for encrypted integers, Ebool for encrypted booleans
CPI OperationsCross-program invocations for encrypted arithmetic and logic
Access ControlPermission system for decryption rights

Next Steps