Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: added noir to flavour text #36

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/nextjs/pages/example-zk/BirthDateSignature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,13 @@ export const BirthDateSignature = ({ aliceDefaultAge }: { aliceDefaultAge: numbe
<p>
When the balloon store implemented their zero knowledge proof solution they made sure that they are using the
same format as the Town Hall for constructing the claim that is being signed. In this project the claim
construction can be found in{" "}
construction for the Town Hall can be found in{" "}
<a href="https://github.com/Kryha/scaffold-eth-2-noir/blob/main/packages/nextjs/pages/example-zk/BirthDateSignature.tsx">
<CodeText text="packages/nextjs/pages/example-zk/BirthDateSignature.tsx" />
</a>{" "}
(
<CodeText text="signBirthYear" />) in the FrontEnd and{" "}
<a href="https://github.com/Kryha/scaffold-eth-2-noir/blob/main/packages/noir/circuits/LessThanSignedAge/src/main.nr">
<CodeText text="packages/noir/circuits/LessThanSignedAge/src/main.nr" />
</a>{" "}
(
<CodeText text="construct_claim_payload" />) when implemented as a Noir circuit.
<CodeText text="signBirthYear" />
).
</p>
<p>
What the Town Hall actually signs is that they confirm that Alice is born in a certain year AND that she has
Expand Down
16 changes: 13 additions & 3 deletions packages/nextjs/pages/example-zk/GenerateProof.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,29 @@ export const GenerateProof = ({ requiredBirthYear }: { requiredBirthYear: number
proof herself locally. This is actually what we are doing in this implementation.
</p>
<p>
The proof is generated in the browser in the file{" "}
The circuit is located in{" "}
<a href="https://github.com/Kryha/scaffold-eth-2-noir/blob/main/packages/noir/circuits/LessThanSignedAge/src/main.nr">
<CodeText text="packages/noir/circuits/LessThanSignedAge/src/main.nr" />
</a>
. It&apos;s written using Noir. It is the Noir-circuit that is used both for generating the proof and for
generating a Solidity-verifier that can help the balloon store verify the proof on-chain.
</p>
<p>
The proof is generated in the browser from the file{" "}
<a href="https://github.com/Kryha/scaffold-eth-2-noir/blob/main/packages/nextjs/utils/noir/noirBrowser.ts">
<CodeText text="packages/nextjs/utils/noir/noirBrowser.ts" />
</a>
. In this file you can see that the proof is generated by using the imported libraries{" "}
<CodeText text="aztec/bb.js" /> and <CodeText text="noir-lang/acvm_js" />. The proof can also be generated
locally, with calling <CodeText text="nargo prove" />. The predefined circuit ABI code used to generate the
locally, by calling <CodeText text="nargo prove" />. The predefined circuit ABI code used to generate the
proof can be found in{" "}
<a href="https://github.com/Kryha/scaffold-eth-2-noir/blob/main/packages/nextjs/generated/circuits.json">
<CodeText text="packages/nextjs/generated/circuits.json" />
</a>
, but we could recompile it using <CodeText text="nargo compile" />.
, but we could recompile it using <CodeText text="nargo compile" />. <CodeText text="nargo" /> is the CLI-tool
for Noir.
</p>
<br />
<p>
*Note that the &quot;signed age&quot; and &quot;ethereum address&quot;, must be the same as the ones you used
to generate the signed message.
Expand Down
Loading