Skip to content

Commit

Permalink
Merge branch 'dev' into feat/on-chain-invites
Browse files Browse the repository at this point in the history
  • Loading branch information
waddaboo authored Nov 29, 2024
2 parents 23d3cc6 + 201ae8d commit 8f0ddaf
Show file tree
Hide file tree
Showing 56 changed files with 2,827 additions and 811 deletions.
4 changes: 2 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build": "nest build"
},
"dependencies": {
"@bandada/credentials": "2.4.1",
"@bandada/utils": "2.4.1",
"@bandada/credentials": "2.4.3",
"@bandada/utils": "2.4.3",
"@ethersproject/hash": "^5.7.0",
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@bandada/api-sdk": "2.4.1",
"@bandada/utils": "2.4.1",
"@bandada/api-sdk": "2.4.3",
"@bandada/utils": "2.4.3",
"@chakra-ui/react": "^2.5.1",
"@chakra-ui/styled-system": "^2.0.0",
"@chakra-ui/theme-tools": "^2.0.16",
Expand Down
2 changes: 1 addition & 1 deletion apps/contracts/contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bandada/contracts",
"version": "2.4.1",
"version": "2.4.3",
"description": "Bandada smart contracts to manage off-chain groups and verify their zero-knowledge proofs.",
"license": "MIT",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ VITE_CLIENT_URL=http://localhost:3002
VITE_CLIENT_INVITES_URL=http://localhost:3002?inviteCode=\
VITE_ETHEREUM_NETWORK=sepolia
VITE_GITHUB_CLIENT_ID=a83a8b014ef38270fb22
VITE_TWITTER_CLIENT_ID=NV82Mm85NWlSZ1llZkpLMl9vN3A6MTpjaQ
VITE_TWITTER_CLIENT_ID=SUw4TUFiZGJaSXh2ak1YRkx3TFQ6MTpjaQ
VITE_TWITTER_REDIRECT_URI=http://localhost:3001/credentials
2 changes: 1 addition & 1 deletion apps/dashboard/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ VITE_CLIENT_URL=https://client.bandada.pse.dev
VITE_CLIENT_INVITES_URL=https://client.bandada.pse.dev?inviteCode=\
VITE_ETHEREUM_NETWORK=sepolia
VITE_GITHUB_CLIENT_ID=6ccd7b93e84260e353f9
VITE_TWITTER_CLIENT_ID=NV82Mm85NWlSZ1llZkpLMl9vN3A6MTpjaQ
VITE_TWITTER_CLIENT_ID=SUw4TUFiZGJaSXh2ak1YRkx3TFQ6MTpjaQ
VITE_TWITTER_REDIRECT_URI=https://app.bandada.pse.dev/credentials
2 changes: 1 addition & 1 deletion apps/dashboard/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ VITE_CLIENT_URL=https://client-staging.bandada.pse.dev
VITE_CLIENT_INVITES_URL=https://client-staging.bandada.pse.dev?inviteCode=\
VITE_ETHEREUM_NETWORK=sepolia
VITE_GITHUB_CLIENT_ID=6ccd7b93e84260e353f9
VITE_TWITTER_CLIENT_ID=NV82Mm85NWlSZ1llZkpLMl9vN3A6MTpjaQ
VITE_TWITTER_CLIENT_ID=SUw4TUFiZGJaSXh2ak1YRkx3TFQ6MTpjaQ
VITE_TWITTER_REDIRECT_URI=https://app-staging.bandada.pse.dev/credentials
4 changes: 2 additions & 2 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"preview": "vite preview"
},
"dependencies": {
"@bandada/credentials": "2.4.1",
"@bandada/utils": "2.4.1",
"@bandada/credentials": "2.4.3",
"@bandada/utils": "2.4.3",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.5.1",
"@chakra-ui/styled-system": "^2.0.0",
Expand Down
43 changes: 41 additions & 2 deletions apps/dashboard/src/pages/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export default function GroupPage(): JSX.Element {
const { hasCopied: hasCopiedGroupId, onCopy: onCopyGroupId } = useClipboard(
groupId || ""
)
const { hasCopied: hasCopiedAdminId, onCopy: onCopyAdminId } = useClipboard(
(_group && _group.admin) || ""
)
const [_searchMember, setSearchMember] = useState<string>("")
const [_removeGroupName, setRemoveGroupName] = useState<string>("")
const [_selectedMembers, setSelectedMembers] = useState<string[]>([])
Expand Down Expand Up @@ -461,15 +464,13 @@ ${memberIds.join("\n")}
borderRadius="8px"
>
<Text fontSize="20px">Group ID</Text>

<InputGroup size="lg" mt="10px">
<Input
pr="50px"
placeholder="Group ID"
value={groupId}
isDisabled
/>

<InputRightElement mr="5px">
<Tooltip
label={
Expand All @@ -495,6 +496,44 @@ ${memberIds.join("\n")}
</InputRightElement>
</InputGroup>
</Box>
<Box
bgColor="balticSea.50"
p="25px 30px 25px 30px"
borderRadius="8px"
>
<Text fontSize="20px">Admin ID</Text>
<InputGroup size="lg" mt="10px">
<Input
pr="50px"
placeholder="Admin ID"
value={_group.admin}
isDisabled
/>
<InputRightElement mr="5px">
<Tooltip
label={
hasCopiedAdminId ? "Copied!" : "Copy"
}
closeOnClick={false}
hasArrow
>
<IconButton
variant="link"
aria-label="Copy Group id"
onClick={onCopyAdminId}
onMouseDown={(e) => e.preventDefault()}
icon={
<Icon
color="sunsetOrange.600"
boxSize="5"
as={FiCopy}
/>
}
/>
</Tooltip>
</InputRightElement>
</InputGroup>
</Box>
)
{groupType === "off-chain" && _group.credentials && (
<Box
Expand Down
22 changes: 21 additions & 1 deletion apps/docs/docs/api-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pnpm add @bandada/api-sdk

Creates a new instance of ApiSdk using the API URL and the [config](https://axios-http.com/docs/req_config).

- Create a new instance using the Bandada API URL and the default config.
- Create a new instance using the Bandada API URL with the default config.

This is what you need if you are using the production Bandada API.

Expand Down Expand Up @@ -514,3 +514,23 @@ const url = apiSdk.getCredentialGroupJoinUrl(
redirectUri
)
```

## Get multiple credentials group join URL

\# **getMultipleCredentialGroupJoinUrl**(): _string_

Returns a custom URL string for joining a multiple credentials group.

```ts
import { DashboardUrl } from "@bandada/api-sdk"

const dashboardUrl = DashboardUrl.DEV
const groupId = "10402173435763029700781503965100"
const commitment = "1"

const url = apiSdk.getMultipleCredentialsGroupJoinUrl(
dashboardUrl,
groupId,
commitment
)
```
4 changes: 2 additions & 2 deletions apps/docs/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sidebar_position: 2

# API

The API has a list of endpoints to interact with the Bandada infrastructure.
The API provides a list of endpoints to interact with the Bandada infrastructure.

It is compatible with any programming language that supports REST API requests.

Read the documentation of the API and try it out: [Bandada API Docs](https://api.bandada.pse.dev/).
Read the API documentation and try it out: [Bandada API Docs](https://api.bandada.pse.dev/).
22 changes: 20 additions & 2 deletions apps/docs/docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 4
sidebar_position: 5
---

# FAQ
Expand All @@ -8,7 +8,7 @@ sidebar_position: 4

You can ask questions about Bandada in the [PSE Discord](https://discord.com/invite/sF5CT5rzrR), there is a channel for it called `bandada` or by opening a [Bandada Discussion](https://github.com/orgs/bandada-infra/discussions).

The most frequent asked questions will be listed below.
The most frequently asked questions will be listed below.

## How can I start a project using Bandada?

Expand All @@ -25,3 +25,21 @@ This is a good option if you are using TypeScript/JavaScript and want to interac
- [Boilerplate](https://github.com/bandada-infra/boilerplate)

This is a good option if you want to quickly create a Bandada project because you can fork it, clone it or use it as a template.

## What is the difference between Semaphore and Bandada?

[Semaphore](https://semaphore.pse.dev/) is a zero-knowledge protocol that allows users to prove their membership in a group and send messages, such as votes or feedback, without revealing their identity. It also provides a simple mechanism to prevent double-signaling. Semaphore works both off-chain and on EVM-compatible chains.

[Bandada](https://bandada.pse.dev/) is an infrastructure for managing privacy-preserving groups. It also provides anti-sybil mechanisms by using credential groups, ensuring that only users meeting specific criteria can join a group.

Semaphore lacks an off-chain infrastructure for managing groups or storing group members, but Bandada fills this gap by simplifying the management of off-chain Semaphore groups. Though Semaphore and Bandada groups are different, they are fully compatible and work well together.

Joining a Semaphore group often requires an anti-sybil mechanism. Bandada integrates this functionality through its credentials package and invite codes functionality.

Bandada is well-suited for managing large groups, as it enables server-side creation of Merkle proofs, an approach that is especially useful when the group size is too large for client-side processing.

While Bandada does not have integrated zero-knowledge (zk) capabilities, it can be paired with Semaphore to add zk functionality to an application.

Semaphore provides a robust on-chain infrastructure for groups, which Bandada leverages for its own on-chain group management.

In summary, Semaphore and Bandada serve different purposes and offer distinct functionalities, but they are fully compatible and work effectively together.
2 changes: 1 addition & 1 deletion apps/docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ slug: /

# What is Bandada?

Bandada is an infrastructure to manage privacy-preserving groups. It also provides antisybil mechanisms by using credential groups so that you can only join a group if you meet a specific criteria.
Bandada is an infrastructure for managing privacy-preserving groups. It also provides anti-sybil mechanisms by using credential groups so that you can only join a group if you meet specific criteria.

Bandada is a public good project. It is free and open source. Everyone can use it and contribute to it.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/docs/resources.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 6
---

import RenderArticles from "../src/components/RenderArticles"
Expand Down
4 changes: 4 additions & 0 deletions apps/docs/docs/tutorials/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Tutorials",
"position": 4
}
4 changes: 4 additions & 0 deletions apps/docs/docs/tutorials/api-sdk/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "API SDK",
"position": 2
}
Loading

0 comments on commit 8f0ddaf

Please sign in to comment.