Sol.College

Full lesson

Chainremit

What it does

From the project README:

ChainRemit lets anyone send money home in seconds using Solana's on-chain escrow — with near-zero fees, real-time FX rates via Pyth, and a compressed NFT receipt for every transfer. Built for the Colosseum Frontier Hackathon.
Original
Shadow-ops-alt/Chainremit
SuperStack fork
Blockchains/Chainremit @ d748ed4
Stars
1
Last push (original)
2026-05-11
Languages
TypeScript, CSS, JavaScript, Rust, HTML
Detected stack
AnchorMetaplexweb3.js
Categories
Other
Licence
Apache-2.0
Homepage
https://chainremit-web.vercel.app

Architecture

14 source files. By extension: .ts ×7, .js ×4, .tsx ×2, .rs ×1.

Top-level directorySource files
apps11
programs3

On-chain programs: programs/escrow/programs/escrow

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/chainremit/. 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.

Shadow-ops-alt/Chainremit · programs/escrow/programs/escrow/src/lib.rs L85–108 @ d748ed4 · Apache-2.0 · original
    )]    pub escrow: Account<'info, Escrow>,     pub system_program: Program<'info, System>,} #[derive(Accounts)]pub struct CancelEscrow<'info> {    #[account(mut)]    pub sender: Signer<'info>,     #[account(        mut,        close = sender,        has_one = sender,        seeds = [b"escrow", sender.key().as_ref(), &escrow.escrow_id],        bump = escrow.bump    )]    pub escrow: Account<'info, Escrow>,     pub system_program: Program<'info, System>,} #[derive(Accounts)]
  1. Line 94 pub sender: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 98 close = sender,: Closes the account at the end of the instruction and refunds its lamports.
  3. Line 99 has_one = sender,: Checks that a stored pubkey field matches the passed account.
  4. Line 100 seeds = [b"escrow", sender.key().as_ref(), &escrow.escrow_id],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  5. Line 101 bump = escrow.bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
Shadow-ops-alt/Chainremit · apps/web/src/App.tsx L829–852 @ d748ed4 · Apache-2.0 · original
            payoutMethod,            recipientHint,          }),        })        setCreated(out)        setTxExplorerUrl(null)      } else {        if (!wallet.connected) {          setVisible(true)          return        }        if (!wallet.publicKey) throw new Error('Connect Phantom wallet first')        if (!wallet.sendTransaction) throw new Error('Wallet does not support sending transactions')         const escrowId = crypto.getRandomValues(new Uint8Array(16))        const claimTokenBytes = crypto.getRandomValues(new Uint8Array(32))        const claimToken = toBase64Url(claimTokenBytes)        const claimHash = await sha256(claimTokenBytes)        const amountLamports = parseAmountLamports(amount)         const [escrowPda] = PublicKey.findProgramAddressSync(          [new TextEncoder().encode('escrow'), wallet.publicKey.toBytes(), escrowId],          PROGRAM_ID,        )
  1. Line 841 if (!wallet.sendTransaction) throw new Error('Wallet does not support sending transactions: Submits the signed transaction to the cluster.
  2. Line 849 const [escrowPda] = PublicKey.findProgramAddressSync(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.

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.

DirectoryCommandRuns
.npm run devnpm -w apps/relayer run dev & npm -w apps/web run dev
.npm run buildnpm -w apps/relayer run build && npm -w apps/web run build
.npm run lintnpm -w apps/relayer run lint && npm -w apps/web run lint
programs/escrownpm run testmocha -t 1000000 tests/
programs/escrownpm run lintprettier */*.js "*/**/*{.js,.ts}" --check
apps/webnpm run devvite
apps/webnpm run buildtsc -b && vite build
apps/webnpm run linteslint .
apps/relayernpm run devtsx watch src/server.ts
apps/relayernpm run startnode dist/server.js
apps/relayernpm run buildtsc -p tsconfig.json
apps/relayernpm run linteslint .
programs/escrowanchor buildcompile programs and generate IDLs
programs/escrowanchor testlocal validator + test suite
programs/escrowanchor run testnpm test --silent

What you could build from it

Used in lessons