Full lesson
tidex6
Private stablecoin payments with disclosure by consent. The sender seals the amount and a memo into a note only the recipient can open, and decides who else may read it. One Groth16 circuit, live on Solana mainnet, Arc and EVM.
What it does
From the project README:
I grant access, not permission. Private stablecoin payments with disclosure by consent — one Rust codebase, live on Solana mainnet, on Arc and on EVM chains.
- Original
- koshak01/tidex6
- SuperStack fork
- Blockchains/tidex6 @
34f661b - Stars
- 1
- Last push (original)
- 2026-10-29
- Languages
- Rust, Solidity, JavaScript, Shell, CSS, Leo
- Detected stack
- Anchor
- Categories
- DeFiPayments
- Licence
- Apache-2.0
- Homepage
- https://tidex6.com
Architecture
285 source files. By extension: .rs ×252, .sol ×29, .jsx ×2, .py ×1, .tsx ×1.
| Top-level directory | Source files |
|---|---|
crates | 168 |
stylus | 53 |
contracts | 29 |
programs | 22 |
examples | 9 |
brand | 2 |
style-guide | 1 |
docs | 1 |
On-chain programs: programs/tidex6-caller, programs/tidex6-confidential-amounts, programs/tidex6-confidential-pool, programs/tidex6-pool-v2, programs/tidex6-registry, programs/tidex6-tip-jar, programs/tidex6-verifier, programs/tidex6-verifier-v2
Dapp: devnet deploy pending
⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/tidex6/. Until then, the lesson and step-by-step guide below are complete, and you can 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/tidex6-wusdc-pool/src/lib.rs L181–204 @ 34f661b · Apache-2.0 · original#[instruction(commitment: [u8; FIELD_ELEMENT_BYTES])]pub struct AppendMemo<'info> { #[account( mut, seeds = [MemoAccount::SEED_PREFIX, &commitment], bump = memo.bump, has_one = depositor, )] pub memo: Account<'info, MemoAccount>, pub depositor: Signer<'info>,} #[derive(Accounts)]#[instruction( commitment: [u8; FIELD_ELEMENT_BYTES], secret: [u8; FIELD_ELEMENT_BYTES], nullifier: [u8; FIELD_ELEMENT_BYTES], nullifier_hash: [u8; FIELD_ELEMENT_BYTES],)]pub struct Refund<'info> { #[account( mut, close = depositor,- Line 185
seeds = [MemoAccount::SEED_PREFIX, &commitment],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 186
bump = memo.bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 187
has_one = depositor,: Checks that a stored pubkey field matches the passed account. - Line 191
pub depositor: Signer<'info>,: Requires this account to have signed the transaction. - Line 204
close = depositor,: Closes the account at the end of the instruction and refunds its lamports.
programs/tidex6-pool-v2/src/lib.rs L313–335 @ 34f661b · Apache-2.0 · original // no later withdraw could prove against. #[account( seeds = [MemoAccount::SEED_PREFIX, &leaf], bump = memo.bump, has_one = depositor, )] pub memo: Account<'info, MemoAccount>, #[account( init, payer = depositor, space = NullifierRecord::ACCOUNT_SIZE, seeds = [NullifierRecord::SEED_PREFIX, &nf], bump, )] pub nullifier: Account<'info, NullifierRecord>, #[account(mut)] pub depositor: Signer<'info>, pub token_program: Interface<'info, TokenInterface>, pub system_program: Program<'info, System>,}- Line 315
seeds = [MemoAccount::SEED_PREFIX, &leaf],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 316
bump = memo.bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 317
has_one = depositor,: Checks that a stored pubkey field matches the passed account. - Line 322
init,: Creates and pays for a new account. Space and payer must be specified. - Line 331
pub depositor: Signer<'info>,: Requires this account to have signed the transaction.
programs/tidex6-verifier-v2/src/lib.rs L289–312 @ 34f661b · Apache-2.0 · original bump, )] pub vault: UncheckedAccount<'info>, /// The memo account opened at deposit. Closed on refund, rent back /// to the depositor. `has_one = depositor` ties it to the signer. #[account( mut, close = depositor, seeds = [MemoAccount::SEED_PREFIX, &commitment], bump = memo.bump, has_one = depositor, )] pub memo: Account<'info, MemoAccount>, /// The per-nullifier PDA. Created here so that after a refund the /// note's nullifier_hash is permanently spent — a later withdraw of /// the same note fails at `init`. #[account( init, payer = depositor, space = NullifierRecord::ACCOUNT_SIZE, seeds = [NullifierRecord::SEED_PREFIX, &nullifier_hash], bump,- Line 289
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 294
/// to the depositor. `has_one = depositor` ties it to the signer.: Checks that a stored pubkey field matches the passed account. - Line 297
close = depositor,: Closes the account at the end of the instruction and refunds its lamports. - Line 298
seeds = [MemoAccount::SEED_PREFIX, &commitment],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 308
init,: Creates and pays for a new account. Space and payer must be specified.
programs/tidex6-confidential-pool/src/lib.rs L301–324 @ 34f661b · Apache-2.0 · original token::mint = mint, token::authority = depositor, )] pub depositor_token: Account<'info, TokenAccount>, #[account( mut, close = depositor, seeds = [MemoAccount::SEED_PREFIX, &commitment], bump = memo.bump, has_one = depositor, )] pub memo: Account<'info, MemoAccount>, #[account( init, payer = depositor, space = NullifierRecord::ACCOUNT_SIZE, seeds = [NullifierRecord::SEED_PREFIX, &nullifier_hash], bump, )] pub nullifier: Account<'info, NullifierRecord>, #[account(mut)]- Line 308
close = depositor,: Closes the account at the end of the instruction and refunds its lamports. - Line 309
seeds = [MemoAccount::SEED_PREFIX, &commitment],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 310
bump = memo.bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 311
has_one = depositor,: Checks that a stored pubkey field matches the passed account. - Line 316
init,: Creates and pays for a new account. Space and payer must be specified.
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 |
|---|---|---|
. | anchor build | compile programs and generate IDLs |
. | anchor test | local validator + test suite |
. | anchor run test | echo 'Tests are written as Rust integration tests in crates/tidex6-verifier/tests/' |
. | cargo build | Rust workspace build |
. | cargo test | Rust tests |
What you could build from it
- Fork the SuperStack copy and extend it within the DeFi gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)
- Learn the pattern first: SPL Tokens: mints, accounts and transfers