-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #604 from semaphore-protocol/docs/v4-alpha
V4-alpha documentation
- Loading branch information
Showing
27 changed files
with
1,492 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useEffect, useState } from "react" | ||
|
||
export default function Articles() { | ||
const [articles, setArticles] = useState<any[]>([]) | ||
|
||
useEffect(() => { | ||
fetch("https://raw.githubusercontent.com/semaphore-protocol/semaphore/main/apps/website/src/data/articles.json") | ||
.then((response) => response.json()) | ||
.catch(() => []) | ||
.then(setArticles) | ||
}, []) | ||
|
||
return ( | ||
<ul> | ||
{articles.map((article) => ( | ||
<li key={article.url + article.title}> | ||
<a href={article.url} target="_blank" rel="noreferrer"> | ||
{article.title} | ||
</a>{" "} | ||
- {article.authors.join(", ")} (<i>{article.date}</i>) | ||
</li> | ||
))} | ||
</ul> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Heading from "@theme/Heading" | ||
import { useEffect, useState } from "react" | ||
|
||
function capitalizeFirstLetter(s: string): string { | ||
return s.charAt(0).toUpperCase() + s.slice(1) | ||
} | ||
|
||
function getEtherscanLink(network: string): string { | ||
switch (network) { | ||
case "sepolia": | ||
return "https://sepolia.etherscan.io/address/" | ||
case "mumbai": | ||
return "https://mumbai.polygonscan.com/address/" | ||
case "arbitrum": | ||
return "https://arbiscan.io/address/" | ||
case "arbitrum-sepolia": | ||
return "https://sepolia.arbiscan.io/address/" | ||
case "optimism-sepolia": | ||
return "https://sepolia-optimism.etherscan.io/address/" | ||
default: | ||
return "" | ||
} | ||
} | ||
|
||
export default function DeployedContracts() { | ||
const [deployedContracts, setDeployedContracts] = useState<any[]>([]) | ||
|
||
useEffect(() => { | ||
fetch( | ||
"https://raw.githubusercontent.com/semaphore-protocol/semaphore/feat/semaphore-v4/packages/contracts/deployed-contracts.json" | ||
) | ||
.then((response) => response.json()) | ||
.catch(() => []) | ||
.then(setDeployedContracts) | ||
}, []) | ||
|
||
return ( | ||
<div> | ||
{deployedContracts.map(({ network, contracts }) => ( | ||
<div key={network}> | ||
<Heading as="h2">{capitalizeFirstLetter(network)}</Heading> | ||
<ul> | ||
{contracts.map(({ name, address }) => ( | ||
<li key={address}> | ||
{name}:{" "} | ||
<a href={getEtherscanLink(network) + address} target="_blank" rel="noreferrer"> | ||
{address} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
))} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { useEffect, useState } from "react" | ||
import CodeBlock from "@theme/CodeBlock" | ||
|
||
export default function RemoteCode({ url, language, title }: { url: string; language: string; title: string }) { | ||
const [code, setCode] = useState<string>("") | ||
|
||
useEffect(() => { | ||
fetch(url) | ||
.then((response) => response.text()) | ||
.catch(() => "") | ||
.then((text) => setCode(text)) | ||
}, [url]) | ||
|
||
return ( | ||
<div> | ||
<CodeBlock language={language} title={title} showLineNumbers> | ||
{code} | ||
</CodeBlock> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useEffect, useState } from "react" | ||
|
||
export default function Videos() { | ||
const [videos, setVideos] = useState<any[]>([]) | ||
|
||
useEffect(() => { | ||
fetch("https://raw.githubusercontent.com/semaphore-protocol/semaphore/main/apps/website/src/data/videos.json") | ||
.then((response) => response.json()) | ||
.catch(() => []) | ||
.then(setVideos) | ||
}, []) | ||
|
||
return ( | ||
<ul> | ||
{videos.map((video) => ( | ||
<li key={video.url + video.title}> | ||
<a href={video.url} target="_blank" rel="noreferrer"> | ||
{video.title} | ||
</a>{" "} | ||
- {video.speakers.join(", ")} at <u>{video.eventName}</u> (<i>{video.date}</i>) | ||
</li> | ||
))} | ||
</ul> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
sidebar_position: 11 | ||
--- | ||
|
||
# Credits | ||
|
||
Semaphore is the work of several people, for a complete list of contributors you can visit the Semaphore [Github insights](https://github.com/semaphore-protocol/semaphore/graphs/contributors). | ||
|
||
- [Barry WhiteHat](https://github.com/barryWhiteHat) | ||
- [Kobi Gurkan](https://github.com/kobigurk) | ||
- [Koh Wei Jie](https://github.com/weijiekoh) | ||
- [Andrija Novakovic](https://github.com/akinovak) | ||
- [Cedoor](https://github.com/cedoor) | ||
- [Rachel Aux](https://github.com/rachelaux) | ||
- [Andy Guzman](https://github.com/aguzmant103) | ||
- [Vivian Plasencia](https://github.com/vplasencia) | ||
- [LauNaMu](https://github.com/0xyNaMu) | ||
- [0xjei](https://github.com/0xjei) | ||
- [Mari Poveda](https://github.com/maripoveda) |
9 changes: 9 additions & 0 deletions
9
apps/docs/versioned_docs/version-V4-alpha/deployed-contracts.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
sidebar_position: 5 | ||
--- | ||
|
||
import DeployedContracts from '@site/src/components/DeployedContracts'; | ||
|
||
# Deployed contracts | ||
|
||
<DeployedContracts /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
sidebar_position: 10 | ||
--- | ||
|
||
# FAQ | ||
|
||
## Where can I ask questions about Semaphore? | ||
|
||
You can ask questions about Semaphore on [Discord](https://semaphore.pse.dev/discord) or by opening a [Semaphore Discussion](https://github.com/semaphore-protocol/semaphore/discussions). The most frequent questions will be listed below. | ||
|
||
## Why should I prevent proofs from being verified twice? | ||
|
||
Since zero-knowledge proofs are completely anonymous, it is important to prevent those generated by eligible identities from being reused by a malicious party. | ||
|
||
For example, in an anonymous voting application a valid proof could be reused to vote again. | ||
|
||
## What is the difference between the "nullifier" and "scope"? | ||
|
||
The [scope](/V4-alpha/glossary#scope) is used like a topic on which users can generate a valid proof only once. The scope is a public value and every one can see what the scope of a proof is. | ||
|
||
The [nullifier](/V4-alpha/glossary#nullifier) is the hash of the private key of the identity and the scope, and it is used to check if the same proof with that specific scope has already been generated by the same user. The nullifier is also a public value and it is what is actually stored to prevent, for example, double-voting. | ||
|
||
In the case of a voting application, if you have a group and you want all members of this group to vote only once, you can use the id of the group as the scope. When a user votes the first time, you can store the hash of voter's private key and the group id (i.e., the nullifier) and prevent double-voting by checking if that hash already exists. | ||
|
||
See the [Semaphore circuits](/V4-alpha/technical-reference/circuits) for more technical information, or the [Semaphore boilerplate](https://github.com/semaphore-protocol/boilerplate/tree/version/4) for a real use-case. | ||
|
||
## Where can I find examples of applications using Semaphore? | ||
|
||
You can find a complete list of applications that are using Semaphore on the [Semaphore website](https://semaphore.pse.dev/projects). | ||
|
||
## How can I start a project using Semaphore? | ||
|
||
There are three ways you can start using Semaphore in your project: using the [CLI](https://github.com/semaphore-protocol/semaphore/tree/feat/semaphore-v4/packages/cli), using the [boilerplate](https://github.com/semaphore-protocol/boilerplate/tree/version/4) as a template or forking it, or installing the Semaphore [packages](/V4-alpha/guides/identities) manually. | ||
|
||
## How can I contribute to the protocol? | ||
|
||
There are several ways you could contribute to the protocol, you can find more information about on [Github](https://github.com/semaphore-protocol#ways-to-contribute). |
Oops, something went wrong.