### Copy Environment Example Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md This command copies the example environment file to a new file named '.env', which will then be configured with specific project details. ```bash cp .env.example .env ``` -------------------------------- ### Copy Relayer Environment File Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Copies the example environment file for the relayer, which contains default configuration settings. This is the first step in setting up the relayer. ```bash cp packages/relayer/.env.example packages/relayer/.env ``` -------------------------------- ### Install Python Requirements Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Installs the necessary Python packages for the prover by referencing the requirements.txt file. This command should be run from the prover directory. ```bash pip install -r requirements.txt ``` -------------------------------- ### Deploy Contracts and Get Addresses Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md This snippet shows example output from deploying contracts, highlighting the addresses for RelayerHandler, TestERC20, and EmailWalletCore. These addresses are crucial for configuring environment variables. ```bash == Logs == RelayerHandler proxy deployed at: 0x9F68880B9A760d15734872EbA3D519549C3996BB # used for registering relayer's info TestERC20 deployed at: 0x5635e6A652bE734F858dAA769e215cdb516eaca4 # ONBOARDING_TOKEN_ADDR EmailWalletCore proxy deployed at: 0xeA1001AE28da904744fdd5167A4EbF1f2f546fab # CORE_CONTRACT_ADDRESS ---- DONE ---- ``` -------------------------------- ### Run Specific Integration Test with Forge Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Example command to run a specific integration test, such as 'testIntegration_Swap_Tokens'. It includes verbose output and FFI for external interactions. Integration tests verify the end-to-end functionality, including proof generation and verification. ```bash forge test --match-test 'testIntegration_Swap_Tokens' -vvv --ffi ``` -------------------------------- ### Example Docker Container Status Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md This is an example output of the 'docker ps' command, showing the status of running containers including email-wallet-imap, email-wallet-relayer, email-wallet-db, and email-wallet-smtp. ```bash CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d0bb20274135 email-wallet-imap "/app/relayer-imap" 7 seconds ago Up 1 second email-wallet-imap-1 7672fc31b4f4 email-wallet-relayer "/app/relayer" 7 seconds ago Up 1 second 0.0.0.0:4500->4500/tcp email-wallet-relayer-1 27c9f2b26382 postgres:15 "docker-entrypoint.s…" 7 seconds ago Up 7 seconds (healthy) 0.0.0.0:5432->5432/tcp email-wallet-db-1 9ccccc1dd244 email-wallet-smtp "/app/relayer-smtp" 7 seconds ago Up 7 seconds (healthy) 0.0.0.0:3000->3000/tcp email-wallet-smtp-1 ``` -------------------------------- ### Start PostgreSQL Database Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Launches a PostgreSQL database instance using Docker. This command configures the database with specific user, password, and database name, and maps the default PostgreSQL port. ```bash docker run --rm --name email-wallet-db -e POSTGRES_PASSWORD=p@ssw0rd -e POSTGRES_USER=emailwallet -e POSTGRES_DB=emailwallet -p 5432:5432 postgres ``` -------------------------------- ### Run Relayer Docker Container Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Starts the Relayer service in a Docker container, mapping port 80 and mounting the .env file. ```bash docker run \ -p 80:80 \ -v $(pwd)/.env:/email-wallet/packages/relayer/.env \ email_wallet_v1_relayer:latest ``` -------------------------------- ### Install mdbook for Documentation Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Installs the mdbook tool, which is used to build and serve project documentation. This is a prerequisite for generating the project's documentation website. ```Shell cargo install mdbook ``` -------------------------------- ### Run Relayer Docker Container with Setup Disabled Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Runs the Relayer service in a Docker container, disabling the setup process via an environment variable. ```bash docker run \ -p 80:80 \ -v $(pwd)/.env:/email-wallet/packages/relayer/.env \ -e SETUP=false email_wallet_v1_relayer:latest ``` -------------------------------- ### Copy Environment Sample File Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Creates a new .env file by copying the .env.sample file, which is a common practice for setting up project-specific configurations. ```sh cp .env.sample .env ``` -------------------------------- ### Run Prover with Modal Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Starts the prover service using Modal, a serverless computing platform. This command executes the prover script within the Modal environment. ```bash modal run python packages/prover/local.py ``` -------------------------------- ### Start Relayer Service Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Starts the relayer service using the Cargo build system. ```rust cargo run --release ``` -------------------------------- ### Install snarkjs with npm Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Installs the snarkjs package globally using npm, which is a dependency for the prover's local execution. Ensure Node.js and npm are installed. ```bash npm install -g snarkjs@latest ``` -------------------------------- ### Run Docker Compose for Local Services Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md This command builds and starts the Docker containers for the local database, IMAP, and SMTP services, essential for the Relayer's operation. ```bash docker compose up --build -d ``` -------------------------------- ### Serve Project Documentation Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Serves the project's documentation website locally. This command assumes mdbook has already been installed and is available in the system's PATH. ```Shell mdbook serve ``` -------------------------------- ### Build Contracts with Forge Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Command to build all smart contracts in the project using the Foundry framework. This is a prerequisite for testing and deployment. ```bash forge build ``` -------------------------------- ### Build Contracts with Forge Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Compiles all Solidity contracts using the Forge build tool, skipping tests and scripts to optimize the build process. ```bash forge build --skip test --skip script ``` -------------------------------- ### Send Test Tokens via Email Source: https://github.com/zkemail/email-wallet/blob/main/docs/src/zk_email_wallet.md Test ZK-Email Wallet functionality with test tokens before using real assets. This example demonstrates sending a 'TEST' token to an email address, utilizing a starting balance. ```Email To: relayer@sendeth.org Subject: Send 2 TEST to friend@gmail.com ``` -------------------------------- ### Deploy Extensions Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deploys various extensions for the email wallet, such as NFTExtension and UniswapExtension. Requires setting environment variables for private key and contract addresses, and uses Forge for scripting on the Sepolia testnet. ```bash PRIVATE_KEY="" \ WETH=0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9 \ TOKEN_REGISTRY=0x9f44be9F69aF1e049dCeCDb2d9296f36C49Ceafb \ DKIM_REGISTRY=0xbE66454b0Fa9E6b3D53DC1b0f9D21978bb864531 \ PRICE_ORACLE=0xF5f40B12aa15286F0DE5610C4e29d87a97997ee7 \ forge script script/07_SetDefaultExtensions.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Generate zkEmail Circuit Proofs Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Generates proofs for the main circuits using example inputs. This command is used to create the cryptographic proofs required for verification. ```bash yarn gen-random-proofs ``` -------------------------------- ### Run Prover Locally Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Executes the local prover script using Python 3. This script is part of the zkEmail Wallet project and handles proof generation. ```bash python3 packages/prover/local.py ``` -------------------------------- ### Switch to Node.js Version 18 Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Ensures the correct Node.js version (18) is used for the project, especially when managing multiple Node.js versions with nvm. ```bash nvm use 18 ``` -------------------------------- ### Deploy Handlers Contracts Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for various handler contracts (RelayerHandler, ExtensionHandler, AccountHandler, UnclaimsHandler) using Foundry. Requires WETH address and standard deployment parameters. ```bash PRIVATE_KEY="" \ WETH=0x7b79995e5f793A07Bc00c21412E50Ecae098E7f9 \ forge script script/05_DeployHandlers.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### List Running Docker Containers Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md This command lists all currently running Docker containers, allowing verification that the database, IMAP, and SMTP services are active. ```bash docker ps ``` -------------------------------- ### Run Unit Tests with Forge Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Command to execute unit tests for the smart contracts, excluding integration tests. This helps in verifying individual contract functionalities. ```bash forge test --no-match-test "testIntegration" ``` -------------------------------- ### Build zkEmail Circuits Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Builds the necessary circuits for the zkEmail project. This typically involves installing dependencies and compiling the circuits. ```bash yarn && yarn build ``` -------------------------------- ### Deploy Wallet Contract Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for the Wallet contract using Foundry. This deployment requires the WETH address and other standard deployment parameters. ```bash PRIVATE_KEY="" \ WETH=0x7b79995e5f793A07Bc00c21412E50Ecae098E7f9 \ forge script script/04_DeployWallet.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Deploy All Verifiers Contracts Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for all verifier contracts using Foundry. Similar to other deployments, it requires necessary environment variables and network configurations. The output provides the deployed contract address for the aggregated verifiers. ```bash PRIVATE_KEY="" \ forge script script/02_DeployAllVerifiers.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Deploy Contracts using Forge Script Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Executes a Forge script to deploy the contracts. It sources environment variables from a .env file and specifies RPC URL, Chain ID, and broadcast mode for deployment. ```bash source .env && \ forge script script/DefaultSetupScript.s.sol:Deploy \ --rpc-url $RPC_URL \ --chain-id $CHAIN_ID \ --broadcast \ -vvv ``` -------------------------------- ### Register Relayer on Chain Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Registers the relayer's details on the blockchain using the Cargo build system. ```rust cargo run --release -- setup ``` -------------------------------- ### Deploy DKIM Registry Contract Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for the DKIM Registry contract using Foundry. This script handles the deployment and verification of the DKIM Registry, requiring standard deployment parameters. ```bash PRIVATE_KEY="" \ forge script script/03_DeployDKIMRegistry.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Build Docker Image for Local Development Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Builds the Docker image for the relayer, tagged for local development (ARM architecture). Requires setting MODAL_TOKEN_ID and MODAL_TOKEN_SECRET build arguments. ```bash cd ../.. docker buildx build -t email_wallet_v1_relayer:latest-arm -f Relayer.Dockerfile . --build-arg modal_token_id=${MODAL_TOKEN_ID} \ --build-arg modal_token_secret=${MODAL_TOKEN_SECRET} ``` -------------------------------- ### Build Docker Image for Production (x86) Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Builds the Docker image for the relayer, tagged for production (x86 compatibility). Requires setting MODAL_TOKEN_ID and MODAL_TOKEN_SECRET build arguments and specifying the platform. ```bash cd ../.. docker buildx build -t email_wallet_v1_relayer:latest -f Relayer.Dockerfile . --build-arg modal_token_id=${MODAL_TOKEN_ID} \ --build-arg modal_token_secret=${MODAL_TOKEN_SECRET} \ --platform=linux/arm64 ``` -------------------------------- ### Deploy Email Wallet Core Contract Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for the core Email Wallet contract. This deployment requires WETH, Token Registry, DKIM Registry, and Price Oracle addresses, along with standard deployment parameters. ```bash PRIVATE_KEY="" \ WETH=0x7b79995e5f793A07Bc00c21412E50Ecae098E7f9 \ TOKEN_REGISTRY=0x9f44be9F69aF1e049dCeCDb2d9296f36C49Ceafb \ DKIM_REGISTRY=0xbE66454b0Fa9E6b3D53DC1b0f9D21978bb864531 \ PRICE_ORACLE=0xF5f40B12aa15286F0DE5610C4e29d87a97997ee7 \ forge script script/06_DeployEmailWalletCore.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Install/Remove Extensions via Email Wallet Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Demonstrates installing and removing extensions for additional functionalities, such as integrating with DeFi protocols like Uniswap. ```Natural Language Install extension Uniswap ``` ```Natural Language Remove extension Uniswap ``` -------------------------------- ### Upgrade Token Registry Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Upgrades the Token Registry contract. This script requires the TOKEN_REGISTRY address and a PRIVATE_KEY to be set as environment variables. It utilizes Forge to execute the upgrade script on the Sepolia testnet. ```bash TOKEN_REGISTRY=0xF1d24E5f7f0Ca617F0c1f3AA34A77EcFfaFedE8f \ PRIVATE_KEY=0x00 \ forge script script/XX_UpgradeTokenRegistry.s.sol:Deploy \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ -vvv ``` -------------------------------- ### Build Docker Image for Production Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Builds a Docker image for the zkEmail Wallet relayer, suitable for production with x86 compatibility. It also passes Modal token credentials and specifies the platform. ```bash docker buildx build -t email_wallet_v1_relayer:latest -f Relayer.Dockerfile . --build-arg modal_token_id=${MODAL_TOKEN_ID} \ --build-arg modal_token_secret=${MODAL_TOKEN_SECRET} \ --platform=linux/arm64 ``` -------------------------------- ### Deploy Token Registry Contract Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for the Token Registry contract using Foundry. Requires private key, RPC URL, chain ID, and optionally Etherscan API key for verification. The output provides the deployed contract address. ```bash PRIVATE_KEY="" \ forge script script/01_DeployTokenRegistry.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Deploy ECDSAOwnedDKIMRegistry Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deploys the ECDSAOwnedDKIMRegistry contract. This involves setting the SIGNER environment variable to the address of the Ethereum wallet responsible for setting the DKIM public key for a domain. Uses Forge for deployment on Sepolia. ```bash PRIVATE_KEY="" \ SIGNER=0x2f6e79a6e1a982a49ca248b70b02f76e921af400 \ forge script script/DeployECDSAOwnedDKIMRegistry.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "S7RWR1ENYB73HZY7WTV3EER7U8CQNBBTAJ" \ --verify ``` -------------------------------- ### Build Docker Image for Local Development Source: https://github.com/zkemail/email-wallet/blob/main/packages/relayer/README.md Builds a Docker image for the zkEmail Wallet relayer, optimized for local development (ARM architecture). It passes Modal token credentials as build arguments. ```bash cd ../.. docker buildx build -t email_wallet_v1_relayer:latest-arm -f Relayer.Dockerfile . --build-arg modal_token_id=${MODAL_TOKEN_ID} \ --build-arg modal_token_secret=${MODAL_TOKEN_SECRET} ``` -------------------------------- ### Deploy Uniswap TWAP Oracle Contract Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deployment script for the Uniswap TWAP Oracle contract. This deployment requires specifying the WETH address and Uniswap Factory address in addition to standard deployment parameters. ```bash PRIVATE_KEY="" \ WETH=0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9 \ UNISWAP_FACTORY=0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f \ forge script script/DeployUniswapTWAPOracle.s.sol:Deploy \ -vvv \ --rpc-url https://ethereum-sepolia.publicnode.com \ --chain-id 11155111 \ --broadcast \ --etherscan-api-key "" \ --verify ``` -------------------------------- ### Send ETH/ERC20 via Email Source: https://github.com/zkemail/email-wallet/blob/main/docs/src/zk_email_wallet.md Initiate cryptocurrency transfers by sending an email to the relayer. This example shows sending DAI to a specified email address. The system automatically deploys a wallet authorized by the recipient's email. ```Email To: relayer@sendeth.org Subject: Send 2 DAI to friend@gmail.com ``` -------------------------------- ### Register Relayer Data with Forge Script Source: https://github.com/zkemail/email-wallet/blob/main/packages/contracts/README.md Deploys a Forge script to register relayer data in the RelayerHandler contract. It requires specific environment variables like RPC URL, private key, relayer handler address, email, and hostname. ```bash source .env && \ forge script script/RegisterRelayer.s.sol --rpc-url $RPC_URL --broadcast ``` -------------------------------- ### Run zkEmail Circuit Tests Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Executes tests for the zkEmail circuits. Requires downloading and setting up specific circuit files in a 'build' directory. ```bash yarn test ``` -------------------------------- ### Generate zkEmail Proving Keys and Verifier Contracts Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Generates proving keys and verifier contracts for the main circuits in the zkEmail project. This is a crucial step for deploying and verifying proofs. ```bash yarn dev-setup ``` -------------------------------- ### Account Initialization Circuit Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Verifies the initialization of an account. It processes padded email headers, RSA public keys, and signatures to generate account-related data. ```Circom circuit account_init { // Inputs: in_padded, pubkey, signature, in_padded_len, sender_relayer_rand, sender_email_idx, code_idx, domain_idx, timestamp_idx // Outputs: domain_name, pubkey_hash, sender_relayer_rand_hash, email_nullifier, sender_pointer, sender_ak_commit, timestamp } ``` -------------------------------- ### Verify zkEmail Circuit Proofs Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Verifies the generated proofs for the zkEmail circuits. This command checks the validity of the cryptographic proofs. ```bash yarn verify-proofs ``` -------------------------------- ### Account Creation Circuit Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Verifies the creation of an account. It takes an email address, relayer's randomness, and account key as input, and outputs various hashes and commitments related to the account. ```Circom circuit account_creation { // Inputs: email_addr, relayer_rand, account_code // Outputs: relayer_rand_hash, pointer, ak_commit, account_salt, psi_point } ``` -------------------------------- ### Set New Owner via Email Wallet Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Illustrates setting a new owner for the Email Wallet, allowing the new owner to control the wallet by executing arbitrary calldata. ```Natural Language Exit Email Wallet. Set owner to 0x1ababab111... ``` -------------------------------- ### Mint NFTs via NFT Extension Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Shows how to use the NFT extension to mint NFTs, specifying the token ID and recipient. This enables NFT creation and transfer. ```Natural Language NFT Send 1337 of Punks to recipient@domain.com ``` -------------------------------- ### Swap Tokens via Uniswap Extension Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Illustrates using the Uniswap extension to swap one token for another. This allows for seamless token exchanges within the Email Wallet. ```Natural Language Swap 1 ETH to DAI ``` ```Natural Language Swap 1 DAI to ETH ``` -------------------------------- ### Set DKIM Registry via Email Wallet Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Demonstrates setting a custom DKIM registry for complete control over email verification within the Email Wallet. ```Natural Language DKIM registry set to 0x1ababab111... ``` -------------------------------- ### Announcement Circuit Definition Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Defines the announcement circuit in Circom, used to verify email address commitments. It takes the email address and randomness as input and outputs the commitment and packed email address integers. ```circom pragma circom 2.0.0; include "./node_modules/circomlib/circuits/sha256.circom"; include "./node_modules/circomlib/circuits/mimcsponge.circom"; // Circuit to verify that the given email address commitment is derived from the given email address and randomness. // It takes as input the following data: // 1. an email address `email_addr`. // 2. a randomness used for the email address commitment `cm_rand`. // Its instances are as follows: // 1. a packed integer of the email address `email_addr_ints`. // 2. an email address commitment `email_addr_commit`. // 3. a randomness used for the email address commitment `cm_rand`. contract EmailAddrCommit{ // Public inputs // email_addr: packed integer of the email address // cm_rand: randomness used for the email address commitment // Private inputs // email_addr_secret: the email address // Outputs // email_addr_commit: email address commitment // Constants // MAX_EMAIL_ADDR_LEN = 256; // Max length of email address // Components // mimcsponge: MiMC-sponge hash function // Logic // 1. Pack the email address into an integer `email_addr_ints`. // 2. Compute the commitment `email_addr_commit` using MiMC-sponge hash of `email_addr_ints` and `cm_rand`. // Example usage: // Assume email_addr_secret = "test@example.com" // Assume cm_rand = 123 // Then email_addr_ints = pack("test@example.com") // And email_addr_commit = mimcsponge(email_addr_ints, cm_rand) // Note: This is a simplified representation. The actual implementation involves more detailed packing and hashing logic. } ``` -------------------------------- ### Execute Calldata via Email Wallet Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Shows how to execute arbitrary calldata on a target contract using the Email Wallet. This enables interaction with any smart contract. ```Natural Language Execute 0xba7676a8..... ``` -------------------------------- ### Email Sender Circuit Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Verifies a user's email for calling a command. It processes email headers, public keys, signatures, and subject information to generate various email-related identifiers and commitments. ```Circom circuit email_sender { // Inputs: in_padded, pubkey, signature, in_padded_len, sender_relayer_rand, sender_email_idx, subject_idx, recipient_email_idx, domain_idx, timestamp_idx // Outputs: masked_subject_str, domain_name, pubkey_hash, sender_relayer_rand_hash, email_nullifier, sender_pointer, has_email_recipient, recipient_email_addr_commit, timestamp } ``` -------------------------------- ### Send ETH via Email Wallet Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Demonstrates sending Ether to an email address or an Ethereum address using the Email Wallet functionality. This is a core feature for transferring funds. ```Natural Language Send 1 ETH to friend@domain.com ``` ```Natural Language Send 2.5 ETH to 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 ``` -------------------------------- ### Claim Circuit Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Verifies the claim of unclaimed funds or states. It uses recipient email address, relayer's randomness, and a commitment randomness as input to generate related hashes and commitments. ```Circom circuit claim { // Inputs: recipient_email_addr, recipient_relayer_rand, cm_rand // Outputs: recipient_relayer_rand_hash, recipient_pointer, recipient_email_addr_commit } ``` -------------------------------- ### Account Transport Circuit Source: https://github.com/zkemail/email-wallet/blob/main/packages/circuits/README.md Verifies the transport of an account between different relayers. It handles email headers, public keys, signatures, and randomness hashes to manage account commitments. ```Circom circuit account_transport { // Inputs: in_padded, pubkey, signature, in_padded_len, old_relayer_rand_hash, new_relayer_rand, sender_email_idx, code_idx, domain_idx, timestamp_idx // Outputs: domain_name, pubkey_hash, email_nullifier, old_ak_commit, new_ak_commit, new_relayer_rand_hash, timestamp, old_relayer_rand_hash } ``` -------------------------------- ### Send ERC20 Tokens via Email Wallet Source: https://github.com/zkemail/email-wallet/blob/main/DESIGN.md Illustrates sending ERC20 tokens to an email address or an Ethereum address. This functionality allows for the transfer of various token types. ```Natural Language Send 1.5 DAI to friend@skiff.com ``` ```Natural Language Send 21.14 DAI to 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.