u8,u16,u32,u64,u128,usize,i8,i16,i32,i64,i128,isizef64,f32(emulated as fixed-point with 52 fractional bits; supported range is[-2^75, 2^75). Values outside this range are unsupported.)- tuples of supported types, including
() - fixed-length arrays of a supported type
- slices with compile-time known length (e.g.,
&arr[..]from fixed arrays, or&[u8]parameters in stdlib APIs like SHA3) - compile-time known ranges
- (mutable) references to a supported type
- user-defined structs of supported types
- functions (but not as input or output of an encrypted instruction)
ArcisX25519Pubkey, an Arcis public key wrapper.- Arcis-defined
Enc,MxeandShared. Pack<T>, a wrapper for bit-packing data into fewer field elements for onchain storage.EncData<T>, encrypted data without embedded cipher info. Use with.to_arcis_with_pubkey_and_nonce()when multiple values share the same key.BaseField, a Curve25519 field element (F_, stored in 256 bits) used as the native type for circuit computations.
Encryption Types
| Type | Description |
|---|---|
Enc<Shared, T> | Data encrypted for client + MXE |
Enc<Mxe, T> | Data encrypted for MXE only |
EncData<T> | Raw encrypted data (advanced use—see below) |
Shared | Owner type for client-shared encryption |
Mxe | Owner type for MXE-only encryption |
Owner type parameter determines who can decrypt:
Shared: Both client and MXE can decrypt. Use for user inputs/outputs that need client-side verification.Mxe: Only the MXE cluster can decrypt. Use for internal protocol state that users should not access.
Public Key Types
| Type | Description |
|---|---|
ArcisX25519Pubkey | Arcis X25519 public key wrapper |
SolanaPublicKey | Solana public key (32 bytes) |
SerializedSolanaPublicKey | Serialized form using {lo: u128, hi: u128} |
Example
Advanced: EncData<T>
EncData<T> stores just the encrypted ciphertext without encryption metadata (pubkey + nonce).
| Type | Contains | Size |
|---|---|---|
Enc<Shared, bool> | pubkey (32B) + nonce (16B) + ciphertext (32B) | ~80 bytes |
EncData<bool> | ciphertext only | ~32 bytes |
EncData<T> omits pubkey and nonce metadata—useful for multiple outputs where callback payload size matters.
Primary Use: Smaller Callback Payloads
UseEncData<T> when returning encrypted data to observers to reduce callback payload size:
EncData output: Multiple return values where encryption metadata would be redundant.
When returned from circuits,
EncData<T> generates EncDataStruct<N> in your Solana program, where N is the number of field elements in T (e.g., EncData<bool> → EncDataStruct<1>). See Callback Type Generation.Secondary Use: Shared Key Input Optimization
When multiple inputs share the same encryption key,Enc<Shared, T> duplicates the key-derivation circuit for each input. Use EncData<T> with explicit key/nonce to avoid this:
Unsupported Types
In particular, Arcis does not currently supportHashMap, Vec, String (we do not support types with a variable len). Constant-size byte strings (like b"hello_world") are supported.
The Enc type defines the encrypted data input, which is used as Enc<Owner, T> where Owner can be either Mxe or Shared, signaling which party can decrypt data of type T. You can read more about dealing with encrypted inputs/outputs here.
Storage representation: All values are stored as 256-bit Curve25519 field elements. A
u8 uses the same storage as a u128—integer type bounds are enforced at compile time, not by storage size. Use Pack<T> to compress multiple small values into fewer field elements for onchain efficiency.What’s Next?
Input/Output
Working with
Enc<Owner, T> for encrypted inputs and outputs.Operations
Complete operation support matrix and iterator reference.
Primitives
RNG, crypto, and
Pack<T> for efficient storage.