Inspiration

Payment fraud detection has always bothered us as a problem — not because it’s unsolved, but because the solutions are black boxes. A transaction gets flagged, and nobody can verify why, when, or at what threshold. The verdict exists somewhere in a database that you have to trust.

When we came across this hackathon, the idea clicked immediately. PayPal already moves money at scale. What if every fraud verdict it produced was cryptographically provable and permanently anchored on-chain — without exposing any raw transaction data?

That’s what we set out to build.

What it does

ZeroTrace scores every PayPal transaction at the moment of capture using a RandomForest ML model. If the fraud score crosses 0.75, it generates a Groth16 zero-knowledge proof of that verdict and submits it to an Ethereum blockchain — permanently, verifiably, without revealing the underlying transaction data.

Three problems it solves:

  • Fraud scores are opaque — ZeroTrace proves the verdict cryptographically.
  • Raw data gets shared with detection services — ZeroTrace reveals nothing except the outcome.
  • Fraud verdicts are mutable — ZeroTrace anchors them on-chain, immutably.

The frontend is a real-time monitoring dashboard built with React and AG Grid, showing live transactions, fraud scores, risk factors, AI explanations, and full ZK proof details, including Groth16 proof components and on-chain transaction hash.

How we built it

Five layers that talk to each other in sequence:

PayPal layer — PayPal JS SDK handles payment capture. The frontend sends transaction metadata to the backend at the moment of capture.

ML layer — A RandomForest classifier scores the transaction. Trained on 200,000 domain-aware simulated transactions — not PaySim, not real data, but a custom simulation that encodes actual financial invariants.

ZK layer — If fraud is detected, a Circom 2.0 circuit generates a Groth16 proof that the score crossed 0.75, without revealing the score itself. snarkjs handles witness generation and proving.

Blockchain layer — The proof hash gets submitted to a FraudRegistry smart contract on a Hardhat Ethereum node via web3.py. The on-chain transaction hash and block number come back and get stored.

Frontend layer — React dashboard with AG Grid for the transaction table, Recharts for analytics, and a detail panel that shows the full ZK proof breakdown per transaction.

Challenges we ran into

The ZK circuit was the hardest part. Circom only works with integers, so the fraud score had to be quantized — multiplied by 100 and compared as an integer against a threshold of 75. Getting witness generation, proving, and on-chain verification to work end-to-end took most of the time.

The other challenge was the data. Something felt persistently off when testing the model on PaySim — the edge cases weren’t there. That pushed us to build the simulator from scratch, which ended up being the most interesting part of the whole project.

The trusted setup is single-party — a known prototype limitation. Production would need an MPC ceremony.

Accomplishments that we're proud of

The data methodology. We didn’t use PaySim. We built a domain-aware simulator that encodes the actual financial laws behind fraud — balance invariants that every fraudulent transaction violates. The model learns to detect these violations directly, which is why it achieves a ROC-AUC of 1.0000 on the test set. That’s not overfitting — it’s mathematically guaranteed separability, because the labels come from deterministic rules, not statistical approximations.

The simulation encodes specific fraud patterns:

  • Account drain with declared amount mismatch.
  • Bilateral double transfer — sender drained, receiver gets more than declared.
  • Ghost transactions between zero-balance accounts.
  • Money fabrication — funds transacted from an empty account.

Getting the full ML → ZK → blockchain pipeline working end-to-end as a live system, not just a proof of concept, is something we’re genuinely proud of.

What we learned

That ZK proofs are more accessible than they look, once you understand what a circuit actually is. That synthetic data is only as good as the domain knowledge you encode into it. And that the hardest problems in fintech aren’t technical — they’re about trust, verifiability, and auditability.

What's next for ZeroTrace

  1. Re-engineer the Hardhat layer for persistent deployment on Render — chain state, contracts, and keys survive restarts without manual redeployment.
  2. MPC trusted setup to remove the single-party limitation.
  3. Extend the ZK circuit to prove additional properties — amount range, account age, velocity checks.
  4. Real PayPal production integration beyond sandbox.
  5. Open the FraudRegistry as a shared public ledger that any payment processor can write to and anyone can audit.

Built With

Share this project:

Updates

Submission history