o1js-email-verify
Version:
Implemented using [o1js](https://github.com/o1-labs/o1js), this project is a reimplementation of [zk-email](https://github.com/zkemail/zk-email-verify), leveraging the Mina proving system [Kimchi](https://o1-labs.github.io/proof-systems/specs/kimchi.html#
22 lines (21 loc) • 751 B
TypeScript
import { Field, Bytes } from 'o1js';
import { Bigint2048 } from 'o1js-rsa';
export { generateInputs, EmailVerifyInputs };
type EmailVerifyInputs = {
paddedHeader: Bytes;
headerHashIndex: Field;
signature: Bigint2048;
publicKey: Bigint2048;
modulusLength: number;
paddedBodyRemainingBytes: Bytes;
precomputedHash: Bytes;
bodyHashIndex: Field;
headerBodyHashIndex: Field;
};
/**
* Generates inputs required for email verification from a raw email string.
*
* @param rawEmail The raw email string.
* @returns The email verification inputs.
*/
declare function generateInputs(rawEmail: string, maxHeaderLength?: number, maxRemainingBodyLength?: number, shaPrecomputeSelector?: string): Promise<EmailVerifyInputs>;