Protocol Online

Tender
Chain

Decentralized. Deterministic. Uncorruptible.

Scroll
01 / Why TenderChain

The Problem
& Our Solution

Public procurement handles huge amounts of money, yet traditional e-tendering still depends on trusting people and editable databases. TenderChain replaces that trust with cryptography and code.

Traditional Tendering

  • Bid leakage

    Sealed bids can be opened early and leaked to a favoured vendor.

  • Human bias

    Officials decide the winner manually, which opens the door to favouritism.

  • Editable records

    Database entries and documents can be silently changed after submission.

  • No public audit

    Bidders cannot independently verify how or why a winner was chosen.

TenderChain

  • Commit-reveal bidding

    Only a cryptographic hash is published until the deadline. Nobody, including the officer, can see a price early.

  • Smart contract decides

    The lowest revealed price wins automatically. Ties go to the earliest reveal. No human picks.

  • Immutable storage

    Bids live on Ethereum; tender documents live on IPFS, addressed by their content hash.

  • Fully auditable

    Every action emits a blockchain event anyone can verify on Etherscan.

02 / Complete Flow

How a Tender
Works, End to End

Follow one tender from publication to award. Colour shows where each step runs: in the browser, on our server and database, on IPFS, or on the Ethereum blockchain.

Stage 1 · Publish

Procurement Officer

01

Create tender

Title, category, description, deadlines, minimum deposit

02

Upload PDF to IPFS

Tender document pinned on Pinata, returns a content ID (CID)

03

createTender()

Title, CID, commit & reveal deadlines, deposit written on-chain

04

Save metadata

Tender details indexed in MongoDB for fast search

Stage 2 · Sealed bidding

Bidder (before commit deadline)

05

Browse & read

Filter by category; view the tender PDF from IPFS

06

Create sealed bid

Browser makes a random 32-byte salt and computes keccak256(tenderId, address, price, salt)

07

commit()

Only the hash + ETH deposit is sent. The price stays secret.

08

Back up salt

Salt encrypted with AES-256-GCM on the server, emailed, and downloadable as JSON

Stage 3 · Reveal

Bidder (after commit deadline)

09

Commit deadline passes

Contract moves the tender from OPEN to REVEAL; no new bids accepted

10

reveal(price, salt)

Bidder discloses the real price and the salt

11

Hash check on-chain

Contract recomputes the hash. Any change to price or salt → "Hash mismatch", rejected

Stage 4 · Award & settle

Smart contract (anyone can trigger)

12

selectWinner()

Lowest revealed price wins; tie → earliest reveal. Tender CLOSED.

13

refundDeposit()

Every bidder who revealed honestly gets the deposit back

14

slashDeposits()

Bidders who committed but never revealed lose their deposit

15

Public results

Winner, price and full audit trail visible to everyone

Ethereum (Sepolia)MongoDB / ServerIPFS (Pinata)Browser / User
03 / Core Cryptography

Commit–Reveal
Sealed Bids

Like putting your price in a locked box and showing everyone the box first. Later you open it. Nobody can peek early, and you cannot swap what is inside.

Phase A · Commit (price hidden)

Price

e.g. 4.2 ETH (secret)

+

Salt

random 32 bytes (secret)

keccak256

Hash

0x9f3c…e1 (public)

// computed in the browser, verified in Solidity
commitHash = keccak256(abi.encodePacked(
  tenderId, bidderAddress, priceWei, salt
))

Only the hash and the deposit go on-chain. Including the bidder's address means nobody can copy someone else's hash.

Phase B · Reveal (verified on-chain)

Bidder reveals price + salt

contract recomputes

keccak256(tenderId, sender, price, salt)

compare with stored hash

Match

Bid accepted and counted

Mismatch

Rejected: price was changed

Hiding

A hash reveals nothing about the price, so competitors and officers learn nothing during bidding.

Binding

It is computationally infeasible to find a different price with the same hash, so bids cannot be changed.

Accountable

The ETH deposit is lost if a bidder refuses to reveal, which stops fake or spam bids.

04 / State Machine

Tender
Lifecycle

Every tender is a state machine enforced by the smart contract. Transitions are driven by block timestamps, not by a person clicking a button.

OPEN

Bidders commit hashes + deposits

commit deadline reached

REVEAL

Bidders reveal price + salt

reveal deadline reached → selectWinner()

CLOSED

Winner fixed on-chain; refunds & slashing

CANCELLED

Officer can cancel an OPEN or REVEAL tender; every bidder can then reclaim the full deposit.

Officer controls

Extend the commit deadline (max 7 days, OPEN only), or fast-forward phases for demos. The officer can never see or change a bid.

Emergency pause

Contract owner can pause commits and reveals if a problem is found (OpenZeppelin Pausable).

Reentrancy safe

Refunds and slashing are protected by OpenZeppelin ReentrancyGuard and update state before sending ETH.

System
Architecture

STRICT MULTI-LAYERED STACK

Layer 03

User / Browser

Layer 02

Node.js Backend

Layer 01

Infrastructure

Scroll

Cryptographic
Workflow

SEQUENCE LOGIC ENSURING ZERO FRONT-RUNNING

Phase 01

Open Phase

Initiator: Officer

Smart Contract Call
> createTender(title, cid, deadlines, deposit) ↳ Executed on Blockchain
Off-Chain Database Call
POST /api/tenders (Store metadata)
Phase 02

Commit Phase

Initiator: Bidder

Smart Contract Call
> commit(tenderId, hash) + msg.value(ETH) ↳ Executed on Blockchain
Off-Chain Database Call
POST /api/salt (Secure Backup & Email)
Phase 03

Reveal Phase

Initiator: Bidder

Smart Contract Call
> reveal(tenderId, price, salt) ↳ Executed on Blockchain
Off-Chain Database Call
Salt recovered from encrypted backup
Phase 04

Closed Phase

Initiator: Smart Contract

Smart Contract Call
> selectWinner(tenderId) ↳ Executed on Blockchain
Off-Chain Database Call
refundDeposit() to honest bidders, slashDeposits() for non-revealers
Scroll

Database
& Roles

STRICT ROLE-BASED ACCESS CONTROL

User Collection

Admins

System governors responsible for officer approval.

Approve Officers
Manage System Health
Tender Collection

Officers

Professionals who publish and manage selection cycles.

createTender()
Upload to IPFS
Bid Collection

Bidders

Vendors submitting encrypted salts and ETH.

commit()
reveal()
Scroll
05 / Authentication

Two-Factor
Wallet Login

Signing in needs all three: your email, your password, and a signature from the exact MetaMask wallet linked to your account. Sign-In with Ethereum (EIP-4361) signatures are free and send no transaction.

01

Enter email + password

02

Server issues one-time nonce

Random, HMAC-signed, expires in 5 minutes

03

MetaMask: sign-in request

Standard EIP-4361 message bound to this website's domain

04

Server verifies everything

05

Session created

Signed JWT (NextAuth); redirected to role dashboard

Step 04 · Checks performed on the server

Password · bcrypt hash comparison

Incorrect email or password

Domain · Message must name this exact website

Blocks phishing sites reusing signatures

Nonce · Valid HMAC, unexpired, never used before

Blocks replaying an old signature

Signature · ethers.verifyMessage recovers the signer

Proves ownership of the private key

Wallet link · Signer must equal the account's registered wallet

Wrong MetaMask account is refused

If any single check fails, login is refused with a clear reason. A stolen password alone is useless without the wallet, and a wallet alone is useless without the password.

06 / Summary

Tech Stack
& Security

Frontend

  • ›Next.js 14 (App Router)
  • ›React 18 + TypeScript
  • ›Tailwind CSS
  • ›Framer Motion

Backend

  • ›Next.js API routes
  • ›NextAuth.js (JWT sessions)
  • ›bcrypt password hashing
  • ›Resend email + cron reminders

Blockchain

  • ›Solidity 0.8.24
  • ›OpenZeppelin 5 (Ownable, Pausable, ReentrancyGuard)
  • ›Hardhat + tests
  • ›Ethereum Sepolia via Alchemy

Data & Storage

  • ›MongoDB Atlas + Mongoose
  • ›IPFS via Pinata (tender PDFs)
  • ›ethers.js v6 + MetaMask
  • ›Hosted on Vercel

Security guarantees

Commit-reveal hides every price until the deadline

Winner chosen by code: lowest price, tie → earliest reveal

Deposits punish fake bids (slashing) and refund honest ones

Salts encrypted with AES-256-GCM, plus email & file backup

Login = password + wallet signature (EIP-4361, one-time nonce)

Role-based access: Admin approves Officers; Officers cannot bid

Reentrancy guard and emergency pause on the contract

Tender documents tamper-proof on IPFS (content-addressed)

ENGINEERED

Lead Developer & Architect

Kishore Vedha

View GitHubView Hyperledger Fabric edition →
© 2026 TENDERCHAINBUILT FOR TRUTH