Full lesson
solana-mixer-core
A privacy-preserving, fixed-denomination mixer on Solana, implemented in Anchor and verified with Succinct SP1.
What it does
From the project README:
A privacy-preserving, fixed-denomination mixer on Solana, implemented in Anchor and verified with Succinct SP1.
- Original
- 2kcmte/solana-mixer-core
- SuperStack fork
- Blockchains/solana-mixer-core @
3f9c5f5 - Stars
- 2
- Last push (original)
- 2025-11-11
- Languages
- Rust, TypeScript
- Detected stack
- Anchor
- Categories
- Infrastructure & Tooling
- Licence
- MIT
Architecture
12 source files. By extension: .rs ×11, .ts ×1.
| Top-level directory | Source files |
|---|---|
tests | 7 |
programs | 4 |
migrations | 1 |
On-chain programs: programs/solana-mixer
Dapp: deploying
This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/solana-mixer-core/, once it is deployed and checked on devnet. Until then, run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
programs/solana-mixer/src/lib.rs L241–264 @ 3f9c5f5 · MIT · original require!( recipient.eq(&ctx.accounts.recipient.key()), ErrorCode::InvalidInput ); **state_info.try_borrow_mut_lamports()? -= to_recipient; **ctx.accounts.recipient.try_borrow_mut_lamports()? += to_recipient; emit!(WithdrawEvent { nullifier_hash, recipient: Pubkey::new_from_array(recipient_bytes), relayer: Pubkey::new_from_array(relayer_bytes), fee, refund, }); Ok(()) }} #[derive(Accounts)]pub struct Initialize<'info> { #[account( init, seeds = [STATE_SEED], bump,- Line 241
require!(: An explicit validation that aborts the instruction with an error. - Line 248
emit!(WithdrawEvent {: Emits an Anchor event that clients can parse from the logs. - Line 262
init,: Creates and pays for a new account. Space and payer must be specified. - Line 263
seeds = [STATE_SEED],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 264
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
. | anchor build | compile programs and generate IDLs |
. | anchor test | local validator + test suite |
. | anchor run test | cargo test |
. | cargo build | Rust workspace build |
. | cargo test | Rust tests |
What you could build from it
- Fork the SuperStack copy and extend it within the Infrastructure & Tooling gaps listed on the idea page.
- Learn the pattern first: Building and sending transactions from a client
- Learn the pattern first: Anchor account constraints