Skip to content

Feat/private transfer#204

Draft
Huygon764 wants to merge 11 commits intodevelopfrom
feat/private-transfer
Draft

Feat/private transfer#204
Huygon764 wants to merge 11 commits intodevelopfrom
feat/private-transfer

Conversation

@Huygon764
Copy link
Contributor

@Huygon764 Huygon764 commented Mar 10, 2026

Types of change

  • Feature
  • Bug
  • Enhancement

Comments (optional)

Allows users to deposit funds into a shared pool and withdraw to a different address with no on-chain link between deposit and withdrawal.

Flow:

Deposit: User → choose token & amount → confirm tx → funds enter Mixer pool (Poseidon commitment stored in on-chain Merkle tree)

Withdraw:

User                        Backend                 zkVerify         Contract
  |  generate ZK proof        |                        |                |
  |  (Noir, in browser)       |                        |                |
  |---withdraw request------->|                        |                |
  |                           |--submit proof--------->|                |
  |                           |<--aggregation result---|                |
  |                           |---Mixer.withdraw()-------------------->|
  |                           |                        | verify & send |
  |<------funds arrive--------|                        |                |

The user's wallet never appears in the withdrawal transaction — a relayer executes it on-chain.

Testing: deposit a fixed amount on Horizen/Base testnet → load deposits on Withdraw tab → select recipient → withdraw → verify funds arrive from the relayer address, not the user's wallet.

@Huygon764 Huygon764 force-pushed the develop branch 2 times, most recently from 97f1d52 to 713c2b1 Compare March 16, 2026 13:18
- Enhanced readability by reformatting import statements and function parameters in `mixer.controller.ts`, `mixer.indexer.ts`, and `mixer.service.ts`.
- Added new components for the Mixer UI: `DepositTab`, `WithdrawTab`, `MixerContainer`, and `PoolStats`.
- Implemented hooks for managing deposits and withdrawals in `useMixerDeposit` and `useMixerWithdraw`.
- Updated DTOs in the shared package to improve type validation.
- Introduced new API methods in `mixerApi` for handling deposits and withdrawals.
- Added state management for cached commitments in `WithdrawTab` to optimize withdrawal processes.
- Updated `getWithdrawableSlots` in `useMixerWithdraw` to return commitments alongside slots, reducing redundant API calls.
- Refactored `useMixerKeys` to utilize refs for base secret management, improving performance during concurrent calls.
- Adjusted `useMixerWithdraw` to accept commitments as parameters, streamlining the withdrawal flow.
@Huygon764 Huygon764 force-pushed the feat/private-transfer branch from 4b64cc4 to 0f80cd2 Compare March 17, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant