Skip to main content

JavaScript SDK

The Inco JavaScript SDK provides client-side utilities for building privacy-preserving applications on Solana. It handles encryption and decryption workflows.

Installation

Features

Encryption

Encrypt values client-side for Inco operations

Attested Reveal

Decrypt handles for off-chain display

Attested Decrypt

Decrypt with on-chain verification

Quick Start

Supported Value Types

TypeExampleNotes
number42, 100Integers only (no floats)
bigint1000000000nFor large values
booleantrue, falseEncrypted as 0 or 1

Attested Reveal vs Attested Decrypt

Both use the same decrypt() function. The difference is how you use the result:
FeatureAttested RevealAttested Decrypt
PurposeDisplay values in UIVerify values on-chain
What you useresult.plaintextsresult.ed25519Instructions + program IX
On-chain TXNoYes
Use caseShow user their balanceConditional logic based on decrypted values