namnc / circom-2-arithc

Circom interpreter to arithmetic circuit description
MIT License
33 stars 7 forks source link

Better ArithmeticCircuit struct and json #38

Open namnc opened 2 months ago

namnc commented 2 months ago

We may have redundant info now so we may want to streamline the output.

Below is Bristol format we can extend it: https://nigelsmart.github.io/MPC-Circuits/

namnc commented 2 months ago

We may also want the gates to have some topological order (e.g. a gate id i > j will only use inputs from gates with id at most j).

namnc commented 1 month ago

I made this python script to convert our json circuit to a sort of arithmetic bristol format during EthTaipei hackathon: https://gist.github.com/namnc/1351994aacb25054ee4696c52ad0802e

This can be used with Kevin's MP-SPDZ loader here: https://gist.github.com/mhchia/79a26963664accbafebb27cf19b8e562#file-circuit_arith-py

It basically parses the json and build a tree with multiple roots and generate id from the leaves in a topological order.

namnc commented 1 month ago

I will proceed with marking main component inputs and outputs.