HashThis is a decentralized application (dApp) that anchors file fingerprints (SHA-256 hashes) to the Nervos Common Knowledge Base (CKB) blockchain. It allows users to create a permanent, tamper-proof timestamp for any digital file without revealing the file's contents to the network.
Live Demo: https://hash-this.vercel.app
- Privacy-First: Files are hashed locally in the browser using the Web Crypto API. Your actual file data never leaves your device; only the unique hash is sent to the network.
- Immutable Anchoring: Hashes are stored in unique Cells on the Nervos CKB Blockchain (Aggron4 Testnet).
- Instant Verification: Anyone can verify the existence and original timestamp of a file by re-hashing it and querying the blockchain.
- Modern Stack: Built with TypeScript, React, Vite, and the CCC SDK (Common Chain Connector).
- Flexible Deployment: Supports both serverless (Vercel) and traditional server (Express) architectures.
| Component | Technology | Description |
|---|---|---|
| Frontend | React + Vite | Fast, client-side UI with local hashing logic. |
| Styling | Tailwind CSS | Responsive, modern design system. |
| Backend | Vercel Serverless / Express | Serverless functions or traditional REST API. |
| Blockchain | Nervos CKB | Layer 1 Proof-of-Work blockchain for maximum security. |
| SDK | @ckb-ccc/core | Modern TypeScript SDK for CKB with better concurrency handling. |
| Deployment | Vercel / Any Node host | Edge network or traditional server deployment. |
HashThis/
├── api-backend/ # Vercel Serverless Backend (Production)
│ ├── api/
│ │ └── hashes/
│ │ ├── index.ts # POST /api/hashes (submit)
│ │ ├── [hash].ts # GET /api/hashes/:hash (verify)
│ │ └── ckb.service.ts # CKB blockchain logic (CCC SDK)
│ ├── vercel.json # Serverless function config
│ └── package.json # Backend dependencies
├── backend/ # Express Server Backend (Alternative)
│ ├── src/
│ │ ├── services/ # CKB blockchain logic
│ │ ├── controllers/ # API route handlers
│ │ ├── config/ # Environment configuration
│ │ └── index.ts # Express server entry
│ └── package.json # Express dependencies
├── frontend/ # React UI
│ ├── src/
│ │ ├── utils/ # Local Hashing (Web Crypto API)
│ │ ├── pages/ # Submit & Verify Views
│ │ └── services/ # API Client
│ └── vercel.json # SPA routing config
└── README.md
Advantages:
- ✅ Zero server maintenance
- ✅ Automatic scaling
- ✅ Free tier available (no credit card)
- ✅ Built-in CDN and CORS
- ✅ No cold starts
Frontend: https://hash-this.vercel.app
Backend API: https://hash-this-api1.vercel.app
Environment Variables (Backend):
PRIVATE_KEY=0x... (your CKB testnet private key)
CKB_NETWORK=testnet
CORS_ORIGIN=https://hash-this.vercel.app
Environment Variables (Frontend):
VITE_API_URL=https://hash-this-api1.vercel.app/api
Deployment Steps:
- Fork this repo
- Connect to Vercel
- Deploy
api-backendas one project - Deploy
frontendas another project - Add environment variables in Vercel dashboard
- Done!
Advantages:
- ✅ Full control over infrastructure
- ✅ Familiar Express.js patterns
- ✅ Easy to debug and monitor
- ✅ Works with any Node.js host
Use Cases:
- Self-hosting on your own VPS
- Docker/Kubernetes deployments
- Development and testing
- Enterprise environments with specific requirements
Install Dependencies:
cd backend
npm installEnvironment Configuration (backend/.env):
PORT=3001
NODE_ENV=production
# CKB Configuration (Aggron4 Testnet)
CKB_RPC_URL=https://testnet.ckb.dev/rpc
CKB_INDEXER_URL=https://testnet.ckb.dev/indexer
CKB_NETWORK=testnet
# Your Private Key (Testnet only!)
PRIVATE_KEY=0xYourTestnetPrivateKeyHere
# CORS Configuration
CORS_ORIGIN=http://localhost:5173Run Express Server:
# Development
npm run dev
# Production
npm run build
npm startThe Express server will run on http://localhost:3001
API Endpoints:
POST /api/v1/hashes- Submit hashGET /api/v1/hashes/:hash- Verify hashGET /health- Health check
Deployment Targets:
- Traditional VPS (DigitalOcean, Linode, AWS EC2)
- Docker containers
- Kubernetes clusters
- Any Node.js hosting service that allows Express apps
Frontend Configuration for Express:
Update frontend/.env:
VITE_API_URL=http://your-server:3001/api/v1- Node.js: v18 or higher (LTS recommended)
- CKB Wallet: A testnet wallet with funds from Nervos Faucet
git clone https://github.com/alienrobotninja/HashThis.git
cd HashThisBackend:
cd api-backend
npm install
npm install -g vercel
vercel devFrontend:
cd frontend
npm install
npm run devURLs:
- Frontend: http://localhost:5173
- Backend: http://localhost:3000
Backend:
cd backend
npm install
npm run devFrontend:
cd frontend
npm install
npm run devURLs:
- Frontend: http://localhost:5173
- Backend: http://localhost:3001
Writes a new hash to the blockchain.
Serverless: POST /api/hashes/index
Express: POST /api/v1/hashes
Request:
{
"fileHash": "0x546c01781527fb2d0d062540ca38f4dd727c67aeb58c00e4f2725600b3653ed5",
"timestamp": "2026-02-28T09:00:00.000Z"
}Response:
{
"txHash": "0x95fbed37ddc62d7d0b28429f005ee50539b3c1b67640ac985f3deeda73383810",
"blockNumber": "pending",
"status": "committed"
}Checks if a hash exists on-chain and retrieves its metadata.
Serverless: GET /api/hashes/:hash
Express: GET /api/v1/hashes/:hash
Example: GET /api/hashes/546c01781527fb2d0d062540ca38f4dd727c67aeb58c00e4f2725600b3653ed5
Response:
{
"timestamp": "2026-02-28T09:00:00.000Z",
"blockNumber": "12345678"
}404 Response (hash not found):
{
"message": "Hash not found on chain"
}- Better Concurrency: CCC handles multiple simultaneous transactions without conflicts
- Simpler API: Automatic input collection and fee calculation
- Official Support: Actively maintained by CKB DevRel team
- Future-Proof: Recommended SDK for new CKB projects
| Feature | Serverless (Vercel) | Express Server |
|---|---|---|
| Maintenance | Zero | Manual updates |
| Scaling | Automatic | Manual/Auto-scaling |
| Cost | Free tier generous | VPS/hosting fees |
| Cold Starts | None (edge network) | N/A |
| Control | Limited | Full control |
| Debugging | Vercel logs | Direct access |
| Best For | Public demos, MVPs | Enterprise, self-hosting |
Both backends use the same CKB service logic - the only difference is the HTTP layer (serverless functions vs Express routes).
Run the End-to-End test suite (Express backend only):
cd backend
npm testContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- Live App: https://hash-this.vercel.app
- Backend API: https://hash-this-api1.vercel.app
- GitHub: https://github.com/alienrobotninja/HashThis
- CKB Explorer (Testnet): https://pudge.explorer.nervos.org
- CCC Documentation: https://docs.nervos.org/docs/sdk-and-devtool/ccc
- Issues Encountered: ISSUES_ENCOUNTERED.md
Built with ❤️ by Alien Robot Ninja 👽🤖🥷 on Nervos CKB