Skip to content

Commit

Permalink
Merge pull request #730 from semaphore-protocol/fix/docs-links
Browse files Browse the repository at this point in the history
Fix docs links
  • Loading branch information
cedoor authored Mar 27, 2024
2 parents 4ac10ba + e05d89c commit afd0e07
Show file tree
Hide file tree
Showing 30 changed files with 104 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For more information, see [Merkle tree in Wikipedia](https://en.wikipedia.org/wi

A value used to prevent double entry or double signalling.

See [Circuit nullifier hash](/technical-reference/circuits/#hash-anulador-nullifier-hash).
See [Circuit nullifier hash](/V2/technical-reference/circuits/#nullifier-hash).

## Relay

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ title: Groups

Use Semaphore in your application or smart contract to create off-chain and on-chain groups.

A [Semaphore group](/glossary/#grupo-semaphore) contains [identity commitments](/glossary/#compromiso-de-identidad-identity-commitment) of group members.
A [Semaphore group](/V2/glossary/#semaphore-group) contains [identity commitments](/V2/glossary/#identity-commitment) of group members.
Example uses of groups include the following:

- Poll question that attendees join to rate an event.
- Ballot that members join to vote on a proposal.
- Whistleblowers who are verified employees of an organization.

A Semaphore group is an [incremental Merkle tree](/glossary/#árbol-de-merkle-merkle-tree), and group members (i.e., identity commitments) are tree leaves.
A Semaphore group is an [incremental Merkle tree](/V2/glossary/#merkle-tree), and group members (i.e., identity commitments) are tree leaves.
Semaphore groups set the following two parameters:

- **Tree depth**: the maximum number of members a group can contain (`max size = 2 ^ tree depth`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Identities

# Semaphore identities

In order to join a [Semaphore group](/glossary#semaphore-group), a user must first create a [Semaphore identity](/glossary#semaphore-identity).
In order to join a [Semaphore group](/V2/glossary#semaphore-group), a user must first create a [Semaphore identity](/V2/glossary#semaphore-identity).
A Semaphore identity contains two values generated with the identity:

- Identity trapdoor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Proofs

Learn how to use Semaphore to generate and verify zero-knowledge proofs.

Once a user joins their [Semaphore identity](/glossary#semaphore-identity) to a [Semaphore group](/glossary#semaphore-group), the user can signal anonymously with a zero-knowledge proof that proves the following:
Once a user joins their [Semaphore identity](/V2/glossary#semaphore-identity) to a [Semaphore group](/V2/glossary#semaphore-group), the user can signal anonymously with a zero-knowledge proof that proves the following:

- The user is a member of the group.
- The same user created the signal and the proof.
Expand All @@ -27,11 +27,11 @@ To generate a proof, pass the following properties to the `generateProof` functi
- `group`: The group to which the user belongs.
- `externalNullifier`: The value that prevents double-signaling.
- `signal`: The signal the user wants to send anonymously.
- `snarkArtifacts`: The `zkey` and `wasm` [trusted setup files](/glossary/#trusted-setup-files).
- `snarkArtifacts`: The `zkey` and `wasm` [trusted setup files](/V2/glossary/#trusted-setup-files).

In the voting system use case, once all the voters have joined their [identities](/guides/identities#create-an-identity) to the ballot [group](/guides/groups),
In the voting system use case, once all the voters have joined their [identities](/V2/guides/identities#create-identities) to the ballot [group](/V2/guides/groups),
a voter can generate a proof to vote for a proposal.
In the call to `generateProof`, the voting system passes the unique ballot ID (the [Merkle tree](/glossary/#merkle-tree/) root of the group) as the
In the call to `generateProof`, the voting system passes the unique ballot ID (the [Merkle tree](/V2/glossary#merkle-tree) root of the group) as the
`externalNullifier` to prevent the voter signaling more than once for the ballot.
The following code sample shows how to use `generateProof` to generate the voting proof:

Expand All @@ -53,7 +53,7 @@ Use the [`@semaphore-protocol/proof`](https://github.com/semaphore-protocol/sema
To verify a proof, pass the following to the `verifyProof` function:

- _`proof`_: the Semaphore proof.
- _`verificationKey`_: the JavaScript object in the `semaphore.json` [trusted setup file](/glossary/#trusted-setup-files).
- _`verificationKey`_: the JavaScript object in the `semaphore.json` [trusted setup file](/V2/glossary/#trusted-setup-files).

The following code sample shows how to parse the verification key object from `semaphore.json`
and verify the previously generated proof:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ and [Chai assertions](https://www.chaijs.com/).
wget http://www.trusted-setup-pse.org/semaphore/20/semaphore.wasm
```
Learn more about [trusted setup files](/glossary/#trusted-setup-files).
Learn more about [trusted setup files](/V2/glossary/#trusted-setup-files).
3. Rename the `Lock.js` test file to `Greeter.js` and replace the content with the following:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebar_position: 2

The [Semaphore circuit](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/circuits) is the heart of the protocol and consists of three parts:

- [**Proof of membership**](/technical-reference/circuits#proof-of-membership)
- [**Nullifier hash**](/technical-reference/circuits#nullifier-hash)
- [**Signal**](/technical-reference/circuits#signal)
- [**Proof of membership**](/V2/technical-reference/circuits#proof-of-membership)
- [**Nullifier hash**](/V2/technical-reference/circuits#nullifier-hash)
- [**Signal**](/V2/technical-reference/circuits#signal)

![Semaphore circuit](https://github.com/semaphore-protocol/semaphore/raw/v2.6.1/packages/circuits/scheme.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebar_position: 3

Semaphore includes three types of contracts:

- [**Base contracts**](/technical-reference/contracts#base-contracts)
- [**Extension contracts**](/technical-reference/contracts#extension-contracts)
- [**Verifiers**](/technical-reference/contracts#verifiers)
- [**Base contracts**](/V2/technical-reference/contracts#base-contracts)
- [**Extension contracts**](/V2/technical-reference/contracts#extension-contracts)
- [**Verifiers**](/V2/technical-reference/contracts#verifiers)

:::info
To use Semaphore contracts and interfaces in your project,
Expand All @@ -24,7 +24,7 @@ Semaphore provides the following base contracts:

These contracts are closely related to the protocol.
You can inherit them in your contract or you can use [`Semaphore.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/Semaphore.sol), which inherits them for you.
See our [deployed contracts](/deployed-contracts#semaphore) to find the addresses for your network.
See our [deployed contracts](/V2/deployed-contracts#semaphore) to find the addresses for your network.

:::info
While some dApps may use on-chain groups, others may prefer to use off-chain groups, saving only their tree roots in the contract.
Expand All @@ -41,7 +41,7 @@ More extensions will be added in the future.
## Verifiers

To verify Semaphore proofs, the [`SemaphoreCore.sol`](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/base/SemaphoreCore.sol) contract requires the address of a deployed verifier contract.
You can choose to manually deploy the [verifier](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/verifiers) you prefer or you can use one of our [deployed verifiers](/deployed-contracts#verifiers).
You can choose to manually deploy the [verifier](https://github.com/semaphore-protocol/semaphore/tree/v2.6.1/packages/contracts/verifiers) you prefer or you can use one of our [deployed verifiers](/V2/deployed-contracts#verifiers).

Each verifier name indicates the tree depth that it can verify.
For example, given a Semaphore proof generated with a tree depth `20`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Community members connect their wallets to the dApp to take the following action

### Relay

To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/glossary/#relay) to broadcast the vote.
To preserve anonymity and avoid disclosing the member's wallet address, the dApp may use a [relay](/V2/glossary/#relay) to broadcast the vote.
The relay calls the **contract** function that then posts the member's vote transaction to Ethereum.

## Private voting
Expand All @@ -52,7 +52,7 @@ The voting scenario has the following steps:

### Create a poll

A community coordinator or dApp administrator uses the deployed smart contract to create an on-chain (Ethereum) poll, a [Semaphore group](/guides/groups/) that members can join and cast votes to.
A community coordinator or dApp administrator uses the deployed smart contract to create an on-chain (Ethereum) poll, a [Semaphore group](/V2/guides/groups/) that members can join and cast votes to.

In the following sample code, the voting contract declares a `createPoll` function that uses the Semaphore base `_createGroup` function:

Expand All @@ -78,11 +78,11 @@ function createPoll(
}
```

A poll is a Semaphore [group](/guides/groups/) that stores the following:
A poll is a Semaphore [group](/V2/guides/groups/) that stores the following:

- A topic to vote on.
- The public ID of the poll creator.
- [Semaphore IDs](/guides/identities/) of members who joined the poll.
- [Semaphore IDs](/V2/guides/identities/) of members who joined the poll.

To create the poll, the administrator calls the smart contract function--for example:

Expand Down Expand Up @@ -128,7 +128,7 @@ With a member registered for a poll, learn how the dApp [records votes](#record-
Once members have joined a poll, the coordinator starts the poll to allow voting.
When a member votes (for example, by selecting a radio button), then the dApp takes the following actions:

1. Uses the `@semaphore-protocol/proof` library to create a proof of the vote, the poll identifier, the Semaphore ID, and a [nullifier](/glossary/#nullifier) that prevents double-voting.
1. Uses the `@semaphore-protocol/proof` library to create a proof of the vote, the poll identifier, the Semaphore ID, and a [nullifier](/V2/glossary/#nullifier) that prevents double-voting.
2. Sends the vote proof to the [relay](#relay).

### Related
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Use cases include private voting, whistleblowing, anonymous DAOs and mixers.

With Semaphore, you can allow your users to do the following:

1. [Create a Semaphore identity](/guides/identities/).
2. [Add their Semaphore identity to a group (i.e. _Merkle tree_)](/guides/groups/).
3. [Send a verifiable, anonymous signal (e.g a vote or endorsement)](/guides/proofs/).
1. [Create a Semaphore identity](/V2/guides/identities/).
2. [Add their Semaphore identity to a group (i.e. _Merkle tree_)](/V2/guides/groups/).
3. [Send a verifiable, anonymous signal (e.g a vote or endorsement)](/V2/guides/proofs/).

When a user broadcasts a signal (for example: a vote), Semaphore zero-knowledge
proofs can ensure that the user has joined the group and hasn't already cast a signal with their nullifier.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ sidebar_position: 7
La identidad de un usuario en el protocolo Semaphore.
Una identidad contiene los tres valores que se mencionan a continuación:

- [Compromiso de identidad](#identity-commitment) (identity commitment): el valor público.
- [Compromiso de identidad](#compromiso-de-identidad-identity-commitment) (identity commitment): el valor público.
- Identidad trampilla (identity trapdoor) y anulador de identidad (identity nullifier): valores secretos que únicamente son del conocimiento del usuario.

## Compromiso de identidad (Identity commitment)

El valor público de la [identidad Semaphore](#semaphore-identity) utilizado en los [grupos Semaphore](#semaphore-group).
El valor público de la [identidad Semaphore](#identidad-semaphore) utilizado en los [grupos Semaphore](#grupo-semaphore).

Semaphore utiliza la función hash [Poseidon](https://www.poseidon-hash.info/) para crear un compromiso de identidad a partir de los valores secretos de la identidad Semaphore.

## Grupo Semaphore

Un grupo es un [árbol de Merkle](#merkle-tree) binario e incremental en el que cada hoja contiene un [compromiso de identidad](#identity-commitment) para un usuario.
Un grupo es un [árbol de Merkle](#árbol-de-merkle-merkle-tree) binario e incremental en el que cada hoja contiene un [compromiso de identidad](#compromiso-de-identidad-identity-commitment) para un usuario.
El compromiso de identidad comprueba que un usuario es un miembro del grupo sin revelar la identidad Semaphore del usuario.

Semaphore utiliza la función hash **Poseidon** para crear árboles de Merkle.
Expand All @@ -39,7 +39,7 @@ Para más información, vea [árbol de Merkle en Wikipedia](https://es.wikipedia

Un valor utilizado para prevenir registros dobles o dos señales emitidas por el mismo usuario.

Ver [hash de circuito nullifier](/technical-reference/circuits/#nullifier-hash).
Ver [hash de circuito nullifier](/V3/technical-reference/circuits#hash-anulador-nullifier-hash).

## Retransmisor (Relayer)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import TabItem from "@theme/TabItem"

# Gupos Semaphore

Un [grupo Semaphore](/glossary/#semaphore-group) contiene los [identity commitments](/glossary/#identity-commitment) (compromisos de identidad) de miembros del grupo.
Un [grupo Semaphore](/V3/glossary/#grupo-semaphore) contiene los [identity commitments](/V3/glossary/#compromiso-de-identidad-identity-commitment) (compromisos de identidad) de miembros del grupo.
Estos son algunos ejemplos de uso de los grupos:

- Encuesta con preguntas a la que se unen las personas que acudieron a un evento para calificarlo,
- votación a la que se unen los miembros para votar por una propuesta,
- Denunciantes que están verificados como empleados de una organización.

Un grupo Semaphore es un [árbol de Merkle incremental](/glossary/#incremental-merkle-tree), y los miembros del grupo (por ejemplo, [identity commitments](/glossary/#identity-commitments)) son las hojas del árbol.
Un grupo Semaphore es un [árbol de Merkle incremental](/V3/glossary/#árbol-de-merkle-merkle-tree), y los miembros del grupo (por ejemplo, [identity commitments](/V3/glossary/#compromiso-de-identidad-identity-commitment)) son las hojas del árbol.
Los grupos Semaphore determinan los siguientes tres parámetro:

- **Group id**: un identificador único para el grupo;
Expand All @@ -24,14 +24,14 @@ Los grupos Semaphore determinan los siguientes tres parámetro:

Aprenda cómo trabajar con grupos.

- [**Grupos off-chain**](#off-chain-groups)
- [**Grupos on-chain**](#on-chain-groups)
- [**Grupos off-chain**](#grupos-off-chain-externos-a-la-cadena)
- [**Grupos on-chain**](#grupos-on-chain)

## Grupos off-chain (externos a la cadena)

- [Crear un grupo](#create-a-group)
- [Añadir miembros](#add-members)
- [Remover o actualizar miembros](#remove-or-update-members)
- [Crear un grupo](#crear-un-grupo)
- [Añadir miembros](#añadir-miembros)
- [Remover o actualizar miembros](#remover-o-actualizar-miembros)

### Crear un grupo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TabItem from "@theme/TabItem"

# Identidades Semaphore

Para unirse a un [grupo Semaphore](/glossary#semaphore-group), un usuario primero deberá crear una [identidad Semaphore](/glossary#semaphore-identity).
Para unirse a un [grupo Semaphore](/V3/glossary#grupo-semaphore), un usuario primero deberá crear una [identidad Semaphore](/V3/glossary#identidad-semaphore).
Una identidad Semaphore contiene dos valores generados junto con la identidad:

- Identity trapdoor (Identidad trampilla)
Expand All @@ -21,8 +21,8 @@ Para prevenir fraudes, la persona dueña debe conservar de forma secreta ambos v

En su código, utilice la librería [`@semaphore-protocol/identity`](https://github.com/semaphore-protocol/semaphore/tree/main/packages/identity) para crear una identidad Semaphore _de forma determinística_ (del hash de un mensaje) o _de forma aleatoria_.

- [**Crear identidades aleatorias**](#create-random-identities)
- [**Crear identidades determinísticas**](#create-deterministic-identities)
- [**Crear identidades aleatorias**](#crear-identidades-aleatorias)
- [**Crear identidades determinísticas**](#crear-identidades-determinísticas)

### Instalar librería:

Expand Down
Loading

0 comments on commit afd0e07

Please sign in to comment.