A ZKP-Enabled Trustless Fiat On-Ramp For Cardano

ENCOINS
7 min readMar 25, 2024

--

by Soorajksaju

The debut of permissionless blockchain and cryptocurrency technologies marked the beginning of a new, fair financial era. Yet, integrating traditional money with its digital counterparts involves a lot of challenges.

Transitioning from a fiat-centric to a digital currency system has historically been hampered by issues of security, privacy, and regulatory compliance. The process of converting fiat into digital currencies often relies on centralized bodies, which provide trust and compliance at the expense of introducing potential systemic failures and privacy violations.

Incidents like the collapse of Mt. Gox and the more recent FTX scandal underscore the vulnerabilities associated with centralized exchanges. The lack of efficient fiat-to-crypto gateways remains a critical hurdle for cryptocurrency adoption and the development of a truly decentralized financial environment.

To address these challenges, ENCOINS, ZkFold and Anastasia Labs have developed a groundbreaking solution utilizing state-of-the-art cryptographic methods to enable secure, anonymous, and trustless fiat on-ramp to cryptocurrencies.

Our Zero-Knowledge Proof Trustless P2P Fiat-to-Crypto On-Ramp, specifically designed for Cardano, utilizes ZKPs to preserve transaction anonymity and security, reinforcing the decentralization ideals of blockchain technology.

Here’s an article that gets into the specifics of the solution we’re deploying on Cardano, aimed at bridging these financial paradigms.

( Full disclosure: A proof of concept for this feature has already been developed by another team: https://github.com/zkp2p/zk-p2p/tree/develop/circuits-circom)

How does the existing P2P fiat gateways work?

Existing P2P fiat pathways to cryptocurrencies are primarily controlled by centralized organizations. Among these, Binance P2P is the most popular one.

Binance P2P facilitates direct transactions between users, acting as an intermediary by providing an escrow service. This setup enables individuals to buy and sell cryptocurrencies directly from each other, utilizing various local currencies and payment methods.

Here’s an overview of its mechanism:

  • Direct exchanges between participants, enabling bargaining and settlement of trades.
  • Compatibility with an extensive selection of over 300 payment methods.
  • A safeguarded escrow service where Binance retains the cryptocurrency until the seller acknowledges receipt of payment.
  • Compulsory identity verification for all participants in the trading process.

The intent behind such P2P fiat gateways is to democratize the access to digital assets. This goal, however, is dependent on the escrow service provider’s trustworthiness and operation. In scenarios where these platforms experience security or functional issues, there is a risk to the security of user’s’ funds. The imposition of identity verification can provoke privacy concerns for those valuing anonymity and create obstacles for individuals who cannot or choose not to fulfill these requirements.

To mitigate these issues, we are developing a trustless mechanism for P2P fiat-to-crypto transitions, with a focus on leveraging zero-knowledge proofs (ZKPs) to ensure enhanced privacy and security.

A Primer on Zero-Knowledge Cryptography

Zero-Knowledge Proofs (ZKPs) are cryptographic protocols that allow one party (the prover) to prove to another party (the verifier) that a statement is true, without revealing any additional information beyond the fact that the statement is true.

For example, in the context of a fiat-to-crypto on-ramp, a ZKP can allow a user to prove that they have transferred fiat currency to the on-ramp, without revealing the actual amount transferred or their identity.

How do ZKPs Work?

ZKPs leverage complex mathematical principles, such as homomorphic encryption and elliptic curve cryptography, to construct proofs that can be verified without revealing the underlying data.

A common type of ZKP used in blockchain applications is a zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge). In a zk-SNARK, the prover constructs a proof by encoding the statement and witness data into a mathematical representation called a Quadratic Arithmetic Program (QAP). The verifier can then check the validity of the proof without knowing the witness data.

The Inner Workings of our Protocol

This is a bold statement, but the protocol we are designing will effectively eliminate the need for centralized exchanges as the sole intermediaries in fiat-to-crypto exchanges, leveraging smart contracts and ZKPs to facilitate direct transactions between users. This system addresses the current bottlenecks when it comes to fiat-to-crypto on and off ramps and offers an alternative that preserves user privacy and reduces reliance on centralized entities.

With this solution, Cardano will have a unique on-ramp feature, which, to the best of our knowledge, is currently unavailable on any other blockchain. We expect a natural inflow of people and capital into the ecosystem.

That being said, let us give you a more detailed look at how this protocol works.

Smart Contracts as the Protocol’s Backbone

At the core of our protocol are smart contracts, which act as neutral, programmable escrows. These contracts securely hold the cryptocurrency deposited by the seller until the transaction’s conditions — verifiably met by the buyer — are fulfilled. The smart contract’s logic ensures that the crypto is only released when a valid ZKP of the fiat transaction is presented by the buyer. This setup eliminates the need for a centralized third party to oversee the transaction, reducing risks and fees associated with traditional exchanges.

Zero-Knowledge Proofs for Privacy and Security

ZKPs enable the buyer to verify that they have fulfilled their part of the transaction (i.e., sending the fiat payment) without revealing sensitive information about the transaction itself. This cryptographic technique ensures the privacy and security of both parties involved, as it prevents any unnecessary exposure of personal data or transaction details. The buyer submits this proof to the smart contract, which, if verified as true, triggers the release of the cryptocurrency. This process ensures a high level of trust and security in peer-to-peer transactions, addressing one of the significant concerns in the contemporary blockchain space — privacy.

Seamless Integration with Payment Processors

For this protocol to achieve widespread adoption, it must seamlessly interface with existing financial infrastructure, including banks and digital wallets like PayPal, Revolut, and others. The protocol is designed to be adaptable, allowing for various fiat transfer methods to be incorporated. This flexibility ensures that users from different regions and with different banking preferences can participate in the ecosystem. Whether through traditional bank transfers or in-app payments, the integration with payment processors is crucial for translating fiat transactions into verifiable digital proofs that can interact with the blockchain.

User Interface and Accessibility

While the core technology operates in the background, its success depends on intuitive and accessible user interfaces. Plans to integrate the protocol into digital wallets and create dedicated applications aim to simplify the user journey, making it easier for individuals to engage in fiat-to-crypto transactions. This aspect of the system is vital for adoption, as it addresses the bottleneck of onboarding new users into the crypto space, especially those from regions with limited access to centralized exchanges.

The user journey for utilizing the P2P onramp can be outlined as follows:

Step 1: Creating an Offer

  • The seller deposits cryptocurrency into a smart contract designed to hold the funds securely. This contract acts as an escrow, only releasing funds under the conditions agreed upon by both parties.
  • Alongside the deposit, the seller lists their offer, specifying the amount of cryptocurrency they wish to sell and the fiat currency price. This offer can be broadcasted through various platforms, potentially integrated directly into wallets or specialized front-end interfaces.

Step 2: Offer Discovery

  • Buyers interested in purchasing cryptocurrency with fiat money search available offers through the chosen platform. This could involve scanning blockchain data for open orders or using off-chain services designed to facilitate offer discovery.

Step 3: Executing the Transaction

  • Once the buyer decides to proceed with a particular offer, they send the agreed fiat amount to the seller’s specified bank account or financial service account (e.g., PayPal).
  • After the fiat transfer, the buyer obtains a confirmation, ideally signed by the payment processor or bank, certifying the transaction’s completion. This confirmation is used to generate a zero-knowledge proof, affirming the transaction occurred without revealing sensitive details.

Step 4: Releasing the Funds

  • The buyer submits the zero-knowledge proof to the smart contract. This proof, along with any required public data (like the transaction amount and recipient), verifies the fiat transaction’s completion according to the agreed terms.
  • Upon successful verification, the smart contract releases the cryptocurrency to the buyer, completing the transaction.

Integration and Adoption

The current stage concentrates on embedding the above mentioned features into digital wallets to support direct conversion from fiat money to cryptocurrency, directly accessible through the wallet’s interface. There is a strategic plan to expand this utility to widely-used financial tools and wallets, including PayPal and Revolut, with the aim of augmenting the user experience and simplifying transaction processes. Looking forward, there is a vision to develop bespoke interfaces and dApp integrations to increase engagement and ease of access for users within the ecosystem.

Elevating Cardano’s Ecosystem with a Trustless Fiat Gateway

Creating a P2P on and off-ramp in a trustless manner relies heavily on a blockchain’s ability to execute transactions securely and predictably. Cardano’s smart contract architecture, characterized by transaction determinism and the capability for transactions to run in parallel, presents an ideal foundation for developing such an application.The implementation of ZKP-verification directly on-chain allows for the validation process to be decentralized and trustless.

Our protocol also aims to support a wide array of applications, with a focus on facilitating wallet-based fiat-to-crypto transactions and exploring possible integrations with DEXs for improved liquidity and diverse trading opportunities.

It proposes a decentralized, privacy-first method for users to convert fiat currencies into cryptocurrencies such as ADA, and conversely, directly contributing to the Cardano ecosystem by offering a dependable fiat access and exit point.

Final words

Thanks to the support of the entire community and Project Catalyst, Cardano will soon have this solution active. If we want a fairer and decentralized world, the only possible way is to build it together. The future will be bright, join us on this path.

For more information on ENCOINS:

Website | Twitter | Discord | Github

--

--