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
| Type | Example | Notes |
|---|---|---|
number | 42, 100 | Integers only (no floats) |
bigint | 1000000000n | For large values |
boolean | true, false | Encrypted as 0 or 1 |
Attested Reveal vs Attested Decrypt
Both use the samedecrypt() function. The difference is how you use the result:
| Feature | Attested Reveal | Attested Decrypt |
|---|---|---|
| Purpose | Display values in UI | Verify values on-chain |
| What you use | result.plaintexts | result.ed25519Instructions + program IX |
| On-chain TX | No | Yes |
| Use case | Show user their balance | Conditional logic based on decrypted values |