Inspiration

The inspiration for DocShield came from observing the high-stakes world of syndicated lending and private credit, where multi-million dollar agreements are often handled as standard PDFs. These documents are surprisingly fragile—vulnerable to "silent" tampering, version confusion, and missed compliance clauses. We wanted to bring the "Zero Trust" philosophy of blockchain to the loan document lifecycle, ensuring that what you sign is exactly what stays in the vault, with every single action tracked and verifiable.

What it does

DocShield is a comprehensive security and compliance layer for loan agreements:

  • Integrity Verification: Uses SHA-256 cryptographic hashing (via Web Crypto API) to fingerprint documents. Even a single character change in a 100-page PDF will trigger a "Tamper Alert."
  • Immutable Audit Trail: Every event—upload, sign, verify—is added to a cryptographically chained log where each entry points to the previous hash, making the history impossible to rewrite.
  • Digital Signature Workflow: A simulated PKI system that allows multiple signatories to legally execute documents with timestamped attestation.
  • Smart Compliance Scanning: Automatically scans document text for required LMA (Loan Market Association) clauses like Interest Rate Caps, Financial Covenants, and Liens.
  • Verification Certificates: Generates a "Certificate of Authenticity" for every document, ready for auditors.

How I built it

The project is built with a focus on client-side security and performance:

  • Frontend: React 18 with Vite for a lightning-fast development cycle.
  • Cryptography: The Web Crypto API handles all SHA-256 generation and random number (nonces) generation, ensuring military-grade security without a server.
  • Document Parsing: PDF.js is integrated to read and scan document contents for compliance checks.
  • State Management: Custom React Context API with useReducer to handle complex document states and the audit chain.
  • Design: A custom CSS design system using a professional Navy & Gold palette, evoking the trust and authority required in the financial sector.
  • Mathematical Integrity: We use chaining logic for the audit log, represented by: $$H_{n} = \text{Hash}(Data_{n} + H_{n-1})$$ This ensures that if entry $n-1$ is changed, all subsequent entries become invalid.

Challenges I ran into

  • Large File Hashing: Processing large PDFs in the browser without freezing the UI required efficient ArrayBuffer handling and asynchronous processing.
  • Simulating PKI: Creating a multi-signatory system that felt authentic without a backend database meant designing a robust localStorage abstraction that maintains relationship integrity.
  • Regex Compliance: Identifying complex legal clauses using keyword proximity and regex patterns was a delicate balancing act to ensure high accuracy in compliance scanning.

Accomplishments that I'm proud of

  • 100% Client-Side Fraud Detection: Successfully building a system that can detect document tampering with absolute certainty without ever needing to send the file to a server.
  • Audit Log Verification: Implementing a "Verify Chain" feature that actually walks through the cryptographically linked logs to prove record integrity.
  • Professional UX: Creating a UI that feels like a premium enterprise financial tool.

What I learned

I deepened my understanding of the Web Crypto API and the nuances of handling cryptographic buffers. I also learned a great deal about LMA standard clauses and how to translate legal requirements into automated scanning logic. Structuring an application as an immutable data store in React provided great insights into predictable state management.

What's next for DocShield

  • Decentralized Anchorage: Pushing the Merkle Root of the day's audit log to a public blockchain (like Polygon or BSC) for public timestamping.
  • AI-Powered OCR: Integrating Tesseract.js or a mini LLM to identify not just keywords, but the actual sentiment and completeness of legal covenants.
  • Multi-Tenant Permissions: Expanding the signature workflow to handle complex organizational hierarchies.

Built With

Share this project:

Updates