Creating a New Pattern
A pattern is a customizable template that guides the system in how to handle and process email data. A pattern specifies:
What information you want to extract from an email.
How to locate this information within the email structure.
Which parts of this information should be made public and which should remain private.
Think of a pattern as a set of instructions to follow when processing an email. It tells the system:
Where to look in the email (header, body, etc.)
What to look for (sender email, subject line, specific content, etc.)
What to reveal and what to keep hidden
Getting started
This guide will walk you through the step-by-step process of creating a new pattern using ZK Email Registry. If you face any challenge creating new Patterns, you can ask our GPT questions about creating new patterns: https://chatgpt.com/g/g-wNBWHHSPV-zk-email-fields-to-extract-generator
Submitting a new Pattern
1. Access the ZK Email Registry
First, visit the ZK Regex Registry at https://sdk.prove.email/. This is where you'll submit your new pattern.
2. Open the Pattern Creation Form
Look for click on the "Submit a new pattern" button. This will take you to the pattern creation form.
3. Fill in Pattern Details
You will need to provide some information about the pattern you want to create.
Pattern Title: Provides a descriptive name for your pattern.
Description: Explains what your pattern verifies.
Slug: Creates a unique identifier for your pattern.
Tags: Categorizes your pattern for easier searching and grouping.
Email Query: Defines how to find relevant emails for your pattern. It is used to find emails directly from the Google inbox when using the SDK.
Circuit Name: Names the generated circuit for your pattern.
Skip Body Hash Check: Determines whether to check the email body or just the headers.
Email sender domain: Represents the domain of the email sender in the email you're using for your pattern.
DKIM selector: An optional parameter that defines the DKIM selector from your email header.
SHA Precompute Selector: Identifies a unique string that precedes the extracted data in the email body.
Max Email Body Length: Specifies the maximum number of characters that the SDK will process from the email body when generating zero-knowledge proofs.
Use new ZK Regex SDK for circuit generation: Specifies whether to use the latest SDK version.
Fields to Extract: Defines the specific pieces of information you want to extract from the email.
When defining fields to extract in your ZK Email pattern, you'll need to choose between two different formats: V1 and V2. Your choice depends on whether you've opted to use the new ZK Regex SDK for circuit generation.
If you've checked the box for "Use new ZK Regex SDK for circuit generation", you should use the V2 format.
If you are using the legacy compiler, then don't check this box to use the V1 format. We do not recommend this.
The V2 format, which uses the SDK, offers more granular control over what parts of the extracted information are public or private. It's generally recommended to use V2 if possible, as it represents the more current and flexible approach.
After you Submit a Pattern
Once a pattern is submitted, it takes around 15 minutes for the circuit and the necessary keys to be created. However, what you can do is to immediately download the example project to test it out locally.
You will see a green tick on the registry home page when the circuit resources have been generated.
Last updated