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.
@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):fhe_sub_const. Both produce enc(balance - amount).
Platform Support
Approval Popup
When your DApp callswallet.callContract(), the 0xio extension shows an approval popup:
- Amount = native value sent to the contract.
amountis raw micro-OCT (1 OCT = 1000000) and is passed to the wallet as is;amountOcttakes OCT and is converted by the SDK. Setamount: 0if none. - Fee = OU (operational units / gas). Shown separately below the amount.
amount parameter.