Secret Vaults

Exploring privacy vaults and automated unit test generation for Solidity smart contracts.

Secret Vaults

Created At

ETHOnline 2025

Project Description

Secret Vaults is a hackathon project focused on exploring privacy-preserving vault designs and automated unit test generation for Solidity smart contracts.

The project combines experimentation with the development of a custom Hardhat 3 plugin for automated Solidity unit test generation, exploration of various vault architectures, and integration with the Pyth Entropy V2 protocol for randomness.

Hardhat TestGen plugin available at: https://www.npmjs.com/package/test-hardhat-testgen

Usage:

pnpm hardhat testgen --run

pnpm hardhat aitestgen --run

Future Improvements:

Extend the TestGen Plugin to:

Support more complex Solidity contracts

Offer additional CLI options (ignore certain contracts, use custom paths/directories)

Integrate more AI models

Generate TypeScript based test files

Get listed on the official Hardhat plugins directory

Secret Vault Design Experiments:

Tested several privacy-focused vault designs:

PKP Privacy Vault – ERC-4626 implementation with Broadcaster & PKP Signatures. Enables pseudo-privacy through delegated transaction submission.

Commitments Vault – Uses Merkle proofs and nullifiers for anonymity (not truly private).

FHE Vault – Encountered limitations due to prolonged testnet relayer downtime.

Conclusion: Achieving full privacy without ZK or FHE integration remains highly challenging.

Secret Vaults Game – A demo game using Pyth Entropy V2.

Live Demo: https://secret-vaults.vercel.app/

About the game: Secret Vaults is a cryptographic guessing game leveraging Pyth Entropy V2 for verifiable randomness. Players create secret vaults with hidden words (known only to the contract), and others attempt to guess them for rewards. If the time expires, the vault creator receives the locked funds, including their initial deposit and any funds collected from incorrect guesses. Generates secrets composed of random adjectives and nouns using Pyth Entropy V2. Demonstrates fair randomness and on-chain verifiability.

Future Improvements:

Improve Secret Vaults game with:

Enhanced UI and gamification (leaderboards, difficulty levels)

Additional security mechanisms (e.g., mempool protection)

Expanded game mechanics and incentive structures

How it's Made

Technologies:

Hardhat 3

Solidity ^0.8.28

OpenZeppelin =5.5.0-rc.1

Pyth Entropy SDK ^2.1.0

Next js 16

TypeScript 5

Deployed on Base Sepolia (can be deployed on any network where Pyth Entropy V2 is available)

Entropy contract: 0x41c9e39574f40ad34c79f1c99b66a45efb830d4c

Game contract: 0x2cDD7E1c2069C8B9b9d62242410CB87F78764705

The plugin was developed based on the official Hardhat 3 plugin template: https://github.com/NomicFoundation/hardhat3-plugin-template

background image mobile

Join the mailing list

Get the latest news and updates

Secret Vaults | ETHGlobal