# Zero-Knowledge Circuits

Zero Knowledge Circuits of Veilon is the core component responsible for safeguarding user privacy. It's purpose built to ensure that transactions, balances, and wallet relationships remain completely hidden using advanced zero knowledge proofs (ZKPs). This makes your financial activities impossible to trace or analyze.

### <mark style="color:yellow;">Purpose:</mark>

Veilon's cryptographic engine provides privacy by shielding transactions, balances, and wallet relationships. Using zero-knowledge proofs, it ensures no one can trace your financial actions on-chain.

### <mark style="color:yellow;">How It Works:</mark>

When you send assets to Veilon:

* **Shielded Commitments**: Assets are converted into encrypted representations called shielded commitments.
* **Zero-Knowledge Proofs (zk-SNARKs)**: These commitments pass through zk-SNARK circuits, validating transactions without revealing any private information.
* **Anonymous Verification**: Each transaction is verified by the network without exposing details of the sender, receiver, or transaction amount.

### <mark style="color:yellow;">Key Features:</mark>

* **Unlinkability**: Transactions remain separate and cannot be correlated.
* **Growing Anonymity Set**: Privacy strengthens over time as more users participate.
* **Deterministic Nullifiers**: Ensure protection against double-spending without revealing historical transaction data.

### <mark style="color:yellow;">Real World Analogy:</mark>

Imagine sending money in a sealed envelope with a special stamp. The stamp confirms the envelope contains valid funds, but no one can see what's inside, who sent it, or where it originated. Veilon provides a digital version of this secure and private transaction method.

```javascript
import { groth16 } from 'snarkjs';

const { proof, publicSignals } = await groth16.fullProve(
  {
    privateKey: userPrivateKey,
    nullifier: inputNullifier,
    merklePath: pathToLeaf,
    amount: shieldedAmount,
    recipient: recipientHash
  },
  './circuit/transfer.wasm',
  './circuit/transfer_final.zkey'
);

console.log('ZK Proof:', proof);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.veilon.io/platform-architecture/zero-knowledge-circuits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
