[NCR#1 Proposal] zkEmail implementation + KYC (Know Your Community) tool #5781
Replies: 5 comments 4 replies
-
@Alex-distributed-lab Hi Alex, is this inspired from the ZK Regex -> Circom tool? |
Beta Was this translation helpful? Give feedback.
-
Hi @Alex-distributed-lab, thanks for submitting the proposal! A few early questions and thoughts: Potential usersWould be great if you could shine light on teams / projects that showed interest in the idea through the lens of a potential user, if you happen to know any. TimelineNoticed that the timeline proposed is >2 months. Mind that audit partners for NCR#1 are being onboarded with the assumption of a 2-month NCR#1 R&D timeline. If the proposal gets selected, audit scope and timeline review might be needed depending on progress. (Happy to guide the process then, simply an early heads up.) |
Beta Was this translation helpful? Give feedback.
-
Re questions:
Can definitely define in more detail as R&D goes, but a good initial target would be matching the current ZK Email implementations (e.g. Circom, Halo2).
Not sure if I understand the question; happy to discuss further if you could elaborate. |
Beta Was this translation helpful? Give feedback.
-
Btw we rewrote zk-regex to support almost all syntax except lookarounds, so I think the easiest way to tackle week 1 (while expanding available syntax) would be to just rip out the circom parts from the existing zk-regex compiler at the step where it generates the min-dfa and transition table from the regex expression! Then, instead of converting the gates into arithmetic gates like circom, you can just make lookups like the halo2 design instead. |
Beta Was this translation helpful? Give feedback.
-
Selected proposals for NCR#1 are announced: https://github.com/orgs/noir-lang/discussions/5932 Thank you for your support on the initiative. NCR is just one of the many ways to start your explorations with Noir, check the announcement for more potential ways to collaborate. Let's bring the world ZK! |
Beta Was this translation helpful? Give feedback.
-
Summary
First, we aim to build the zkEmail library in Noir and provide certain primitives to the language ecosystem, such as a regex mechanism tailored for ZK.
Secondly, based on the zkEmail solution, we are going to implement a tool for community driving. The logic is straightforward here:
As a PoC of the tool mentioned, we would build a solution that allows businesses to make airdrops through their mailing list.
Methodology
Stage 1: Implementation of Noir Primitives
Objective: Engineer regex pattern matching library.
Approach:
Stage 2: Implementation of zkEmail protocol
Objective: Engineer zkEmail library in Noir.
Approach:
Stage 3: Implementation of PoC of email-powered airdrop
Objective: Show how the zkEmails protocol helps communities driving
Approach:
RegExp implementation Logic:
We envision two possible variants for solving the task of implementing the zkEmail SDK on Noir:
Noir Full Implementation:
The implementation includes the following stages: Regex → Postfix Notation → NFA → Checking the Message. The initial version of the program assumes the use of visible ASCII characters plus space characters, excluding the following control characters, which are encoded in Base64 format.
Operations: The main operations that this regex will support:
Hybrid implementation of Noir RegExp with Rust:
In this implementation, Rust will translate the Regex into its final form, i.e., DFA. Then, write this data to the Noir program and the message, and Noir will check the message structure with this regex.
Operations: This implementation will have all the same operations as the Noir full implementation, but some new ones are added:
DKIM Signature Verification Logic:
Inputs: e and m values for RSA, DKIM signature, raw_msg, regex.
regex_check(raw_msg, regex)
.msg_hash = sha256(raw_msg)
.msg_hash == decode_base64(DKIM.body_hash)
.decode_base64(DKIM.signature_value) ^ e % n == x
.x == sha256(construct_sign_struct(raw_msg))
Solution PoC logic:
Timeline and Deliverables
Stage 1. The Regex library in Noir is tested and validated.
Deliverables. Implementation will have a noir-only version and a hybrid one.
Timeline. 1 month
Stage 2. zkEmail library in Noir, tested and validated.
Deliverables. Enabling full zkEmail proof generation logic in Noir.
Timeline. 1 month
Stage 3. zkEmail-powered airdrop.
Deliverables. Deployed solution. Then we will send airdrops to Distributed Lab team members by emails =)
Timeline. 1.5 months
Team:
Distributed Lab, 10 years of blockchain development:
Past contributions to Aztec:
Hashmap lib: #4241
PLUME signature: https://github.com/distributed-lab/noir-plume
Start Date
The next day after the announcement
Additional research points:
Questions
Are any specific performance benchmarks for the final ZK Email SDK that are nice to meet?
Are there any additional compliance or security standards we must consider during development?
Beta Was this translation helpful? Give feedback.
All reactions