ONI-CHAN
For ETH-Tokyo 2024, we are proud to present ONI-CHAN, a fiat-to-crypto, over-the-counter protocol designed to be fast, and to eliminate the need for trust.
What is ONI-CHAN?
ONI-CHAN is an innovative on-chain solution that addresses the trust issues commonly associated with traditional OTC trading.
By leveraging zero-knowledge proofs, the protocol ensures that users can securely and instantly claim from a smart contract the cryptocurrency they’ve purchased as soon as they deposit fiat money into a specified account, whether it's a bank account or a digital wallet like PayPal.
Fun fact: “Oni-chan” is an anagram of “onchain” -- a happy little accident that perfectly aligns with the protocol’s on-chain nature.
What is OTC?
Over-the-Counter (OTC) trading refers to the direct exchange of assets between two parties without the involvement of a centralized exchange.
Traditional OTC Flow and Its Challenges
The traditional OTC trading process typically follows these steps:
Trade Initiation: The user initiates the trade.
Fiat Transfer: The user transfers fiat to a specified account.
Fund Confirmation: The seller confirms receipt of funds.
Crypto Transfer: The seller sends cryptocurrency to the user.
Crypto Receipt: The user receives the purchased cryptocurrency.
However, this method is fraught with potential issues:
During Fund Confirmation:
Delayed Response: The seller may be slow in responding, causing unnecessary delays.
Overwhelmed Sellers: The seller might be handling too many requests, leading to slow or missed transactions.
Transaction Bailout: The seller could bail out on the transaction after the funds have been transferred, leaving the user in a precarious situation.
Scammers: The seller may be a scammer, leaving the user at risk of losing their money.
During Crypto Transfer:
Incorrect Amount: The seller might send the wrong amount of cryptocurrency.
Wrong Address: The seller could mistakenly send the funds to an incorrect address.
The Solution? Eliminating Uncertainty
Imagine a world where all this uncertainty is removed, and users can have peace of mind as soon as they’ve sent the funds. With ONI-CHAN, this vision becomes a reality, as it ensures that every step of the transaction is secure, automatic, and trustless, eliminating the risks associated with traditional OTC trading.
Building the Perfect ONI-CHAN
ONI-CHAN leverages cutting-edge technology to create a secure, trustless environment for OTC trading, addressing the pain points of traditional methods. At the core of our protocol is the Reclaim Protocol, which we have customized to integrate with Mega Bank’s transfer history. This integration allows users to securely prove their bank transfer history and submit a zero-knowledge proof (zk proof) for smart contract verification.
Using Reclaim Protocol
Reclaim Protocol is a decentralized data verification tool that ensures data integrity and privacy. It works by using a TLS proxy with selective disclosure and zk proof mechanisms. Here’s how it fits into ONI-CHAN:
Custom Data Provider: We have created a custom data provider using Reclaim Protocol, specifically designed to connect with Mega Bank. This allows users to retrieve their bank transfer history in a secure and private manner.
Secure and Private Verification: When a user initiates a transaction on ONI-CHAN, they can use Reclaim Protocol to generate a zk proof of their bank transfer history. This proof is cryptographically secured, ensuring that the user’s sensitive information, such as account numbers, remains private.
Smart Contract Integration: The zk proof generated by Reclaim Protocol is submitted to the ONI-CHAN smart contract for verification. Within the smart contract, sellers can create an order and deposit their cryptocurrency, specifying the conditions they want the buyer to prove, such as a bank transfer to a specific account or a PayPal transfer to a particular email address.
By integrating Reclaim Protocol, ONI-CHAN ensures that each step of the OTC transaction is secure and trustless. Users can rest assured that once they submit their payment, the verification process is automatic, eliminating the delays and uncertainties associated with traditional OTC trading.
Challenges
Defining the schema for the data retrieved from Mega Bank: The bank’s response format was not straightforward, which led to several rounds of trial and error in defining the correct schema that could be parsed and used by Reclaim Protocol.
Reliability of proof generation and submission: Reclaim Protocol requires specific tokens or cookies to generate proofs for bank related requests, but these elements were not always present or properly handled in the bank’s responses.
Instability of Reclaim Protocol: As a relatively new and evolving protocol, it isn't always stable or predictable. This meant that even when our schema and token management were correct, we still faced occasional failures due to the underlying protocol.
Deployment
- Scroll sepolia: 0xd570bf4598d3ccf214e288dd92222b8bd3134984
- Linea sepolia: 0x8b3340efcb90e586edf0790538c7f3730560d4b3
- Nero testnet: 0x8b3340EFcB90e586Edf0790538c7f3730560D4b3
Learnings
We learned how Reclaim Protocol works to securely pull and verify sensitive data, such as bank transfer history, without exposing the actual details. The protocol’s ability to generate zero-knowledge proofs allows us to ensure the authenticity of the data while maintaining user privacy.
Potential Next Steps
- Implement advanced KYC/AML procedures using ZK proofs, balancing regulatory requirements with user privacy.
- Develop tailored solutions for institutional clients, including batch order processing and comprehensive reporting tools.
- Extend ZK proof capabilities to verify diverse assets beyond bank transfers, enabling trades of various valuable items for crypto.
- Enhance platform flexibility by supporting multiple blockchain networks.