Skip to content

Commit fab5c3d

Browse files
authored
Merge pull request #659 from semaphore-protocol/chore/v4-website
Update Semaphore code and links in the website Former-commit-id: 8602771
2 parents a4fba4e + a00ea54 commit fab5c3d

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

apps/website/src/app/learn/page.tsx

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,32 @@ export default function Learn() {
9595
{
9696
title: "Semaphore identities",
9797
description:
98-
"Given to all Semaphore group members, it is comprised of three parts - identity commitment, trapdoor, and nullifier.",
98+
"A Semaphore identity is an EdDSA key-pair plus the commitment (i.e. the hash of the public key), which is used as the public value of the Semaphore group members.",
9999
linkText: "Create Semaphore identities",
100100
linkUrl: "https://docs.semaphore.pse.dev/guides/identities",
101101
codeText: `import { Identity } from "@semaphore-protocol/identity"
102102
103-
const { trapdoor, nullifier, commitment } = new Identity()`,
103+
// Random identity.
104+
const identity1 = new Identity()
105+
106+
// Passing a secret.
107+
const identity2 = new Identity("secret")
108+
`,
104109
itemList: [
105110
{
106111
icon: <IconEyelash w="24px" h="24px" color="primary.600" />,
107-
heading: "Private values",
108-
body: "Trapdoor and nullifier values are the private values of the Semaphore identity. To avoid fraud, the owner must keep both values secret."
112+
heading: "Private value",
113+
body: "The private key is a secret that identity owners must keep private. It can either be generated randomly or passed as a parameter."
109114
},
110115
{
111116
icon: <IconEye w="24px" h="24px" color="primary.600" />,
112117
heading: "Public values",
113-
body: "Semaphore uses the Poseidon hash function to create the identity commitment from the identity private values. Identity commitments can be made public, similarly to Ethereum addresses."
118+
body: "Semaphore uses the Poseidon hash function to derive the identity commitment from the identity public key. Identity commitments can be made public, similarly to Ethereum addresses."
114119
},
115120
{
116121
icon: <IconUser w="24px" h="24px" color="primary.600" />,
117-
heading: "Generate identities",
118-
body: "Semaphore identities can be generated deterministically or randomly. Deterministic identities can be generated from the hash of a secret message."
122+
heading: "Storing identities",
123+
body: "Building a system to save or recover secret values of Semaphore identities is nontrivial. You may choose to delegate such functionality, for example by using a signature as a secret."
119124
}
120125
]
121126
},
@@ -127,45 +132,41 @@ const { trapdoor, nullifier, commitment } = new Identity()`,
127132
linkUrl: "https://docs.semaphore.pse.dev/guides/groups",
128133
codeText: `import { Group } from "@semaphore-protocol/group"
129134
130-
const group = new Group(1)
135+
const members = [identity1.commitment, identity2.commitment]
131136
132-
group.addMember(commitment)`,
137+
const group = new Group(members)
138+
`,
133139
itemList: [
134140
{
135141
icon: <IconTree w="24px" h="24px" color="primary.600" />,
136142
heading: "Merkle trees",
137-
body: "Each leaf contains an identity commitment for a user. The identity commitment proves that the user is a group member without revealing the private identity of the user."
143+
body: "Each leaf contains an identity commitment for a user. The structure of Merkle trees ensures that it can be efficiently proved that an identity commitment is a member of the group."
138144
},
139145
{
140146
icon: <IconGroup w="24px" h="24px" color="primary.600" />,
141147
heading: "Types of groups",
142-
body: "Groups can be created and managed in a decentralized fashion with Semaphore contracts or off-chain with our JavaScript libraries."
148+
body: "Groups can be created and managed in a decentralized fashion with Semaphore contracts or off-chain with the JavaScript libraries."
143149
},
144150
{
145151
icon: <IconManageUsers w="24px" h="24px" color="primary.600" />,
146152
heading: "Group management",
147-
body: "Users can join and leave groups by themselves, or an admin can add and remove them. Admins can be centralized authorities, Ethereum accounts, multi-sig wallets or smart contracts."
153+
body: "Users could join and leave groups by themselves, or an admin could add and remove them. Admins can be centralized authorities, Ethereum accounts, multi-sig wallets or smart contracts."
148154
}
149155
]
150156
},
151157
{
152158
title: "Semaphore proofs",
153-
description:
154-
"Semaphore group members can anonymously prove that they are part of a group and that they are generating their own proofs and signals.",
159+
description: "Semaphore group members can prove that they are part of a group and send anonymous messages.",
155160
linkText: "Generate Semaphore proofs",
156161
linkUrl: "https://docs.semaphore.pse.dev/guides/proofs",
157162
codeText: `import { generateProof, verifyProof } from "@semaphore-protocol/proof"
158-
import { utils } from "ethers"
159163
160-
const externalNullifier = utils.formatBytes32String("Topic")
161-
const signal = utils.formatBytes32String("Hello world")
164+
const scope = "Semaphore"
165+
const message = "Hello world"
162166
163-
const fullProof = await generateProof(identity, group, externalNullifier, signal, {
164-
zkeyFilePath: "./semaphore.zkey",
165-
wasmFilePath: "./semaphore.wasm"
166-
})
167+
const proof = await generateProof(identity1, group, scope, message)
167168
168-
await verifyProof(fullProof, group.depth)`,
169+
await verifyProof(proof)`,
169170
itemList: [
170171
{
171172
icon: <IconBadge w="24px" h="24px" color="primary.600" />,
@@ -174,13 +175,13 @@ await verifyProof(fullProof, group.depth)`,
174175
},
175176
{
176177
icon: <IconFlag w="24px" h="24px" color="primary.600" />,
177-
heading: "Signals",
178-
body: "Group users can anonymously broadcast signals such as votes or endorsements without revealing their original identity."
178+
heading: "Messages",
179+
body: "Group users can anonymously share messages such as votes or endorsements without revealing their original identity."
179180
},
180181
{
181182
icon: <IconCheck w="24px" h="24px" color="primary.600" />,
182-
heading: "Verifiers",
183-
body: "Semaphore proofs can be verified with our contracts or off-chain with our JavaScript libraries."
183+
heading: "Proof verification",
184+
body: "Semaphore proofs can be verified both on-chain with the Semaphore contracts, or off-chain with the JavaScript libraries."
184185
}
185186
]
186187
}

apps/website/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function Home() {
4545
</VStack>
4646

4747
<Stack direction={{ base: "column", sm: "row" }} spacing="6" align="center">
48-
<Link href="https://docs.semaphore.pse.dev/quick-setup" isExternal>
48+
<Link href="https://docs.semaphore.pse.dev/getting-started" isExternal>
4949
<Button size={{ base: "md", md: "lg" }}>Get Started</Button>
5050
</Link>
5151
<Link href="https://demo.semaphore.pse.dev" isExternal>

0 commit comments

Comments
 (0)