Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

FHE Types

Pre-Alpha Disclaimer: This is an early pre-alpha release for exploring the SDK and starting development only. There is no real encryption — all data is completely public and stored as plaintext on-chain. Do not submit any sensitive or real data. Encryption keys and the trust model are not final; do not rely on any encryption guarantees or key material until mainnet. All interfaces, APIs, and data formats are subject to change without notice. The Solana program and all on-chain data will be wiped periodically and everything will be deleted when we transition to Encrypt Alpha 1. This software is provided “as is” without warranty of any kind; use is entirely at your own risk and dWallet Labs assumes no liability for any damages arising from its use.

Scalar Types (16)

TypeByte WidthRust Equivalent
EBool1u8 (0 or 1)
EUint81u8
EUint162u16
EUint324u32
EUint648u64
EUint12816u128
EUint25632[u8; 32]
EAddress32[u8; 32]
EUint51264[u8; 64]
EUint1024128[u8; 128]
… up to EUint655368192[u8; 8192]

Boolean Vectors (16)

EBitVector2 through EBitVector65536 — packed boolean arrays.

Arithmetic Vectors (13)

EVectorU8 through EVectorU32768 — SIMD-style encrypted integer arrays (8,192 bytes each).

Plaintext Types

For inputs that don’t need encryption:

TypeEncrypted Equivalent
PBoolEBool
PUint8EUint8
PUint16EUint16
PUint32EUint32
PUint64EUint64

Plaintext inputs are embedded in the instruction data (not ciphertext accounts).

Type Safety

Each type has a compile-time FHE_TYPE_ID:

  • Operations between incompatible types fail at compile time
  • The on-chain processor verifies fhe_type of each input account matches the graph
  • The CPI extension trait verifies fhe_type at runtime before CPI