NightSign is a privacy-preserving document signing dApp built on the Midnight Network. It uses Zero-Knowledge Proofs (ZKPs) to verify document signatures without revealing the signer's identity or the document contents.
- 🔒 Privacy-First: Documents are hashed locally; only the proof hits the blockchain
- ⚡ Zero-Knowledge: Prove document integrity without revealing the signer's identity
- 🌙 Midnight Network: Built on Midnight's privacy-preserving blockchain
- 💎 Lace Wallet: Native integration with the Midnight Lace wallet
- 🎨 Aerodrome-Inspired UI: Modern dark theme with neon accents
- Lace Beta Wallet browser extension installed
- Midnight Preprod Network configured in Lace
- Node.js 18+
# Clone the repository
git clone https://github.com/yourusername/night-sign.git
cd night-sign
# Install dependencies
npm install
# Start development server
npm run dev- Install the Lace browser extension
- Create or import a wallet
- Switch to the Preprod network:
- Open Lace settings
- Navigate to Networks
- Select "Preprod"
Create a .env file for custom configuration:
VITE_PROOF_SERVER_URL=http://localhost:6300
VITE_MIDNIGHT_NETWORK=preprod┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ User │────▶│ NightSign │────▶│ Midnight │
│ uploads │ │ (Frontend) │ │ Network │
│ document │ └──────────────┘ └─────────────┘
└─────────────┘ │
▼
┌─────────────────┐
│ Compact ZK │
│ Circuit │
│ (signDocument)│
└─────────────────┘
- Document Upload: User selects a file (PDF, contract, etc.)
- Local Hashing: SHA-256 hash computed in-browser (document never leaves the device)
- ZK Proof Generation: The Compact circuit generates a zero-knowledge proof
- Shielded Submission: Proof submitted to Midnight network (no identity reveal)
- Verification: Anyone can verify the signature without knowing the signer or document
- Document Privacy: Only the hash is computed; original file stays local
- Identity Privacy: ZK proofs verify the signer without revealing their address
- Transaction Privacy: Midnight's shielded transactions hide all metadata
NightSign supports Selective Disclosure - verifiers can check specific attributes without revealing the full proof.
To verify a signed document, you need:
1 original. The PDF/document - The file that was signed 2. The ZK-Proof String - Provided by the signer (found in the signature receipt)
- Navigate to the Verify a Document page
- Drop the original document file into the upload zone
- Paste the ZK-Proof String into the text area
- Click Verify Signature
The verification reveals only what the proof certifies:
| Disclosure | Shows |
|---|---|
| Document Integrity | ✅ Whether the file matches the signed hash |
| Signer Authenticity | ✅ Whether signed by a valid Midnight wallet |
| Timestamp | ✅ When the signature was created |
What stays private:
- The signer's full address (only shows truncated)
- The document contents (only hash is verified)
- Transaction details
Signers can download a .txt receipt containing:
- Document name and hash
- Signer address (truncated)
- ZK-Proof string
- Timestamp
- Mock transaction ID
npm run testnpm run buildnight-sign/
├── src/
│ ├── components/ # React components
│ ├── hooks/ # Custom hooks (wallet, etc.)
│ ├── managed/ # Compiled ZK artifacts
│ │ └── docusign/ # Circuit output
│ ├── App.tsx # Main application
│ └── main.tsx # Entry point
├── public/ # Static assets
├── index.html # HTML template
└── package.json # Dependencies
- All document hashing happens client-side
- Zero-knowledge proofs ensure signers cannot be deanonymized
- The Midnight network provides additional privacy guarantees
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
MIT License - see LICENSE for details.
- Midnight Network - Privacy-preserving blockchain
- Lace Wallet - Midnight's official wallet
- Aerodrome Finance - UI inspiration