Inspiration

In today's digital age, we blindly trust centralized tech giants with our most sensitive files and data. Data breaches, unauthorized data mining, and server outages are common occurrences. We asked ourselves: What if we could build a file storage system where the user maintains absolute cryptographic ownership of their files, without sacrificing the convenience of modern web applications?

That's how Onion was born—a multi-layered, secure approach to personal data.

What it does

Onion acts as your personal, decentralized Web3 Dropbox.

Connect & Authenticate: Users securely connect to the DApp using their crypto wallet via WalletConnect/Reown. Client-side Encryption: When a user selects a file to upload, Onion encrypts the file locally in the browser using AES encryption. The encryption key is deterministically derived from a secure wallet signature, meaning the platform never sees the raw file or the key. Decentralized Storage: The encrypted blob is pinned and distributed across the InterPlanetary File System (IPFS) using Pinata. Smart Contract Registry: The resulting IPFS CID (Content Identifier) and file metadata are permanently stored on-chain in the FileVault smart contract, linking the file explicitly to the user's wallet address. Seamless Retrieval: Users can view their dashboard of uploaded files, retrieve them from IPFS gateways, decrypt them locally, and download them—all in one seamless UI.

How we built it

Onion is built on a modern, robust Web3 technology stack:

Frontend: Built with Next.js (App Router), TypeScript, and TailwindCSS for a blazing-fast, responsive user interface. Authentication: Integrated Reown (AppKit/WalletConnect) for seamless, multi-wallet connectivity. Smart Contracts: Written in Solidity and developed/tested using the Hardhat environment. We utilize ethers.js on the frontend to interact with the local/testnet RPC nodes. Storage & IPFS: We integrated Pinata's IPFS API to reliably pin our encrypted files to the decentralized web. Cryptography: We leveraged CryptoJS to handle robust AES client-side encryption and decryption.

Challenges we ran into

Cross-Origin Dev Issues: Setting up Next.js WebSocket hot-reloading with a local network IP for mobile wallet testing required diving into Next.js Turbopack configuration settings and tweaking allowedDevOrigins. Wallet Signature Determinism: Deriving a stable, repeatable encryption key purely from a wallet signature without storing it locally or exposing it on-chain was a unique cryptographic hurdle. Smart Contract State Management: We ran into local Hardhat node reset issues where our deployed FileVault contract address would wipe out, leading to BAD_DATA decode errors in the frontend. We built robust deployment scripts to handle swift local testing. IPFS Gateway Reliability: To ensure files were always retrievable, we had to implement a multi-gateway fallback mechanism in our fetching logic in case a specific IPFS gateway timed out.

Accomplishments that we're proud of

Successfully implementing zero-knowledge architecture. Not even the developers of Onion can view the contents of the files uploaded by our users. Creating a buttery-smooth Web2-like user experience while utilizing complex Web3 technologies under the hood. Building a full-stack DApp from scratch—from the Solidity smart contracts up to the Next.js frontend—in a single hackathon timeframe.

What we learned

Deepened our understanding of ethers.js contract interactions and transaction lifecycle management. Mastered decentralized file pinning and retrieval via Pinata and IPFS. Gained valuable experience debugging local EVM networks, Next.js server/client component boundaries, and WalletConnect integration flows.

What's next for Onion

File Sharing: Implementing secure, public-key cryptography to allow users to share specific files with other wallet addresses (using the recipient's public key). Folder Structures: Creating an on-chain/off-chain hybrid tree structure to allow users to organize files into folders. Mainnet Deployment: Auditing the FileVault smart contract and deploying it to a Layer 2 network (like Base or Arbitrum) for low-cost, fast transactions. Tokenomics: Introducing a storage-staking mechanism where users can pay for their Pinata IPFS pinning costs autonomously using crypto.

Built With

Share this project:

Updates