From 5c98b289ca4206afbe728f90f8e250eebcff16b0 Mon Sep 17 00:00:00 2001 From: zero Date: Wed, 10 Apr 2024 09:51:32 +0200 Subject: [PATCH] doc/book: add section on using zkrender tool --- doc/src/zkas/writing-zk-proofs.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/src/zkas/writing-zk-proofs.md b/doc/src/zkas/writing-zk-proofs.md index dd7cf88c7..8ae96e72d 100644 --- a/doc/src/zkas/writing-zk-proofs.md +++ b/doc/src/zkas/writing-zk-proofs.md @@ -75,3 +75,16 @@ log, and compare it with the public values you see in the `witness.json` from when the proof was created. This will allow you to pinpoint exactly where the error occurs. +## Viewing the ZK Circuit Layout + +ZK circuit have a layout. The less empty space, the more efficient is your +circuit. Usually it just means reducing the `k` value specified. The number of +rows in your circuit is $2ᵏ$, so reducing the value by 1 will halve the number +of rows. + +To generate an image of the circuit layout, simply run: + +``` +./bin/zkrunner/zkrender.py -w src/contract/dao/proof/witness/exec.json src/contract/dao/proof/exec.zk /tmp/layout.png +``` +