Introduction
Zero-Knowledge (ZK) technology itself is not new. However, what sets Hamsa's solution apart is the way Hamsa’s zk-CSC extends ERC standards, adding mechanisms to split and merge balances in privacy, and combines ZK proofs with advanced composability and token lifecycle management.
Modular Architecture for Private Transactions
Traditional ZK implementations often focus on privacy-preserving computation in isolated contexts — such as confidential transfers. These typically rely on monolithic smart contracts and simple ZK proof-verification.
In contrast, Hamsa's solution employs a modular architecture that allows for:
- Balance Splitting Before Transactions: Prior to executing a transaction, the consolidated cyphered balance is split into components, which can include private data and public data, depending on what is required for the transaction.
- ZK-Verification Logic: Specialized composable smart contracts — powered by ZK — are used to verify that the private operation correctly performed under the established rules without exposing sensitive information.
- Balance merging Post-Execution: Once the transaction logic is complete, the transferred amounts are aggregated to the receiver's unified balance, maintaining full integrity without revealing sensitive data.
Zero-Knowledge Composable Smart Contracts
ZK-CSC combines Zero-Knowledge Proofs (ZKPs) with atomic smart contract execution to ensure privacy, security, and atomicity in decentralized transactions. This enables trustless, confidential, and efficient execution of complex on-chain operations, making them ideal for private financial transactions, DeFi, and institutional clearing and settlement.
Features:
- Atomic Execution – Ensures all conditions are met before a transaction is finalized (e.g., both payment and asset transfer occur simultaneously).
- Zero-Knowledge Privacy – Transaction details (sender, receiver, and amounts) remain confidential while still being verifiable.
- Interoperability – ZK-CSC enables seamless interaction with multiple smart contracts in a programmable and modular way
- Scalability – By using NOVA zk-folding techniques, multiple transactions can be bundled into a single proof, reducing processing times and improving the throughput.
- Decentralization – No need for trusted third parties; smart contracts verify proofs on-chain without exposing sensitive data.
- Trust Anchoring – The network state can be anchored on a public, EVM-compatible blockchain, providing an enhanced security and finality to the L2 network.
A ZK-CSC framework typically entails the following operations. First, a transaction is built, a Zero-Knowledge proof is generated, then the client signs the transaction. This is an off-chain private computation that happens inside the client's infrastructure, using ZK proof circuits to prove that the user has the right to execute the transaction and that all conditions (e.g., balance checks, approval) are met. No private data is leaked. Following this, the transaction is submitted to the L2 blockchain, which handles its atomic verification and execution. The CSC smart contract may execute some basic checks, then a ZK verifier smart contract assesses the zero knowledge proof validity. Upon successful verification, the smart contract executes the transaction atomically, guaranteeing that either all contract conditions are satisfied, or the entire transaction is reversed.
Efficient ZK for Proof Generation
The proving time for ZK circuits can add some latency to the transaction finalization. To ensure Zero-Knowledge Composable Smart Contracts (ZK-CSC) run efficiently, Hamsa L2 solution uses a combination of advanced cryptographic techniques, optimized computation strategies, and scalable software architectures. The high performance is achieved, among other things, through:
- Precompiled Circuits – Instead of generating circuits from scratch, we reuse pre-verified optimized circuit templates for common operations.
- Recursive Proof Composition – Combine multiple ZK into a single proof to reduce proof creation and verification cost.
- Minimized Circuit Complexity – Avoid unnecessary computations inside the ZK circuit, only proving with minimal required data.
- Efficient Commitment Schemes – Thorough selection of hashes, curves and other cryptographic algorithms based on their safety and performance for ZK proofs.
Enabling Collaboration with Private Smart Contracts
To facilitate seamless interaction between private and public contracts, we have defined extended token standards such as ERC-20. In addition to the functions already provided by these standards, our token model introduces two new methods privateReserveAmount and privateRollBackAmount, allowing banks and financial institutions to execute business transactions aligned with their use cases.
A key innovation of Hamsa's ZK-CSC is its ability to enable seamless interaction and orchestration between private smart contracts, as well as with public ones. This capability unlocks a new paradigm for decentralized applications, allowing developers to preserve privacy without sacrificing interoperability.
Traditionally, privacy-preserving smart contracts operate in silos due to the complexity of maintaining confidentiality across interactions. ZK-CSCs break this barrier by enabling:
- Private-Private Composability: Two or more private contracts can securely interact without leaking sensitive data, using zero-knowledge proofs to verify correctness.
- Private-Public Composability: Private contracts can invoke or be invoked by public contracts.
These interactions are orchestrated through well-defined interfaces and proof verifications that maintain trust without data exposure.