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 develop an application layer that could be used directly in layer 1 and in other contexts as well. 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. On one hand, it mainly involves conducting research and laying the groundwork for integrating the protocol into the Cardano ecosystem. On the other hand, the base smart contracts of the protocol are currently being prototyped and developed.
- <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.
The completion of this proposal will result in an MVP of the protocol. This adaptation of the Semaphore protocol will catalyze the development of new privacy-focused applications in Cardano that were previously unattainable. Projects could benefit from this proposal according to their needs and utilize 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.
Status of the project
As the challenge requires, prototypes of the solution are necessary. Our team has already developed some important pieces of the protocol:
(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) The Incremental Merkle Tree
A key feature of the protocol is managing users and memberships within a group. To represent this set of members, we needed to develop a data structure that is efficient for on-chain use. This data structure is the Incremental Merkle Tree, which we developed in Aiken. It enables users to register and provide proof of their membership in the group:
- <https://github.com/Modulo-P/settled-pimt>