> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inco.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust crate Overview

> Overview of the Inco Rust Crate for Solana

# 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`:

```toml theme={null}
[dependencies]
inco-lightning = { version = "0.1.4", features = ["cpi"] }
```

## Setup

### 1. Add the program to your Anchor.toml

```toml theme={null}
[programs.devnet]
inco_lightning = "5sjEbPiqgZrYwR31ahR6Uk9wf5awoX61YGg7jExQSwaj"
```

### 2. Import the crate in your program

```rust theme={null}
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

```rust theme={null}
#[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

| Concept             | Description                                                       |
| ------------------- | ----------------------------------------------------------------- |
| **Handles**         | 128-bit references to encrypted values stored off-chain           |
| **Encrypted Types** | `Euint128` for encrypted integers, `Ebool` for encrypted booleans |
| **CPI Operations**  | Cross-program invocations for encrypted arithmetic and logic      |
| **Access Control**  | Permission system for decryption rights                           |

## Next Steps

<CardGroup cols={2}>
  <Card title="Library Reference" icon="code" href="/svm/rust-sdk/lib-reference">
    Complete API reference
  </Card>

  <Card title="Concepts Guide" icon="book" href="/svm/guide/intro">
    Deep dive into core concepts
  </Card>

  <Card title="Tutorial" icon="graduation-cap" href="/svm/tutorials/confidential-spl-token/overview">
    Build a confidential token
  </Card>
</CardGroup>
