Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
5854e74
chore: cleaning up the app
hooperben Dec 11, 2025
ddcafde
chore: cleaning codebse up a bit
hooperben Dec 11, 2025
796d39c
fix: more cleaning
hooperben Dec 11, 2025
ef6726d
chore: more cleaning
hooperben Dec 11, 2025
6781e74
chore: more cleaning
hooperben Dec 11, 2025
be38c75
chore: moved _components
hooperben Dec 11, 2025
4d879c1
feat: more cleaning
hooperben Dec 11, 2025
c490e51
feat: more cleaning and sorting of client components
hooperben Dec 11, 2025
ccd5c3d
chore: added logos
hooperben Dec 11, 2025
177c723
chore: bumped nargo version
hooperben Dec 11, 2025
25cdae2
feat: cleaning up note types + methods
hooperben Dec 12, 2025
594aa77
chore: cleaned up circuits to use common lib + small contract audit
hooperben Dec 15, 2025
eabc22d
fix: fixed import path
hooperben Dec 15, 2025
7c94a2d
fix: made indexer use chainId for endpoints
hooperben Dec 15, 2025
2e2b0ca
chore: docs + added basic relayer app
hooperben Dec 15, 2025
0c9317b
feat: added basic http1 server
hooperben Dec 15, 2025
fe3b400
feat: got proofs submitting to relayer
hooperben Dec 18, 2025
e0bf596
chore: removed rust relayer
hooperben Jan 1, 2026
82dc1ad
chore: updating claude + vite config for ngrok
hooperben Jan 1, 2026
d71bb3b
feat: added storybook
hooperben Jan 1, 2026
4a75406
chore: added relayer to pnpm workspace
hooperben Jan 2, 2026
6eb6e4a
feat: added mock provider to storybook + inline encrypt
hooperben Jan 2, 2026
05c32a5
feat: fixed dollar values in balance card header
hooperben Jan 3, 2026
a74298a
feat: improved asset breakdown table UI
hooperben Jan 3, 2026
04a583a
chore: added boilerplate relayer template
hooperben Jan 4, 2026
95ceb5b
chore: updated .lock file
hooperben Jan 4, 2026
b6a717d
chore: added relayer script
hooperben Jan 4, 2026
2a87c3e
chore: removed unused warp circuits
hooperben Jan 5, 2026
fb06834
chore: added transfer external circuits
hooperben Jan 5, 2026
d0933c3
chore: bumped hardhat
hooperben Jan 5, 2026
3cdcf6f
feat: added transfer external to contracts build script
hooperben Jan 5, 2026
547e7ad
feat: added transfer external function
hooperben Jan 5, 2026
cb31c1d
fix: fixed the broken withdraw test
hooperben Jan 6, 2026
4e91d60
feat: added tabs from shadcn
hooperben Jan 6, 2026
c4cc19b
feat: added portfolio page
hooperben Jan 6, 2026
961309b
chore: cleaning up encrypt/decrypt UI
hooperben Jan 8, 2026
3d977a9
fix: added key to assets map
hooperben Jan 8, 2026
bb25e09
feat: added recharts and shadcn chart
hooperben Jan 8, 2026
c0ff730
chore: started on portfolio page
hooperben Jan 9, 2026
8b1c10c
feat: fresh deployments
hooperben Jan 11, 2026
e01e041
chore: updated sepolia to new deployment address
hooperben Jan 12, 2026
67d1d6c
chore: added dotenv to relayer
hooperben Jan 13, 2026
d70f150
chore: added relayer core functionality
hooperben Jan 13, 2026
7297032
chore: added example script for relayer
hooperben Jan 13, 2026
6d1ec61
chore: added shadcn accordion and field
hooperben Jan 14, 2026
e285b8a
feat: heaps of UI improvements
hooperben Jan 14, 2026
62a4c85
feat: looking more like a bank
hooperben Jan 14, 2026
498b765
feat: got the rest of the UI looking pretty good
hooperben Jan 14, 2026
81dd687
feat: more improvements
hooperben Jan 14, 2026
749d0b6
feat: added qr code package
hooperben Jan 15, 2026
ba88082
feat: more improvements
hooperben Jan 15, 2026
3328ae6
chore: fresh deployment
hooperben Jan 15, 2026
0efc4fe
chore: fresh deployment
hooperben Jan 15, 2026
ef2aba8
feat: improved verbosity of tx tracking
hooperben Jan 15, 2026
aeff888
chore: added arb sepolia to relayer
hooperben Jan 15, 2026
0181918
feat: new UI for encrypt, decrypt and transfer + moved to arb sepolia
hooperben Jan 15, 2026
abd95b1
fix: removed old sepolia config
hooperben Jan 15, 2026
15881e5
chore: docs
hooperben Jan 15, 2026
c5405b9
fix: fixed indexer config
hooperben Jan 15, 2026
ba20639
fix: wrapped the owner secret in poseidon field
hooperben Jan 15, 2026
ac44b3d
feat: got spacing more consistent + fixed autofocus on share dialog
hooperben Jan 15, 2026
84b9c20
feat: improved encrypt, send and decrypt UX
hooperben Jan 15, 2026
dd79d2f
feat: added tx sponsor to relayer
hooperben Jan 16, 2026
217d45c
chore: added shared to realyer config
hooperben Jan 16, 2026
b456e65
chore: updated .gitignore
hooperben Jan 16, 2026
d6597f5
feat: cleaned up relayer code
hooperben Jan 16, 2026
ba42997
feat: moved networks to shared
hooperben Jan 16, 2026
1f98fc2
fix: fixed relayer dockerfile
hooperben Jan 16, 2026
7b9234e
fix: fixed build
hooperben Jan 16, 2026
a2c10fa
fix: fixed relayer build
hooperben Jan 17, 2026
9224b74
chore: docs + settings formatting
hooperben Jan 17, 2026
0ab387e
feat: added erc20 sending
hooperben Jan 18, 2026
1187355
chore: added retry buttons to send
hooperben Jan 19, 2026
82b9068
chore: fixed private balannces not appearing + clean ups
hooperben Jan 19, 2026
4edece7
chore: more UI fixes + import refinements
hooperben Jan 19, 2026
d08a7be
fix: forgot to commit network file changes
hooperben Jan 19, 2026
91183b3
chore: improved sync process
hooperben Jan 19, 2026
5d3b399
feat: added mainnet deployments
hooperben Jan 19, 2026
334924a
feat: adding mainnet to indexer config
hooperben Jan 19, 2026
fb1d3e9
chore: updated mainnet deployment details
hooperben Jan 19, 2026
50296f2
fix: fixed indexer config
hooperben Jan 19, 2026
670b75d
chore: added usdc to mainnet deployment
hooperben Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pinata-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
export PATH="$HOME/.nargo/bin:$PATH"
noirup --version 1.0.0-beta.15
noirup --version 1.0.0-beta.16
echo "$HOME/.nargo/bin" >> $GITHUB_PATH

- name: Install bb (Barretenberg)
Expand All @@ -43,7 +43,7 @@ jobs:
env:
VITE_GITHUB_ACTION_BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
VITE_DOMAIN: ${{ github.ref == 'refs/heads/main' && 'https://commbank.eth.limo' || 'https://dev.commbank.eth.limo' }}
VITE_DEFAULT_CHAIN_ID: ${{ github.ref == 'refs/heads/main' && '1' || '11155111' }}
VITE_DEFAULT_CHAIN_ID: ${{ github.ref == 'refs/heads/main' && '1' || '421614' }}
run: |
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-client-v2-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: |
curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
export PATH="$HOME/.nargo/bin:$PATH"
noirup --version 1.0.0-beta.15
noirup --version 1.0.0-beta.16
echo "$HOME/.nargo/bin" >> $GITHUB_PATH

- name: Install bb (Barretenberg)
Expand Down
60 changes: 29 additions & 31 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CommBank.eth is a privacy-enabled DeFi platform that facilitates private transfe

## Monorepo Structure

This is a Bun workspace monorepo with the following packages:
This is a pnpm workspace monorepo with the following packages:

### `client/` - Next.js Frontend (Primary)

Expand Down Expand Up @@ -79,7 +79,7 @@ This is a Bun workspace monorepo with the following packages:

### `circuits/` - Zero-Knowledge Circuits (Noir)

- **Tech Stack:** Noir language v1.0.0-beta.15
- **Tech Stack:** Noir language v1.0.0-beta.16
- **Purpose:** ZK-SNARK circuit definitions for private operations
- **Circuits:**
- `deposit/` - Prove deposit commitment without revealing amount
Expand Down Expand Up @@ -124,58 +124,56 @@ This is a Bun workspace monorepo with the following packages:

```bash
# Install all dependencies
bun install
pnpm install

# Format all code
bun run format
pnpm run format

# Check formatting
bun run format:check
pnpm run format:check

# Lint all code
bun run lint
pnpm run lint

# Fix lint errors
bun run lint:fix
pnpm run lint:fix

# Start development (runs client by default)
bun run dev
pnpm run dev

# Build client
bun run build
pnpm run build

# Build contracts and generate verifiers
bun run build-contracts
pnpm run build-contracts
```

### Client (Next.js)

```bash
cd client
bun run dev # Start dev server on localhost:3000
bun run build # Production build
bun run start # Run production build
bun run lint # Next.js linting
pnpm run dev # Start dev server on localhost:3000
pnpm run build # Production build
pnpm run start # Run production build
pnpm run lint # Next.js linting
```

### client (Vite + React Router)

```bash
cd client
bun run dev # Start Vite dev server
bun run build # Build with TypeScript + Vite
bun run preview # Preview production build
bun run lint # ESLint check
pnpm run dev # Start Vite dev server
pnpm run build # Build with TypeScript + Vite
pnpm run preview # Preview production build
pnpm run lint # ESLint check
```

### Contracts

```bash
cd contracts
bun run build # Build verifiers from circuits (primary build command)
bun run build-bb # Compile Noir circuits to bytecode
bun run build-ipfs # Build and upload to IPFS
bun run deploy # Deploy contracts (ts-node scripts/deploy.ts)
pnpm run build # Build verifiers from circuits (primary build command)
pnpm run build-bb # Compile Noir circuits to bytecode

# Testing
npx hardhat test # Run all tests
Expand Down Expand Up @@ -278,7 +276,7 @@ const proof = await deposit.depositNoir.generateProof(inputs);
- **Config:** `eslint.config.mjs` at root (modern flat config)
- **Rules:** TypeScript + Prettier plugin integration
- **Ignored Paths:** node_modules, dist, build, .next, out
- **Run:** `bun run lint` and `bun run lint:fix`
- **Run:** `pnpm run lint` and `pnpm run lint:fix`

### Prettier Configuration

Expand All @@ -289,7 +287,7 @@ const proof = await deposit.depositNoir.generateProof(inputs);
- Single quotes: false (use double quotes)
- Print width: 80 characters
- Tab width: 2 spaces
- **Run:** `bun run format` and `bun run format:check`
- **Run:** `pnpm run format` and `pnpm run format:check`

### TypeScript Configuration

Expand Down Expand Up @@ -387,7 +385,7 @@ const proof = await deposit.depositNoir.generateProof(inputs);

### Circuits

- **Language:** Noir v1.0.0-beta.15
- **Language:** Noir v1.0.0-beta.16
- **Dependencies:** Poseidon (noir-lang/poseidon)
- **Proving:** Aztec Barretenberg backend via bb.js

Expand All @@ -402,7 +400,7 @@ const proof = await deposit.depositNoir.generateProof(inputs);
- `PRIVATE_KEY` - Deployment account key
- `DEMO_MNEMONIC_ALICE` - Test wallet mnemonic

**Auto-loaded by Bun:** Use environment variables directly; Bun loads `.env` automatically
**Loading ENV:** Use dotenv or configure your shell to load `.env` files

## Testing Overview

Expand Down Expand Up @@ -437,8 +435,8 @@ const proof = await deposit.depositNoir.generateProof(inputs);
### Running client Locally

1. `cd client`
2. `bun install` (if dependencies changed)
3. `bun run dev` - Opens at http://localhost:5173
2. `pnpm install` (if dependencies changed)
3. `pnpm run dev` - Opens at http://localhost:5173
4. Changes auto-reload (Vite HMR)

### Debugging Proofs
Expand All @@ -451,14 +449,14 @@ const proof = await deposit.depositNoir.generateProof(inputs);
### Deploying to Testnets

1. Ensure proper ENV variables are set
2. Verify circuit artifacts are built (`bun run build-contracts`)
2. Verify circuit artifacts are built (`pnpm run build-contracts`)
3. Run: `npx hardhat run scripts/deploy.ts --network <network-name>`
4. Network names: hardhat, mainnet, arbitrumOne, base

### Working with Shared Package

- Always import as `shared-package/*` (not relative paths)
- Changes to shared require re-running `bun install` in dependent packages
- Changes to shared require re-running `pnpm install` in dependent packages
- Shared uses workspace:\* to link to contracts package

## Notable Design Decisions
Expand All @@ -468,7 +466,7 @@ const proof = await deposit.depositNoir.generateProof(inputs);
3. **Encrypted Notes:** Notes encrypted with user's public key, enabling note passing without on-chain storage
4. **Two Keys:** Signing key (public key) and owning key (poseidon hash) allow efficient ZK proofs vs on-chain encryption
5. **TypeChain Integration:** Type-safe contract ABIs prevent runtime errors during tests
6. **Bun Runtime:** Faster compilation and bundling for TS/TSX; better dev experience than Node.js
6. **pnpm Workspaces:** Efficient disk space usage with symlinked node_modules; strict dependency resolution

## Known Limitations & WIPs

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# commbank.eth

### the bank you don't have to trust
### open source, privacy enhancing financial technologies

## Components

- `client*/`: the commbank.eth web app (currently 2 versions)
- `contracts/`: the EVM smart contracts required to facilitate private transfers
- `circuits/`: an implementation of a Multi Asset Shield Pool with `poseidon2` as the merkle tree hash function
- `indexer/`: the indexer that makes the merkle tree data available easier
- `client/`: the commbank.eth web app deployed to `https://commbank.eth.limo`
- `contracts/`: the EVM smart contracts required to facilitate Private Unstoppable Money
- `circuits/`: Private Unstoppable Money Zero Knowledge circuits
- `indexer/`: a data indexer used to cache Private Unstoppable Money transactions more efficiently
- `relayer/`: an expressJS based backend that forwards RPC requests and works as a transaction relayer

## Development

Expand Down
1 change: 1 addition & 0 deletions circuits/deposit/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ authors = [""]

[dependencies]
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
pum_lib = { path = '../pum_lib' }
11 changes: 2 additions & 9 deletions circuits/deposit/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
use poseidon;

fn calculate_leaf(asset_id: Field, asset_amount: Field, owner: Field, secret: Field) -> Field {
let leaf_hash =
poseidon::poseidon2::Poseidon2::hash([asset_id, asset_amount, owner, secret], 4);

leaf_hash
}
use pum_lib;

fn main(
hash: pub Field,
Expand All @@ -14,7 +7,7 @@ fn main(
owner: Field,
secret: Field,
) {
let reconstructed_leaf = calculate_leaf(asset_id, asset_amount, owner, secret);
let reconstructed_leaf = pum_lib::calculate_leaf(asset_id, asset_amount, owner, secret);

assert(reconstructed_leaf == hash);
}
Expand Down
4 changes: 2 additions & 2 deletions circuits/warp/Nargo.toml → circuits/pum_lib/Nargo.toml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "warp"
type = "bin"
name = "pum_lib"
authors = [""]
type = "lib"

[dependencies]
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
48 changes: 48 additions & 0 deletions circuits/pum_lib/src/lib.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
use poseidon;
use poseidon::poseidon2;

global HEIGHT: u32 = 12;

pub fn calculate_leaf(asset_id: Field, asset_amount: Field, owner: Field, secret: Field) -> Field {
let leaf_hash =
poseidon::poseidon2::Poseidon2::hash([asset_id, asset_amount, owner, secret], 4);

leaf_hash
}

pub fn compute_merkle_root(
leaf: Field,
path: [Field; HEIGHT - 1],
path_indices: [Field; HEIGHT - 1],
) -> Field {
let mut current = leaf;
for i in 0..HEIGHT - 1 {
let path_bit = path_indices[i];
let (hash_left, hash_right) = if path_bit == 0 {
(path[i], current)
} else {
(current, path[i])
};
current = poseidon2::Poseidon2::hash([hash_left, hash_right], 2);
}
current
}

pub fn compute_nullifier(
leaf_index: Field,
owner: Field,
secret: Field,
asset_id: Field,
asset_amount: Field,
) -> Field {
poseidon2::Poseidon2::hash([leaf_index, owner, secret, asset_id, asset_amount], 5)
}

pub fn reconstruct_leaf(
asset_id: Field,
asset_amount: Field,
owner: Field,
secret: Field,
) -> Field {
poseidon2::Poseidon2::hash([asset_id, asset_amount, owner, secret], 4)
}
1 change: 1 addition & 0 deletions circuits/transfer/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ authors = [""]

[dependencies]
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
pum_lib = { path = '../pum_lib' }
40 changes: 4 additions & 36 deletions circuits/transfer/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
global HEIGHT: u32 = 12;
global NOTE_COUNT: u32 = 3;

use poseidon::poseidon2::{self, Poseidon2Hasher};

use pum_lib::{self, compute_merkle_root, compute_nullifier, reconstruct_leaf};
use std::{collections::map::HashMap, hash::BuildHasherDefault};

global HEIGHT: u32 = 12;
global NOTE_COUNT: u32 = 3;

struct InputNote {
asset_id: Field,
asset_amount: Field,
Expand All @@ -23,38 +23,6 @@ struct OutputNote {
asset_amount: Field,
}

fn compute_merkle_root(
leaf: Field,
path: [Field; HEIGHT - 1],
path_indices: [Field; HEIGHT - 1],
) -> Field {
let mut current = leaf;
for i in 0..HEIGHT - 1 {
let path_bit = path_indices[i];
let (hash_left, hash_right) = if path_bit == 0 {
(path[i], current)
} else {
(current, path[i])
};
current = poseidon2::Poseidon2::hash([hash_left, hash_right], 2);
}
current
}

fn compute_nullifier(
leaf_index: Field,
owner: Field,
secret: Field,
asset_id: Field,
asset_amount: Field,
) -> Field {
poseidon2::Poseidon2::hash([leaf_index, owner, secret, asset_id, asset_amount], 5)
}

fn reconstruct_leaf(asset_id: Field, asset_amount: Field, owner: Field, secret: Field) -> Field {
poseidon2::Poseidon2::hash([asset_id, asset_amount, owner, secret], 4)
}

fn main(
root: pub Field,
input_notes: [InputNote; NOTE_COUNT],
Expand Down
8 changes: 8 additions & 0 deletions circuits/transfer_external/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "transfer_external"
type = "bin"
authors = [""]

[dependencies]
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
pum_lib = { path = '../pum_lib' }
Loading