noname icon indicating copy to clipboard operation
noname copied to clipboard

Build an online playground for noname

Open lognorman20 opened this issue 1 year ago • 1 comments

To make the introduction of noname to new users easier as well as help developers write circuits in a simpler fashion, an online playground/compiler can be constructed. This website allows a user to write a sample noname program, compile it, and choose various options about the circuit generated such as backend system.A reference for this is Circom's zkREPL.

lognorman20 avatar Jul 08 '24 01:07 lognorman20

that would be great indeed. for reference the go playground, and rust playground

mimoo avatar Jul 08 '24 14:07 mimoo

@mimoo I built a quick and dirty first version here: https://noname-code-playground.onrender.com/.

Repo: https://github.com/lognorman20/noname-playground/tree/main

Would love for any feedback

lognorman20 avatar Jul 27 '24 22:07 lognorman20

First of all, I love love love it! This is amazing. I'm going to give a demo of noname next week and will use this! Is it possible to easy load any of the examples we have in the examples folder :D?

Second: I'm trying to imagine a UI where we could easily see what constraints and witness gets produced when we create proofs. I think the best thing we can do right now is refactor noname to produce a JSON with the debug output, which could be displayed in HTML (instead of as a terminal output in the bottom). Think similar to https://godbolt.org

Third: I'm wondering how hard it would be to also produce ethereum artifacts from this UI (cc @katat) so that we can easily demo noname using this and remix, and that's it :o (if I could do my demo like that on the 10th that would be amazing)

Fourth, feature request for noname itself: if we could compile noname in WASM we would not need a backend which could be quite nice. But kimchi doesn't support WASM for now so it wouldn't be that simple I believe... (cc @bkase, one )

mimoo avatar Jul 30 '24 17:07 mimoo

BTW the example compilation is incorrect o.o but I can't reproduce this locally. Perhaps it's because it's on a version that was buggy. A cool thing would be to display the version of noname as well :D (unfortunately we haven't been good at releasing versions consistently)

mimoo avatar Aug 02 '24 16:08 mimoo

I'll work on 1) and 3). As for the compilation being incorrect, what is the expected output? The version of noname is noname 0.7.0. I installed it using cargo install --git https://www.github.com/zksecurity/noname

lognorman20 avatar Aug 07 '24 06:08 lognorman20

I've added predefined examples and prove button that integrates w/ snarkjs. The save proof button doesn't work yet but ill probably do it soon telegram-cloud-photo-size-1-5017169182604767221-y telegram-cloud-photo-size-1-5017169182604767222-y

lognorman20 avatar Aug 07 '24 10:08 lognorman20

@mimoo updated with ability to prove, view snarkjs output, download all relevant proof files, and load examples

https://github.com/user-attachments/assets/100670a2-0dfd-4f01-a66e-c611427889a6

lognorman20 avatar Aug 07 '24 18:08 lognorman20

This is great!

I think the public_output example is not the same one as the one in example/. Also was it a pain to set the private/public inputs for each example? Maybe we should have these set in files also so it's easy to run them manually.

compilation-wise I was wrong ^^ I think things look good!

mimoo avatar Aug 08 '24 03:08 mimoo

BTW feel free to add a link to your repo on the README here

mimoo avatar Aug 08 '24 03:08 mimoo

Awesome! It was mostly just copy paste work to get the examples set up. Which public_output are you referring to? The one here looks to be the same. For the private/public inputs I'm referring to the test file.

Side note: I've acquired the domain noname-playground.xyz for the playground. I also will be doing some backend migration in the coming days to make the system more robust, but from my experimentation, everything is working as expected. Please let me know if there's any improvements/feedback you'd like to add and I'll be happy to work on this further.

lognorman20 avatar Aug 08 '24 05:08 lognorman20