Read these articles to find the answers to this challenge:
Circom in Remix Part 1: Definitions
Circom in Remix Part 2: Playtime
The questions are a few section down.
TLDR:
A player generates a ZK Proofs which is submitted to an onchain contract. The solution stay hidden.
When the questions have been correctly answered, a Remixer badge can be minted.
All the data in the Ethereum blockchain is public and visible. This means that if the challenge is coded in Solidity, the first user who finds the solution will submit that solution in a transaction and thus the solution will be visible by everyone.
Using a ZK Proof, we only require the user to post a proof that the challenge has been successfully completed.
There are 2 parts to this question - can the same person (address) post the same proof? And can a different address post the same proof?
Incorporated in the proof is a special parameter named externalNullifier - a number generated from a timestamp. If a different value is used in the nullifier, then a different proof will be generated, but it will still show that the questions were correctly answered.
The smart contract used for verifying the proof will remember the nullifier.
An address (a user) can only submit a single proof - even if another nullifier is used. And a nullifier can only be used once.
So even when the actual proof becomes public, it won't be possible to re-post that specific proof.
The contract keeps a mapping of all the users that completed the challenge (using msg.sender
), it is also possible to ask for a signed nullifier instead of directly using msg.sender
The contract for Remix Challenge is on the Optimism chain and posting the proof will cost about 60-110 cents worth of Optimism ETH in gas.
Clone the following repository in Remix https://github.com/yann300/remix-challenges
Once the cloned repo has been retrieved, open the file, verify-solution.ts, which is in the scripts folder.
What is a phase2 number in a Groth16 verification system?
A: The random number set generated from the Powers of Tau ceremony
B: The final random number set generated from the Powers of Tau ceremony with extra entropy added
C: The random number set that involves both the trusted setup and the circuit being verified
D: A trusted setup that is totally independent of the circuit
What does the witness include?
A: The inputs
B: The intermediary results
C: The outputs
D: a, b, and c
Circom logic gates can be:
A: Subtractive and divisive
B: Just multiplication
C: Multiplication and summation
D: Multiplication with trusted setup
In the Remix Circom plugin, how do you generate the .wasm file?
A: Run a script or hit the compile button
B: Hit the compile button as soon as the compiler loads
C: Hit the compiler button when the .circom file is in the Editor
Remember, input only the letter (A, B, C, or D) of the corresponding correct answer.
Starting on line 76 of verify-solution.ts (which is in the scripts folder), input the answers to the questions.
Run the script by either right-clicking on the script in the File Explorer or clicking on the green play button.
If the program executes correctly, you have successfully answered the 4 questions.
If you have not answered the questions correctly, the proof will NOT be generated and the file generated/proof.json
will not be created.
This proof can be used in a verifier to prove that you found the 4 values. By doing so, only the proof needs to be shared, you don't need to share the 4 values, but everyone can be certain that you know these values.
Go to the next steps.
generated/proof.json
for calling the function publishChallenge
in the Remix Rewards contract.or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing