Generating inputs from emails
Inputs are the data extracted from an email according to your defined pattern. They serve as the basis for generating zero-knowledge proofs.
Understanding the Flow
Before we dive into the implementation, let's understand the flow of generating inputs from emails using the ZK Email SDK:
Pattern Definition:
You start by defining a pattern in the ZK Email SDK Registry.
This pattern specifies what information to extract from emails and how to process it.
Input Worker Initialization:
When your application starts, you initialize an input worker for your specific pattern.
This worker contains the logic to parse emails according to your pattern.
Email Content Input:
Your application provides a way for users to input email content (e.g., a textarea).
Input Generation:
When triggered (e.g., by a button click), your application sends the email content to the input worker.
The worker processes the email content according to your pattern.
It extracts the relevant information and formats it as specified in your pattern.
Result Handling:
The generated input is returned to your application.
You can then display this input to the user or use it for further processing (e.g., proof generation).
Error Handling:
Throughout this process, you need to handle potential errors, such as invalid email content or processing failures.
Step-by-Step Guide
TODO
Last updated