← Back to home

Whisper Transactions

Token Transfer on public chain using ZKP and privacy-preserving token

Screenshots

Whisper Transactions screenshot 1
Whisper Transactions screenshot 2
Whisper Transactions screenshot 3

Problem Statement

This project represents an implementation of private transactions on a public blockchain, specifically Hedera Hashgraph, using the Hyperledger Zeto toolkit. Here's a technical description of the project:ArchitectureThe project combines Hedera Hashgraph's public distributed ledger with Hyperledger Zeto's privacy-preserving token toolkit to enable confidential token transfers between Hedera wallets. It leverages several key components:The native token management on the Hedera network.The deployment and execution of the privacy-preserving smart contracts.Hyperledger Zeto: A UTXO-based privacy toolkit utilizing Zero Knowledge Proofs (ZKPs).Key Technical FeaturesUTXO ModelUnlike typical ERC-20 tokens on Ethereum-compatible chains, this project adopts a UTXO (Unspent Transaction Output) model similar to Bitcoin. This approach enhances privacy and enables better parallel processing of transactions.Zero Knowledge ProofsThe project extensively uses ZKPs to validate transactions without revealing sensitive information. The ZKP circuits support various levels of privacy, including:Anonymity for sender and receiverConfidentiality of transaction valuesMasking of transaction historyCommitment SchemeEach UTXO is represented on-chain as a commitment hash, combining:Token valueSalt (for randomness)Owner's public keyTransaction FlowThe sender creates a transaction, consuming one or more input UTXOs and creating new output UTXOs.A ZKP is generated to prove the transaction's validity without revealing its details.The transaction and proof are submitted to the Hedera Smart Contract Service.The smart contract verifies the ZKP and, if valid, updates the on-chain state by nullifying input UTXOs and creating new output UTXOs.Privacy LevelsMultiple level of privacy configuration is possible:Basic anonymity with unencrypted valuesEnhanced privacy with encrypted valuesFull privacy with history masking using nullifiersFor this project, we have used Basic anonymity to demonstrate the concept.Integration with HederaThe project utilizes Hedera's native token capabilities through the Hedera Token Service.Smart contracts are deployed using Hedera's Solidity-compatible environment, leveraging the Ethereum Virtual Machine (EVM).Transactions benefit from Hedera's high throughput and low, predictable fees.Unique AspectsFirst known implementation of UTXO-based private tokens on Hedera's public network.Combines the security and efficiency of Hedera's hashgraph consensus with advanced cryptographic privacy techniques.Demonstrates the potential for enterprise-grade privacy solutions on public ledgers, addressing a key concern for institutional adoption.This project showcases the potential for building sophisticated, privacy-preserving decentralized applications on Hedera Hashgraph, bridging the gap between public blockchain transparency and the privacy requirements of sensitive financial transactions.

Solution

This project implements private transactions on the Hedera Hashgraph public blockchain using the Hyperledger Zeto toolkit. Here's a breakdown of the key components and technologies:Backend (txn-backend):Built with Node.js and Express.jsUses TypeScript for type safetyIntegrates with MongoDB for data storageUtilizes various cryptographic libraries:maci-crypto for key generation and encryptionsnarkjs for zero-knowledge proof generation and verificationposeidon-lite for hash functionsFrontend (txn-app):Built with Next.js, a React frameworkUses TypeScript for type safetyIntegrates with Web3Modal for wallet connectionsUses Wagmi for Ethereum interactionsEmploys TanStack Query (React Query) for data fetching and state managementZero-Knowledge Proofs (ZKP):Utilizes Circom for creating ZKP circuitsImplements various ZKP circuits for different privacy levels:Anonymous transactionsEncrypted transactionsTransactions with nullifiersKYC-compliant transactionsUses snarkjs for proof generation and verificationMerkle Trees:Implements Sparse Merkle Trees (SMT) using @iden3/js-merkletreeUsed for efficient storage and verification of UTXOs and identitiesCryptography:Employs Poseidon hash functions for various cryptographic operationsUses ECDH (Elliptic Curve Diffie-Hellman) for shared key generationImplements custom encryption and decryption functionsSmart Contracts:Utilizes Solidity for writing smart contractsImplements verifier contracts for on-chain proof verificationTesting:Uses Mocha as the test runnerImplements both unit tests and integration tests for ZKP circuits and cryptographic functionsNotable technical achievements:Implementation of a UTXO model on Hedera, which is typically account-based.Integration of ZKPs with Hedera's smart contract service, enabling privacy-preserving computations on a public blockchain.Custom implementation of encrypted transactions with regulatory compliance features.Use of Sparse Merkle Trees for efficient UTXO and identity management.The project demonstrates a sophisticated approach to privacy-preserving transactions on a public blockchain, combining advanced cryptographic techniques with the efficiency and security of Hedera Hashgraph. The modular architecture allows for different levels of privacy and compliance, making it suitable for various use cases, from simple anonymous transfers to fully regulated, KYC-compliant transactions.

Hackathon

ETHOnline 2024

2024

Prizes

  • 🏆

    EVM Starter Bounty

    Hedera

Contributors