Inspiration

The two-week pay cycle is a design flaw in modern life. For over 100 million workers, it's a relic of an analog era that creates a constant, stressful gap between earning money and having access to it. This liquidity gap fuels a predatory, multi-billion dollar payday loan industry and forces people into high-interest debt simply to manage their daily lives.

Existing "Earned Wage Access" (EWA) solutions are a patch, not a fix. They are centralized, proprietary systems that require deep corporate partnerships, creating honeypots of sensitive payroll data while only serving employees of specific, pre-approved companies.

We were inspired by a fundamental question: What if liquidity wasn't tied to a calendar? What if your pay wasn't a batch, but a stream? We envisioned a new, open financial primitive that could decouple earning from payday for everyone, without compromising privacy or creating a centralized point of failure.

What it does

Stream is a decentralized protocol that allows any employee to instantly and privately access their earned wages the moment their work is verified.

It's not a loan; it's your money, faster. Using a novel application of Zero-Knowledge Proofs, Stream allows a user to cryptographically prove they have earned their wages without revealing who they are, who they work for, or the specific amount they earn to the public blockchain.

The user flow is radically simple:

  1. At the end of a shift or work period, an employer's payroll system generates a simple, standard digital signature attesting to the work done.
  2. The employee's Stream wallet uses this signature to generate a private, on-device Zero-Knowledge Proof.
  3. The user submits this anonymous proof to the Stream smart contract and instantly receives their corresponding pay from a global liquidity pool.

This transforms earned-but-unpaid labor from an entry in a corporate ledger into a verifiable, liquid digital asset under the user's control.

How we built it

We built Stream as a full-stack, end-to-end decentralized application, with three core technical pillars:

1. The Zero-Knowledge Circuit (The Core Miracle)

The heart of Stream is a custom Zero-Knowledge Proof circuit written in Circom. This circuit is designed to prove a user possesses a valid ECDSA signature from a known employer's public key, without revealing the signature itself.

We used the circomlib library for the core cryptographic components and the Poseidon hash function for its SNARK-friendly efficiency, which is critical for performance. The entire witness calculation is compiled to WASM (WebAssembly), allowing the most computationally intensive part of the process—the proof generation—to run entirely client-side in the user's browser. This preserves user privacy and makes the system massively scalable.

The core logic of our system can be expressed as a simple ZKP function: $$ \text{Proof}(P, w) \rightarrow V(P, x) $$ Where our program P verifies a secret witness w (the employer's signature) against a public input x (the employer's public key and a unique nullifier).

2. The On-Chain Verifier (The Arbiter of Truth)

The on-chain component is a Solidity smart contract, developed and tested using the Hardhat framework. It has two main functions:

  • Proof Verification: We used SnarkJS to automatically generate a Verifier.sol contract from our compiled circuit. This contract performs the on-chain verification of the Groth16 proofs submitted by users.
  • Double-Spend Prevention: The most critical security feature is our nullifier scheme. Our contract maintains a mapping(bytes32 => bool) of used nullifiers. Before verifying a proof, the contract first checks that the unique nullifier associated with that work period has not been used before, making it impossible to claim the same pay twice. We rigorously followed the Checks-Effects-Interactions security pattern to prevent re-entrancy attacks.

3. The dApp & System Architecture (The Glue)

The user-facing application is a React/Next.js web app that serves as the central orchestrator.

  • Frontend: We used Ethers.js to connect to the user's browser wallet (e.g., MetaMask), craft transactions, and interact with the deployed smart contract.
  • Simulated Employer: A simple Node.js/Express server acts as a signing oracle, simulating an employer's payroll API by providing valid signatures on demand.
  • Client-Side Proving: The frontend fetches the signed message from the backend, then uses SnarkJS to invoke the WASM prover directly in the browser. This generates the proof, which is then submitted to the blockchain, completing the end-to-end, trust-minimized flow.

Challenges we ran into

  • The ZKP Performance Budget: Zero-Knowledge Proof generation is computationally expensive. Our initial, more complex circuit design took over 30 seconds to generate a proof in the browser, which destroyed the "instant" user experience. We had to ruthlessly refactor and simplify our Circom circuit, cutting out non-essential constraints and optimizing our hashing algorithm, to get the proof time down to our target of under 7 seconds.
  • Data Formatting Hell: The path of data from a backend JavaScript signature, to a BigInt format for the Circom witness, to the hexadecimal calldata expected by the Solidity contract was incredibly brittle. We spent a significant amount of time debugging obscure formatting errors and mismatches between the cryptographic libraries and the EVM.
  • Managing Asynchronous States: The user flow involves waiting for two very different asynchronous events: a local, CPU-bound proof generation and a remote, network-bound transaction confirmation. Building a clean, non-blocking React UI that could gracefully handle the state transitions between "Proving," "Submitting," and "Success" was a major frontend challenge.

Accomplishments that we're proud of

  • We Ran a ZKP in a Browser: We successfully built a full-stack application around a client-side, in-browser Zero-Knowledge Proof. This is a bleeding-edge technique that preserves user privacy to the highest degree and demonstrates a practical application of complex cryptography.
  • A Complete, End-to-End Protocol: We didn't just build a proof-of-concept for one part. We built the entire, functional loop: from the employer's signature, to the user's private proof generation, to the final, on-chain settlement of funds on a public testnet.
  • Abstracting "God-Tier" Complexity: We are most proud of taking one of the most complex concepts in modern cryptography and abstracting it away behind a single button. The user doesn't need to know what a ZK-SNARK is; they just know they can get their money instantly and privately.

What we learned

  • Applied Cryptography is a Practical Tool: We learned that Zero-Knowledge Proofs are no longer just a theoretical concept. With tools like Circom and SnarkJS, a small, dedicated team can build powerful, privacy-preserving applications in a matter of hours, not years.
  • The Power of Off-Chain Computation: The biggest gas optimization for a dApp isn't in the Solidity code; it's in the architecture. By moving all the heavy verification logic off-chain and only putting the result (the proof) on-chain, we created a system that is far more scalable and cost-effective than a purely on-chain approach.
  • Protocols over Platforms: We learned the power of building open, permissionless systems. Stream isn't a closed app that requires corporate sales deals. It's a protocol that any employer and any employee can use, just like email. This is a fundamentally more powerful and equitable model for the future of finance.

What's next for Stream

This hackathon project is the proof-of-concept for a much larger vision. Our next steps are clear:

  • Gasless Transactions: We plan to integrate ERC-4337 Account Abstraction to allow users to receive their pay without needing to hold native ETH for gas fees, removing a major point of friction for mainstream adoption.
  • DeFi Liquidity Pool Integration: To ensure the protocol is always liquid, we will integrate with established DeFi lending protocols like Aave and Compound, allowing the Stream contract to earn yield on its float.
  • Formal Security Audits: Before any mainnet launch, the Circom circuit and the Solidity smart contracts would undergo multiple, rigorous security audits from top-tier firms to ensure the safety of user funds.

Built With

Share this project:

Updates