Giftchain - An alternative approach to platforms like BuyMeACoffee or Patreon to Support Creators with Crypto on-chain
Giftchain is a multi-chain web application that enables users to send digital gifts using Sui and Solana blockchains. It features a unified interface for gifting, where users can send crypto gifts wrapped in digital visuals, which are then revealed by the recipient.
The Crypto Coins are directly Sent to the Reciever, Giftchain does not custody coins!
- Multi-Chain Support: Seamlessly switch between Sui and Solana.
- Frontend: React + TypeScript + Vite app using a custom
multichainkitto abstract wallet interactions. - Backend: Fastify server handling user profiles, gift metadata, and transaction verification for both chains.
- Smart Contract (Sui): A Move package that facilitates fee collection and gift events. On Solana, native Memo programs are used.
The codebase is organized into three main directories:
/client— React + TypeScript frontend application./server— Node.js + Fastify backend API./giftchain-sui/giftchain— Sui Move smart contract package.
- Sui: A custom Move contract (
wrap_gift) is called. It splits a fee to the treasury and transfers the gift amount directly to the recipient. It emits aGiftSentevent which the backend validates on payment. - Solana: A direct wallet transfer is constructed containing gift amount of coins and sent to the receiver with a transaction that includes Platform Fee. The backend validates on payment.
Ensure you have the following installed before starting:
- Node.js: v18+ recommended
- Package Manager: npm or pnpm
- Git
- MongoDB: Local instance or Atlas URI
- Sui CLI: For building and deploying smart contracts
Before running the app, you must set up the Sui environment and deploy the contracts if you intend to interact with the blockchain features locally or on testnet.
Follow the official Sui documentation to install the binaries for your OS.
Connect to the Sui Testnet:
sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443
sui client switch --env testnetJoin the Sui Discord or use the command line faucet if available for your active address:
sui client faucetNavigate to the contract directory:
cd giftchain-sui/giftchainBuild the package:
sui move buildPublish to Testnet:
sui client publish --gas-budget 100000000Important:
- Capture the Package ID from the output.
- Update the frontend
VITE_PACKAGE_IDand backendPACKAGE_IDenvironment variables with this new ID.
- Navigate to the server directory:
cd server - Install dependencies:
npm install
- Configure environment variables:
- Copy
.env.exampleto.env - Update
MONGO_URI,PACKAGE_IDANDADD YOUR CLOUDINARY ENVS.
- Copy
- Run the development server:
npm run dev
- Navigate to the client directory:
cd client - Install dependencies:
npm install
- Configure environment variables:
- Copy
.env.exampleto.env - Update
VITE_API_URLandVITE_PACKAGE_ID.
- Copy
- Start the development server:
npm run dev
PORT=5000
MONGO_URI=mongodb://localhost:27017/giftchain
SUI_NETWORK=testnet
PACKAGE_ID=0x...VITE_API_URL=http://localhost:5000
VITE_PACKAGE_ID=0x...
VITE_SUI_NETWORK=testnetTo start the full stack locally:
- Start MongoDB (if local).
- Start Backend (
npm run devin/server). - Start Frontend (
npm run devin/client).
This project is licensed under the Apache License 2.0.