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).
Network Proof Rules
Each network states which proof rules it accepts. 0xio wallets read them before any private action and again right before signing.- Where:
octra_pvacMigrationStatusfor the address.proof_mathis"wide"or"prior"and sets the challenge arithmetic.proof_key(true or false) says whether proofs are bound to the registered encryption key. - Fallback: when the answer has no
proof_math, only the devnet runtime the Octra reference client lists (read fromoctra_runtimeVersion) counts, and it means wide arithmetic without key binding. - No rules: a network that states neither gets no private operation from the wallet. The user sees that private actions are paused, and nothing is sent.
- Rules changed: when the rules read right before signing differ from the ones the proofs were built under, nothing is sent and the action is prepared again.
- Key binding: on a
proof_keynetwork every key switch carriesowner_cipherandowner_proof, a proof that the sender owns the key being registered. - Migration: when the network opens its cipher proof route, a balance held under an older key migrates with a
cipher_proofpayload instead of the older migration format.
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.