Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Etched - Web3 Certificate SBT Platform

Etched Logo Ethereum Polygon Rust Next.js

Mint tamper-proof graduation certificates and diplomas as Soulbound Tokens


🎯 Overview

Etched is a decentralized platform for issuing and verifying academic credentials as Soulbound Tokens (SBT). SBTs are non-transferable NFTs permanently bound to a recipient's wallet, making them ideal for credentials that should never be sold or transferred.

Key Features

  • πŸ” Soulbound Tokens - Certificates cannot be transferred or sold
  • βœ… Multi-level verification - Admin β†’ Validator β†’ Certificator workflow
  • πŸ›οΈ Institution-based - Validators are tied to specific institutions
  • πŸ” On-chain verification - Anyone can verify a certificate by its hash
  • 🌐 Wallet-based auth - No passwords, just sign with your wallet

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Frontend     │────▢│    Backend      │────▢│  Smart Contract β”‚
β”‚    (Next.js)    β”‚     β”‚   (Actix Web)   β”‚     β”‚  (Solidity)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                       β”‚                       β”‚
        β–Ό                       β–Ό                       β–Ό
   React + ethers.js      JWT + Wallet Auth       ERC721 + SBT
   Wallet Connect         Metadata Hosting        AccessControl

Roles

Role Description
Admin Verifies validators from institutions. Adds/removes validators on-chain.
Validator Reviews certificate requests. Approves or rejects, triggering SBT mint.
Certificator Submits certificate data. Receives hash for public verification.

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Rust 1.70+
  • MetaMask or compatible wallet

1. Setup Smart Contract

cd contracts
npm install
cp .env.example .env
# Edit .env with your PRIVATE_KEY

# Start local Hardhat node
npx hardhat node

# Deploy (in new terminal)
npx hardhat run scripts/deploy.js --network localhost

Save the deployed contract address for frontend config.

2. Setup Backend

cd backend
cp .env.example .env
# Edit .env - set ADMIN_ADDRESSES to your wallet address

cargo run
# Server runs at http://localhost:8080

3. Setup Frontend

cd frontend
npm install
cp .env.example .env.local
# Edit .env.local:
# - NEXT_PUBLIC_CONTRACT_ADDRESS=<deployed address>
# - NEXT_PUBLIC_CHAIN_ID=31337

npm run dev
# App runs at http://localhost:3000

4. Configure MetaMask

  1. Add network: http://localhost:8545 (Chain ID: 31337)
  2. Import test account from Hardhat (first account is admin)
  3. Connect wallet on the app

πŸ“– Workflow

1. Admin Verifies Validator

Admin wallet β†’ Sign in β†’ Add validator address + institution info β†’ On-chain tx

2. Certificator Submits Request

Certificator β†’ Fill certificate form β†’ Create metadata β†’ Submit on-chain request

3. Validator Approves

Validator β†’ View pending requests β†’ Verify off-chain β†’ Approve β†’ SBT minted to recipient

4. Public Verification

Anyone β†’ Enter certificate hash β†’ Verify on-chain β†’ See token details

πŸ”§ Environment Variables

Backend (.env)

JWT_SECRET=your-secret-key
ADMIN_ADDRESSES=0xYourAdminWallet,0xAnotherAdmin
PUBLIC_BASE_URL=http://localhost:8080
BIND_ADDR=0.0.0.0:8080

Frontend (.env.local)

NEXT_PUBLIC_API_BASE=http://localhost:8080
NEXT_PUBLIC_CONTRACT_ADDRESS=0xDeployedContractAddress
NEXT_PUBLIC_CHAIN_ID=31337

Contracts (.env)

PRIVATE_KEY=0xYourPrivateKey
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY
MUMBAI_RPC_URL=https://polygon-mumbai.infura.io/v3/YOUR_KEY
POLYGON_RPC_URL=https://polygon-mainnet.infura.io/v3/YOUR_KEY

πŸ“š API Documentation

See docs/API.md for complete API reference.

Quick Examples

# Get auth nonce
curl -X POST http://localhost:8080/auth/nonce \
  -H 'Content-Type: application/json' \
  -d '{"address":"0x..."}'

# List validators
curl http://localhost:8080/validators

# Create metadata (requires JWT)
curl -X POST http://localhost:8080/metadata \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"certificate_name":"Diploma","recipient_name":"John",...}'

πŸ”— Networks

Network Chain ID Status
Localhost 31337 Development
Sepolia 11155111 Testnet
Polygon Mumbai 80001 Testnet
Polygon Mainnet 137 Production

πŸ“ Project Structure

etched/
β”œβ”€β”€ contracts/           # Solidity smart contracts
β”‚   β”œβ”€β”€ CertificateSBT.sol
β”‚   β”œβ”€β”€ scripts/deploy.js
β”‚   └── hardhat.config.js
β”œβ”€β”€ backend/             # Rust Actix Web API
β”‚   β”œβ”€β”€ src/main.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ frontend/            # Next.js React app
β”‚   β”œβ”€β”€ src/app/
β”‚   β”œβ”€β”€ src/lib/
β”‚   └── package.json
β”œβ”€β”€ docs/                # Documentation
β”‚   └── API.md
└── README.md

πŸ›‘οΈ Security

  • Soulbound: Tokens cannot be transferred after minting
  • Role-based access: Smart contract enforces Admin/Validator permissions
  • Signature verification: Backend verifies EIP-191 signatures
  • Institution binding: Validators can only approve requests from their institution

πŸ“„ License

MIT License - see LICENSE for details.


Built with ❀️ for trustworthy credentials

Releases

Packages

Contributors

Languages