From 44f8db99bcbf0e91702b4cdd720fe87de30328a3 Mon Sep 17 00:00:00 2001 From: mhchia Date: Mon, 15 Jan 2024 23:23:53 +0800 Subject: [PATCH 1/7] feat: let user define computation in functions --- examples/computation/computation.ipynb | 657 +++++++++++++++++++++++++ examples/computation/data.json | 31 ++ zkstats/__init__.py | 0 zkstats/computation.py | 79 +++ zkstats/core.py | 27 +- zkstats/ops.py | 74 +++ 6 files changed, 845 insertions(+), 23 deletions(-) create mode 100644 examples/computation/computation.ipynb create mode 100644 examples/computation/data.json create mode 100644 zkstats/__init__.py create mode 100644 zkstats/computation.py create mode 100644 zkstats/ops.py diff --git a/examples/computation/computation.ipynb b/examples/computation/computation.ipynb new file mode 100644 index 0000000..3d17633 --- /dev/null +++ b/examples/computation/computation.ipynb @@ -0,0 +1,657 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: ezkl==7.0.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 1)) (7.0.0)\n", + "Requirement already satisfied: torch in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 2)) (2.1.1)\n", + "Requirement already satisfied: requests in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 3)) (2.31.0)\n", + "Requirement already satisfied: scipy in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 4)) (1.11.4)\n", + "Requirement already satisfied: numpy in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 5)) (1.26.2)\n", + "Requirement already satisfied: matplotlib in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 6)) (3.8.2)\n", + "Requirement already satisfied: statistics in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 7)) (1.0.3.5)\n", + "Requirement already satisfied: onnx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 8)) (1.15.0)\n", + "Requirement already satisfied: typing-extensions in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (4.8.0)\n", + "Requirement already satisfied: networkx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.2.1)\n", + "Requirement already satisfied: fsspec in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (2023.12.0)\n", + "Requirement already satisfied: filelock in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.13.1)\n", + "Requirement already satisfied: jinja2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.1.2)\n", + "Requirement already satisfied: sympy in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (1.12)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.3.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.6)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (2023.11.17)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (2.1.0)\n", + "Requirement already satisfied: importlib-resources>=3.2.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (6.1.1)\n", + "Requirement already satisfied: packaging>=20.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (23.2)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.4.5)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.2.0)\n", + "Requirement already satisfied: pillow>=8 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (10.1.0)\n", + "Requirement already satisfied: cycler>=0.10 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (4.46.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (2.8.2)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (3.1.1)\n", + "Requirement already satisfied: docutils>=0.3 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from statistics->-r ../../requirements.txt (line 7)) (0.20.1)\n", + "Requirement already satisfied: protobuf>=3.20.2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from onnx->-r ../../requirements.txt (line 8)) (4.25.1)\n", + "Requirement already satisfied: zipp>=3.1.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib->-r ../../requirements.txt (line 6)) (3.17.0)\n", + "Requirement already satisfied: six>=1.5 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->-r ../../requirements.txt (line 6)) (1.16.0)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from jinja2->torch->-r ../../requirements.txt (line 2)) (2.1.3)\n", + "Requirement already satisfied: mpmath>=0.19 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from sympy->torch->-r ../../requirements.txt (line 2)) (1.3.0)\n", + "\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.3.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.3.2\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "pip install -r ../../requirements.txt" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import ezkl\n", + "import torch\n", + "from torch import nn\n", + "import json\n", + "import os\n", + "import time\n", + "import scipy\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "import statistics\n", + "import math" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "%run -i ../../zkstats/core.py" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# init path\n", + "os.makedirs(os.path.dirname('shared/'), exist_ok=True)\n", + "os.makedirs(os.path.dirname('prover/'), exist_ok=True)\n", + "verifier_model_path = os.path.join('shared/verifier.onnx')\n", + "prover_model_path = os.path.join('prover/prover.onnx')\n", + "verifier_compiled_model_path = os.path.join('shared/verifier.compiled')\n", + "prover_compiled_model_path = os.path.join('prover/prover.compiled')\n", + "pk_path = os.path.join('shared/test.pk')\n", + "vk_path = os.path.join('shared/test.vk')\n", + "proof_path = os.path.join('shared/test.pf')\n", + "settings_path = os.path.join('shared/settings.json')\n", + "# srs_path = os.path.join('shared/kzg.srs')\n", + "witness_path = os.path.join('prover/witness.json')\n", + "# this is private to prover since it contains actual data\n", + "comb_data_path = os.path.join('prover/comb_data.json')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "======================= ZK-STATS FLOW =======================" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 1\n", + "Verifier calls `export_onnx` with dummy data, to generate the onnx model. Dummy data is used to infer the shape of the model\n", + "\n", + "### Output\n", + "- `verifier.onnx` file" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "!@# len(data)= 300\n" + ] + } + ], + "source": [ + "data_path = os.path.join('data.json')\n", + "dummy_data_path = os.path.join('shared/dummy_data.json')\n", + "\n", + "f_raw_input = open(data_path, \"r\")\n", + "data = json.loads(f_raw_input.read())[\"input_data\"][0]\n", + "print(\"!@# len(data)=\", len(data))\n", + "data_tensor = torch.reshape(torch.tensor(data),(1, len(data), 1))\n", + "\n", + "# dummy data for data consumer. Just need to be the same len as private data\n", + "dummy_data = np.round(np.random.uniform(1,10,len(data)),1)\n", + "json.dump({\"input_data\":[dummy_data.tolist()]}, open(dummy_data_path, 'w'))\n", + "\n", + "dummy_data_tensor = torch.reshape(torch.tensor(dummy_data), (1, len(dummy_data),1 ))\n", + "dummy_theory_output = torch.mean(dummy_data_tensor)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 2\n", + "- User defines their computation in a function with signature `computation(state: State, x: list[torch.Tensor])`.\n", + "- Prover calls `create_model(computation)` to derive the actual model.\n", + "- Prover calls `prover_gen_settings`: export onnx file and compute the settings required by `ezkl.calibrate_settings`" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/t3/5psrvr1x0w1_6n9kx2n7d9700000gn/T/ipykernel_29423/1578668560.py:8: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n", + " b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", + "/var/folders/t3/5psrvr1x0w1_6n9kx2n7d9700000gn/T/ipykernel_29423/1578668560.py:8: TracerWarning: Converting a tensor to a Python float might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!\n", + " b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", + "/Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages/torch/onnx/symbolic_opset9.py:2174: FutureWarning: 'torch.onnx.symbolic_opset9._cast_Bool' is deprecated in version 2.0 and will be removed in the future. Please Avoid using this function and create a Cast node instead.\n", + " return fn(g, to_cast_func(g, input, False), to_cast_func(g, other, False))\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "==== Generate & Calibrate Setting ====\n", + "scale: default\n", + "setting: {\"run_args\":{\"tolerance\":{\"val\":0.0,\"scale\":1.0},\"input_scale\":8,\"param_scale\":8,\"scale_rebase_multiplier\":10,\"lookup_range\":[-76800,153600],\"logrows\":18,\"num_inner_cols\":2,\"variables\":[[\"batch_size\",1]],\"input_visibility\":{\"Hashed\":{\"hash_is_public\":true,\"outlets\":[]}},\"output_visibility\":\"Public\",\"param_visibility\":\"Private\"},\"num_rows\":14432,\"total_assignments\":11438,\"total_const_size\":1213,\"model_instance_shapes\":[[300,1],[1]],\"model_output_scales\":[0,8],\"model_input_scales\":[8],\"module_sizes\":{\"kzg\":[],\"poseidon\":[14432,[1]],\"elgamal\":[0,[0]]},\"required_lookups\":[\"Abs\",{\"GreaterThan\":{\"a\":0.0}},\"KroneckerDelta\"],\"check_mode\":\"UNSAFE\",\"version\":\"7.0.0\",\"num_blinding_factors\":null}\n" + ] + } + ], + "source": [ + "from zkstats.computation import State, create_model\n", + "\n", + "\n", + "def computation(state: State, x: list[torch.Tensor]):\n", + " x = x[0]\n", + " b_0, out_0 = state.median(x)\n", + " b_1, out_1 = state.median(x)\n", + " b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", + " return torch.logical_and(torch.logical_and(b_0, b_1), b_2), out_2\n", + "\n", + "prover_model = create_model(computation)\n", + "prover_gen_settings([data_path], comb_data_path, prover_model, prover_model_path, \"default\", \"resources\", settings_path)\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 3\n", + "- Prover generates proof with `prover_gen_proof`:\n", + " - 1. Compile circuit with `compile_circuit`\n", + " - Inputs: onnx model, settings path\n", + " - Outputs: compiled \n", + " - 2. Generate witness with\n", + "- Verifier generates keys with " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "==== setting up ezkl ====\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "spawning module 0\n", + "spawning module 2\n", + "spawning module 0\n", + "spawning module 2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time setup: 57.55826187133789 seconds\n", + "=======================================\n", + "!@# compiled_model exists? True\n", + "!@# compiled_model exists? True\n", + "==== Generating Witness ====\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "spawning module 0\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "witness boolean: 1.0\n", + "witness result 1 : 49.55078125\n", + "==== Generating Proof ====\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "spawning module 2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "proof: {'instances': [[[3042937791208075219, 8157070662846698822, 3804781648660056856, 172406108020799675], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [18341455175509539295, 12796101019039945164, 1607286914885633240, 1929881192315725821]]], 'proof': '116dee6043db883556dc183eb028d3cb41d62c807ddb59e78e6d6d161f5cb057287687aef2921cea7e9a54188ae1ed7315a5d027cc5e7f936a551dbfa82dff80303a1d813238084e065f0e3e1ce59fd25a1d2f6ecc04a70b11cedcb07c4c32b91a3a2b210fd05fa6220368f7d44da1b2a58ff81b0127f5f295ff062dc384b4951f3630e3ab7f38044fdd96e54169e523f23394eb86c19fcb4dbd2ac3fe8e27370afd1e867a76372d3ffc8e21fb12284953cddc9d3fdd0b83be6c84a392154bfa0aaefed03f3b039ed1833e99a715f46b401abfdca0cf07a205feb44d1ba079ec1662ba4b0857d0df57658a0d255f2c83e8522650ff3f5d433c2b958aaf1064b71bd1ca3529d8b2a63a6672832ac8d910ae2ca83db7a916f3bc8966f692290ec509d4e5243e223d7bd1e9c89f685564c73185177bfdc1888a41e8dce8cda6236e1f05f56bd7ea4bc570fde5974fbc3f7817dc9a70ccf4a48d3f8fcf6e5f79a8db0b7c6f09dd3827fba0d675c18e0500af429c649def13b3e5971b3058dcf71c02131b15189cc670f202d1cb55f22d12b2c4d56f152f54441bee19ce8164539c572b5afea92adb3fd89d35d1e6a5081ce8a835f4767dce0dd41096845f82a14a5c2223e6f4cfeb5fbfa42a40a106338eb82ba2ca6eced9eaea25ab4baa62846e1b1456773c425133b5a03d754d8663f0ba007b8ccde9ce0e00a48c2a64fd91f20f09ebda43e6efdaf331fac048b8f8538a2b3d68a78b7f0a963e7d4f52d27bc61c2a247701277a88fc4e2060180f39472a291d7be203ffdc7fae161354c91505192bdcff75aa4704bb2e5723c1923e568e8771965d20505ce9e40b47cfb9facfc4149f0dac1f8e0ec95d584f0268cbefbb35ad2cb04954789ca702a57149c0fb8b1a91ade425522e8bd3fc62269ecba75b54e3ecb09c3cb857f03826224a5efcd62f7021a25815bf001bcf3e4778bbb50399bcde9b7a0f54dad1b39349659528c415117880effc281d631fabf3f36f6933ba27d0d20d313defd4351ed83fb0e6d324f55fd8b857437a201042571b0e296db8b3150f5c315aeb6d1434ce114ea2f7284c1b323f4768f29e682ccfc5653326dcbf64a29f2bde44cc2fbc9ba12925012122bfe072c0a9aa225e312cfbd01003cbd86a71f918957a7c06bc0182d85b4a044f1706c1f23da5de5ede7f2c94755837072e95961f8cc3f55cea9dab956fd22128c58a0a372ab53fe3c9760baaab094c2288f13d114db1e2455c7dfb8d9a520cbe6555dd663344a4cc8e9b21dc734a78f6b239dcb1390b9aa9f246023b23110b1772e571d06ef1fb46273007ff93f1ca51e2332cbb9838a1e5f1040fe9ee91104ed928bac385265dac0bc8a239f465b90739c5db51be002eaaabfbdb2a2a3d020f63de2099eb61d4e236d28438a0ac808d4ed1526584c22cc466ec82ff1a6a0f8ad1a65828c5de1516c0f31806c5b8211edc2708cb3c84b76092d758f1d6002946973de9de11600d27f81933454d618709c9f50be02b70119b913bd7668bb813d1564e1654f7a7742d07f02d5cb9dc24365089b7050445a416a05d84be36a9021a32d33d22b7d62c7b881216a614e4a06ce304cd05aa221fe7b1decf6b5a8b27a5f7637fe89ab5374a1ec28eb13c912dad8cad86f0a9e35d315c206f36f96d2ac3bb41e5c3ce45409914b8bd9cfb81fcb6d0ee3d7f411b208eda966144add504a9f8fb01fb39268e61df872b1715252694f02b35cd6bb3e673151927ed60c223f3d6892b110015423b1f6b11b6195803d662350cfcd8a922da8ddcda41f2ee12fdb5c92f81576439d12300b178fd29d84d92da7206c5e90c223ccd123050d60f91c46d4b4fdc5061fdd46762709bf2662253bd406a5ea5405a1ad8c0a498522da95265f50e91e5508cd38103b38ac8ab6c9146de74243a9c9fa5a627862dd71090955db15ea477f1193519d50ad1def6aa2ae11ed18d5029c839fb58fdd1370ca43148b2134056e7db67df78755f74127499ec6aae3a46bcc2f29d44f458ec20172292f598d8ab68a43f711a69b1ac71fbb87ae40c7659b0e6a0a42dd365242503da1e97c7f51c141238865717133fd166d1ccc0192df45f67c262e4d84b4d2e94f79df38db0e5fd5487ccedc2a9489f59d688c6ffd3032e466874df62140c299c505a38571ef189f0a499084ed53a23d90e381787c3949f538c91f5ec6b14204b25ddd8c85f0e58ff1603e87e6c6af839acc29e9025e5f5466f7eb1895f8b0f73e1daf63444512ef8afc43390ea64c1bbe47afc7abf39ba0338bce584c8ae022876b12224bf3ebcd25693df02bf6c6abd3890fb4775ef8109f277681e855721a5f1a8326308d6e9914d3ed3e8c7d63e755146961808da9acdf2d91957b44708d02a5f4f2adcc86ffa71b00ca60ccf30105611d1ceffdaa38f0211e12a01382881261e1abd4d20dbf4e2dd3feda30d183043499688035b99a322aa24c1be9b18c9b640fcb64e5356aaa27ea140682b3ab19448e2b1c13269127cbdf4297747163068e2f3dd70673b6f16a92a462efb53c62a2dd45269a64a72143ab88fc97e25bf958011c820693b1c4f0712fccbbbba432b0c00a729d8600973dc07570d3d19ee71396345ca5e7b07ddc690eb7f2e0d618beb5c08721f30942ffd6ccc76ab0b83d6109084d6d40e8ea2be5928ce6e28deff5e153a20eee0541fbb8852700714737590d26b5abc879f97916fca7553cc79c9ec774717665bee33219931e3b2209e4c89544fcb3fb1ab5326bba4952937aa3c5c8ce544865a18dea5493e123622b46298c3438df1313d400dfce48a512aa811eb3cd309882364f787718b22910f60cc6ded36318869113a8ca4c4ebaa66266da9ce0239b2250262ebba7287192e43bd87f8863681c90232b23cb0d9147360d237fb4ba3583a333f6f0203d1951d8f61e6b80b19977375c5649eca5b090c8687e737aa3c5f8fc2bd9fde46532300bbcccf89d7e3d68b941b1d4b335039945a0dad2b9a72d3933a8f4f43179bf010e04f2df91155976f914404b70b7665c131e682ba0f6776504d06a7052bd2212444597d720a8f4bc67799d2635e8bd36f81b991e3216d334f271f31e49cd28c0ff08083587d22bf1330161b59ca53e70b462af2b3a58041c020dfe8b17c23d908b10be80acafb6614cd32258516613de8dc418fc261e7dc3aa1e75297a5f17027b2a75554b9ac04fb5600d5563f19220497d30d7f6d991cb7c2fb72c472cd5807c729d8452538f22aa5189f6ac0b93db6fe7249b16e8a48f976c31bbe9fe253273afcbea69d2e1c0ad90fd284d8a54468973c8b2eb9d8c4dbdd3fb73d4bd923282ced059f88a36d878ae30ab66fab6750a367513c0dfbe0da8f71ca6bdde8731042e19a07ab1a575f759058123b0d2bcaa2229d127f202639bc79629b1ab6aa28ce2f1db1d0c035e449c2a39e6b7cfc9e87b503d1de90126812c50ecb28c6b0102fc6e146a0b85680e8fc8b44d46238dcc060f82264ea3ac2a6fa4390d55a7c2b8771c4a4de958fc55404737b2a39924c456e5d0c113d2567d1aca7612bbce60bb6c53a542626c59aec7b6e40d1a461623330dfa31785b0ddd582f5183a1bd41ed4f46eadbb1b66083fd8a8d7bb9f6bd9f20487c0dc4322772e4afe7f20749d2274b5d222512638337f9af13397756770fc65b620856a233fc0379c5b4f466b138e0b2ddf785e99963d553311ca738605e955eac90c07113f96cb53e2a5a66123c0073d9e4758f9bd1012b92a54498e8ad9c8eb33bc288c338bea62cd81de8923c0073d9e4758f9bd1012b92a54498e8ad9c8eb33bc288c338bea62cd81de8913c9888bb971794c4d5dc13d88b248a02b3d5be3f1eb030b8ce5571d4415d7840048ff4150c43ebd424c30fef791e51d104704f711c7f97c37e823a7ae0b5ea02909d0680a40eabefd571aa0a6a04d0754043ba19336abd958b01e86dba9bcda00000000000000000000000000000000000000000000000000000000000000000685efaa09718888fc4853f8326fb3573c5f4b0e58c956f3942808e5301fb1d005d9c4aa08eeafe89344fe1fb9fd6dab2f1b429d9dc83629af0a66718ead3dc42fbf57eeb14d2c1d76008553880e6099aa73c66b03c88074d4f717e7e22486060dc91dd99632d849dd2e0dc0805f0ce7dfc438778ea03398cf6b53db8bc64c86111f8c1ffdb68edca77aa5dc98d88a6799eca6045fe8ff2ae1f2aa13997578992033f660f6f7e57522870cb111a8e99c525b2d41f4dc70d63995fa224c219846258f953c2dd910986c4aa2a235a241dd5fe3d86a8db40349513d6d3c606d34021547d1ae84b40a3bb1de2c7aa925a7defa475877837ff1c43e668eb4348c5865254660388f393a140bb2b82c66180511e0283b4e53aeeb1ac8bc754cadd6023d25fd5975a2bc1d22762be2a2a3c1cb3ec8b4f79a6768c820c0c6c482736453f22b25e38f6c75ac3caab493aa8e53e8d51778e05a59405d0ef49bf33ad17a9ede279ec9ecdec622e7c72807260f7917d2076197982db58688604e71ec1a0a5d0b21509c144675bd52761c3205705146894c205888801f493eff4898c58e68ed2b1a688ff6d06b24d6bcdf3c87b51789c7cd08a2c912f0cfbac104e837b75fe117185a39094c84cb19bdd1304c483c8e82a38d7e0e0553ac4007ed8bcd3af0f5ed092bf95a9cd0526b1fba52d50150b3aa8fd6ae498c750ebf2d4aa19457166b8d015e9c656650d69a43e6310e8ca2618ea7a530e98398cfa2793da42426ea9b1b0d3e8923d7273ec6d7b085b3df007537d13fd2cb81b15bf1866b28f2f28974af07e46873c7eef5f8e46dc5032812d7f30d3c0a800abaafbbfa73c0f88139a1632af4734c1755d8e23c11512c59bf53780f5a927ba733fd2c2813e1afb7b39f1e15dfd7a07fa475c1382112129be732f2966257870d4e9159ed3b6d49e5a1506e203d1ba94e36833424058c218be2c6f3ef1320f97eb91f1ffd8db325c1691bb11a0eb44be4fde844eba169532b5f87231beeb8160221de20c6f0c8132db8c45107bc2c183acd3c8edf095d1b8f820f834cbc4a900e8788ef81773f2c0177d66c22f1037c9aad10032d376b045d7e171f9e5e5a6996bb6535412e12c9a1a890b81591d12fb33b658e119e8a8e72fe36fceccaed3ae2df6609542e4b0033a1acde161af7b749bb411d0f6cd39fcb8e0ba69725eadf2da3c935eac939b801c9f365238c07ddf0a3f7e9dbbe8f538f39386ebcd06fb4d9788dc07c320a5128f0d4cf1ecebc4b3b32a0ad1f325135250464e605f81d373b2eeb5367ffdaa7705be8671f9738e90bdfd8fb3ecaf5f69fdeff8d1e2fc712179fab7a36e66f9d14fed40c1a0d75b770c18de640cab1e14df0e15d2425e18b6a9e8a88f3cd51c60d4ebc8e169913738d8abd5e6962d11224f552bb971512591d2d71abf23c8b60f7ee0adf0d6ecf277a86cca110a281e382fbe9a544b808f203c470b2d2b3b3978d7b51ea304dff37fc52fe18a6948c7d70aee4a5ac3be1e6b6874d8cd50a5d1c9873786a27d347a334fdd8e683dc27a0e56b8ec1175ba7e82903ab6f7a13f880b3f832d002fa9c0c8c28aa20bdc80d571206395dc4a2c0e3fe400c0549d2c80ddec2cf7c02fff7a168c303a20ba5eced23c3f5e16322c104a0066788ba0702dba8b0de0a09e9ed943b70da1b1ced53ad8a48eb42dc70bf7a5fb2ad8528015e471d8714e01b722b1a5bbecd5d8798682fab263f45afd413e9b644cb977ac64e920a36483f01e102dd45f62a8d5c58c8779430918fe2a88db7e2a0b3bb666cbf93fb7b988c1cc0966c9a618d1a56c16300bbd73151cf0d17a7994b62bce62182eecdc87668283c5c14a9299194afa5749029a94cb89b97a9aa87b8670e30a51af1158f9e61059b8b7e50fdeebf5ab568aaf4a925ea30cad8afc77e7b054e92abb3c625a78f2ebd273ff763503377570bf71d402bf070f941efb9d8bb221f0ae42b97079f1c090fb2b207461658136bdfcf3872f3e045c0eefe273ae3da5e85fb72b50395ba17851d7f6020dcc3f293098d3ad60738393c30056db07612e8a50c96ab01f6b02af836f6b6d7926a72d8edf4ea5cc391bb7d3bb161bc2fc90bcbd23311f19c3b0e2fcb0db3efb6e19cea49f3db05f1b2660dde83c02c549f73f923ca07be4d882248fb8bf81b14d8253b81030c29c626c1082e4dc05571d8517500849d4b2a3e2d08d75cd923d94520b1767cc3cfbfac36e1b64b492b5f4d8f3c423da231881727ccac9f0525e8784a72e59336b9652ad1bf4ef2a6ce777669b6f207944f5c7e', 'transcript_type': 'EVM'}\n", + "Time gen prf: 79.79581594467163 seconds\n" + ] + } + ], + "source": [ + "# Here verifier & prover can concurrently call setup since all params are public to get pk.\n", + "# Here write as verifier function to emphasize that verifier must calculate its own vk to be sure\n", + "verifier_setup(prover_model_path, prover_compiled_model_path, settings_path, vk_path, pk_path )\n", + "\n", + "print(\"=======================================\")\n", + "# Prover generates proof\n", + "# print(\"Theory output: \", theory_output)\n", + "prover_gen_proof(prover_model_path, comb_data_path, witness_path, prover_compiled_model_path, settings_path, proof_path, pk_path)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "num_inputs: 1\n", + "prf instances: [[[3042937791208075219, 8157070662846698822, 3804781648660056856, 172406108020799675], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [18341455175509539295, 12796101019039945164, 1607286914885633240, 1929881192315725821]]]\n", + "proof boolean: 1.0\n", + "proof result 1 : 0.00390625\n", + "proof result 2 : 0.00390625\n", + "proof result 3 : 0.00390625\n", + "proof result 4 : 0.00390625\n", + "proof result 5 : 0.00390625\n", + "proof result 6 : 0.00390625\n", + "proof result 7 : 0.00390625\n", + "proof result 8 : 0.00390625\n", + "proof result 9 : 0.00390625\n", + "proof result 10 : 0.00390625\n", + "proof result 11 : 0.00390625\n", + "proof result 12 : 0.00390625\n", + "proof result 13 : 0.00390625\n", + "proof result 14 : 0.00390625\n", + "proof result 15 : 0.00390625\n", + "proof result 16 : 0.00390625\n", + "proof result 17 : 0.00390625\n", + "proof result 18 : 0.00390625\n", + "proof result 19 : 0.00390625\n", + "proof result 20 : 0.00390625\n", + "proof result 21 : 0.00390625\n", + "proof result 22 : 0.00390625\n", + "proof result 23 : 0.00390625\n", + "proof result 24 : 0.00390625\n", + "proof result 25 : 0.00390625\n", + "proof result 26 : 0.00390625\n", + "proof result 27 : 0.00390625\n", + "proof result 28 : 0.00390625\n", + "proof result 29 : 0.00390625\n", + "proof result 30 : 0.00390625\n", + "proof result 31 : 0.00390625\n", + "proof result 32 : 0.00390625\n", + "proof result 33 : 0.00390625\n", + "proof result 34 : 0.00390625\n", + "proof result 35 : 0.00390625\n", + "proof result 36 : 0.00390625\n", + "proof result 37 : 0.00390625\n", + "proof result 38 : 0.00390625\n", + "proof result 39 : 0.00390625\n", + "proof result 40 : 0.00390625\n", + "proof result 41 : 0.00390625\n", + "proof result 42 : 0.00390625\n", + "proof result 43 : 0.00390625\n", + "proof result 44 : 0.00390625\n", + "proof result 45 : 0.00390625\n", + "proof result 46 : 0.00390625\n", + "proof result 47 : 0.00390625\n", + "proof result 48 : 0.00390625\n", + "proof result 49 : 0.00390625\n", + "proof result 50 : 0.00390625\n", + "proof result 51 : 0.00390625\n", + "proof result 52 : 0.00390625\n", + "proof result 53 : 0.00390625\n", + "proof result 54 : 0.00390625\n", + "proof result 55 : 0.00390625\n", + "proof result 56 : 0.00390625\n", + "proof result 57 : 0.00390625\n", + "proof result 58 : 0.00390625\n", + "proof result 59 : 0.00390625\n", + "proof result 60 : 0.00390625\n", + "proof result 61 : 0.00390625\n", + "proof result 62 : 0.00390625\n", + "proof result 63 : 0.00390625\n", + "proof result 64 : 0.00390625\n", + "proof result 65 : 0.00390625\n", + "proof result 66 : 0.00390625\n", + "proof result 67 : 0.00390625\n", + "proof result 68 : 0.00390625\n", + "proof result 69 : 0.00390625\n", + "proof result 70 : 0.00390625\n", + "proof result 71 : 0.00390625\n", + "proof result 72 : 0.00390625\n", + "proof result 73 : 0.00390625\n", + "proof result 74 : 0.00390625\n", + "proof result 75 : 0.00390625\n", + "proof result 76 : 0.00390625\n", + "proof result 77 : 0.00390625\n", + "proof result 78 : 0.00390625\n", + "proof result 79 : 0.00390625\n", + "proof result 80 : 0.00390625\n", + "proof result 81 : 0.00390625\n", + "proof result 82 : 0.00390625\n", + "proof result 83 : 0.00390625\n", + "proof result 84 : 0.00390625\n", + "proof result 85 : 0.00390625\n", + "proof result 86 : 0.00390625\n", + "proof result 87 : 0.00390625\n", + "proof result 88 : 0.00390625\n", + "proof result 89 : 0.00390625\n", + "proof result 90 : 0.00390625\n", + "proof result 91 : 0.00390625\n", + "proof result 92 : 0.00390625\n", + "proof result 93 : 0.00390625\n", + "proof result 94 : 0.00390625\n", + "proof result 95 : 0.00390625\n", + "proof result 96 : 0.00390625\n", + "proof result 97 : 0.00390625\n", + "proof result 98 : 0.00390625\n", + "proof result 99 : 0.00390625\n", + "proof result 100 : 0.00390625\n", + "proof result 101 : 0.00390625\n", + "proof result 102 : 0.00390625\n", + "proof result 103 : 0.00390625\n", + "proof result 104 : 0.00390625\n", + "proof result 105 : 0.00390625\n", + "proof result 106 : 0.00390625\n", + "proof result 107 : 0.00390625\n", + "proof result 108 : 0.00390625\n", + "proof result 109 : 0.00390625\n", + "proof result 110 : 0.00390625\n", + "proof result 111 : 0.00390625\n", + "proof result 112 : 0.00390625\n", + "proof result 113 : 0.00390625\n", + "proof result 114 : 0.00390625\n", + "proof result 115 : 0.00390625\n", + "proof result 116 : 0.00390625\n", + "proof result 117 : 0.00390625\n", + "proof result 118 : 0.00390625\n", + "proof result 119 : 0.00390625\n", + "proof result 120 : 0.00390625\n", + "proof result 121 : 0.00390625\n", + "proof result 122 : 0.00390625\n", + "proof result 123 : 0.00390625\n", + "proof result 124 : 0.00390625\n", + "proof result 125 : 0.00390625\n", + "proof result 126 : 0.00390625\n", + "proof result 127 : 0.00390625\n", + "proof result 128 : 0.00390625\n", + "proof result 129 : 0.00390625\n", + "proof result 130 : 0.00390625\n", + "proof result 131 : 0.00390625\n", + "proof result 132 : 0.00390625\n", + "proof result 133 : 0.00390625\n", + "proof result 134 : 0.00390625\n", + "proof result 135 : 0.00390625\n", + "proof result 136 : 0.00390625\n", + "proof result 137 : 0.00390625\n", + "proof result 138 : 0.00390625\n", + "proof result 139 : 0.00390625\n", + "proof result 140 : 0.00390625\n", + "proof result 141 : 0.00390625\n", + "proof result 142 : 0.00390625\n", + "proof result 143 : 0.00390625\n", + "proof result 144 : 0.00390625\n", + "proof result 145 : 0.00390625\n", + "proof result 146 : 0.00390625\n", + "proof result 147 : 0.00390625\n", + "proof result 148 : 0.00390625\n", + "proof result 149 : 0.00390625\n", + "proof result 150 : 0.00390625\n", + "proof result 151 : 0.00390625\n", + "proof result 152 : 0.00390625\n", + "proof result 153 : 0.00390625\n", + "proof result 154 : 0.00390625\n", + "proof result 155 : 0.00390625\n", + "proof result 156 : 0.00390625\n", + "proof result 157 : 0.00390625\n", + "proof result 158 : 0.00390625\n", + "proof result 159 : 0.00390625\n", + "proof result 160 : 0.00390625\n", + "proof result 161 : 0.00390625\n", + "proof result 162 : 0.00390625\n", + "proof result 163 : 0.00390625\n", + "proof result 164 : 0.00390625\n", + "proof result 165 : 0.00390625\n", + "proof result 166 : 0.00390625\n", + "proof result 167 : 0.00390625\n", + "proof result 168 : 0.00390625\n", + "proof result 169 : 0.00390625\n", + "proof result 170 : 0.00390625\n", + "proof result 171 : 0.00390625\n", + "proof result 172 : 0.00390625\n", + "proof result 173 : 0.00390625\n", + "proof result 174 : 0.00390625\n", + "proof result 175 : 0.00390625\n", + "proof result 176 : 0.00390625\n", + "proof result 177 : 0.00390625\n", + "proof result 178 : 0.00390625\n", + "proof result 179 : 0.00390625\n", + "proof result 180 : 0.00390625\n", + "proof result 181 : 0.00390625\n", + "proof result 182 : 0.00390625\n", + "proof result 183 : 0.00390625\n", + "proof result 184 : 0.00390625\n", + "proof result 185 : 0.00390625\n", + "proof result 186 : 0.00390625\n", + "proof result 187 : 0.00390625\n", + "proof result 188 : 0.00390625\n", + "proof result 189 : 0.00390625\n", + "proof result 190 : 0.00390625\n", + "proof result 191 : 0.00390625\n", + "proof result 192 : 0.00390625\n", + "proof result 193 : 0.00390625\n", + "proof result 194 : 0.00390625\n", + "proof result 195 : 0.00390625\n", + "proof result 196 : 0.00390625\n", + "proof result 197 : 0.00390625\n", + "proof result 198 : 0.00390625\n", + "proof result 199 : 0.00390625\n", + "proof result 200 : 0.00390625\n", + "proof result 201 : 0.00390625\n", + "proof result 202 : 0.00390625\n", + "proof result 203 : 0.00390625\n", + "proof result 204 : 0.00390625\n", + "proof result 205 : 0.00390625\n", + "proof result 206 : 0.00390625\n", + "proof result 207 : 0.00390625\n", + "proof result 208 : 0.00390625\n", + "proof result 209 : 0.00390625\n", + "proof result 210 : 0.00390625\n", + "proof result 211 : 0.00390625\n", + "proof result 212 : 0.00390625\n", + "proof result 213 : 0.00390625\n", + "proof result 214 : 0.00390625\n", + "proof result 215 : 0.00390625\n", + "proof result 216 : 0.00390625\n", + "proof result 217 : 0.00390625\n", + "proof result 218 : 0.00390625\n", + "proof result 219 : 0.00390625\n", + "proof result 220 : 0.00390625\n", + "proof result 221 : 0.00390625\n", + "proof result 222 : 0.00390625\n", + "proof result 223 : 0.00390625\n", + "proof result 224 : 0.00390625\n", + "proof result 225 : 0.00390625\n", + "proof result 226 : 0.00390625\n", + "proof result 227 : 0.00390625\n", + "proof result 228 : 0.00390625\n", + "proof result 229 : 0.00390625\n", + "proof result 230 : 0.00390625\n", + "proof result 231 : 0.00390625\n", + "proof result 232 : 0.00390625\n", + "proof result 233 : 0.00390625\n", + "proof result 234 : 0.00390625\n", + "proof result 235 : 0.00390625\n", + "proof result 236 : 0.00390625\n", + "proof result 237 : 0.00390625\n", + "proof result 238 : 0.00390625\n", + "proof result 239 : 0.00390625\n", + "proof result 240 : 0.00390625\n", + "proof result 241 : 0.00390625\n", + "proof result 242 : 0.00390625\n", + "proof result 243 : 0.00390625\n", + "proof result 244 : 0.00390625\n", + "proof result 245 : 0.00390625\n", + "proof result 246 : 0.00390625\n", + "proof result 247 : 0.00390625\n", + "proof result 248 : 0.00390625\n", + "proof result 249 : 0.00390625\n", + "proof result 250 : 0.00390625\n", + "proof result 251 : 0.00390625\n", + "proof result 252 : 0.00390625\n", + "proof result 253 : 0.00390625\n", + "proof result 254 : 0.00390625\n", + "proof result 255 : 0.00390625\n", + "proof result 256 : 0.00390625\n", + "proof result 257 : 0.00390625\n", + "proof result 258 : 0.00390625\n", + "proof result 259 : 0.00390625\n", + "proof result 260 : 0.00390625\n", + "proof result 261 : 0.00390625\n", + "proof result 262 : 0.00390625\n", + "proof result 263 : 0.00390625\n", + "proof result 264 : 0.00390625\n", + "proof result 265 : 0.00390625\n", + "proof result 266 : 0.00390625\n", + "proof result 267 : 0.00390625\n", + "proof result 268 : 0.00390625\n", + "proof result 269 : 0.00390625\n", + "proof result 270 : 0.00390625\n", + "proof result 271 : 0.00390625\n", + "proof result 272 : 0.00390625\n", + "proof result 273 : 0.00390625\n", + "proof result 274 : 0.00390625\n", + "proof result 275 : 0.00390625\n", + "proof result 276 : 0.00390625\n", + "proof result 277 : 0.00390625\n", + "proof result 278 : 0.00390625\n", + "proof result 279 : 0.00390625\n", + "proof result 280 : 0.00390625\n", + "proof result 281 : 0.00390625\n", + "proof result 282 : 0.00390625\n", + "proof result 283 : 0.00390625\n", + "proof result 284 : 0.00390625\n", + "proof result 285 : 0.00390625\n", + "proof result 286 : 0.00390625\n", + "proof result 287 : 0.00390625\n", + "proof result 288 : 0.00390625\n", + "proof result 289 : 0.00390625\n", + "proof result 290 : 0.00390625\n", + "proof result 291 : 0.00390625\n", + "proof result 292 : 0.00390625\n", + "proof result 293 : 0.00390625\n", + "proof result 294 : 0.00390625\n", + "proof result 295 : 0.00390625\n", + "proof result 296 : 0.00390625\n", + "proof result 297 : 0.00390625\n", + "proof result 298 : 0.00390625\n", + "proof result 299 : 0.00390625\n", + "proof result 300 : 49.55078125\n", + "verified\n" + ] + } + ], + "source": [ + "# Verifier verifies\n", + "verifier_verify(proof_path, settings_path, vk_path)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/examples/computation/data.json b/examples/computation/data.json new file mode 100644 index 0000000..15cd182 --- /dev/null +++ b/examples/computation/data.json @@ -0,0 +1,31 @@ +{ + "input_data": [ + [ + 23.2, 92.8, 91.0, 37.2, 82.0, 15.5, 79.3, 46.6, 98.1, 75.5, 78.9, 77.6, + 33.8, 75.7, 96.8, 12.3, 18.4, 13.4, 6.0, 8.2, 25.8, 41.3, 68.5, 15.2, + 74.7, 72.7, 18.0, 42.2, 36.1, 76.7, 1.2, 96.4, 4.9, 92.0, 12.8, 28.2, + 61.8, 56.9, 44.3, 50.4, 81.6, 72.5, 12.9, 40.3, 12.8, 28.8, 36.3, 16.1, + 68.4, 35.3, 79.2, 48.4, 97.1, 93.7, 77.0, 48.7, 93.7, 54.1, 65.4, 30.8, + 34.4, 31.4, 78.7, 12.7, 90.7, 39.4, 86.0, 55.9, 6.8, 22.2, 65.3, 18.8, + 7.1, 55.9, 38.6, 15.6, 59.2, 77.3, 76.9, 11.9, 19.9, 19.4, 54.3, 39.4, + 4.0, 61.1, 16.8, 81.9, 49.3, 76.9, 19.2, 68.2, 54.4, 70.2, 89.8, 23.4, + 67.5, 18.7, 10.8, 80.7, 80.3, 96.2, 62.3, 17.2, 23.0, 98.0, 19.1, 8.1, + 36.2, 7.5, 55.9, 1.2, 56.8, 85.1, 18.9, 23.0, 13.5, 64.3, 9.1, 14.1, 14.1, + 23.1, 73.2, 86.6, 39.1, 45.5, 85.0, 79.0, 15.8, 5.2, 81.5, 34.3, 24.3, + 14.2, 84.6, 33.7, 86.3, 83.3, 62.8, 72.7, 14.7, 36.8, 92.5, 4.7, 30.0, + 59.4, 57.6, 37.4, 22.0, 20.9, 61.6, 26.8, 47.1, 63.6, 6.0, 96.6, 61.2, + 80.2, 59.3, 23.1, 29.3, 46.3, 89.2, 77.6, 83.2, 87.2, 63.2, 81.8, 55.0, + 59.7, 57.8, 43.4, 92.4, 66.9, 82.1, 51.0, 22.1, 29.9, 41.0, 85.2, 61.5, + 14.6, 48.0, 52.7, 31.4, 83.9, 35.5, 77.3, 35.8, 32.6, 22.2, 19.3, 49.1, + 70.9, 43.9, 88.8, 56.3, 41.8, 90.3, 20.4, 80.4, 36.4, 91.5, 69.6, 75.3, + 92.4, 84.8, 17.7, 2.3, 41.3, 91.3, 68.6, 73.3, 62.5, 60.5, 73.5, 70.7, + 77.5, 76.8, 98.1, 40.9, 66.3, 8.6, 48.9, 75.4, 14.7, 35.9, 89.6, 15.1, + 45.0, 77.6, 30.5, 76.1, 46.9, 34.3, 65.1, 43.9, 91.6, 88.8, 8.9, 42.9, + 11.8, 32.1, 20.1, 48.9, 79.7, 15.3, 45.4, 80.1, 73.1, 76.5, 52.4, 9.6, + 41.9, 52.7, 55.1, 30.9, 83.7, 46.7, 39.3, 40.5, 52.4, 19.2, 25.8, 52.7, + 81.0, 38.0, 54.5, 15.3, 64.3, 88.3, 49.8, 90.5, 90.4, 79.7, 87.3, 32.3, + 11.9, 5.7, 33.6, 75.1, 65.9, 29.1, 39.4, 87.5, 3.3, 66.3, 79.0, 97.9, + 69.6, 22.0, 62.8, 97.1, 90.4, 39.5, 11.7, 30.3, 18.9, 34.6, 6.6 + ] + ] +} diff --git a/zkstats/__init__.py b/zkstats/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/zkstats/computation.py b/zkstats/computation.py new file mode 100644 index 0000000..0041316 --- /dev/null +++ b/zkstats/computation.py @@ -0,0 +1,79 @@ +from abc import abstractmethod +from typing import Callable, Type + +import torch +from torch import nn + +from .ops import Operation, Mean, Median, IsResultPrecise + + +DEFAULT_ERROR = 0.01 + + +class State: + """ + State is a container for intermediate results of computation. + + Stage 1 (is_exporting_onnx = False): for every call to State (mean, median, etc.), result + is calculated and temporarily stored in the state. Call `set_ready_for_exporting_onnx` to indicate + Stage 2: all operations are calculated and results are ready to be used. Call `set_ready_for_exporting_onnx` + to indicate it's ready to generate settings. + Stage 3 (is_exporting_onnx = True): when exporting to onnx, when the operations are called, the results and + the conditions are popped from the state and filled in the onnx graph. + """ + def __init__(self, error = DEFAULT_ERROR) -> None: + self.ops: list[Operation] = [] + self.error: float = error + self.is_exporting_onnx = False + + def set_ready_for_exporting_onnx(self) -> None: + self.is_exporting_onnx = True + + def mean(self, X: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: + return self._call_op(X, Mean) + + def median(self, X: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: + return self._call_op(X, Median) + + # TODO: add the rest of the operations + + def _call_op(self, x: torch.Tensor, op_type: Type[Operation]) -> tuple[IsResultPrecise, torch.Tensor]: + if self.is_exporting_onnx is False: + op = op_type.create(x, self.error) + self.ops.append(op) + return torch.tensor(1), op.result + else: + op = self.ops.pop(0) + if not isinstance(op, op_type): + raise Exception(f"operation type mismatch: {op_type=} != {type(op)=}") + return op.ezkl(x), op.result + + +class IModel(nn.Module): + @abstractmethod + def preprocess(self, x: list[torch.Tensor]) -> None: + ... + + @abstractmethod + def forward(self, *x: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: + ... + + + +TComputation = Callable[[State, list[torch.Tensor]], tuple[IsResultPrecise, torch.Tensor]] + + +def create_model(computation: TComputation) -> Type[nn.Module]: + """ + """ + state = State() + + class Model(nn.Module): + def preprocess(self, x: list[torch.Tensor]) -> None: + computation(state, x) + state.set_ready_for_exporting_onnx() + + def forward(self, *x: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: + return computation(state, x) + + return Model diff --git a/zkstats/core.py b/zkstats/core.py index 6a2cb62..2b9b6a8 100644 --- a/zkstats/core.py +++ b/zkstats/core.py @@ -9,33 +9,14 @@ import json import time - -def load_model(module_path: str) -> Type[torch.nn.Module]: - """ - Load a model from a Python module. - """ - # FIXME: This is unsafe since malicious code can be executed - - model_name = "Model" - module_name = os.path.splitext(os.path.basename(module_path))[0] - spec = importlib.util.spec_from_file_location(module_name, module_path) - module = importlib.util.module_from_spec(spec) - sys.modules[module_name] = module - spec.loader.exec_module(module) - - try: - cls = getattr(module, model_name) - except AttributeError: - raise ImportError(f"class {model_name} does not exist in {module_name}") - return cls +from zkstats.computation import IModel # Export model -def export_onnx(model, data_tensor_array, model_loc): +def export_onnx(model: Type[IModel], data_tensor_array: list[Tensor], model_loc: str): circuit = model() - # Try running `prepare()` if it exists try: - circuit.prepare(data_tensor_array) + circuit.preprocess(data_tensor_array) except AttributeError: pass @@ -131,7 +112,7 @@ def process_data(data_path_array, comb_data_path) -> list[Tensor]: return data_tensor_array # we decide to not have comb_data_path as parameter since a bit redundant parameter. -def prover_gen_settings(data_path_array, comb_data_path, prover_model,prover_model_path, scale, mode, settings_path): +def prover_gen_settings(data_path_array, comb_data_path, prover_model, prover_model_path, scale, mode, settings_path): data_tensor_array = process_data(data_path_array, comb_data_path) # export onnx file diff --git a/zkstats/ops.py b/zkstats/ops.py new file mode 100644 index 0000000..e8c0277 --- /dev/null +++ b/zkstats/ops.py @@ -0,0 +1,74 @@ +from abc import ABC, abstractmethod, abstractclassmethod + + +import numpy as np +import torch + + +# boolean: either 1.0 or 0.0 +IsResultPrecise = torch.Tensor + + +class Operation(ABC): + def __init__(self, result: torch.Tensor, error: float): + self.result = result + self.error = error + + @abstractclassmethod + def create(cls, x: torch.Tensor, error: float) -> 'Operation': + ... + + @abstractmethod + def ezkl(self, x: torch.Tensor) -> IsResultPrecise: + ... + + +class Mean(Operation): + @classmethod + def create(cls, x: torch.Tensor, error: float) -> 'Mean': + return cls(torch.mean(x), error) + + def ezkl(self, X: torch.Tensor) -> IsResultPrecise: + size = X.size() + return torch.abs(torch.sum(X)-size[1]*self.result)<=torch.abs(self.error*size[1]*self.result) + + +class Median(Operation): + def __init__(self, x: torch.Tensor, error: float): + super().__init__(torch.tensor(np.median(x)), error) + sorted_x = np.sort(x) + len_x = len(x) + self.lower = torch.tensor(sorted_x[int(len_x/2)-1]) + self.upper = torch.tensor(sorted_x[int(len_x/2)]) + + @classmethod + def create(cls, x: torch.Tensor, error: float) -> 'Median': + return cls(x, error) + + def ezkl(self, X: torch.Tensor) -> IsResultPrecise: + # since within 1%, we regard as same value + count_less = torch.sum((X < (1-self.error)*self.result).double()) + count_equal = torch.sum((torch.abs(X-self.result)<=torch.abs(self.error*self.result)).double()) + size = X.size()[1] + half_len = torch.floor(torch.div(size, 2)) + + # not support modulo yet + less_cons = count_lesshalf_len + + # For count_equal == 0 + lower_exist = torch.sum((torch.abs(X-self.lower)<=torch.abs(self.error*self.lower)).double())>0 + lower_cons = torch.sum((X>(1+self.error)*self.lower).double())==half_len + upper_exist = torch.sum((torch.abs(X-self.upper)<=torch.abs(self.error*self.upper)).double())>0 + upper_cons = torch.sum((X<(1-self.error)*self.upper).double())==half_len + bound = count_less==half_len + # 0.02 since 2*0.01 + bound_avg = (torch.abs(self.lower+self.upper-2*self.result)<=torch.abs(2*self.error*self.result)) + + median_in_cons = torch.logical_and(less_cons, more_cons) + median_out_cons = torch.logical_and(torch.logical_and(bound, bound_avg), torch.logical_and(torch.logical_and(lower_cons, upper_cons), torch.logical_and(lower_exist, upper_exist))) + + return torch.where(count_equal==0, median_out_cons, median_in_cons) + + +# TODO: add the rest of the operations From ea2612d939e2f93cb54bcba9548200d672c76d05 Mon Sep 17 00:00:00 2001 From: mhchia Date: Mon, 15 Jan 2024 23:40:24 +0800 Subject: [PATCH 2/7] feat: remove unused models and add comments --- zkstats/computation.py | 8 +++++++ zkstats/models.py | 49 ------------------------------------------ 2 files changed, 8 insertions(+), 49 deletions(-) delete mode 100644 zkstats/models.py diff --git a/zkstats/computation.py b/zkstats/computation.py index 0041316..88d7e2c 100644 --- a/zkstats/computation.py +++ b/zkstats/computation.py @@ -60,11 +60,19 @@ def forward(self, *x: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: +# An computation function. Example: +# def computation(state: State, x: list[torch.Tensor]): +# b_0, out_0 = state.median(x[0]) +# b_1, out_1 = state.median(x[1]) +# b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1)) +# return torch.logical_and(torch.logical_and(b_0, b_1), b_2), out_2 TComputation = Callable[[State, list[torch.Tensor]], tuple[IsResultPrecise, torch.Tensor]] + def create_model(computation: TComputation) -> Type[nn.Module]: """ + Create a torch model from a `computation` function defined by user """ state = State() diff --git a/zkstats/models.py b/zkstats/models.py deleted file mode 100644 index 4d48afc..0000000 --- a/zkstats/models.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Any -from abc import ABC, abstractmethod -from torch import nn -import torch - - -class BaseZKStatsModel(ABC, nn.Module): - def __init__(self): - super().__init__() - - @abstractmethod - def forward(self, X: Any) -> Any: - """ - :param X: a tensor of shape (1, n, 1) - :return: a tuple of (bool, float) - """ - - -class NoDivisionModel(BaseZKStatsModel): - def __init__(self): - super().__init__() - # w represents mean in this case - - @abstractmethod - def prepare(expected_output: Any): - ... - - @abstractmethod - def forward(self, X: Any) -> tuple[float, float]: - # some expression of tolerance to error in the inference - # must have w first! - ... - -class MeanModel(NoDivisionModel): - def __init__(self): - super().__init__() - - def prepare(self, X: Any): - expected_output = torch.mean(X[0]) - # w represents mean in this case - self.w = nn.Parameter(data = expected_output, requires_grad = False) - - def forward(self, X: Any) -> tuple[float, float]: - # some expression of tolerance to error in the inference - # must have w first! - return (torch.abs(torch.sum(X)-X.size()[1]*(self.w))<0.01*X.size()[1]*(self.w), self.w) - - -# TODO: Copy the rest of models here From dcf8576edcda316d15792b1f9b1dc6b45878a357 Mon Sep 17 00:00:00 2001 From: mhchia Date: Tue, 16 Jan 2024 14:18:17 +0800 Subject: [PATCH 3/7] fix wrong type and use correct types --- zkstats/computation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zkstats/computation.py b/zkstats/computation.py index 88d7e2c..d7872bd 100644 --- a/zkstats/computation.py +++ b/zkstats/computation.py @@ -55,7 +55,7 @@ def preprocess(self, x: list[torch.Tensor]) -> None: ... @abstractmethod - def forward(self, *x: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: + def forward(self, *x: list[torch.Tensor]) -> tuple[IsResultPrecise, torch.Tensor]: ... @@ -70,18 +70,18 @@ def forward(self, *x: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: -def create_model(computation: TComputation) -> Type[nn.Module]: +def create_model(computation: TComputation) -> Type[IModel]: """ Create a torch model from a `computation` function defined by user """ state = State() - class Model(nn.Module): + class Model(IModel): def preprocess(self, x: list[torch.Tensor]) -> None: computation(state, x) state.set_ready_for_exporting_onnx() - def forward(self, *x: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: + def forward(self, *x: list[torch.Tensor]) -> tuple[IsResultPrecise, torch.Tensor]: return computation(state, x) return Model From 2f2944b269bae84be0c201ff7593865f7f467c78 Mon Sep 17 00:00:00 2001 From: mhchia Date: Wed, 17 Jan 2024 17:42:18 +0800 Subject: [PATCH 4/7] feat: remove booleans from user defined computation --- examples/computation/computation.ipynb | 758 +++++++++++-------------- zkstats/computation.py | 74 ++- 2 files changed, 389 insertions(+), 443 deletions(-) diff --git a/examples/computation/computation.ipynb b/examples/computation/computation.ipynb index 3d17633..9f45abb 100644 --- a/examples/computation/computation.ipynb +++ b/examples/computation/computation.ipynb @@ -17,25 +17,25 @@ "Requirement already satisfied: matplotlib in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 6)) (3.8.2)\n", "Requirement already satisfied: statistics in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 7)) (1.0.3.5)\n", "Requirement already satisfied: onnx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 8)) (1.15.0)\n", - "Requirement already satisfied: typing-extensions in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (4.8.0)\n", - "Requirement already satisfied: networkx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.2.1)\n", "Requirement already satisfied: fsspec in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (2023.12.0)\n", - "Requirement already satisfied: filelock in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.13.1)\n", + "Requirement already satisfied: networkx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.2.1)\n", "Requirement already satisfied: jinja2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.1.2)\n", "Requirement already satisfied: sympy in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (1.12)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.3.2)\n", + "Requirement already satisfied: filelock in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.13.1)\n", + "Requirement already satisfied: typing-extensions in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (4.8.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.6)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.3.2)\n", "Requirement already satisfied: certifi>=2017.4.17 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (2023.11.17)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (2.1.0)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.2.0)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (3.1.1)\n", "Requirement already satisfied: importlib-resources>=3.2.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (6.1.1)\n", + "Requirement already satisfied: cycler>=0.10 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (0.12.1)\n", "Requirement already satisfied: packaging>=20.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (23.2)\n", - "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.4.5)\n", - "Requirement already satisfied: contourpy>=1.0.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.2.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (2.8.2)\n", "Requirement already satisfied: pillow>=8 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (10.1.0)\n", - "Requirement already satisfied: cycler>=0.10 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (0.12.1)\n", "Requirement already satisfied: fonttools>=4.22.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (4.46.0)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (2.8.2)\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (3.1.1)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.4.5)\n", "Requirement already satisfied: docutils>=0.3 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from statistics->-r ../../requirements.txt (line 7)) (0.20.1)\n", "Requirement already satisfied: protobuf>=3.20.2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from onnx->-r ../../requirements.txt (line 8)) (4.25.1)\n", "Requirement already satisfied: zipp>=3.1.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib->-r ../../requirements.txt (line 6)) (3.17.0)\n", @@ -78,7 +78,7 @@ "metadata": {}, "outputs": [], "source": [ - "%run -i ../../zkstats/core.py" + "from zkstats.core import prover_gen_settings, verifier_setup, prover_gen_proof, verifier_verify" ] }, { @@ -134,30 +134,10 @@ "cell_type": "code", "execution_count": 5, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "!@# len(data)= 300\n" - ] - } - ], + "outputs": [], "source": [ "data_path = os.path.join('data.json')\n", - "dummy_data_path = os.path.join('shared/dummy_data.json')\n", - "\n", - "f_raw_input = open(data_path, \"r\")\n", - "data = json.loads(f_raw_input.read())[\"input_data\"][0]\n", - "print(\"!@# len(data)=\", len(data))\n", - "data_tensor = torch.reshape(torch.tensor(data),(1, len(data), 1))\n", - "\n", - "# dummy data for data consumer. Just need to be the same len as private data\n", - "dummy_data = np.round(np.random.uniform(1,10,len(data)),1)\n", - "json.dump({\"input_data\":[dummy_data.tolist()]}, open(dummy_data_path, 'w'))\n", - "\n", - "dummy_data_tensor = torch.reshape(torch.tensor(dummy_data), (1, len(dummy_data),1 ))\n", - "dummy_theory_output = torch.mean(dummy_data_tensor)" + "dummy_data_path = os.path.join('shared/dummy_data.json')" ] }, { @@ -177,24 +157,324 @@ "metadata": {}, "outputs": [ { - "name": "stderr", + "name": "stdout", "output_type": "stream", "text": [ - "/var/folders/t3/5psrvr1x0w1_6n9kx2n7d9700000gn/T/ipykernel_29423/1578668560.py:8: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n", - " b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", - "/var/folders/t3/5psrvr1x0w1_6n9kx2n7d9700000gn/T/ipykernel_29423/1578668560.py:8: TracerWarning: Converting a tensor to a Python float might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!\n", - " b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", - "/Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages/torch/onnx/symbolic_opset9.py:2174: FutureWarning: 'torch.onnx.symbolic_opset9._cast_Bool' is deprecated in version 2.0 and will be removed in the future. Please Avoid using this function and create a Cast node instead.\n", - " return fn(g, to_cast_func(g, input, False), to_cast_func(g, other, False))\n" + "!@# x: [tensor([[[23.2000],\n", + " [92.8000],\n", + " [91.0000],\n", + " [37.2000],\n", + " [82.0000],\n", + " [15.5000],\n", + " [79.3000],\n", + " [46.6000],\n", + " [98.1000],\n", + " [75.5000],\n", + " [78.9000],\n", + " [77.6000],\n", + " [33.8000],\n", + " [75.7000],\n", + " [96.8000],\n", + " [12.3000],\n", + " [18.4000],\n", + " [13.4000],\n", + " [ 6.0000],\n", + " [ 8.2000],\n", + " [25.8000],\n", + " [41.3000],\n", + " [68.5000],\n", + " [15.2000],\n", + " [74.7000],\n", + " [72.7000],\n", + " [18.0000],\n", + " [42.2000],\n", + " [36.1000],\n", + " [76.7000],\n", + " [ 1.2000],\n", + " [96.4000],\n", + " [ 4.9000],\n", + " [92.0000],\n", + " [12.8000],\n", + " [28.2000],\n", + " [61.8000],\n", + " [56.9000],\n", + " [44.3000],\n", + " [50.4000],\n", + " [81.6000],\n", + " [72.5000],\n", + " [12.9000],\n", + " [40.3000],\n", + " [12.8000],\n", + " [28.8000],\n", + " [36.3000],\n", + " [16.1000],\n", + " [68.4000],\n", + " [35.3000],\n", + " [79.2000],\n", + " [48.4000],\n", + " [97.1000],\n", + " [93.7000],\n", + " [77.0000],\n", + " [48.7000],\n", + " [93.7000],\n", + " [54.1000],\n", + " [65.4000],\n", + " [30.8000],\n", + " [34.4000],\n", + " [31.4000],\n", + " [78.7000],\n", + " [12.7000],\n", + " [90.7000],\n", + " [39.4000],\n", + " [86.0000],\n", + " [55.9000],\n", + " [ 6.8000],\n", + " [22.2000],\n", + " [65.3000],\n", + " [18.8000],\n", + " [ 7.1000],\n", + " [55.9000],\n", + " [38.6000],\n", + " [15.6000],\n", + " [59.2000],\n", + " [77.3000],\n", + " [76.9000],\n", + " [11.9000],\n", + " [19.9000],\n", + " [19.4000],\n", + " [54.3000],\n", + " [39.4000],\n", + " [ 4.0000],\n", + " [61.1000],\n", + " [16.8000],\n", + " [81.9000],\n", + " [49.3000],\n", + " [76.9000],\n", + " [19.2000],\n", + " [68.2000],\n", + " [54.4000],\n", + " [70.2000],\n", + " [89.8000],\n", + " [23.4000],\n", + " [67.5000],\n", + " [18.7000],\n", + " [10.8000],\n", + " [80.7000],\n", + " [80.3000],\n", + " [96.2000],\n", + " [62.3000],\n", + " [17.2000],\n", + " [23.0000],\n", + " [98.0000],\n", + " [19.1000],\n", + " [ 8.1000],\n", + " [36.2000],\n", + " [ 7.5000],\n", + " [55.9000],\n", + " [ 1.2000],\n", + " [56.8000],\n", + " [85.1000],\n", + " [18.9000],\n", + " [23.0000],\n", + " [13.5000],\n", + " [64.3000],\n", + " [ 9.1000],\n", + " [14.1000],\n", + " [14.1000],\n", + " [23.1000],\n", + " [73.2000],\n", + " [86.6000],\n", + " [39.1000],\n", + " [45.5000],\n", + " [85.0000],\n", + " [79.0000],\n", + " [15.8000],\n", + " [ 5.2000],\n", + " [81.5000],\n", + " [34.3000],\n", + " [24.3000],\n", + " [14.2000],\n", + " [84.6000],\n", + " [33.7000],\n", + " [86.3000],\n", + " [83.3000],\n", + " [62.8000],\n", + " [72.7000],\n", + " [14.7000],\n", + " [36.8000],\n", + " [92.5000],\n", + " [ 4.7000],\n", + " [30.0000],\n", + " [59.4000],\n", + " [57.6000],\n", + " [37.4000],\n", + " [22.0000],\n", + " [20.9000],\n", + " [61.6000],\n", + " [26.8000],\n", + " [47.1000],\n", + " [63.6000],\n", + " [ 6.0000],\n", + " [96.6000],\n", + " [61.2000],\n", + " [80.2000],\n", + " [59.3000],\n", + " [23.1000],\n", + " [29.3000],\n", + " [46.3000],\n", + " [89.2000],\n", + " [77.6000],\n", + " [83.2000],\n", + " [87.2000],\n", + " [63.2000],\n", + " [81.8000],\n", + " [55.0000],\n", + " [59.7000],\n", + " [57.8000],\n", + " [43.4000],\n", + " [92.4000],\n", + " [66.9000],\n", + " [82.1000],\n", + " [51.0000],\n", + " [22.1000],\n", + " [29.9000],\n", + " [41.0000],\n", + " [85.2000],\n", + " [61.5000],\n", + " [14.6000],\n", + " [48.0000],\n", + " [52.7000],\n", + " [31.4000],\n", + " [83.9000],\n", + " [35.5000],\n", + " [77.3000],\n", + " [35.8000],\n", + " [32.6000],\n", + " [22.2000],\n", + " [19.3000],\n", + " [49.1000],\n", + " [70.9000],\n", + " [43.9000],\n", + " [88.8000],\n", + " [56.3000],\n", + " [41.8000],\n", + " [90.3000],\n", + " [20.4000],\n", + " [80.4000],\n", + " [36.4000],\n", + " [91.5000],\n", + " [69.6000],\n", + " [75.3000],\n", + " [92.4000],\n", + " [84.8000],\n", + " [17.7000],\n", + " [ 2.3000],\n", + " [41.3000],\n", + " [91.3000],\n", + " [68.6000],\n", + " [73.3000],\n", + " [62.5000],\n", + " [60.5000],\n", + " [73.5000],\n", + " [70.7000],\n", + " [77.5000],\n", + " [76.8000],\n", + " [98.1000],\n", + " [40.9000],\n", + " [66.3000],\n", + " [ 8.6000],\n", + " [48.9000],\n", + " [75.4000],\n", + " [14.7000],\n", + " [35.9000],\n", + " [89.6000],\n", + " [15.1000],\n", + " [45.0000],\n", + " [77.6000],\n", + " [30.5000],\n", + " [76.1000],\n", + " [46.9000],\n", + " [34.3000],\n", + " [65.1000],\n", + " [43.9000],\n", + " [91.6000],\n", + " [88.8000],\n", + " [ 8.9000],\n", + " [42.9000],\n", + " [11.8000],\n", + " [32.1000],\n", + " [20.1000],\n", + " [48.9000],\n", + " [79.7000],\n", + " [15.3000],\n", + " [45.4000],\n", + " [80.1000],\n", + " [73.1000],\n", + " [76.5000],\n", + " [52.4000],\n", + " [ 9.6000],\n", + " [41.9000],\n", + " [52.7000],\n", + " [55.1000],\n", + " [30.9000],\n", + " [83.7000],\n", + " [46.7000],\n", + " [39.3000],\n", + " [40.5000],\n", + " [52.4000],\n", + " [19.2000],\n", + " [25.8000],\n", + " [52.7000],\n", + " [81.0000],\n", + " [38.0000],\n", + " [54.5000],\n", + " [15.3000],\n", + " [64.3000],\n", + " [88.3000],\n", + " [49.8000],\n", + " [90.5000],\n", + " [90.4000],\n", + " [79.7000],\n", + " [87.3000],\n", + " [32.3000],\n", + " [11.9000],\n", + " [ 5.7000],\n", + " [33.6000],\n", + " [75.1000],\n", + " [65.9000],\n", + " [29.1000],\n", + " [39.4000],\n", + " [87.5000],\n", + " [ 3.3000],\n", + " [66.3000],\n", + " [79.0000],\n", + " [97.9000],\n", + " [69.6000],\n", + " [22.0000],\n", + " [62.8000],\n", + " [97.1000],\n", + " [90.4000],\n", + " [39.5000],\n", + " [11.7000],\n", + " [30.3000],\n", + " [18.9000],\n", + " [34.6000],\n", + " [ 6.6000]]], dtype=torch.float64)]\n" ] }, { - "name": "stdout", - "output_type": "stream", - "text": [ - "==== Generate & Calibrate Setting ====\n", - "scale: default\n", - "setting: {\"run_args\":{\"tolerance\":{\"val\":0.0,\"scale\":1.0},\"input_scale\":8,\"param_scale\":8,\"scale_rebase_multiplier\":10,\"lookup_range\":[-76800,153600],\"logrows\":18,\"num_inner_cols\":2,\"variables\":[[\"batch_size\",1]],\"input_visibility\":{\"Hashed\":{\"hash_is_public\":true,\"outlets\":[]}},\"output_visibility\":\"Public\",\"param_visibility\":\"Private\"},\"num_rows\":14432,\"total_assignments\":11438,\"total_const_size\":1213,\"model_instance_shapes\":[[300,1],[1]],\"model_output_scales\":[0,8],\"model_input_scales\":[8],\"module_sizes\":{\"kzg\":[],\"poseidon\":[14432,[1]],\"elgamal\":[0,[0]]},\"required_lookups\":[\"Abs\",{\"GreaterThan\":{\"a\":0.0}},\"KroneckerDelta\"],\"check_mode\":\"UNSAFE\",\"version\":\"7.0.0\",\"num_blinding_factors\":null}\n" + "ename": "IndexError", + "evalue": "list index out of range", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[6], line 11\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m state\u001b[38;5;241m.\u001b[39mmean(torch\u001b[38;5;241m.\u001b[39mtensor([out_0, out_1])\u001b[38;5;241m.\u001b[39mreshape(\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m1\u001b[39m))\n\u001b[1;32m 10\u001b[0m prover_model \u001b[38;5;241m=\u001b[39m create_model(computation)\n\u001b[0;32m---> 11\u001b[0m \u001b[43mprover_gen_settings\u001b[49m\u001b[43m(\u001b[49m\u001b[43m[\u001b[49m\u001b[43mdata_path\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcomb_data_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprover_model\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprover_model_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mdefault\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mresources\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msettings_path\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/projects/work/pse/zk-stats-lib/zkstats/core.py:119\u001b[0m, in \u001b[0;36mprover_gen_settings\u001b[0;34m(data_path_array, comb_data_path, prover_model, prover_model_path, scale, mode, settings_path)\u001b[0m\n\u001b[1;32m 116\u001b[0m data_tensor_array \u001b[38;5;241m=\u001b[39m process_data(data_path_array, comb_data_path)\n\u001b[1;32m 118\u001b[0m \u001b[38;5;66;03m# export onnx file\u001b[39;00m\n\u001b[0;32m--> 119\u001b[0m \u001b[43mexport_onnx\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprover_model\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdata_tensor_array\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprover_model_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 120\u001b[0m \u001b[38;5;66;03m# gen + calibrate setting\u001b[39;00m\n\u001b[1;32m 121\u001b[0m gen_settings(comb_data_path, prover_model_path, scale, mode, settings_path)\n", + "File \u001b[0;32m~/projects/work/pse/zk-stats-lib/zkstats/core.py:19\u001b[0m, in \u001b[0;36mexport_onnx\u001b[0;34m(model, data_tensor_array, model_loc)\u001b[0m\n\u001b[1;32m 17\u001b[0m circuit \u001b[38;5;241m=\u001b[39m model()\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 19\u001b[0m \u001b[43mcircuit\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpreprocess\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata_tensor_array\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m:\n\u001b[1;32m 21\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", + "File \u001b[0;32m~/projects/work/pse/zk-stats-lib/zkstats/computation.py:119\u001b[0m, in \u001b[0;36mcreate_model..Model.preprocess\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpreprocess\u001b[39m(\u001b[38;5;28mself\u001b[39m, x: \u001b[38;5;28mlist\u001b[39m[torch\u001b[38;5;241m.\u001b[39mTensor]) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 119\u001b[0m \u001b[43mcomputation\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 120\u001b[0m state\u001b[38;5;241m.\u001b[39mset_ready_for_exporting_onnx()\n", + "Cell \u001b[0;32mIn[6], line 7\u001b[0m, in \u001b[0;36mcomputation\u001b[0;34m(state, x)\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m!@# x:\u001b[39m\u001b[38;5;124m\"\u001b[39m, x)\n\u001b[1;32m 6\u001b[0m out_0 \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mmedian(x[\u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m----> 7\u001b[0m out_1 \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mmedian(\u001b[43mx\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m)\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m state\u001b[38;5;241m.\u001b[39mmean(torch\u001b[38;5;241m.\u001b[39mtensor([out_0, out_1])\u001b[38;5;241m.\u001b[39mreshape(\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m1\u001b[39m))\n", + "\u001b[0;31mIndexError\u001b[0m: list index out of range" ] } ], @@ -203,11 +483,10 @@ "\n", "\n", "def computation(state: State, x: list[torch.Tensor]):\n", - " x = x[0]\n", - " b_0, out_0 = state.median(x)\n", - " b_1, out_1 = state.median(x)\n", - " b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", - " return torch.logical_and(torch.logical_and(b_0, b_1), b_2), out_2\n", + " print(\"!@# x:\", x)\n", + " out_0 = state.median(x[0])\n", + " out_1 = state.median(x[0])\n", + " return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", "\n", "prover_model = create_model(computation)\n", "prover_gen_settings([data_path], comb_data_path, prover_model, prover_model_path, \"default\", \"resources\", settings_path)\n" @@ -229,69 +508,9 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "==== setting up ezkl ====\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "spawning module 0\n", - "spawning module 2\n", - "spawning module 0\n", - "spawning module 2\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Time setup: 57.55826187133789 seconds\n", - "=======================================\n", - "!@# compiled_model exists? True\n", - "!@# compiled_model exists? True\n", - "==== Generating Witness ====\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "spawning module 0\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "witness boolean: 1.0\n", - "witness result 1 : 49.55078125\n", - "==== Generating Proof ====\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "spawning module 2\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "proof: {'instances': [[[3042937791208075219, 8157070662846698822, 3804781648660056856, 172406108020799675], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [18341455175509539295, 12796101019039945164, 1607286914885633240, 1929881192315725821]]], 'proof': '116dee6043db883556dc183eb028d3cb41d62c807ddb59e78e6d6d161f5cb057287687aef2921cea7e9a54188ae1ed7315a5d027cc5e7f936a551dbfa82dff80303a1d813238084e065f0e3e1ce59fd25a1d2f6ecc04a70b11cedcb07c4c32b91a3a2b210fd05fa6220368f7d44da1b2a58ff81b0127f5f295ff062dc384b4951f3630e3ab7f38044fdd96e54169e523f23394eb86c19fcb4dbd2ac3fe8e27370afd1e867a76372d3ffc8e21fb12284953cddc9d3fdd0b83be6c84a392154bfa0aaefed03f3b039ed1833e99a715f46b401abfdca0cf07a205feb44d1ba079ec1662ba4b0857d0df57658a0d255f2c83e8522650ff3f5d433c2b958aaf1064b71bd1ca3529d8b2a63a6672832ac8d910ae2ca83db7a916f3bc8966f692290ec509d4e5243e223d7bd1e9c89f685564c73185177bfdc1888a41e8dce8cda6236e1f05f56bd7ea4bc570fde5974fbc3f7817dc9a70ccf4a48d3f8fcf6e5f79a8db0b7c6f09dd3827fba0d675c18e0500af429c649def13b3e5971b3058dcf71c02131b15189cc670f202d1cb55f22d12b2c4d56f152f54441bee19ce8164539c572b5afea92adb3fd89d35d1e6a5081ce8a835f4767dce0dd41096845f82a14a5c2223e6f4cfeb5fbfa42a40a106338eb82ba2ca6eced9eaea25ab4baa62846e1b1456773c425133b5a03d754d8663f0ba007b8ccde9ce0e00a48c2a64fd91f20f09ebda43e6efdaf331fac048b8f8538a2b3d68a78b7f0a963e7d4f52d27bc61c2a247701277a88fc4e2060180f39472a291d7be203ffdc7fae161354c91505192bdcff75aa4704bb2e5723c1923e568e8771965d20505ce9e40b47cfb9facfc4149f0dac1f8e0ec95d584f0268cbefbb35ad2cb04954789ca702a57149c0fb8b1a91ade425522e8bd3fc62269ecba75b54e3ecb09c3cb857f03826224a5efcd62f7021a25815bf001bcf3e4778bbb50399bcde9b7a0f54dad1b39349659528c415117880effc281d631fabf3f36f6933ba27d0d20d313defd4351ed83fb0e6d324f55fd8b857437a201042571b0e296db8b3150f5c315aeb6d1434ce114ea2f7284c1b323f4768f29e682ccfc5653326dcbf64a29f2bde44cc2fbc9ba12925012122bfe072c0a9aa225e312cfbd01003cbd86a71f918957a7c06bc0182d85b4a044f1706c1f23da5de5ede7f2c94755837072e95961f8cc3f55cea9dab956fd22128c58a0a372ab53fe3c9760baaab094c2288f13d114db1e2455c7dfb8d9a520cbe6555dd663344a4cc8e9b21dc734a78f6b239dcb1390b9aa9f246023b23110b1772e571d06ef1fb46273007ff93f1ca51e2332cbb9838a1e5f1040fe9ee91104ed928bac385265dac0bc8a239f465b90739c5db51be002eaaabfbdb2a2a3d020f63de2099eb61d4e236d28438a0ac808d4ed1526584c22cc466ec82ff1a6a0f8ad1a65828c5de1516c0f31806c5b8211edc2708cb3c84b76092d758f1d6002946973de9de11600d27f81933454d618709c9f50be02b70119b913bd7668bb813d1564e1654f7a7742d07f02d5cb9dc24365089b7050445a416a05d84be36a9021a32d33d22b7d62c7b881216a614e4a06ce304cd05aa221fe7b1decf6b5a8b27a5f7637fe89ab5374a1ec28eb13c912dad8cad86f0a9e35d315c206f36f96d2ac3bb41e5c3ce45409914b8bd9cfb81fcb6d0ee3d7f411b208eda966144add504a9f8fb01fb39268e61df872b1715252694f02b35cd6bb3e673151927ed60c223f3d6892b110015423b1f6b11b6195803d662350cfcd8a922da8ddcda41f2ee12fdb5c92f81576439d12300b178fd29d84d92da7206c5e90c223ccd123050d60f91c46d4b4fdc5061fdd46762709bf2662253bd406a5ea5405a1ad8c0a498522da95265f50e91e5508cd38103b38ac8ab6c9146de74243a9c9fa5a627862dd71090955db15ea477f1193519d50ad1def6aa2ae11ed18d5029c839fb58fdd1370ca43148b2134056e7db67df78755f74127499ec6aae3a46bcc2f29d44f458ec20172292f598d8ab68a43f711a69b1ac71fbb87ae40c7659b0e6a0a42dd365242503da1e97c7f51c141238865717133fd166d1ccc0192df45f67c262e4d84b4d2e94f79df38db0e5fd5487ccedc2a9489f59d688c6ffd3032e466874df62140c299c505a38571ef189f0a499084ed53a23d90e381787c3949f538c91f5ec6b14204b25ddd8c85f0e58ff1603e87e6c6af839acc29e9025e5f5466f7eb1895f8b0f73e1daf63444512ef8afc43390ea64c1bbe47afc7abf39ba0338bce584c8ae022876b12224bf3ebcd25693df02bf6c6abd3890fb4775ef8109f277681e855721a5f1a8326308d6e9914d3ed3e8c7d63e755146961808da9acdf2d91957b44708d02a5f4f2adcc86ffa71b00ca60ccf30105611d1ceffdaa38f0211e12a01382881261e1abd4d20dbf4e2dd3feda30d183043499688035b99a322aa24c1be9b18c9b640fcb64e5356aaa27ea140682b3ab19448e2b1c13269127cbdf4297747163068e2f3dd70673b6f16a92a462efb53c62a2dd45269a64a72143ab88fc97e25bf958011c820693b1c4f0712fccbbbba432b0c00a729d8600973dc07570d3d19ee71396345ca5e7b07ddc690eb7f2e0d618beb5c08721f30942ffd6ccc76ab0b83d6109084d6d40e8ea2be5928ce6e28deff5e153a20eee0541fbb8852700714737590d26b5abc879f97916fca7553cc79c9ec774717665bee33219931e3b2209e4c89544fcb3fb1ab5326bba4952937aa3c5c8ce544865a18dea5493e123622b46298c3438df1313d400dfce48a512aa811eb3cd309882364f787718b22910f60cc6ded36318869113a8ca4c4ebaa66266da9ce0239b2250262ebba7287192e43bd87f8863681c90232b23cb0d9147360d237fb4ba3583a333f6f0203d1951d8f61e6b80b19977375c5649eca5b090c8687e737aa3c5f8fc2bd9fde46532300bbcccf89d7e3d68b941b1d4b335039945a0dad2b9a72d3933a8f4f43179bf010e04f2df91155976f914404b70b7665c131e682ba0f6776504d06a7052bd2212444597d720a8f4bc67799d2635e8bd36f81b991e3216d334f271f31e49cd28c0ff08083587d22bf1330161b59ca53e70b462af2b3a58041c020dfe8b17c23d908b10be80acafb6614cd32258516613de8dc418fc261e7dc3aa1e75297a5f17027b2a75554b9ac04fb5600d5563f19220497d30d7f6d991cb7c2fb72c472cd5807c729d8452538f22aa5189f6ac0b93db6fe7249b16e8a48f976c31bbe9fe253273afcbea69d2e1c0ad90fd284d8a54468973c8b2eb9d8c4dbdd3fb73d4bd923282ced059f88a36d878ae30ab66fab6750a367513c0dfbe0da8f71ca6bdde8731042e19a07ab1a575f759058123b0d2bcaa2229d127f202639bc79629b1ab6aa28ce2f1db1d0c035e449c2a39e6b7cfc9e87b503d1de90126812c50ecb28c6b0102fc6e146a0b85680e8fc8b44d46238dcc060f82264ea3ac2a6fa4390d55a7c2b8771c4a4de958fc55404737b2a39924c456e5d0c113d2567d1aca7612bbce60bb6c53a542626c59aec7b6e40d1a461623330dfa31785b0ddd582f5183a1bd41ed4f46eadbb1b66083fd8a8d7bb9f6bd9f20487c0dc4322772e4afe7f20749d2274b5d222512638337f9af13397756770fc65b620856a233fc0379c5b4f466b138e0b2ddf785e99963d553311ca738605e955eac90c07113f96cb53e2a5a66123c0073d9e4758f9bd1012b92a54498e8ad9c8eb33bc288c338bea62cd81de8923c0073d9e4758f9bd1012b92a54498e8ad9c8eb33bc288c338bea62cd81de8913c9888bb971794c4d5dc13d88b248a02b3d5be3f1eb030b8ce5571d4415d7840048ff4150c43ebd424c30fef791e51d104704f711c7f97c37e823a7ae0b5ea02909d0680a40eabefd571aa0a6a04d0754043ba19336abd958b01e86dba9bcda00000000000000000000000000000000000000000000000000000000000000000685efaa09718888fc4853f8326fb3573c5f4b0e58c956f3942808e5301fb1d005d9c4aa08eeafe89344fe1fb9fd6dab2f1b429d9dc83629af0a66718ead3dc42fbf57eeb14d2c1d76008553880e6099aa73c66b03c88074d4f717e7e22486060dc91dd99632d849dd2e0dc0805f0ce7dfc438778ea03398cf6b53db8bc64c86111f8c1ffdb68edca77aa5dc98d88a6799eca6045fe8ff2ae1f2aa13997578992033f660f6f7e57522870cb111a8e99c525b2d41f4dc70d63995fa224c219846258f953c2dd910986c4aa2a235a241dd5fe3d86a8db40349513d6d3c606d34021547d1ae84b40a3bb1de2c7aa925a7defa475877837ff1c43e668eb4348c5865254660388f393a140bb2b82c66180511e0283b4e53aeeb1ac8bc754cadd6023d25fd5975a2bc1d22762be2a2a3c1cb3ec8b4f79a6768c820c0c6c482736453f22b25e38f6c75ac3caab493aa8e53e8d51778e05a59405d0ef49bf33ad17a9ede279ec9ecdec622e7c72807260f7917d2076197982db58688604e71ec1a0a5d0b21509c144675bd52761c3205705146894c205888801f493eff4898c58e68ed2b1a688ff6d06b24d6bcdf3c87b51789c7cd08a2c912f0cfbac104e837b75fe117185a39094c84cb19bdd1304c483c8e82a38d7e0e0553ac4007ed8bcd3af0f5ed092bf95a9cd0526b1fba52d50150b3aa8fd6ae498c750ebf2d4aa19457166b8d015e9c656650d69a43e6310e8ca2618ea7a530e98398cfa2793da42426ea9b1b0d3e8923d7273ec6d7b085b3df007537d13fd2cb81b15bf1866b28f2f28974af07e46873c7eef5f8e46dc5032812d7f30d3c0a800abaafbbfa73c0f88139a1632af4734c1755d8e23c11512c59bf53780f5a927ba733fd2c2813e1afb7b39f1e15dfd7a07fa475c1382112129be732f2966257870d4e9159ed3b6d49e5a1506e203d1ba94e36833424058c218be2c6f3ef1320f97eb91f1ffd8db325c1691bb11a0eb44be4fde844eba169532b5f87231beeb8160221de20c6f0c8132db8c45107bc2c183acd3c8edf095d1b8f820f834cbc4a900e8788ef81773f2c0177d66c22f1037c9aad10032d376b045d7e171f9e5e5a6996bb6535412e12c9a1a890b81591d12fb33b658e119e8a8e72fe36fceccaed3ae2df6609542e4b0033a1acde161af7b749bb411d0f6cd39fcb8e0ba69725eadf2da3c935eac939b801c9f365238c07ddf0a3f7e9dbbe8f538f39386ebcd06fb4d9788dc07c320a5128f0d4cf1ecebc4b3b32a0ad1f325135250464e605f81d373b2eeb5367ffdaa7705be8671f9738e90bdfd8fb3ecaf5f69fdeff8d1e2fc712179fab7a36e66f9d14fed40c1a0d75b770c18de640cab1e14df0e15d2425e18b6a9e8a88f3cd51c60d4ebc8e169913738d8abd5e6962d11224f552bb971512591d2d71abf23c8b60f7ee0adf0d6ecf277a86cca110a281e382fbe9a544b808f203c470b2d2b3b3978d7b51ea304dff37fc52fe18a6948c7d70aee4a5ac3be1e6b6874d8cd50a5d1c9873786a27d347a334fdd8e683dc27a0e56b8ec1175ba7e82903ab6f7a13f880b3f832d002fa9c0c8c28aa20bdc80d571206395dc4a2c0e3fe400c0549d2c80ddec2cf7c02fff7a168c303a20ba5eced23c3f5e16322c104a0066788ba0702dba8b0de0a09e9ed943b70da1b1ced53ad8a48eb42dc70bf7a5fb2ad8528015e471d8714e01b722b1a5bbecd5d8798682fab263f45afd413e9b644cb977ac64e920a36483f01e102dd45f62a8d5c58c8779430918fe2a88db7e2a0b3bb666cbf93fb7b988c1cc0966c9a618d1a56c16300bbd73151cf0d17a7994b62bce62182eecdc87668283c5c14a9299194afa5749029a94cb89b97a9aa87b8670e30a51af1158f9e61059b8b7e50fdeebf5ab568aaf4a925ea30cad8afc77e7b054e92abb3c625a78f2ebd273ff763503377570bf71d402bf070f941efb9d8bb221f0ae42b97079f1c090fb2b207461658136bdfcf3872f3e045c0eefe273ae3da5e85fb72b50395ba17851d7f6020dcc3f293098d3ad60738393c30056db07612e8a50c96ab01f6b02af836f6b6d7926a72d8edf4ea5cc391bb7d3bb161bc2fc90bcbd23311f19c3b0e2fcb0db3efb6e19cea49f3db05f1b2660dde83c02c549f73f923ca07be4d882248fb8bf81b14d8253b81030c29c626c1082e4dc05571d8517500849d4b2a3e2d08d75cd923d94520b1767cc3cfbfac36e1b64b492b5f4d8f3c423da231881727ccac9f0525e8784a72e59336b9652ad1bf4ef2a6ce777669b6f207944f5c7e', 'transcript_type': 'EVM'}\n", - "Time gen prf: 79.79581594467163 seconds\n" - ] - } - ], + "outputs": [], "source": [ "# Here verifier & prover can concurrently call setup since all params are public to get pk.\n", "# Here write as verifier function to emphasize that verifier must calculate its own vk to be sure\n", @@ -305,320 +524,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "num_inputs: 1\n", - "prf instances: [[[3042937791208075219, 8157070662846698822, 3804781648660056856, 172406108020799675], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [18341455175509539295, 12796101019039945164, 1607286914885633240, 1929881192315725821]]]\n", - "proof boolean: 1.0\n", - "proof result 1 : 0.00390625\n", - "proof result 2 : 0.00390625\n", - "proof result 3 : 0.00390625\n", - "proof result 4 : 0.00390625\n", - "proof result 5 : 0.00390625\n", - "proof result 6 : 0.00390625\n", - "proof result 7 : 0.00390625\n", - "proof result 8 : 0.00390625\n", - "proof result 9 : 0.00390625\n", - "proof result 10 : 0.00390625\n", - "proof result 11 : 0.00390625\n", - "proof result 12 : 0.00390625\n", - "proof result 13 : 0.00390625\n", - "proof result 14 : 0.00390625\n", - "proof result 15 : 0.00390625\n", - "proof result 16 : 0.00390625\n", - "proof result 17 : 0.00390625\n", - "proof result 18 : 0.00390625\n", - "proof result 19 : 0.00390625\n", - "proof result 20 : 0.00390625\n", - "proof result 21 : 0.00390625\n", - "proof result 22 : 0.00390625\n", - "proof result 23 : 0.00390625\n", - "proof result 24 : 0.00390625\n", - "proof result 25 : 0.00390625\n", - "proof result 26 : 0.00390625\n", - "proof result 27 : 0.00390625\n", - "proof result 28 : 0.00390625\n", - "proof result 29 : 0.00390625\n", - "proof result 30 : 0.00390625\n", - "proof result 31 : 0.00390625\n", - "proof result 32 : 0.00390625\n", - "proof result 33 : 0.00390625\n", - "proof result 34 : 0.00390625\n", - "proof result 35 : 0.00390625\n", - "proof result 36 : 0.00390625\n", - "proof result 37 : 0.00390625\n", - "proof result 38 : 0.00390625\n", - "proof result 39 : 0.00390625\n", - "proof result 40 : 0.00390625\n", - "proof result 41 : 0.00390625\n", - "proof result 42 : 0.00390625\n", - "proof result 43 : 0.00390625\n", - "proof result 44 : 0.00390625\n", - "proof result 45 : 0.00390625\n", - "proof result 46 : 0.00390625\n", - "proof result 47 : 0.00390625\n", - "proof result 48 : 0.00390625\n", - "proof result 49 : 0.00390625\n", - "proof result 50 : 0.00390625\n", - "proof result 51 : 0.00390625\n", - "proof result 52 : 0.00390625\n", - "proof result 53 : 0.00390625\n", - "proof result 54 : 0.00390625\n", - "proof result 55 : 0.00390625\n", - "proof result 56 : 0.00390625\n", - "proof result 57 : 0.00390625\n", - "proof result 58 : 0.00390625\n", - "proof result 59 : 0.00390625\n", - "proof result 60 : 0.00390625\n", - "proof result 61 : 0.00390625\n", - "proof result 62 : 0.00390625\n", - "proof result 63 : 0.00390625\n", - "proof result 64 : 0.00390625\n", - "proof result 65 : 0.00390625\n", - "proof result 66 : 0.00390625\n", - "proof result 67 : 0.00390625\n", - "proof result 68 : 0.00390625\n", - "proof result 69 : 0.00390625\n", - "proof result 70 : 0.00390625\n", - "proof result 71 : 0.00390625\n", - "proof result 72 : 0.00390625\n", - "proof result 73 : 0.00390625\n", - "proof result 74 : 0.00390625\n", - "proof result 75 : 0.00390625\n", - "proof result 76 : 0.00390625\n", - "proof result 77 : 0.00390625\n", - "proof result 78 : 0.00390625\n", - "proof result 79 : 0.00390625\n", - "proof result 80 : 0.00390625\n", - "proof result 81 : 0.00390625\n", - "proof result 82 : 0.00390625\n", - "proof result 83 : 0.00390625\n", - "proof result 84 : 0.00390625\n", - "proof result 85 : 0.00390625\n", - "proof result 86 : 0.00390625\n", - "proof result 87 : 0.00390625\n", - "proof result 88 : 0.00390625\n", - "proof result 89 : 0.00390625\n", - "proof result 90 : 0.00390625\n", - "proof result 91 : 0.00390625\n", - "proof result 92 : 0.00390625\n", - "proof result 93 : 0.00390625\n", - "proof result 94 : 0.00390625\n", - "proof result 95 : 0.00390625\n", - "proof result 96 : 0.00390625\n", - "proof result 97 : 0.00390625\n", - "proof result 98 : 0.00390625\n", - "proof result 99 : 0.00390625\n", - "proof result 100 : 0.00390625\n", - "proof result 101 : 0.00390625\n", - "proof result 102 : 0.00390625\n", - "proof result 103 : 0.00390625\n", - "proof result 104 : 0.00390625\n", - "proof result 105 : 0.00390625\n", - "proof result 106 : 0.00390625\n", - "proof result 107 : 0.00390625\n", - "proof result 108 : 0.00390625\n", - "proof result 109 : 0.00390625\n", - "proof result 110 : 0.00390625\n", - "proof result 111 : 0.00390625\n", - "proof result 112 : 0.00390625\n", - "proof result 113 : 0.00390625\n", - "proof result 114 : 0.00390625\n", - "proof result 115 : 0.00390625\n", - "proof result 116 : 0.00390625\n", - "proof result 117 : 0.00390625\n", - "proof result 118 : 0.00390625\n", - "proof result 119 : 0.00390625\n", - "proof result 120 : 0.00390625\n", - "proof result 121 : 0.00390625\n", - "proof result 122 : 0.00390625\n", - "proof result 123 : 0.00390625\n", - "proof result 124 : 0.00390625\n", - "proof result 125 : 0.00390625\n", - "proof result 126 : 0.00390625\n", - "proof result 127 : 0.00390625\n", - "proof result 128 : 0.00390625\n", - "proof result 129 : 0.00390625\n", - "proof result 130 : 0.00390625\n", - "proof result 131 : 0.00390625\n", - "proof result 132 : 0.00390625\n", - "proof result 133 : 0.00390625\n", - "proof result 134 : 0.00390625\n", - "proof result 135 : 0.00390625\n", - "proof result 136 : 0.00390625\n", - "proof result 137 : 0.00390625\n", - "proof result 138 : 0.00390625\n", - "proof result 139 : 0.00390625\n", - "proof result 140 : 0.00390625\n", - "proof result 141 : 0.00390625\n", - "proof result 142 : 0.00390625\n", - "proof result 143 : 0.00390625\n", - "proof result 144 : 0.00390625\n", - "proof result 145 : 0.00390625\n", - "proof result 146 : 0.00390625\n", - "proof result 147 : 0.00390625\n", - "proof result 148 : 0.00390625\n", - "proof result 149 : 0.00390625\n", - "proof result 150 : 0.00390625\n", - "proof result 151 : 0.00390625\n", - "proof result 152 : 0.00390625\n", - "proof result 153 : 0.00390625\n", - "proof result 154 : 0.00390625\n", - "proof result 155 : 0.00390625\n", - "proof result 156 : 0.00390625\n", - "proof result 157 : 0.00390625\n", - "proof result 158 : 0.00390625\n", - "proof result 159 : 0.00390625\n", - "proof result 160 : 0.00390625\n", - "proof result 161 : 0.00390625\n", - "proof result 162 : 0.00390625\n", - "proof result 163 : 0.00390625\n", - "proof result 164 : 0.00390625\n", - "proof result 165 : 0.00390625\n", - "proof result 166 : 0.00390625\n", - "proof result 167 : 0.00390625\n", - "proof result 168 : 0.00390625\n", - "proof result 169 : 0.00390625\n", - "proof result 170 : 0.00390625\n", - "proof result 171 : 0.00390625\n", - "proof result 172 : 0.00390625\n", - "proof result 173 : 0.00390625\n", - "proof result 174 : 0.00390625\n", - "proof result 175 : 0.00390625\n", - "proof result 176 : 0.00390625\n", - "proof result 177 : 0.00390625\n", - "proof result 178 : 0.00390625\n", - "proof result 179 : 0.00390625\n", - "proof result 180 : 0.00390625\n", - "proof result 181 : 0.00390625\n", - "proof result 182 : 0.00390625\n", - "proof result 183 : 0.00390625\n", - "proof result 184 : 0.00390625\n", - "proof result 185 : 0.00390625\n", - "proof result 186 : 0.00390625\n", - "proof result 187 : 0.00390625\n", - "proof result 188 : 0.00390625\n", - "proof result 189 : 0.00390625\n", - "proof result 190 : 0.00390625\n", - "proof result 191 : 0.00390625\n", - "proof result 192 : 0.00390625\n", - "proof result 193 : 0.00390625\n", - "proof result 194 : 0.00390625\n", - "proof result 195 : 0.00390625\n", - "proof result 196 : 0.00390625\n", - "proof result 197 : 0.00390625\n", - "proof result 198 : 0.00390625\n", - "proof result 199 : 0.00390625\n", - "proof result 200 : 0.00390625\n", - "proof result 201 : 0.00390625\n", - "proof result 202 : 0.00390625\n", - "proof result 203 : 0.00390625\n", - "proof result 204 : 0.00390625\n", - "proof result 205 : 0.00390625\n", - "proof result 206 : 0.00390625\n", - "proof result 207 : 0.00390625\n", - "proof result 208 : 0.00390625\n", - "proof result 209 : 0.00390625\n", - "proof result 210 : 0.00390625\n", - "proof result 211 : 0.00390625\n", - "proof result 212 : 0.00390625\n", - "proof result 213 : 0.00390625\n", - "proof result 214 : 0.00390625\n", - "proof result 215 : 0.00390625\n", - "proof result 216 : 0.00390625\n", - "proof result 217 : 0.00390625\n", - "proof result 218 : 0.00390625\n", - "proof result 219 : 0.00390625\n", - "proof result 220 : 0.00390625\n", - "proof result 221 : 0.00390625\n", - "proof result 222 : 0.00390625\n", - "proof result 223 : 0.00390625\n", - "proof result 224 : 0.00390625\n", - "proof result 225 : 0.00390625\n", - "proof result 226 : 0.00390625\n", - "proof result 227 : 0.00390625\n", - "proof result 228 : 0.00390625\n", - "proof result 229 : 0.00390625\n", - "proof result 230 : 0.00390625\n", - "proof result 231 : 0.00390625\n", - "proof result 232 : 0.00390625\n", - "proof result 233 : 0.00390625\n", - "proof result 234 : 0.00390625\n", - "proof result 235 : 0.00390625\n", - "proof result 236 : 0.00390625\n", - "proof result 237 : 0.00390625\n", - "proof result 238 : 0.00390625\n", - "proof result 239 : 0.00390625\n", - "proof result 240 : 0.00390625\n", - "proof result 241 : 0.00390625\n", - "proof result 242 : 0.00390625\n", - "proof result 243 : 0.00390625\n", - "proof result 244 : 0.00390625\n", - "proof result 245 : 0.00390625\n", - "proof result 246 : 0.00390625\n", - "proof result 247 : 0.00390625\n", - "proof result 248 : 0.00390625\n", - "proof result 249 : 0.00390625\n", - "proof result 250 : 0.00390625\n", - "proof result 251 : 0.00390625\n", - "proof result 252 : 0.00390625\n", - "proof result 253 : 0.00390625\n", - "proof result 254 : 0.00390625\n", - "proof result 255 : 0.00390625\n", - "proof result 256 : 0.00390625\n", - "proof result 257 : 0.00390625\n", - "proof result 258 : 0.00390625\n", - "proof result 259 : 0.00390625\n", - "proof result 260 : 0.00390625\n", - "proof result 261 : 0.00390625\n", - "proof result 262 : 0.00390625\n", - "proof result 263 : 0.00390625\n", - "proof result 264 : 0.00390625\n", - "proof result 265 : 0.00390625\n", - "proof result 266 : 0.00390625\n", - "proof result 267 : 0.00390625\n", - "proof result 268 : 0.00390625\n", - "proof result 269 : 0.00390625\n", - "proof result 270 : 0.00390625\n", - "proof result 271 : 0.00390625\n", - "proof result 272 : 0.00390625\n", - "proof result 273 : 0.00390625\n", - "proof result 274 : 0.00390625\n", - "proof result 275 : 0.00390625\n", - "proof result 276 : 0.00390625\n", - "proof result 277 : 0.00390625\n", - "proof result 278 : 0.00390625\n", - "proof result 279 : 0.00390625\n", - "proof result 280 : 0.00390625\n", - "proof result 281 : 0.00390625\n", - "proof result 282 : 0.00390625\n", - "proof result 283 : 0.00390625\n", - "proof result 284 : 0.00390625\n", - "proof result 285 : 0.00390625\n", - "proof result 286 : 0.00390625\n", - "proof result 287 : 0.00390625\n", - "proof result 288 : 0.00390625\n", - "proof result 289 : 0.00390625\n", - "proof result 290 : 0.00390625\n", - "proof result 291 : 0.00390625\n", - "proof result 292 : 0.00390625\n", - "proof result 293 : 0.00390625\n", - "proof result 294 : 0.00390625\n", - "proof result 295 : 0.00390625\n", - "proof result 296 : 0.00390625\n", - "proof result 297 : 0.00390625\n", - "proof result 298 : 0.00390625\n", - "proof result 299 : 0.00390625\n", - "proof result 300 : 49.55078125\n", - "verified\n" - ] - } - ], + "outputs": [], "source": [ "# Verifier verifies\n", "verifier_verify(proof_path, settings_path, vk_path)" diff --git a/zkstats/computation.py b/zkstats/computation.py index d7872bd..3e841fc 100644 --- a/zkstats/computation.py +++ b/zkstats/computation.py @@ -1,5 +1,5 @@ from abc import abstractmethod -from typing import Callable, Type +from typing import Callable, Type, Optional, Union import torch from torch import nn @@ -14,20 +14,21 @@ class State: """ State is a container for intermediate results of computation. - Stage 1 (is_exporting_onnx = False): for every call to State (mean, median, etc.), result + Stage 1 (current_op_index is None): for every call to State (mean, median, etc.), result is calculated and temporarily stored in the state. Call `set_ready_for_exporting_onnx` to indicate Stage 2: all operations are calculated and results are ready to be used. Call `set_ready_for_exporting_onnx` to indicate it's ready to generate settings. - Stage 3 (is_exporting_onnx = True): when exporting to onnx, when the operations are called, the results and + Stage 3 (current_op_index is not None): when exporting to onnx, when the operations are called, the results and the conditions are popped from the state and filled in the onnx graph. """ - def __init__(self, error = DEFAULT_ERROR) -> None: + def __init__(self, error: float) -> None: self.ops: list[Operation] = [] + self.bools: list[Callable[[], torch.Tensor]] = [] self.error: float = error - self.is_exporting_onnx = False + self.current_op_index: Optional[int] = None def set_ready_for_exporting_onnx(self) -> None: - self.is_exporting_onnx = True + self.current_op_index = 0 def mean(self, X: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: return self._call_op(X, Mean) @@ -37,16 +38,55 @@ def median(self, X: torch.Tensor) -> tuple[IsResultPrecise, torch.Tensor]: # TODO: add the rest of the operations - def _call_op(self, x: torch.Tensor, op_type: Type[Operation]) -> tuple[IsResultPrecise, torch.Tensor]: - if self.is_exporting_onnx is False: + def _call_op(self, x: torch.Tensor, op_type: Type[Operation]) -> Union[torch.Tensor, tuple[IsResultPrecise, torch.Tensor]]: + if self.current_op_index is None: op = op_type.create(x, self.error) self.ops.append(op) - return torch.tensor(1), op.result + return op.result else: - op = self.ops.pop(0) + # Copy the current op index to a local variable since self.current_op_index will be incremented. + current_op_index = self.current_op_index + # Sanity check that current op index is not out of bound + len_ops = len(self.ops) + if current_op_index >= len(self.ops): + raise Exception(f"current_op_index out of bound: {current_op_index=} >= {len_ops=}") + + op = self.ops[current_op_index] + # Sanity check that the operation type matches the current op type if not isinstance(op, op_type): raise Exception(f"operation type mismatch: {op_type=} != {type(op)=}") - return op.ezkl(x), op.result + + ### + # Change the states to avoid race condition + # + + # Increment the current op index + self.current_op_index += 1 + + # Push the ezkl condition, which is checked only in the last operation + def is_precise() -> IsResultPrecise: + return op.ezkl(x) + self.bools.append(is_precise) + ### + + # If this is the last operation, aggregate all `is_precise`, and return (is_precise_aggregated, result) + # else, return only result + if current_op_index == len_ops - 1: + # Sanity check for length of self.ops and self.bools + len_bools = len(self.bools) + if len_ops != len_bools: + raise Exception(f"length mismatch: {len_ops=} != {len_bools=}") + is_precise_aggregated = torch.tensor(1.0) + for i in range(len_bools): + res = self.bools[i]() + is_precise_aggregated = torch.logical_and(is_precise_aggregated, res) + return is_precise_aggregated, op.result + elif current_op_index > len_ops - 1: + # Sanity check that current op index does not exceed the length of ops + raise Exception(f"current_op_index out of bound: {current_op_index=} > {len_ops=}") + else: + # It's not the last operation, just return the result + return op.result class IModel(nn.Module): @@ -62,19 +102,17 @@ def forward(self, *x: list[torch.Tensor]) -> tuple[IsResultPrecise, torch.Tensor # An computation function. Example: # def computation(state: State, x: list[torch.Tensor]): -# b_0, out_0 = state.median(x[0]) -# b_1, out_1 = state.median(x[1]) -# b_2, out_2 = state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1)) -# return torch.logical_and(torch.logical_and(b_0, b_1), b_2), out_2 +# out_0 = state.median(x[0]) +# out_1 = state.median(x[1]) +# return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1)) TComputation = Callable[[State, list[torch.Tensor]], tuple[IsResultPrecise, torch.Tensor]] - -def create_model(computation: TComputation) -> Type[IModel]: +def create_model(computation: TComputation, error: float = DEFAULT_ERROR) -> Type[IModel]: """ Create a torch model from a `computation` function defined by user """ - state = State() + state = State(error) class Model(IModel): def preprocess(self, x: list[torch.Tensor]) -> None: From b105fca8665ff99545f09093099ed71435e1b293 Mon Sep 17 00:00:00 2001 From: mhchia Date: Thu, 18 Jan 2024 17:52:27 +0800 Subject: [PATCH 5/7] remove comments --- zkstats/computation.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/zkstats/computation.py b/zkstats/computation.py index 3e841fc..83ae74d 100644 --- a/zkstats/computation.py +++ b/zkstats/computation.py @@ -56,10 +56,6 @@ def _call_op(self, x: torch.Tensor, op_type: Type[Operation]) -> Union[torch.Ten if not isinstance(op, op_type): raise Exception(f"operation type mismatch: {op_type=} != {type(op)=}") - ### - # Change the states to avoid race condition - # - # Increment the current op index self.current_op_index += 1 @@ -67,7 +63,6 @@ def _call_op(self, x: torch.Tensor, op_type: Type[Operation]) -> Union[torch.Ten def is_precise() -> IsResultPrecise: return op.ezkl(x) self.bools.append(is_precise) - ### # If this is the last operation, aggregate all `is_precise`, and return (is_precise_aggregated, result) # else, return only result @@ -77,10 +72,12 @@ def is_precise() -> IsResultPrecise: if len_ops != len_bools: raise Exception(f"length mismatch: {len_ops=} != {len_bools=}") is_precise_aggregated = torch.tensor(1.0) - for i in range(len_bools): - res = self.bools[i]() - is_precise_aggregated = torch.logical_and(is_precise_aggregated, res) - return is_precise_aggregated, op.result + # for i in range(len_bools): + # res = self.bools[i]() + # is_precise_aggregated = torch.logical_and(is_precise_aggregated, res) + print("!@# LASTTTTT!!!") + return self.bools[0](), op.result + # return torch.tensor(1.0), op.result elif current_op_index > len_ops - 1: # Sanity check that current op index does not exceed the length of ops raise Exception(f"current_op_index out of bound: {current_op_index=} > {len_ops=}") From ad3666cd0727232645633e17fb89d0f2b081514c Mon Sep 17 00:00:00 2001 From: mhchia Date: Fri, 19 Jan 2024 15:57:03 +0800 Subject: [PATCH 6/7] fix: make mean's output a scalar instead of a 2d array To ensure `lower` and `upper` are a scalar, `x` must be a 1d array. Otherwise, if `x` is a 3d array, `lower` and `upper` will be 2d array, which are not what we want in our context. However, we tend to have x as a `[1, len(x), 1]`. In this case, we need to flatten `x` to 1d array to get the correct `lower` and `upper`. --- examples/computation/computation.ipynb | 433 ++++++------------------- zkstats/computation.py | 13 +- zkstats/ops.py | 23 +- 3 files changed, 122 insertions(+), 347 deletions(-) diff --git a/examples/computation/computation.ipynb b/examples/computation/computation.ipynb index 9f45abb..9ea04d1 100644 --- a/examples/computation/computation.ipynb +++ b/examples/computation/computation.ipynb @@ -18,24 +18,24 @@ "Requirement already satisfied: statistics in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 7)) (1.0.3.5)\n", "Requirement already satisfied: onnx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from -r ../../requirements.txt (line 8)) (1.15.0)\n", "Requirement already satisfied: fsspec in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (2023.12.0)\n", - "Requirement already satisfied: networkx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.2.1)\n", - "Requirement already satisfied: jinja2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.1.2)\n", - "Requirement already satisfied: sympy in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (1.12)\n", "Requirement already satisfied: filelock in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.13.1)\n", "Requirement already satisfied: typing-extensions in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (4.8.0)\n", + "Requirement already satisfied: jinja2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.1.2)\n", + "Requirement already satisfied: networkx in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (3.2.1)\n", + "Requirement already satisfied: sympy in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from torch->-r ../../requirements.txt (line 2)) (1.12)\n", "Requirement already satisfied: idna<4,>=2.5 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.6)\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.3.2)\n", "Requirement already satisfied: certifi>=2017.4.17 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (2023.11.17)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (3.3.2)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from requests->-r ../../requirements.txt (line 3)) (2.1.0)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (2.8.2)\n", "Requirement already satisfied: contourpy>=1.0.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.2.0)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (4.46.0)\n", + "Requirement already satisfied: cycler>=0.10 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (0.12.1)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.4.5)\n", "Requirement already satisfied: pyparsing>=2.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (3.1.1)\n", "Requirement already satisfied: importlib-resources>=3.2.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (6.1.1)\n", - "Requirement already satisfied: cycler>=0.10 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (0.12.1)\n", - "Requirement already satisfied: packaging>=20.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (23.2)\n", - "Requirement already satisfied: python-dateutil>=2.7 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (2.8.2)\n", "Requirement already satisfied: pillow>=8 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (10.1.0)\n", - "Requirement already satisfied: fonttools>=4.22.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (4.46.0)\n", - "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (1.4.5)\n", + "Requirement already satisfied: packaging>=20.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from matplotlib->-r ../../requirements.txt (line 6)) (23.2)\n", "Requirement already satisfied: docutils>=0.3 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from statistics->-r ../../requirements.txt (line 7)) (0.20.1)\n", "Requirement already satisfied: protobuf>=3.20.2 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from onnx->-r ../../requirements.txt (line 8)) (4.25.1)\n", "Requirement already satisfied: zipp>=3.1.0 in /Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib->-r ../../requirements.txt (line 6)) (3.17.0)\n", @@ -157,324 +157,26 @@ "metadata": {}, "outputs": [ { - "name": "stdout", + "name": "stderr", "output_type": "stream", "text": [ - "!@# x: [tensor([[[23.2000],\n", - " [92.8000],\n", - " [91.0000],\n", - " [37.2000],\n", - " [82.0000],\n", - " [15.5000],\n", - " [79.3000],\n", - " [46.6000],\n", - " [98.1000],\n", - " [75.5000],\n", - " [78.9000],\n", - " [77.6000],\n", - " [33.8000],\n", - " [75.7000],\n", - " [96.8000],\n", - " [12.3000],\n", - " [18.4000],\n", - " [13.4000],\n", - " [ 6.0000],\n", - " [ 8.2000],\n", - " [25.8000],\n", - " [41.3000],\n", - " [68.5000],\n", - " [15.2000],\n", - " [74.7000],\n", - " [72.7000],\n", - " [18.0000],\n", - " [42.2000],\n", - " [36.1000],\n", - " [76.7000],\n", - " [ 1.2000],\n", - " [96.4000],\n", - " [ 4.9000],\n", - " [92.0000],\n", - " [12.8000],\n", - " [28.2000],\n", - " [61.8000],\n", - " [56.9000],\n", - " [44.3000],\n", - " [50.4000],\n", - " [81.6000],\n", - " [72.5000],\n", - " [12.9000],\n", - " [40.3000],\n", - " [12.8000],\n", - " [28.8000],\n", - " [36.3000],\n", - " [16.1000],\n", - " [68.4000],\n", - " [35.3000],\n", - " [79.2000],\n", - " [48.4000],\n", - " [97.1000],\n", - " [93.7000],\n", - " [77.0000],\n", - " [48.7000],\n", - " [93.7000],\n", - " [54.1000],\n", - " [65.4000],\n", - " [30.8000],\n", - " [34.4000],\n", - " [31.4000],\n", - " [78.7000],\n", - " [12.7000],\n", - " [90.7000],\n", - " [39.4000],\n", - " [86.0000],\n", - " [55.9000],\n", - " [ 6.8000],\n", - " [22.2000],\n", - " [65.3000],\n", - " [18.8000],\n", - " [ 7.1000],\n", - " [55.9000],\n", - " [38.6000],\n", - " [15.6000],\n", - " [59.2000],\n", - " [77.3000],\n", - " [76.9000],\n", - " [11.9000],\n", - " [19.9000],\n", - " [19.4000],\n", - " [54.3000],\n", - " [39.4000],\n", - " [ 4.0000],\n", - " [61.1000],\n", - " [16.8000],\n", - " [81.9000],\n", - " [49.3000],\n", - " [76.9000],\n", - " [19.2000],\n", - " [68.2000],\n", - " [54.4000],\n", - " [70.2000],\n", - " [89.8000],\n", - " [23.4000],\n", - " [67.5000],\n", - " [18.7000],\n", - " [10.8000],\n", - " [80.7000],\n", - " [80.3000],\n", - " [96.2000],\n", - " [62.3000],\n", - " [17.2000],\n", - " [23.0000],\n", - " [98.0000],\n", - " [19.1000],\n", - " [ 8.1000],\n", - " [36.2000],\n", - " [ 7.5000],\n", - " [55.9000],\n", - " [ 1.2000],\n", - " [56.8000],\n", - " [85.1000],\n", - " [18.9000],\n", - " [23.0000],\n", - " [13.5000],\n", - " [64.3000],\n", - " [ 9.1000],\n", - " [14.1000],\n", - " [14.1000],\n", - " [23.1000],\n", - " [73.2000],\n", - " [86.6000],\n", - " [39.1000],\n", - " [45.5000],\n", - " [85.0000],\n", - " [79.0000],\n", - " [15.8000],\n", - " [ 5.2000],\n", - " [81.5000],\n", - " [34.3000],\n", - " [24.3000],\n", - " [14.2000],\n", - " [84.6000],\n", - " [33.7000],\n", - " [86.3000],\n", - " [83.3000],\n", - " [62.8000],\n", - " [72.7000],\n", - " [14.7000],\n", - " [36.8000],\n", - " [92.5000],\n", - " [ 4.7000],\n", - " [30.0000],\n", - " [59.4000],\n", - " [57.6000],\n", - " [37.4000],\n", - " [22.0000],\n", - " [20.9000],\n", - " [61.6000],\n", - " [26.8000],\n", - " [47.1000],\n", - " [63.6000],\n", - " [ 6.0000],\n", - " [96.6000],\n", - " [61.2000],\n", - " [80.2000],\n", - " [59.3000],\n", - " [23.1000],\n", - " [29.3000],\n", - " [46.3000],\n", - " [89.2000],\n", - " [77.6000],\n", - " [83.2000],\n", - " [87.2000],\n", - " [63.2000],\n", - " [81.8000],\n", - " [55.0000],\n", - " [59.7000],\n", - " [57.8000],\n", - " [43.4000],\n", - " [92.4000],\n", - " [66.9000],\n", - " [82.1000],\n", - " [51.0000],\n", - " [22.1000],\n", - " [29.9000],\n", - " [41.0000],\n", - " [85.2000],\n", - " [61.5000],\n", - " [14.6000],\n", - " [48.0000],\n", - " [52.7000],\n", - " [31.4000],\n", - " [83.9000],\n", - " [35.5000],\n", - " [77.3000],\n", - " [35.8000],\n", - " [32.6000],\n", - " [22.2000],\n", - " [19.3000],\n", - " [49.1000],\n", - " [70.9000],\n", - " [43.9000],\n", - " [88.8000],\n", - " [56.3000],\n", - " [41.8000],\n", - " [90.3000],\n", - " [20.4000],\n", - " [80.4000],\n", - " [36.4000],\n", - " [91.5000],\n", - " [69.6000],\n", - " [75.3000],\n", - " [92.4000],\n", - " [84.8000],\n", - " [17.7000],\n", - " [ 2.3000],\n", - " [41.3000],\n", - " [91.3000],\n", - " [68.6000],\n", - " [73.3000],\n", - " [62.5000],\n", - " [60.5000],\n", - " [73.5000],\n", - " [70.7000],\n", - " [77.5000],\n", - " [76.8000],\n", - " [98.1000],\n", - " [40.9000],\n", - " [66.3000],\n", - " [ 8.6000],\n", - " [48.9000],\n", - " [75.4000],\n", - " [14.7000],\n", - " [35.9000],\n", - " [89.6000],\n", - " [15.1000],\n", - " [45.0000],\n", - " [77.6000],\n", - " [30.5000],\n", - " [76.1000],\n", - " [46.9000],\n", - " [34.3000],\n", - " [65.1000],\n", - " [43.9000],\n", - " [91.6000],\n", - " [88.8000],\n", - " [ 8.9000],\n", - " [42.9000],\n", - " [11.8000],\n", - " [32.1000],\n", - " [20.1000],\n", - " [48.9000],\n", - " [79.7000],\n", - " [15.3000],\n", - " [45.4000],\n", - " [80.1000],\n", - " [73.1000],\n", - " [76.5000],\n", - " [52.4000],\n", - " [ 9.6000],\n", - " [41.9000],\n", - " [52.7000],\n", - " [55.1000],\n", - " [30.9000],\n", - " [83.7000],\n", - " [46.7000],\n", - " [39.3000],\n", - " [40.5000],\n", - " [52.4000],\n", - " [19.2000],\n", - " [25.8000],\n", - " [52.7000],\n", - " [81.0000],\n", - " [38.0000],\n", - " [54.5000],\n", - " [15.3000],\n", - " [64.3000],\n", - " [88.3000],\n", - " [49.8000],\n", - " [90.5000],\n", - " [90.4000],\n", - " [79.7000],\n", - " [87.3000],\n", - " [32.3000],\n", - " [11.9000],\n", - " [ 5.7000],\n", - " [33.6000],\n", - " [75.1000],\n", - " [65.9000],\n", - " [29.1000],\n", - " [39.4000],\n", - " [87.5000],\n", - " [ 3.3000],\n", - " [66.3000],\n", - " [79.0000],\n", - " [97.9000],\n", - " [69.6000],\n", - " [22.0000],\n", - " [62.8000],\n", - " [97.1000],\n", - " [90.4000],\n", - " [39.5000],\n", - " [11.7000],\n", - " [30.3000],\n", - " [18.9000],\n", - " [34.6000],\n", - " [ 6.6000]]], dtype=torch.float64)]\n" + "/var/folders/t3/5psrvr1x0w1_6n9kx2n7d9700000gn/T/ipykernel_56057/1617438771.py:8: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n", + " return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", + "/var/folders/t3/5psrvr1x0w1_6n9kx2n7d9700000gn/T/ipykernel_56057/1617438771.py:8: TracerWarning: Converting a tensor to a Python float might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!\n", + " return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", + "/Users/mhchia/projects/work/pse/zk-stats-lib/zkstats/computation.py:75: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.\n", + " is_precise_aggregated = torch.tensor(1.0)\n", + "/Users/mhchia/projects/work/pse/zk-stats-lib/.venv/lib/python3.9/site-packages/torch/onnx/symbolic_opset9.py:2174: FutureWarning: 'torch.onnx.symbolic_opset9._cast_Bool' is deprecated in version 2.0 and will be removed in the future. Please Avoid using this function and create a Cast node instead.\n", + " return fn(g, to_cast_func(g, input, False), to_cast_func(g, other, False))\n" ] }, { - "ename": "IndexError", - "evalue": "list index out of range", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[6], line 11\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m state\u001b[38;5;241m.\u001b[39mmean(torch\u001b[38;5;241m.\u001b[39mtensor([out_0, out_1])\u001b[38;5;241m.\u001b[39mreshape(\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m1\u001b[39m))\n\u001b[1;32m 10\u001b[0m prover_model \u001b[38;5;241m=\u001b[39m create_model(computation)\n\u001b[0;32m---> 11\u001b[0m \u001b[43mprover_gen_settings\u001b[49m\u001b[43m(\u001b[49m\u001b[43m[\u001b[49m\u001b[43mdata_path\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcomb_data_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprover_model\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprover_model_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mdefault\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mresources\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msettings_path\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/projects/work/pse/zk-stats-lib/zkstats/core.py:119\u001b[0m, in \u001b[0;36mprover_gen_settings\u001b[0;34m(data_path_array, comb_data_path, prover_model, prover_model_path, scale, mode, settings_path)\u001b[0m\n\u001b[1;32m 116\u001b[0m data_tensor_array \u001b[38;5;241m=\u001b[39m process_data(data_path_array, comb_data_path)\n\u001b[1;32m 118\u001b[0m \u001b[38;5;66;03m# export onnx file\u001b[39;00m\n\u001b[0;32m--> 119\u001b[0m \u001b[43mexport_onnx\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprover_model\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdata_tensor_array\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprover_model_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 120\u001b[0m \u001b[38;5;66;03m# gen + calibrate setting\u001b[39;00m\n\u001b[1;32m 121\u001b[0m gen_settings(comb_data_path, prover_model_path, scale, mode, settings_path)\n", - "File \u001b[0;32m~/projects/work/pse/zk-stats-lib/zkstats/core.py:19\u001b[0m, in \u001b[0;36mexport_onnx\u001b[0;34m(model, data_tensor_array, model_loc)\u001b[0m\n\u001b[1;32m 17\u001b[0m circuit \u001b[38;5;241m=\u001b[39m model()\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 19\u001b[0m \u001b[43mcircuit\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpreprocess\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata_tensor_array\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m:\n\u001b[1;32m 21\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m~/projects/work/pse/zk-stats-lib/zkstats/computation.py:119\u001b[0m, in \u001b[0;36mcreate_model..Model.preprocess\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpreprocess\u001b[39m(\u001b[38;5;28mself\u001b[39m, x: \u001b[38;5;28mlist\u001b[39m[torch\u001b[38;5;241m.\u001b[39mTensor]) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 119\u001b[0m \u001b[43mcomputation\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 120\u001b[0m state\u001b[38;5;241m.\u001b[39mset_ready_for_exporting_onnx()\n", - "Cell \u001b[0;32mIn[6], line 7\u001b[0m, in \u001b[0;36mcomputation\u001b[0;34m(state, x)\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m!@# x:\u001b[39m\u001b[38;5;124m\"\u001b[39m, x)\n\u001b[1;32m 6\u001b[0m out_0 \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mmedian(x[\u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m----> 7\u001b[0m out_1 \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mmedian(\u001b[43mx\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m)\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m state\u001b[38;5;241m.\u001b[39mmean(torch\u001b[38;5;241m.\u001b[39mtensor([out_0, out_1])\u001b[38;5;241m.\u001b[39mreshape(\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m1\u001b[39m))\n", - "\u001b[0;31mIndexError\u001b[0m: list index out of range" + "name": "stdout", + "output_type": "stream", + "text": [ + "==== Generate & Calibrate Setting ====\n", + "scale: default\n", + "setting: {\"run_args\":{\"tolerance\":{\"val\":0.0,\"scale\":1.0},\"input_scale\":8,\"param_scale\":8,\"scale_rebase_multiplier\":10,\"lookup_range\":[-34048,33628],\"logrows\":17,\"num_inner_cols\":2,\"variables\":[[\"batch_size\",1]],\"input_visibility\":{\"Hashed\":{\"hash_is_public\":true,\"outlets\":[]}},\"output_visibility\":\"Public\",\"param_visibility\":\"Private\"},\"num_rows\":1312,\"total_assignments\":289,\"total_const_size\":52,\"model_instance_shapes\":[[1],[1]],\"model_output_scales\":[0,8],\"model_input_scales\":[8],\"module_sizes\":{\"kzg\":[],\"poseidon\":[1312,[1]],\"elgamal\":[0,[0]]},\"required_lookups\":[\"Abs\",{\"GreaterThan\":{\"a\":0.0}},\"KroneckerDelta\"],\"check_mode\":\"UNSAFE\",\"version\":\"7.0.0\",\"num_blinding_factors\":null}\n" ] } ], @@ -483,9 +185,9 @@ "\n", "\n", "def computation(state: State, x: list[torch.Tensor]):\n", - " print(\"!@# x:\", x)\n", - " out_0 = state.median(x[0])\n", - " out_1 = state.median(x[0])\n", + " x_0 = x[0]\n", + " out_0 = state.median(x_0)\n", + " out_1 = state.median(x_0)\n", " return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", "\n", "prover_model = create_model(computation)\n", @@ -508,9 +210,63 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "spawning module 0\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "==== setting up ezkl ====\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "spawning module 2\n", + "spawning module 0\n", + "spawning module 2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Time setup: 23.758974313735962 seconds\n", + "=======================================\n", + "!@# compiled_model exists? True\n", + "!@# compiled_model exists? True\n", + "==== Generating Witness ====\n", + "witness boolean: 1.0\n", + "witness result 1 : 59.6015625\n", + "==== Generating Proof ====\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "spawning module 0\n", + "spawning module 2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "proof: {'instances': [[[1969817931821079592, 14093252634055327186, 3010599488369023793, 2676483216109330922], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [10077958863098660019, 689600963559187911, 14561112591056096131, 381975124955332008]]], 'proof': '0d74573c6f907eddd298a72bc0d97b89e8b39d3fbb63b132fb6e9a72e566f5b41dcee3495d40f3c0ce73f2469c5e3d7b48d69b25a37ce19d15536c2932d72e9c0838b9435df676b85297131d7b3e791ee365137a82cf577503ffb33102d520c4035446c0cf0045c3843f163586289422aa07d07ea9be17c207f54110fe7a3d00047e0c4de126417a3f04612935c7f516afb647eb5cc7cddca9121d487e2483651f84e3676caf3cd1646cea8f8e2451226dae62df907ed6a2e68f38d005cf08562cf756873193135047aa8a8d49f58672b4d7794c97aaf8f4af9497bb67cc12750c7abb9cd75076e03b8888d8975c8764311a62ac32545333ccef4785e130fda7160ff719ebb890f2081264d4bba44927d8be5919e1c666674c2755170ba123220f7dd8ce25687e6ac5d95e241feaab2712c94983f67c29a772c8d970c2bd7169224746428dec36a5f3c16020a8b6ee18259514335861468bf6e84d473d9221fb2447517cce833b359fccef7522a8d952d5ca23fcaa082dd6f1514f52723ef9210bb7576513c1ef3cce490647cb837b08c6b4acdb03c1c9f264a1d64dc118f2bc09b2c109d4987985cd361a8499a4df32590dcb9e8bdbcab4c28a197df35e6e9922fe3b7279f14a74092a92f5e7f70bbf5e377a61dd60387ac1a92da4c1bbb9c00954ebf7edf548662a711bd2e52533944aba6ce9921c1f471763fca211eb07170c70dd8103c25a9603740d68957c1b80924e47ade661f37ca5062371c5742165266e959e6e2c1833ed79a8967122ead5d9b32f62436fef8299947d8758d09d6d17f3a6383e7a59088449c46f2feb8be94ec9f036509e6290f8a8074b71813f55148ac214874c53b13f0571434448e2958b2e85144c85b7955a572c0e51185dc61716b3eb33f2c7c4af200ad596b5d416fdd1f1478b0e5fb7fa9bdebc218352e81fc72471d8a2d94f5002b448da9617a44f52811d4e41764283aabedcac125b011bad373dfcab6e667d24437f81c79a7b3c7c1f1b18d6c0677e96b1bac0183c222c4123462f41ce90e95048721c31654f56608ca1301cf9d425459b829dfdf1fc0d820f7098f968194f86ac1991515b2b05014acdf91ae3bc3b642bd1805786b42a2d58523a287bc3d22f6593bf5b3a10ac389a8c87bcea4ebd07ee89a95be84a258378494e05856815bc60053749bac64c7bedc73cfa56e88568270ff351518e0a9b004760f47917851594a043051f318d360c836664414796fb995ef40ce62f1efe61e76ba18f81867e524093084dce151b53f82c4f931753d3978cbdaa35191f31d46738d333142c225f5325273b6a22ead726b44ee175b2b0ddd45072efc426c012dd6df12681f4af332c0414016d1e6f6cd75aef6201a544cd1687ceb41806e489bc802bb995c2fbde070b951809b206e4748e75d3a642e7fccc0b7ca0000d99afb5d3f4ccefea59ca330d767e7b79e56acb85c6c24fadc59d3f5d852788084a258c1e3874529bf0d9412f7f7c63927bcf806499c0e7eeb44dd36da9028f0c923bb943a7ae05b8ac0d3024c6063d3aed875588e0f1225c5301eb6633a724011e450181f5214ccc78abd0086e9e9bef1aee8a5b9e20e998ec057e03017dc208679bd6413fcebde6c4dbf52d76fbddc3faf87d1f4ddfda25edadf0a520bbef2be7d0015d752d95f14be0d917d1d0089c9911ad88fc77ee1ed616f25f5bd487089837c45b2314a172fca59efaab4ebfe385fda79983be91b4323f1997a00a7e21dba837d83dd616e93c6e8ad2c390979ec52a3cfcbb95973673b2a7b71f2dda064c80125534e7e9ba00525078ac45d3eacb159b5663228522211abadbacda611eb71f7d52b3594b618bc3b970b92dfc740bb6982a684d80b036c12380fe9703193e02af3a2763b23a61f34ee86cd1273a0bdcbf75326950554dc24c3ed88a082bcfde2527168466b8f7e0745dab28d67232c91b1e9bb2f23d874e5bfcd4dc1c2983117118161f343c89ca25da3238bd8820925402e43e727229b74d55879a4d2d2c9752bb49b861ec02fd0dfb3012b762ee7530a00b6c15006bff88393da58e074a62330c34bc11579235620d6f7b4415d01da2d3705fb9495d7ba4615e915806d28b6d4b17ba5e7144ae13e4d1391195b24f4bae6e8a6733c8ddb325f22faf1fda1fd8dbb3f05f8e01a6b1e53d5155342db351d33307ef259815b6d1f7b2e103d70459abd1ab645af41307b457c609f4da2dff8febe99c5bbeaaa8bd0ed1e52b52bd1a0fe2dec76756f8da36597d19632c58cbe991bfc422eb1a55964bbabd21c03dc3e1f5270c9ec9e1686a60dcbb6b568d5602b14645ba8dadcf13d09677096c94b2f21446a9d997f3e83aaa62b7b22aa10934a17a23d1b1574f48be449c1905c22027e5edbb8b6e5190185e84723b85fc65e8ff71b65e632756520f41111e8870cbfac707e5041f3eb09c7379958f0d7eeb8f3aa44646c962b7dde389f3182121c7c1a6ef54d340fcab3225874e9ca59c24abe4df8aea9ca07c6365300611124426da29867818a7715675b4ff52974a6be243fe74ff775d90053381a6242be2780ad42b36eb8f8b190319598f3faaf6bc62c2b6505a16d94e65eca1a1a113cb32304440a8d0ea59afbdbe017bef522d2093e2e31bc51c3787ccac5bc81809bdbe6667c13502de1411f257a4fd20487495427099a6f8ccc77e753bc48f19077b314e3f4de1892f253d809c7448dde49b1699fd025fea9bf7c266660370f2148ad5d6651103711fa712c27b502baaa40730cb8d5b176a28cb9d1bcc518ab520894e31c6d7cf9c98340e7830f747d2a2635716f78e8f46ff2fbd77532587842be522f8edb4d4e43fda32a6cfa8996bb73951a921d93a3d52b0e3d63bf4a97f20e37c379aa4724b7c4461597806e1fe2a2119744538ee0673db36f5fe344c9e1ec252442b148c0f4f7add1b0e0fd382f63b9283b98c745fb3481d185423ac4c2e89f497d17fde562ca8bad8a18e2000d913d87b854e653b69c065d09a6815902333789e2205ac548e65e36f1c14bb3825ca6725ec5098a659428ed2931effe515e4ae1490839108062431323a33d33606c0f7b7b777a0c51356e5086968e5780c013ada34a9fdd250e084b7882ae78596c61d7d02a5bc49d9153157a4a595cd140f633afb3d903c3831c3ec70e5b3fc892dadf44b490ab2ccdc122e90dd5e5e26316c206063e07ec0cbcf3794f4f5a3bf528362b5e2ceaf43ffb27c97f307092c850a621b59b9903927fa21b4e1fda318e7984770fc467a29163b722c72002c06e5d0db9b79081070bc8829c80a69619e2699aca320e89c1359fd3e8ce9ab8818c77b79eeaec47489643196ec35d5c9bdbd3ae8dbe2673a380a1da733129979201223d66dc653a712d2d91f7f1e58f2650e107ec9bf65318d25a4d9748e0b0c073af7958e473cd3b326159b82c1ccb720bbde41d1dc030e7569a06070525d1c07f829e9af2735f64d01d40407c498c362d1e5eef71c0c244e0516bc1f427e991069dec9cf3ee13f0d3ac65c817af7d82821e53106eb28b74cee5e52c971674d17bd47df935b55c5c00f706e90323ae9b476774ba2683bd866765851133bcda50d96e701a511eeb94d9dacb3c02f19cb5c852f325fd97237feff265c27c289802fca59ed7a8cf79bfbafec937480ab28a129acce6af9149d0520c4f8b06375e121f0be4f9f34318aff158a6fc53879ca91407f014537327a6bf804526ee1136b112e9669af424f3b52835700b46e19ce2fb32a17ff231b99a36c5472da1d8720015d8fc9cfd0dd5318f156e60ae2c6fb18f32cf7b12c57829660da5e7fbd10a51b3236c833ccd49584b8b07182ec995803c49996560fc4ac6cf9d525819588492b9c9b95694137cb3ff1aa402ff539c148961da42630b9ae4c72b5f4671c38c62206b9812a3341d7d0ebf2f0da44c98f88d76e8da60637c0a3a7a7baf424f81a000000000000000000000000000000000000000000000000000000000000000017496b23d94e929942aa11c316527cbd6e9ac8f4157f407527ac0245f354d9e41c6b0ca3128a7237b1d7e42d3672db1ca1b2f1a88fc81b482f98247bb044ad9b186c8395da679ddabfeec1b838c22bf1da9f546882149a7be44dbe07df733c980a65ae9642693327faa111be7a472407a532c99148075741480c148c6f66f46c183d50ddd9a3cc2d5a6040d49bcafe5092f3ff2cef34075196f5f89568248fe02ec17570bc48b40b0f069f821f77f6f066aee27798bcda6f14dd08e48a11d0760110a8e30d150b90bf5f45599cc8de233d1fec25b77da680a8a31fabb670ad730f2e595bbf06ff6137317f705833095cdc58f5ffe93188231bd0d2be1e833d6712ea7ec02056218b3dea4fe4e8023da3b01ef541b3117a7d240cc488b5a4c7792178a927b6c5aa490cb67baccbdb26520becf36c083087f0410b1ecd25c4958f15456ba16a8829dfa67b50d881e4d996e588b22bd5312aee3698e969c6bcc16705ef97e7a85bce8dd9b91ba9612606f7345a2ff0981d5803b9343cae9556dc012506f4f92a3f8b5458250e0ab7a2eb51e3f55e7ab9747e1f7fc1115722c2114326a35eb56285e116e789eac4471ad45b3a64dd2d63207ad2d1e65f3537cf31171ac44734853ff134c35a62af8ef0aa57ab9ef0fe3f47b605a03c7d5a600056020a8ce61589f9d8c165298be34e61b14e156196ded3920fda5198dd7e8b20759d2b7d1e0758c86b33d7c1f0700cd01ab96e75c6a4947913e9344a15254367406821c49600dd6a726cf438a3b8fb2ff9d12b45234ac18530e490b1d467706b441f1f8f9f2d770a9913e14e87d53b0a18c34d9298669fd91a495735f2bfb418d9602b01c7d764de4321d0df626dc0c0f48b6fd627214f1711f59267edc81e4bfa1b0a934ccc44ceea2dd4ee1642a1201f9384aef2f59398fdcbe6cdbc5c15b799cc28b96ba77b0e7e9c944ac15fb5ad911c48b57c2333e9d7c0b145756cec51fbb72d4c07c0b9afcc50006c3fe5494240d2be4c05c1e8b4ffcca2b2c97bd2d5585611ee24149cab975ba15fc2c535beb7f40609b83148848bd54274a16fb280d83f2aeaabdafe8b712c68637e14691a39c22c7a00f6c300667471413a797c0470dd11e5f9ac00f7eedf98a95427ac86acaccf5cc84dc43ad6dba483f2881077982a1a7a4ae57e699cf693c340e337ed96dda66f950904fc43146b5c1755ef9782cd16e75f6675eff5d0f8035113c447268a75f6f778327c14e3218e7f9e9b968bb219e17cb8437ae289e78d46f0920b6b9bf995ed8718d1eae0c7df5821a223782309ba31973ff2fe0928c70e017b03cbbf5030dc3f9aeed3bea7977c0c4e8fc5210048e741c4d05e2c0df89139046f1319219b1031fa2de4e1c34b1a68c779c3b30e984a6692a248b91f7f587a41e8e1906b24139d763792044218e68e2e49c4b8243b77b3d6b488ce9e42f408e30e0849f3d22e396ad92040e1a20b8fe7c9af7d0668e080bfac2ef7a0109f8557eec41e57712a79eac6a19a7c12266b88e1f33c11d0c5d2e88d80682654f0e59f2292eb170bd051553417b0e37666d0aabd0c7500fb34d4cccceb5dc0e1c2d55e70ae047058da4f045614026a5106d3cd563fee0a3a0b14dedc96b9a04974582f8b221bb874ae0642a2a18ee9eecd06cc0b67e51c5133b2212bb2faf450dac68cdcba1acc3bcca474353e55ff2b11d7198d6bd017237910652f40983be73c91be2719902a26bf2cd4311ddb231fa4ac082f81c223a0164241d6888a351455c6cbaa425e1f1514e1aec5084f09e8bc007ff753a217af1a45aa1e5248f38f0a38e3c600ccca1892fc1bc322e0633dcd399add8ca5203a72cbb04b66d341b662b3dbc40018da547c7d23ba446215115c2e0278729915157fe4b9d9c2ef2360b4dc23871a614279764c81bbcf7b848a82178259bb40203f203c911267069d1dbdc7a6f111559d22be7f5fc88d17a9f581760401c4d41fb57ee64b04ff83c7ecdc77f3efa8571dc60f01f3a22489d62ed2728b523a32136e25abb4db7d7a808c8e51bd5879e8937e07e17773c009117152df90632c231d92bb18ba49e5f2179f81169c1abb0a69334fe36b165008ee3bdfd7f714211706f42eda605931cb2db589822a2d1491419e17cca022b18fc3158f7afc67a7312afab1f21db369a1c078c74c97cb151a88e48a220fd4037a6663fb9ace95561121844c751cea4c06bae23358f6d1d09826f27d77930075f614efbfecd38a0b242e354742cb6b9893124f330765a7d8cbde3188732aefb69d17c1fda64ee80fb7', 'transcript_type': 'EVM'}\n", + "Time gen prf: 32.832326889038086 seconds\n" + ] + } + ], "source": [ "# Here verifier & prover can concurrently call setup since all params are public to get pk.\n", "# Here write as verifier function to emphasize that verifier must calculate its own vk to be sure\n", @@ -524,20 +280,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "num_inputs: 1\n", + "prf instances: [[[1969817931821079592, 14093252634055327186, 3010599488369023793, 2676483216109330922], [12436184717236109307, 3962172157175319849, 7381016538464732718, 1011752739694698287], [10077958863098660019, 689600963559187911, 14561112591056096131, 381975124955332008]]]\n", + "proof boolean: 1.0\n", + "proof result 1 : 59.6015625\n", + "verified\n" + ] + } + ], "source": [ "# Verifier verifies\n", "verifier_verify(proof_path, settings_path, vk_path)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/zkstats/computation.py b/zkstats/computation.py index 83ae74d..893e13a 100644 --- a/zkstats/computation.py +++ b/zkstats/computation.py @@ -25,6 +25,7 @@ def __init__(self, error: float) -> None: self.ops: list[Operation] = [] self.bools: list[Callable[[], torch.Tensor]] = [] self.error: float = error + # Pointer to the current operation index. If None, it's in stage 1. If not None, it's in stage 3. self.current_op_index: Optional[int] = None def set_ready_for_exporting_onnx(self) -> None: @@ -64,7 +65,7 @@ def is_precise() -> IsResultPrecise: return op.ezkl(x) self.bools.append(is_precise) - # If this is the last operation, aggregate all `is_precise`, and return (is_precise_aggregated, result) + # If this is the last operation, aggregate all `is_precise` in `self.bools`, and return (is_precise_aggregated, result) # else, return only result if current_op_index == len_ops - 1: # Sanity check for length of self.ops and self.bools @@ -72,12 +73,10 @@ def is_precise() -> IsResultPrecise: if len_ops != len_bools: raise Exception(f"length mismatch: {len_ops=} != {len_bools=}") is_precise_aggregated = torch.tensor(1.0) - # for i in range(len_bools): - # res = self.bools[i]() - # is_precise_aggregated = torch.logical_and(is_precise_aggregated, res) - print("!@# LASTTTTT!!!") - return self.bools[0](), op.result - # return torch.tensor(1.0), op.result + for i in range(len_bools): + res = self.bools[i]() + is_precise_aggregated = torch.logical_and(is_precise_aggregated, res) + return is_precise_aggregated, op.result elif current_op_index > len_ops - 1: # Sanity check that current op index does not exceed the length of ops raise Exception(f"current_op_index out of bound: {current_op_index=} > {len_ops=}") diff --git a/zkstats/ops.py b/zkstats/ops.py index e8c0277..890f9f9 100644 --- a/zkstats/ops.py +++ b/zkstats/ops.py @@ -22,7 +22,6 @@ def create(cls, x: torch.Tensor, error: float) -> 'Operation': def ezkl(self, x: torch.Tensor) -> IsResultPrecise: ... - class Mean(Operation): @classmethod def create(cls, x: torch.Tensor, error: float) -> 'Mean': @@ -33,11 +32,27 @@ def ezkl(self, X: torch.Tensor) -> IsResultPrecise: return torch.abs(torch.sum(X)-size[1]*self.result)<=torch.abs(self.error*size[1]*self.result) +def to_1d(x: torch.Tensor) -> torch.Tensor: + x_shape = x.size() + # Only allows 1d array or [1, len(x), 1] + if len(x_shape) == 1: + return x + elif len(x_shape) == 3 and x_shape[0] == 1 and x_shape[2] == 1: + return x.reshape(-1) + else: + raise Exception(f"Unsupported shape: {x_shape=}") + + class Median(Operation): def __init__(self, x: torch.Tensor, error: float): - super().__init__(torch.tensor(np.median(x)), error) - sorted_x = np.sort(x) - len_x = len(x) + # NOTE: To ensure `lower` and `upper` are a scalar, `x` must be a 1d array. + # Otherwise, if `x` is a 3d array, `lower` and `upper` will be 2d array, which are not what + # we want in our context. However, we tend to have x as a `[1, len(x), 1]`. In this case, + # we need to flatten `x` to 1d array to get the correct `lower` and `upper`. + x_1d = to_1d(x) + super().__init__(torch.tensor(np.median(x_1d)), error) + sorted_x = np.sort(x_1d) + len_x = len(x_1d) self.lower = torch.tensor(sorted_x[int(len_x/2)-1]) self.upper = torch.tensor(sorted_x[int(len_x/2)]) From 9cc9c62f205c2e172514f0cdb0177b2008ab1f2b Mon Sep 17 00:00:00 2001 From: mhchia Date: Wed, 24 Jan 2024 00:17:23 +0800 Subject: [PATCH 7/7] test: add tests for op and computation, and refactor --- examples/computation/computation.ipynb | 2 +- tests/__init__.py | 0 tests/conftest.py | 18 ++ tests/helpers.py | 57 ++++++ tests/test_computation.py | 31 ++++ tests/test_ops.py | 36 ++++ zkstats/cli.py | 35 +++- zkstats/computation.py | 4 +- zkstats/core.py | 244 ++++++++++++------------- zkstats/ops.py | 9 +- 10 files changed, 293 insertions(+), 143 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/helpers.py create mode 100644 tests/test_computation.py create mode 100644 tests/test_ops.py diff --git a/examples/computation/computation.ipynb b/examples/computation/computation.ipynb index 9ea04d1..daf0510 100644 --- a/examples/computation/computation.ipynb +++ b/examples/computation/computation.ipynb @@ -190,7 +190,7 @@ " out_1 = state.median(x_0)\n", " return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1))\n", "\n", - "prover_model = create_model(computation)\n", + "_, prover_model = create_model(computation)\n", "prover_gen_settings([data_path], comb_data_path, prover_model, prover_model_path, \"default\", \"resources\", settings_path)\n" ] }, diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..e7eb8ec --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,18 @@ +import pytest +import torch + + +@pytest.fixture +def error() -> float: + return 0.01 + + +@pytest.fixture +def column_0(): + return torch.tensor([3.0, 4.5, 1.0, 2.0, 7.5, 6.4, 5.5]) + + +@pytest.fixture +def column_1(): + return torch.tensor([2.7, 3.3, 1.1, 2.2, 3.8, 8.2, 4.4]) + diff --git a/tests/helpers.py b/tests/helpers.py new file mode 100644 index 0000000..eff22e7 --- /dev/null +++ b/tests/helpers.py @@ -0,0 +1,57 @@ +import json +from typing import Type +from pathlib import Path + +import torch + +from zkstats.core import prover_gen_settings, verifier_setup, prover_gen_proof, verifier_verify +from zkstats.computation import IModel, IsResultPrecise + + +def compute(basepath: Path, data: list[torch.Tensor], model: Type[IModel]) -> IsResultPrecise: + comb_data_path = basepath / "comb_data.json" + model_path = basepath / "model.onnx" + settings_path = basepath / "settings.json" + witness_path = basepath / "witness.json" + compiled_model_path = basepath / "model.compiled" + proof_path = basepath / "model.proof" + pk_path = basepath / "model.pk" + vk_path = basepath / "model.vk" + data_paths = [basepath / f"data_{i}.json" for i in range(len(data))] + + for i, d in enumerate(data): + filename = data_paths[i] + data_json = {"input_data": [d.tolist()]} + with open(filename, "w") as f: + f.write(json.dumps(data_json)) + + prover_gen_settings( + data_path_array=[str(i) for i in data_paths], + comb_data_path=str(comb_data_path), + prover_model=model, + prover_model_path=str(model_path), + scale="default", + mode="resources", + settings_path=str(settings_path), + ) + verifier_setup( + str(model_path), + str(compiled_model_path), + str(settings_path), + str(vk_path), + str(pk_path), + ) + prover_gen_proof( + str(model_path), + str(comb_data_path), + str(witness_path), + str(compiled_model_path), + str(settings_path), + str(proof_path), + str(pk_path), + ) + verifier_verify( + str(proof_path), + str(settings_path), + str(vk_path), + ) diff --git a/tests/test_computation.py b/tests/test_computation.py new file mode 100644 index 0000000..e899785 --- /dev/null +++ b/tests/test_computation.py @@ -0,0 +1,31 @@ +import statistics +import torch +import torch + +from zkstats.computation import State, create_model +from zkstats.ops import Mean, Median + +from .helpers import compute + + +def computation(state: State, x: list[torch.Tensor]): + out_0 = state.median(x[0]) + out_1 = state.median(x[1]) + return state.mean(torch.tensor([out_0, out_1]).reshape(1,-1,1)) + + +def test_computation(tmp_path, column_0: torch.Tensor, column_1: torch.Tensor, error: float): + state, model = create_model(computation, error) + compute(tmp_path, [column_0, column_1], model) + assert state.current_op_index == 3 + + ops = state.ops + op0 = ops[0] + assert isinstance(op0, Median) + assert op0.result == statistics.median(column_0) + op1 = ops[1] + assert isinstance(op1, Median) + assert op1.result == statistics.median(column_1) + op2 = ops[2] + assert isinstance(op2, Mean) + assert op2.result == statistics.mean([op0.result.tolist(), op1.result.tolist()]) diff --git a/tests/test_ops.py b/tests/test_ops.py new file mode 100644 index 0000000..cebe4a1 --- /dev/null +++ b/tests/test_ops.py @@ -0,0 +1,36 @@ +import json +from typing import Type, Callable +from dataclasses import dataclass +from pathlib import Path +import statistics + +import pytest + +import torch +from zkstats.computation import Operation, Mean, Median, IModel, IsResultPrecise + +from .helpers import compute + + +@pytest.mark.parametrize( + "op_type, expected_func", + [ + (Mean, statistics.mean), + (Median, statistics.median), + ] +) +def test_1d(tmp_path, column_0: torch.Tensor, error: float, op_type: Type[Operation], expected_func: Callable[[list[float]], float]): + op = op_type.create(column_0, error) + expected_res = expected_func(column_0.tolist()) + assert expected_res == op.result + model = op_to_model(op) + compute(tmp_path, [column_0], model) + + +def op_to_model(op: Operation) -> Type[IModel]: + class Model(IModel): + def forward(self, x: list[torch.Tensor]) -> tuple[IsResultPrecise, torch.Tensor]: + return op.ezkl(x), op.result + return Model + + diff --git a/zkstats/cli.py b/zkstats/cli.py index bf8cd5c..37eabf6 100644 --- a/zkstats/cli.py +++ b/zkstats/cli.py @@ -1,7 +1,12 @@ import os +import sys +from typing import Type +import importlib.util + import click +import torch -from .core import prover_gen_proof, prover_setup, load_model, verifier_verify, gen_data_commitment +from .core import prover_gen_proof, prover_gen_settings, verifier_setup, verifier_verify, gen_data_commitment cwd = os.getcwd() # TODO: Should make this configurable @@ -29,15 +34,19 @@ def cli(): def prove(model_path: str, data_path: str): model = load_model(model_path) print("Loaded model:", model) - prover_setup( + prover_gen_settings( [data_path], comb_data_path, model, model_onnx_path, - compiled_model_path, "default", "resources", settings_path, + ) + verifier_setup( + model_path, + compiled_model_path, + settings_path, vk_path, pk_path, ) @@ -80,6 +89,26 @@ def main(): cli() +def load_model(module_path: str) -> Type[torch.nn.Module]: + """ + Load a model from a Python module. + """ + # FIXME: This is unsafe since malicious code can be executed + + model_name = "Model" + module_name = os.path.splitext(os.path.basename(module_path))[0] + spec = importlib.util.spec_from_file_location(module_name, module_path) + module = importlib.util.module_from_spec(spec) + sys.modules[module_name] = module + spec.loader.exec_module(module) + + try: + cls = getattr(module, model_name) + except AttributeError: + raise ImportError(f"class {model_name} does not exist in {module_name}") + return cls + + # Register commands cli.add_command(prove) cli.add_command(verify) diff --git a/zkstats/computation.py b/zkstats/computation.py index 893e13a..45a1654 100644 --- a/zkstats/computation.py +++ b/zkstats/computation.py @@ -104,7 +104,7 @@ def forward(self, *x: list[torch.Tensor]) -> tuple[IsResultPrecise, torch.Tensor TComputation = Callable[[State, list[torch.Tensor]], tuple[IsResultPrecise, torch.Tensor]] -def create_model(computation: TComputation, error: float = DEFAULT_ERROR) -> Type[IModel]: +def create_model(computation: TComputation, error: float = DEFAULT_ERROR) -> tuple[State, Type[IModel]]: """ Create a torch model from a `computation` function defined by user """ @@ -118,4 +118,4 @@ def preprocess(self, x: list[torch.Tensor]) -> None: def forward(self, *x: list[torch.Tensor]) -> tuple[IsResultPrecise, torch.Tensor]: return computation(state, x) - return Model + return state, Model diff --git a/zkstats/core.py b/zkstats/core.py index 2b9b6a8..884dea4 100644 --- a/zkstats/core.py +++ b/zkstats/core.py @@ -1,5 +1,3 @@ -import sys -import importlib.util from typing import Type import torch from torch import Tensor @@ -12,73 +10,6 @@ from zkstats.computation import IModel -# Export model -def export_onnx(model: Type[IModel], data_tensor_array: list[Tensor], model_loc: str): - circuit = model() - try: - circuit.preprocess(data_tensor_array) - except AttributeError: - pass - - device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") - - # print(device) - - circuit.to(device) - - # Flips the neural net into inference mode - circuit.eval() - input_names = [] - dynamic_axes = {} - - data_tensor_tuple = () - for i in range(len(data_tensor_array)): - data_tensor_tuple += (data_tensor_array[i],) - input_index = "input"+str(i+1) - input_names.append(input_index) - dynamic_axes[input_index] = {0 : 'batch_size'} - dynamic_axes["output"] = {0 : 'batch_size'} - - # Export the model - torch.onnx.export(circuit, # model being run - data_tensor_tuple, # model input (or a tuple for multiple inputs) - model_loc, # where to save the model (can be a file or file-like object) - export_params=True, # store the trained parameter weights inside the model file - opset_version=11, # the ONNX version to export the model to - do_constant_folding=True, # whether to execute constant folding for optimization - input_names = input_names, # the model's input names - output_names = ['output'], # the model's output names - dynamic_axes=dynamic_axes) - -# =================================================================================================== -# =================================================================================================== - -# mode is either "accuracy" or "resources" -def gen_settings(comb_data_path, onnx_filename, scale, mode, settings_filename): - print("==== Generate & Calibrate Setting ====") - # Set input to be Poseidon Hash, and param of computation graph to be public - # Poseidon is not homomorphic additive, maybe consider Pedersens or Dory commitment. - gip_run_args = ezkl.PyRunArgs() - gip_run_args.input_visibility = "hashed" # matrix and generalized inverse commitments - gip_run_args.output_visibility = "public" # no parameters used - gip_run_args.param_visibility = "private" # should be Tensor(True)--> to enforce arbitrary data in w - - # generate settings - ezkl.gen_settings(onnx_filename, settings_filename, py_run_args=gip_run_args) - if scale =="default": - ezkl.calibrate_settings( - comb_data_path, onnx_filename, settings_filename, mode) - else: - ezkl.calibrate_settings( - comb_data_path, onnx_filename, settings_filename, mode, scales = scale) - - assert os.path.exists(settings_filename) - assert os.path.exists(comb_data_path) - assert os.path.exists(onnx_filename) - f_setting = open(settings_filename, "r") - print("scale: ", scale) - print("setting: ", f_setting.read()) - # =================================================================================================== # =================================================================================================== @@ -89,36 +20,19 @@ def verifier_define_calculation(verifier_model, verifier_model_path, dummy_data_ dummy_data = np.array(json.loads(open(path, "r").read())["input_data"][0]) dummy_data_tensor_array.append(torch.reshape(torch.tensor(dummy_data), (1, len(dummy_data),1 ))) # export onnx file - export_onnx(verifier_model, dummy_data_tensor_array, verifier_model_path) + _export_onnx(verifier_model, dummy_data_tensor_array, verifier_model_path) # =================================================================================================== # =================================================================================================== -def process_data(data_path_array, comb_data_path) -> list[Tensor]: - # Load data from data_path_array into data_tensor_array - data_tensor_array=[] - comb_data = [] - for path in data_path_array: - data = np.array( - json.loads(open(path, "r").read())["input_data"][0] - ) - data_tensor = torch.tensor(data) - t = (1, len(data), 1) - data_tensor_array.append(torch.reshape(data_tensor, t)) - comb_data.append(data.tolist()) - # Serialize data into file: - # comb_data comes from `data` - json.dump(dict(input_data = comb_data), open(comb_data_path, 'w' )) - return data_tensor_array - # we decide to not have comb_data_path as parameter since a bit redundant parameter. def prover_gen_settings(data_path_array, comb_data_path, prover_model, prover_model_path, scale, mode, settings_path): - data_tensor_array = process_data(data_path_array, comb_data_path) + data_tensor_array = _process_data(data_path_array, comb_data_path) # export onnx file - export_onnx(prover_model, data_tensor_array, prover_model_path) + _export_onnx(prover_model, data_tensor_array, prover_model_path) # gen + calibrate setting - gen_settings(comb_data_path, prover_model_path, scale, mode, settings_path) + _gen_settings(comb_data_path, prover_model_path, scale, mode, settings_path) # =================================================================================================== # =================================================================================================== @@ -149,29 +63,6 @@ def verifier_setup(verifier_model_path, verifier_compiled_model_path, settings_p assert os.path.isfile(pk_path) assert os.path.isfile(settings_path) -# =================================================================================================== -# =================================================================================================== - -def prover_setup( - data_path_array, - comb_data_path, - prover_model, - prover_model_path, - prover_compiled_model_path, - scale, - mode, - settings_path, - vk_path, - pk_path, -): - data_tensor_array = process_data(data_path_array, comb_data_path) - - # export onnx file - export_onnx(prover_model, data_tensor_array, prover_model_path) - # gen + calibrate setting - gen_settings(comb_data_path, prover_model_path, scale, mode, settings_path) - verifier_setup(prover_model_path, prover_compiled_model_path, settings_path, vk_path, pk_path) - def prover_gen_proof( prover_model_path, @@ -182,9 +73,7 @@ def prover_gen_proof( proof_path, pk_path ): - print("!@# compiled_model exists?", os.path.isfile(prover_compiled_model_path)) res = ezkl.compile_circuit(prover_model_path, prover_compiled_model_path, settings_path) - print("!@# compiled_model exists?", os.path.isfile(prover_compiled_model_path)) assert res == True # now generate the witness file print('==== Generating Witness ====') @@ -222,27 +111,32 @@ def verifier_verify(proof_path, settings_path, vk_path): settings = json.load(open(settings_path)) output_scale = settings['model_output_scales'] + # First check the zk proof is valid + res = ezkl.verify( + proof_path, + settings_path, + vk_path, + ) + print("!@# res: ", res) + assert res == True + + # Then, parse the proof and check the boolean output is true (i.e. the first output is 1.0), + # to make sure the result is within error bounds. proof = json.load(open(proof_path)) num_inputs = len(settings['model_input_scales']) + proof_instance = proof["instances"] + print("prf instances: ", proof_instance) print("num_inputs: ", num_inputs) - proof["instances"][0][num_inputs] = ezkl.float_to_vecu64(1.0, output_scale[0]) - json.dump(proof, open(proof_path, 'w')) - - print("prf instances: ", proof['instances']) + # First output is the boolean result + is_valid = ezkl.vecu64_to_float(proof_instance[0][num_inputs], output_scale[0]) + assert is_valid == 1.0 - print("proof boolean: ", ezkl.vecu64_to_float(proof['instances'][0][num_inputs], output_scale[0])) - for i in range(num_inputs+1, len(proof['instances'][0])): - print("proof result",i-num_inputs,":", ezkl.vecu64_to_float(proof['instances'][0][i], output_scale[1])) - - - res = ezkl.verify( - proof_path, - settings_path, - vk_path, - ) - - assert res == True - print("verified") + # Print the parsed proof + print("proof boolean: ", is_valid) + # TODO: Should we check if the number of outputs is 2? + outputs = proof_instance[0][num_inputs+1:] + for i, v in enumerate(outputs): + print("proof result",i,":", ezkl.vecu64_to_float(v, output_scale[1])) def gen_data_commitment(data_path: str) -> int: @@ -258,3 +152,89 @@ def gen_data_commitment(data_path: str) -> int: hashed = ezkl.poseidon_hash(data_transformed)[0] print("hashed: ", hashed) return int(ezkl.vecu64_to_felt(hashed), 16) + + +# Export model +def _export_onnx(model: Type[IModel], data_tensor_array: list[Tensor], model_loc: str): + circuit = model() + try: + circuit.preprocess(data_tensor_array) + except AttributeError: + pass + + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + # print(device) + + circuit.to(device) + + # Flips the neural net into inference mode + circuit.eval() + input_names = [] + dynamic_axes = {} + + data_tensor_tuple = () + for i in range(len(data_tensor_array)): + data_tensor_tuple += (data_tensor_array[i],) + input_index = "input"+str(i+1) + input_names.append(input_index) + dynamic_axes[input_index] = {0 : 'batch_size'} + dynamic_axes["output"] = {0 : 'batch_size'} + + # Export the model + torch.onnx.export(circuit, # model being run + data_tensor_tuple, # model input (or a tuple for multiple inputs) + model_loc, # where to save the model (can be a file or file-like object) + export_params=True, # store the trained parameter weights inside the model file + opset_version=11, # the ONNX version to export the model to + do_constant_folding=True, # whether to execute constant folding for optimization + input_names = input_names, # the model's input names + output_names = ['output'], # the model's output names + dynamic_axes=dynamic_axes) + +# =================================================================================================== +# =================================================================================================== + +# mode is either "accuracy" or "resources" +def _gen_settings(comb_data_path, onnx_filename, scale, mode, settings_filename): + print("==== Generate & Calibrate Setting ====") + # Set input to be Poseidon Hash, and param of computation graph to be public + # Poseidon is not homomorphic additive, maybe consider Pedersens or Dory commitment. + gip_run_args = ezkl.PyRunArgs() + gip_run_args.input_visibility = "hashed" # matrix and generalized inverse commitments + gip_run_args.output_visibility = "public" # no parameters used + gip_run_args.param_visibility = "private" # should be Tensor(True)--> to enforce arbitrary data in w + + # generate settings + ezkl.gen_settings(onnx_filename, settings_filename, py_run_args=gip_run_args) + if scale =="default": + ezkl.calibrate_settings( + comb_data_path, onnx_filename, settings_filename, mode) + else: + ezkl.calibrate_settings( + comb_data_path, onnx_filename, settings_filename, mode, scales = scale) + + assert os.path.exists(settings_filename) + assert os.path.exists(comb_data_path) + assert os.path.exists(onnx_filename) + f_setting = open(settings_filename, "r") + print("scale: ", scale) + print("setting: ", f_setting.read()) + +def _process_data(data_path_array, comb_data_path) -> list[Tensor]: + # Load data from data_path_array into data_tensor_array + data_tensor_array=[] + comb_data = [] + for path in data_path_array: + data = np.array( + json.loads(open(path, "r").read())["input_data"][0] + ) + data_tensor = torch.tensor(data) + t = (1, len(data), 1) + data_tensor_array.append(torch.reshape(data_tensor, t)) + comb_data.append(data.tolist()) + # Serialize data into file: + # comb_data comes from `data` + json.dump(dict(input_data = comb_data), open(comb_data_path, 'w' )) + return data_tensor_array + diff --git a/zkstats/ops.py b/zkstats/ops.py index 890f9f9..8d4c641 100644 --- a/zkstats/ops.py +++ b/zkstats/ops.py @@ -1,10 +1,8 @@ from abc import ABC, abstractmethod, abstractclassmethod - import numpy as np import torch - # boolean: either 1.0 or 0.0 IsResultPrecise = torch.Tensor @@ -22,14 +20,15 @@ def create(cls, x: torch.Tensor, error: float) -> 'Operation': def ezkl(self, x: torch.Tensor) -> IsResultPrecise: ... + class Mean(Operation): @classmethod def create(cls, x: torch.Tensor, error: float) -> 'Mean': return cls(torch.mean(x), error) - def ezkl(self, X: torch.Tensor) -> IsResultPrecise: - size = X.size() - return torch.abs(torch.sum(X)-size[1]*self.result)<=torch.abs(self.error*size[1]*self.result) + def ezkl(self, x: torch.Tensor) -> IsResultPrecise: + size = x.size() + return torch.abs(torch.sum(x)-size[1]*self.result)<=torch.abs(self.error*size[1]*self.result) def to_1d(x: torch.Tensor) -> torch.Tensor: