PriStox

Privately buy tokenized assets using ZKPs, without revealing balance and wallet address.

PriStox

Created At

ETHOnline 2025

Project Description

PriStox enables buying tokenized assets privately using ZKPs without revealing user's balance and wallet address. It lets users deposit PYUSD in a PYUSD/TSLA pool contract and buy tokenized tesla stocks using the deposited funds by submitting zkproof of their balance in the pool.

Tools or protocols used are as follows :

  1. Hardhat : Smart contract development, testing and deployment .
  2. PayPal USD(PYUSD) : Stablecoin used for trading and pool liquidity.
  3. Pyth network : Real time stock price following pyth's on-demand model .

The Problem

  • Every wallet on a public blockchain can be tracked. People can see:
    • Which tokens or stocks you buy
    • How much you invest
    • Whom you send money to. This complete lack of financial privacy exposes traders, strategies, and holdings to the world. As tokenized real-world assets (RWAs) become mainstream, the absence of privacy layers becomes a serious issue for investors and institutions alike.

The Solution :

  • PriStox = Privacy + Stocks. It introduces a ZK-powered pool architecture where users can:
  • Deposit PYUSD privately using a commitment note (generated from a nullifier + secret).
  • Buy tokenized Tesla shares (TSLA) pegged to real Tesla stock price via Pyth’s on-demand pull model.
  • Withdraw PYUSD anytime by submitting a zero-knowledge proof, without revealing wallet history or balance. All interactions are ZK-verified, Merkle-tree tracked, and gas-efficient, with a local AI agent (MCP) that executes commands like : “Deposit 100 PYUSD” “Buy 2 Tesla shares” “Withdraw my balance”

Components :

  • Circuit (Noir) : Generates zero-knowledge proofs for deposit, withdrawal, and trade actions.
  • Smart Contract : Verifies proofs, updates Merkle roots, handles PYUSD and TSLA token logic.
  • Server : Maintains off-chain Merkle tree, provides Merkle proofs to clients.
  • Relayer : Submits user proofs and price updates from Pyth Hermes API.
  • Local MCP : Natural language command processor that automates proof generation and transaction flow.

Full workflow : 1 ) Deposit

  • MCP generates nullifier and secret locally.
  • MCP computes preCommitment = Poseidon2(nullifier, secret) and sends a deposit
    transaction to the Pool contract with preCommitment and PYUSD tokens (ERC-20 transfer).
  • The contract hashes preCommitment with the deposit amount (or re-computes leaf - deterministically), updates the merkle root on-chain and emits an event containing the actual commitment leaf.
  • The Merkle Manager off-chain server picks up the event and inserts the leaf into the off-chain - Merkle tree (updates root).
  • User’s funds are now in the pool, represented by a commitment leaf; no on-chain link to the user’s wallet is preserved.

2 ) Buy tokenized Tesla shares (TSLA)

  • User asks MCP to buy shares; MCP fetches live tesla price from Hermes API.
  • MCP requests the Merkle inclusion proof for the user’s commitment from the Merkle Manager server.
  • MCP constructs the public inputs (desired buy amount or shares, price, etc.) and uses the Noir circuit to produce a ZK proof showing: a) Valid inclusion of commitment under a signed root b) Nullifier & secret reveal the user’s control c) Subtracting the buy amount from the commitment’s balance yields a valid new commitment (or zero if fully consumed)
  • Relayer receives proof, priceUpdate data from hermes and submits the transaction.
  • Pool verifies the proof, checks nullifier has not been used, applies the 5% slippage tolerance, and mints tokenized tesla shares (TSLA) to the recipient.
  • Contract records the nullifier as used and emits events for the minted tokens and new commitment.
  1. Withdraw
  • MCP generates a proof showing ownership of a commitment and amount to withdraw.
  • Proof + public inputs are submitted via relayer.
  • Contract verifies proof and nullifier, then transfers PYUSD to the target address.

Impact : PriStox brings privacy and accessibility to the growing world of on-chain real-world assets. It’s not just another DeFi protocol — it’s a foundation for private investing, built with the future of finance in mind. “Because privacy never goes out of stock.”

How it's Made

PriStox is built using Hardhat, Noir, PYUSD, and Pyth Network, combining privacy, real-world assets, and stable liquidity in one protocol. The Noir circuit generates zero-knowledge proofs for deposits, withdrawals, and trades, ensuring that user balances and identities remain hidden. The smart contract, written in Solidity and deployed via Hardhat, verifies these proofs, manages on-chain Merkle roots, and interacts with PYUSD for liquidity and Pyth’s on-demand price model for live Tesla stock prices. An off-chain Merkle server maintains the full Merkle tree and provides inclusion proofs, while a relayer submits user proofs and price updates on-chain, enabling gasless and anonymous interactions. Finally, a local MCP agent lets users perform all actions — deposits, trades, withdrawals — using natural language commands, automatically generating commitments, proofs, and transactions behind the scenes. I used Poseidon2 hashing to maintain ZK consistency between the Noir circuit and Solidity contract. The combination of off-chain Merkle management, on-demand price validation, and AI-driven interaction makes PriStox both technically innovative and user-friendly.

background image mobile

Join the mailing list

Get the latest news and updates