iden3 / circom

zkSnark circuit compiler
GNU General Public License v3.0
1.31k stars 253 forks source link

Wasm support - virtualize filesystem #264

Open voltrevo opened 4 months ago

voltrevo commented 4 months ago

This PR replaces all usage of std::fs with virtual_fs::FileSystem, which enables compiling circom in pure rust.

In particular, this enables running circom in webassembly. Here's a demo.

I work on MPC within PSE, and one of our goals is to enable easy and productive development of MPC applications in JS. We hope to achieve this by providing an end-to-end solution in portable JS code, which includes compiling circom programs into arithmetic circuits. More info.

I recognize this is a lot of code from a new external contributor 😅. Feel free to treat this as a conversation starter, but it does work and I believe could be merged as-is.