Please describe your proposed solution
¿Why this proposal matters?
Privacy is a key element of every network that pursues to be safe, power balanced and censorship-resistant. These matters are even more important today with the emergence of hypervigilance and Artificial Intelligence technologies. At the moment, Cardano is by default a transparent network that lacks built-in privacy capabilities; however, the adoption of Zero-Knowledge cryptography is enhancing key aspects of the blockchain industry that were neglected in the past such as Privacy. Our proposal aims to add private capabilities directly in layer 1 and in other contexts as well such as in the Hydra protocol. The usage of this technology will catalyze the development of new privacy-focused applications in Cardano with a broad use-cases.
¿What is the Semaphore protocol?
The Semaphore Protocol is a privacy focused layer that was born in the Ethereum ecosystem. It allows users to demonstrate their membership in a group and send arbitrary information without revealing their identity. It uses Zero-Knowledge cryptography to achieve anonymous proof of membership and overcome the double-signaling problem. As we point out later, the protocol has proven to have a wide range of use cases, and it serves as a base layer where other types of applications can be built on top of it. Since the verification of Zero-Knowledge proofs will be possible soon with the next Plutus hard fork, the objective of this proposal is to adapt this protocol to the Cardano network.
The proposal
Thus, in general, this proposal intends to port the Semaphore protocol to Cardano, a project consisting of a two-phased process.
The first phase, funded in Catalyst F11 and presently under development, consist in: On one hand, it mainly involved conducting research and laying the groundwork for integrating the cryptographic components into the Cardano ecosystem. On the other hand, the base smart contracts of the protocol are currently
- <https://cardano.ideascale.com/c/idea/113249>
As a second phase, the current proposal will intend to improve the on-chain components and develop the off-chain components of the protocol. This will imply the following:
- Test the smart contracts of the protocol that have been prototyped and develop them into their final form.
- Develop a library that interfaces and constructs the transactions needed to interact with the protocol. This library will be in TypeScript or JavaScript, featuring an API for constructing such transactions.
- Create and develop the protocol relayer. To interact with the protocol, an intermediary called the relayer is required. Relayers act as channels for sending messages and proofs to the blockchain while preserving the anonymity of the user. The application API mentioned above will be utilized to create this relayer.
Although our project will do a demo of the protocol by implementing a voting solution, the completion of this proposal will mainly result in an open-source tool that can be reused for various purposes. In this sense, the Semaphore protocol serves as a base protocol that can be extended by developers to address different privacy solutions (we will list many of the use cases below). Any project needing to privately verify its members and send anonymous messages to the blockchain will benefit from this solution. This adaptation of the Semaphore protocol will help develop new privacy-focused applications on Cardano that weren't possible before. Projects can use this proposal according to their needs and apply it in various contexts
- Layer 1: Projects that need high security standards could run this protocol directly in layer 1 of the blockchain.
- Hydra protocol: Projects that require a high transaction throughput with multi-party security assumptions could use this layer on top of the Hydra protocol. At the moment our team is already developing a Hydra environment focused on Zero-Knowledge applications, and in this context developers will be able to use the Semaphore solution in Hydra.
- Off-chain: Projects that need less security assumptions could use this protocol off-chain for certain processes of their applications.
In summary, this project aims to adapt the Semaphore protocol and create an open-source tool that satisfy a wide range of privacy use-cases. As mentioned, the first phase is nearing completion, and in this round, we seek funding to refine our current progress and develop the off-chain components of the project.
Annex: Status of the project
Additionally, it could be useful to mention the state of the project and highlight some key pieces of the protocol that already has been developed:
(1) Zero-Knowledge Validator
The protocol in order to work and function, it requires to verify Zero-Knowledge proofs. This verification is an indispensable component of the protocol operation, concretely, the validator (smart contract) which checks the Zero-Knowledge proofs. We already developed this validator along with some front-end utilities to make proof construction a straight forward process. This component can be found in the ak-381 library:
- <https://github.com/Modulo-P/ak-381>
To showcase and demonstrate the possible applications of this validators a dapp has been made. It is important to note that these demo is one of the first fully functional Zero-Knowledge application of the Cardano ecosystem.
- <https://zkmastermind.modulo-p.io/>
(2) Semaphore circuit adaptation
Originally, the circuit of the protocol was implemented to work on the BN254 elliptic curve, we already concluded the adaptation of the circuit to the BLS12-381 supported by Cardano:
- <https://github.com/Modulo-P/modp-semaphore-bls12381>
(3) Base smart contracts of the protocol.
A first prototype of the protocol's smart contracts has already been developed. Also, the repository contains a document with the research findings that summarize the conclusions from the first phase:
- <https://github.com/Modulo-P/Cardano-Semaphore>