Skip to content

Commit

Permalink
docs: more descriptive comments on set-membership witness fixing (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-camuto authored Oct 5, 2023
1 parent 790b37e commit ac3e453
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion examples/notebooks/set_membership.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@
"assert os.path.isfile(witness_path_truthy)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "41fd15a8",
"metadata": {},
"outputs": [],
"source": [
"witness = json.load(open(witness_path, \"r\"))\n",
"witness"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -329,7 +340,14 @@
"# WE GOT CIRCUIT PARAMETERS\n",
"# EVERYTHING ANYONE HAS EVER NEEDED FOR ZK\n",
"\n",
"# we force the output to be 0 this corresponds to the set membership test being true -- and we set this to a fixed vis output\n",
"# this means that the output is fixed and the verifier can see it but that if the input is not in the set the output will not be 0 and the verifier will reject\n",
"witness = json.load(open(witness_path, \"r\"))\n",
"witness[\"outputs\"][0] = [[0, 0, 0, 0]]\n",
"json.dump(witness, open(witness_path, \"w\"))\n",
"\n",
"witness = json.load(open(witness_path, \"r\"))\n",
"print(witness[\"outputs\"][0])\n",
"\n",
"res = ezkl.setup(\n",
" compiled_model_path,\n",
Expand Down Expand Up @@ -497,7 +515,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down

0 comments on commit ac3e453

Please sign in to comment.