Sol.College

Full lesson

Driftly

Driftly — Internet Capital Markets Powered by Solana cNFTs

What it does

From the project README:

Build, sell, redeem, and trade digital assets with Solana’s Compressed NFTs (cNFTs). Driftly gives small businesses programmatic loyalty, verifiable discounts, and secondary-market liquidity — at internet scale and near-zero cost (Mint More than 1 Million cNFTs for 0.3 Sol 🤩).
Original
Ayushjhax/Driftly
SuperStack fork
Blockchains/Driftly @ 3ccc785
Stars
0
Last push (original)
2025-10-30
Languages
TypeScript, CSS, JavaScript, Shell
Detected stack
MetaplexNext.jsSolana Payweb3.js
Categories
NFTs & Digital Assets
Licence
MIT
Homepage
https://monke-driftly.vercel.app/

Architecture

196 source files. By extension: .ts ×142, .tsx ×46, .js ×8.

Top-level directorySource files
frontend158
api16
template13
lib6
types2
scripts1

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

Ayushjhax/Driftly · lib/solana-pay-verification.ts L1–24 @ 3ccc785 · MIT · original
// Solana Pay-Based Verification System// INNOVATIVE: Use Solana Pay for BOTH payment AND redemption verification! import { Connection, PublicKey, Transaction, Keypair } from '@solana/web3.js';import {   createTransferCheckedInstruction,  getAssociatedTokenAddress,  TOKEN_PROGRAM_ID} from '@solana/spl-token';import { encodeURL, createQR, findReference, validateTransfer } from '@solana/pay';import BigNumber from 'bignumber.js';import QRCode from 'qrcode'; const MEMO_PROGRAM_ID = new PublicKey('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'); /** * INNOVATION 1: Discount NFT Verification via Solana Pay *  * Instead of traditional QR codes, we use Solana Pay to create a transaction that: * 1. Verifies cNFT ownership (via memo instruction) * 2. Burns a small redemption token (0.000001 SOL) * 3. Records redemption on-chain *  * This makes redemption atomic and trustless!
  1. Line 6 createTransferCheckedInstruction,: A checked token transfer, which also verifies the mint and decimals.
  2. Line 10 import { encodeURL, createQR, findReference, validateTransfer } from '@solana/pay';: Encodes a Solana Pay request URL.
  3. Line 10 import { encodeURL, createQR, findReference, validateTransfer } from '@solana/pay';: Finds or validates the on-chain payment by its reference key.
Ayushjhax/Driftly · frontend/lib/nft-transfer.ts L1–23 @ 3ccc785 · MIT · original
import {   Connection,   PublicKey,   Keypair,   Transaction,  SystemProgram,  LAMPORTS_PER_SOL,  sendAndConfirmTransaction} from '@solana/web3.js';import {   createMint,   createAccount,   mintTo,   getOrCreateAssociatedTokenAccount,  createTransferInstruction,  getAccount,  createInitializeMintInstruction,  createInitializeAccountInstruction,  createMintToInstruction,  MINT_SIZE,  TOKEN_PROGRAM_ID,  getMinimumBalanceForRentExemptMint} from '@solana/spl-token';
  1. Line 8 sendAndConfirmTransaction: Submits the signed transaction to the cluster.
  2. Line 15 createTransferInstruction,: An SPL token transfer through the Token Program.
  3. Line 19 createMintToInstruction,: Mints new tokens. The mint authority must sign.
Ayushjhax/Driftly · frontend/lib/nft-minting.ts L1–23 @ 3ccc785 · MIT · original
import {   Connection,   PublicKey,   Keypair,   Transaction,  SystemProgram,  LAMPORTS_PER_SOL,  sendAndConfirmTransaction} from '@solana/web3.js';import {   createMint,   createAccount,   mintTo,   getOrCreateAssociatedTokenAccount,  createTransferInstruction,  getAccount,  createInitializeMintInstruction,  createInitializeAccountInstruction,  createMintToInstruction,  MINT_SIZE,  TOKEN_PROGRAM_ID,  getMinimumBalanceForRentExemptMint} from '@solana/spl-token';
  1. Line 8 sendAndConfirmTransaction: Submits the signed transaction to the cluster.
  2. Line 15 createTransferInstruction,: An SPL token transfer through the Token Program.
  3. Line 19 createMintToInstruction,: Mints new tokens. The mint authority must sign.
Ayushjhax/Driftly · frontend/app/merchant/page.tsx L109–131 @ 3ccc785 · MIT · original
        })      );       // Add memo with redemption data      const memo = `R:MBS-20OFF-2024:20`;      transaction.add(        new TransactionInstruction({          keys: [],          programId: new PublicKey('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),          data: Buffer.from(memo, 'utf-8')        })      );       // Get recent blockhash      const { blockhash } = await connection.getLatestBlockhash();      transaction.recentBlockhash = blockhash;      transaction.feePayer = publicKey;       console.log('📝 Transaction created, sending...');            // Send transaction      const signature = await sendTransaction(transaction, connection);      console.log('✅ Transaction sent:', signature);
  1. Line 123 const { blockhash } = await connection.getLatestBlockhash();: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 130 const signature = await sendTransaction(transaction, connection);: Submits the signed transaction to the cluster.

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 devbun --watch api/server.ts
.npm run startbun run api/server.ts
frontendnpm run devnext dev
frontendnpm run startnext start
frontendnpm run buildnext build
frontendnpm run lintnext lint

What you could build from it

Used in lessons