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 directory | Source files |
|---|---|
apps | 11 |
programs | 3 |
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.
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)]- Line 94
pub sender: Signer<'info>,: Requires this account to have signed the transaction. - Line 98
close = sender,: Closes the account at the end of the instruction and refunds its lamports. - Line 99
has_one = sender,: Checks that a stored pubkey field matches the passed account. - 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. - Line 101
bump = escrow.bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
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, )- Line 841
if (!wallet.sendTransaction) throw new Error('Wallet does not support sending transactions: Submits the signed transaction to the cluster. - 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.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | npm -w apps/relayer run dev & npm -w apps/web run dev |
. | npm run build | npm -w apps/relayer run build && npm -w apps/web run build |
. | npm run lint | npm -w apps/relayer run lint && npm -w apps/web run lint |
programs/escrow | npm run test | mocha -t 1000000 tests/ |
programs/escrow | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
apps/web | npm run dev | vite |
apps/web | npm run build | tsc -b && vite build |
apps/web | npm run lint | eslint . |
apps/relayer | npm run dev | tsx watch src/server.ts |
apps/relayer | npm run start | node dist/server.js |
apps/relayer | npm run build | tsc -p tsconfig.json |
apps/relayer | npm run lint | eslint . |
programs/escrow | anchor build | compile programs and generate IDLs |
programs/escrow | anchor test | local validator + test suite |
programs/escrow | anchor run test | npm test --silent |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)