Skip to main content

Overview

@0xio/pvac (v1.0.2) provides standalone FHE (Fully Homomorphic Encryption) primitives for DApps that need to work with encrypted balances on Octra Network. It runs entirely client-side via WASM: no wallet extension dependency for cryptographic operations. The primitives are built on the Ristretto255 group (curve25519-dalek): exponential-ElGamal ciphers, Bulletproofs-style range proofs, and Pedersen commitments.
PVAC’s confidentiality rests on the discrete-log hardness assumption (Ristretto255). It is not lattice-based and is not post-quantum / quantum-safe.
Use @0xio/pvac for FHE crypto, and @0xio/sdk for wallet signing. They work together:

Installation

Quick Start

API Reference

Encryption

Cipher Arithmetic

Proofs

Private DEX Example

Subtracting a Public Amount

To subtract a known amount from an encrypted balance (e.g., after a swap):
This is mathematically identical to fhe_sub_const. Both produce enc(balance - amount).

Platform Support

Approval Popup

When your DApp calls wallet.callContract(), the 0xio extension shows an approval popup:
  • Amount = native value sent to the contract. amount is raw micro-OCT (1 OCT = 1000000) and is passed to the wallet as is; amountOct takes OCT and is converted by the SDK. Set amount: 0 if none.
  • Fee = OU (operational units / gas). Shown separately below the amount.
If you see a non-zero amount and expect 0, check your amount parameter.