Skip to content

Commit

Permalink
Merge pull request #605 from semaphore-protocol/chore/v3-code
Browse files Browse the repository at this point in the history
Update code of the Learn page to latest v3
  • Loading branch information
cedoor authored Jan 30, 2024
2 parents 4403322 + 59dc2ec commit 64e2f6a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions apps/website/src/app/learn/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ export default function Learn() {
linkUrl: "https://docs.semaphore.pse.dev/guides/identities",
codeText: `import { Identity } from "@semaphore-protocol/identity"
const identity = new Identity()
const trapdoor = identity.getTrapdoor()
const nullifier = identity.getNullifier()
const commitment = identity.generateCommitment()`,
const { trapdoor, nullifier, commitment } = new Identity()`,
itemList: [
{
icon: <IconEyelash w="24px" h="24px" color="primary.600" />,
Expand Down Expand Up @@ -159,18 +155,17 @@ group.addMember(commitment)`,
linkText: "Generate Semaphore proofs",
linkUrl: "https://docs.semaphore.pse.dev/guides/proofs",
codeText: `import { generateProof, verifyProof } from "@semaphore-protocol/proof"
import { utils } from "ethers"
const externalNullifier = BigInt(1)
const signal = "Hello world"
const externalNullifier = utils.formatBytes32String("Topic")
const signal = utils.formatBytes32String("Hello world")
const fullProof = await generateProof(identity, group, externalNullifier, signal, {
zkeyFilePath: "./semaphore.zkey",
wasmFilePath: "./semaphore.wasm"
})
const verificationKey = JSON.parse(fs.readFileSync("./semaphore.json", "utf-8"))
await verifyProof(verificationKey, fullProof)`,
await verifyProof(fullProof, group.depth)`,
itemList: [
{
icon: <IconBadge w="24px" h="24px" color="primary.600" />,
Expand Down

0 comments on commit 64e2f6a

Please sign in to comment.