Skip to content

Commit

Permalink
Initialize ceremony
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Nov 20, 2023
1 parent f97ac92 commit 3834b1c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ceremony.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TARGET_CIRCUIT=./inputs/test.circom
INPUT_PTAU=./inputs/test.ptau
CEREMONY_BRANCH=ceremony/test
CONTRIBUTIONS_PATH=./contributions
OUTPUT_PATH=./results
10 changes: 10 additions & 0 deletions inputs/test.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pragma circom 2.1.2;

template Test() {
signal input a;
signal input b;
signal output c;
c <== a * b;
}

component main = Test();
3 changes: 3 additions & 0 deletions inputs/test.ptau
Git LFS file not shown
3 changes: 0 additions & 3 deletions scripts/finish
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ check_finish_env() {
# get the last contribution zkey file from the contributions file
if [ ! -f "$CONTRIBUTIONS_FILE" ]; then
error "contribution file does not exists, is the ceremony initialized?"
exit 1
else
LAST_CONTRIBUTION_FILE=$(get_last_contribution_file_path)
LAST_CONTRIBUTION_HASH=$(get_last_contribution_hash)
Expand All @@ -24,11 +23,9 @@ check_finish_env() {
finish_and_verify() {
if [ "$(get_file_hash "$LAST_CONTRIBUTION_FILE")" == "<check CONTRIBUTIONS.md file>" ]; then
error "no contributions"
exit 1
fi
if [ "$(get_file_hash "$LAST_CONTRIBUTION_FILE")" != "$LAST_CONTRIBUTION_HASH" ]; then
error "the last contribution file has been modified, please check the CONTRIBUTIONS.md file"
exit 1
fi
$SNARKJS zkey beacon $LAST_CONTRIBUTION_FILE $OUTPUT_PATH/${CIRCUIT_FILENAME}_proving_key.zkey 0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f 10 -n="Final Beacon phase2"
$SNARKJS zkey verify $CONTRIBUTIONS_PATH/$CIRCUIT_FILENAME.r1cs $INPUT_PTAU_PATH $OUTPUT_PATH/${CIRCUIT_FILENAME}_proving_key.zkey
Expand Down

0 comments on commit 3834b1c

Please sign in to comment.