Skip to content

SpyCrypto/AutoDiscovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

318 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoDiscovery Logo

AutoDiscovery

The Cost of Discovery Failure β€” autoDiscovery.legal

Automated discovery compliance: build once, comply everywhere.

A Midnight-based dApp that automates legal discovery with jurisdiction-aware compliance,
zero-knowledge proofs, and privacy-first architecture.

This project is built on the Midnight Network.

Built on Midnight License Target TypeScript React


Project Overview Β· Build Plan Β· Architecture Β· Discovery Protocol Β· Email Safety


🚨 The Problem

With legal discovery sanctions reaching $8.5 million in a single case and 6 attorneys referred to the State Bar for discipline, discovery management in its current state is a huge problem in the US.

The legal discovery process is messy, time consuming, and varies by jurisdiction β€” with enormous consequences for compliance failures resulting in lost cases, unfavorable case delays, extremely expensive sanctions, and the potential of being disbarred.

πŸ’° $8.5M+ top sanction (single case) Β· πŸ“Š $704,094 avg sanction Β· πŸ›οΈ 38,000+ NYC cases dismissed (2024) Β· βš–οΈ 28% of malpractice claims from missed deadlines Β· πŸ’Έ $30B+/yr litigation cost from discovery

In New York City alone, 38,000+ cases were dismissed in 2024 due to discovery compliance failures β€” and conviction rates dropped from 50% to 25%. Nationally, discovery consumes 20–50% of total litigation costs β€” over $30 billion a year.


πŸ’‘ The Solution

With autoDiscovery.legal, we aim to organize and formalize a hard-coded, geographically compliant, law-based protocol that will help organize, distribute, and give proper, accurate, and secure access control to user-aggregated legal discovery.

This protocol will abstract away liability, reduce man hours and overall costs, increase profits, and form an immutable (existing forever) proof of compliance, custody, provenance, and access.

It is our hope that autoDiscovery.legal will be the default protocol for accurate and dependable discovery/evidence management β€” backed with error insurance that will protect law firms from errors and omissions.

"AutoDiscovery doesn't just help you manage discovery β€” it mathematically proves you did it right."


βš™οΈ What AutoDiscovery Does

πŸ” Privacy-First Discovery Automation

  • Jurisdiction Rule Packs β€” Modular, per-state procedural rules auto-applied at case creation (IRCP, URCP, CR, FRCP, and more)
  • 9-Step Discovery Protocol β€” 24 universal document categories, party attribution, origination tracking, chain-of-custody, and AI-assisted metadata extraction
  • Zero-Knowledge Proofs β€” Compliance attestations become immutable court records without exposing underlying data
  • Selective Disclosure β€” Reveal only what's required, nothing more

πŸ›‘οΈ Intelligent Safeguards

  • Email Safety Protocol β€” Threat-level classification when composing emails to opposing counsel, judges, or external parties (details)
  • Tandem Approval β€” N sets of eyes must sign off before sensitive emails can send
  • Attachment Scanning β€” Metadata warnings for EXIF data, tracked changes, hidden PDF layers
  • Case Contact Management β€” Team-based contact organization with role-aware visual cues, precedence ratings, and connected-contact highlighting

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        USER'S MACHINE                                β”‚
β”‚  Local state: documents, AI metadata, search indexes, encryption     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                     PRIVATE LEDGER (on-chain, encrypted)             β”‚
β”‚  Document metadata Β· Party records Β· Deadlines Β· Case details        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                   PUBLIC LEDGER (on-chain, immutable)                 β”‚
β”‚  Compliance proof hashes Β· Timestamps Β· Production Merkle roots      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    SEALED LEDGER (write-once)                        β”‚
β”‚  Commitment schemes Β· Pre-disclosure freezes                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“œ Smart Contract Suite (6 Contracts)

Contract Purpose
discovery-core Case lifecycle, discovery steps, obligation tracking
jurisdiction-registry Modular rule packs per jurisdiction
compliance-proof ZK attestation generation and verification
document-registry Production tracking, Merkle trees, Twin Protocol bonds
access-control YubiKey-based authentication, role-gated permissions
expert-witness W-9/I-9 workflows, qualification attestation

πŸ“ Full Architecture β†’ Β· YubiKey Access Control β†’ Β· Discovery Automation β†’


🧰 Tech Stack

Layer Technology Purpose
Frontend React 19 Β· Vite 6 Β· TypeScript 5 Β· Tailwind CSS 4 Glass-morphism UI with jurisdiction comparatives
UI Components shadcn/ui Β· Lucide Icons Accessible, themeable component library
Smart Contracts Compact (Midnight) Privacy-preserving ZK smart contracts
Blockchain Midnight Network Dual-ledger (public + private) with ZK proofs
Wallet Lace Browser Extension User key management and transaction signing
Build Turborepo Β· npm workspaces Monorepo orchestration
Hosting Vercel / Netlify Frontend deployment

πŸ“ Project Structure

AutoDiscovery/
β”œβ”€β”€ frontend-demoland-vite-react/           # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/            # Reusable UI (email safety dialog, etc.)
β”‚   β”‚   β”œβ”€β”€ layouts/               # App shell, sidebar, navigation
β”‚   β”‚   β”œβ”€β”€ pages/                 # Dashboard, case view, contacts, login
β”‚   β”‚   β”œβ”€β”€ providers/             # Provider pattern (auth, cases, docs, AI, contacts, email safety)
β”‚   β”‚   β”‚   └── demoland/          # Mock providers for demo environment
β”‚   β”‚   └── lib/                   # Utilities
β”‚   └── public/
β”œβ”€β”€ autodiscovery-contract/        # Compact smart contracts & TypeScript types
β”‚   └── src/types/                 # Strongly-typed data model (6 entities)
β”œβ”€β”€ autodiscovery-cli/             # CLI tools for deployment & operations
β”œβ”€β”€ docs/                          # Comprehensive documentation (20+ docs)
β”‚   β”œβ”€β”€ discovery-automation/      # 9-step discovery protocol deep dives
β”‚   └── reference/                 # Jurisdiction research archives
β”œβ”€β”€ media/                         # Brand assets
└── turbo.json                     # Monorepo configuration

πŸš€ Quick Start

Prerequisites

Tool Version Link
Node.js v23+ nodejs.org
npm v11+ Bundled with Node.js
Docker Latest docker.com
Git LFS Latest git-lfs.com
Compact Compiler Latest docs.midnight.network
Lace Wallet Latest Chrome Web Store

Setup

# Clone the repository
git clone [email protected]:SpyCrypto/AutoDiscovery.git
cd AutoDiscovery

# Install all dependencies (monorepo)
npm install

# Build smart contracts
npm run build

# Start frontend in demoLand mode
npm run dev:frontend

Environment Variables

# Copy environment templates
cp autodiscovery-cli/.env_template autodiscovery-cli/.env
cp frontend-demoland-vite-react/.env_template frontend-demoland-vite-react/.env

🚒 Deployment

1. Running the Proof Server (Local / Undeployed)

The repo ships Docker Compose files in autodiscovery-cli/ for running the proof server locally without a live network:

# Start proof server only (for contract compilation & testing)
cd autodiscovery-cli
docker compose -f ps-undeployed.yml up

# Or start the full local dev stack (proof server + indexer + node)
docker compose -f standalone.yml up

Default endpoints when running locally:

Service URL
Proof server http://localhost:6300
Indexer http://localhost:8088
Node ws://localhost:9944

The proof server image used is midnightnetwork/proof-server:7.0.0.
Before deploying to PreProd, check docs.midnight.network/relnotes for the latest Ledger 7.0-compatible image tag.


2. Funding a Wallet on PreProd

To interact with Midnight PreProd you need a wallet funded with tDUST tokens:

  1. Install the Lace wallet browser extension and create or import a wallet.
  2. Switch Lace to the Midnight PreProd network.
  3. Copy your unshielded address from Lace.
  4. Visit the faucet at https://faucet.midnight.network/ and request tDUST tokens.
  5. You will need two values when configuring the CLI .env:
    • Wallet mnemonic (24-word BIP-39 phrase) β†’ MY_PREVIEW_MNEMONIC
    • Unshielded address β†’ MY_UNDEPLOYED_UNSHIELDED_ADDRESS

3. Environment Variable Reference

autodiscovery-cli/.env

Variable Description How to obtain
MY_PREVIEW_MNEMONIC 24-word BIP-39 mnemonic for the deployer wallet Export from Lace wallet settings
MY_UNDEPLOYED_UNSHIELDED_ADDRESS Unshielded tDUST address used for local/undeployed testing Copy from Lace wallet (unshielded address)

frontend-demoland-vite-react/.env

Variable Description How to obtain
VITE_AD_MODE demoland for mock data, realdeal for live blockchain Set to realdeal when connecting to PreProd
VITE_CONTRACT_ADDRESS On-chain address of the deployed discovery-core contract Output from CLI deployment (npm run tui-preview)
VITE_MIDNIGHT_NETWORK Midnight network target (testnet for PreProd) Use testnet for PreProd
VITE_AI_SERVICE_URL URL for the AI metadata extraction service (optional) Set if running the AI parsing service locally

frontend-realdeal/.env

Variable Description How to obtain
VITE_CONTRACT_ADDRESS On-chain address of the deployed contract Output from CLI deployment

4. Switching to realDeal / PreProd

Follow these steps to connect the frontend to a live PreProd deployment:

  1. Deploy the contracts from the CLI:
    cd autodiscovery-cli
    npm run tui-preview
  2. Copy the contract address printed in the deployment output.
  3. Update the frontend .env:
    VITE_AD_MODE=realdeal
    VITE_CONTRACT_ADDRESS=<address from step 2>
  4. Restart the frontend dev server.

Note: The realDeal provider layer is currently a stub (see finding 5.1 from the Build Club review). Setting VITE_AD_MODE=realdeal will currently still fall back to demoLand providers. This section documents the intended flow for when the realDeal providers are fully implemented.


5. Reference Resources

Resource Description
midnight-local-dev Local development stack
midnight-doc-manager Working PreProd integration example
Midnight Release Notes Docker image versions & Ledger compatibility

πŸ“š Documentation Index

Document Description
Project Overview Executive summary, problem statement, solution architecture
Build Plan Living roadmap with phase tracking
Smart Contract Partitioning 6-contract architecture, private/public/sealed state mapping
Discovery Automation 9-step protocol, 24 categories, Merkle hashing, Twin Protocol
Email Safety Protocol Threat levels, recipient flags, attachment scanning, tandem approval
Case Contacts Feature Team-based contacts, star precedence, connected glow, drag reorder
YubiKey Access Control Hardware key auth design (3 modes)
DemoLand vs RealDeal Mock vs production architecture split
Jurisdiction Deep Dive ID, OH, WA, UT, CA, NY rule mapping
Customer Analysis Matrix Market research and adoption strategy
UI Design Notes Brand palette, glass morphism, component guidelines
Pitch Deck 11-slide investor pitch with stats, horror stories, and ROI math
Pitch Fodder Shock & awe stats, landmark cases, one-pager, shareable synopsis
Week 3 Homework Build Club deliverables tracker, resource pack, 3-min script outline
GeoZ Oracle 🌐 Companion project β€” privacy-preserving geolocation oracle on Midnight (GeoZ.us / GeoZ.app)

🌎 Jurisdiction Coverage

πŸ₯‡ Idaho (IRCP) Β· πŸ₯ˆ Utah (URCP) Β· πŸ₯‰ Washington (CR) Β· 4️⃣ California (CCP) Β· 5️⃣ New York City (CPLR) Β· 6️⃣ Ohio (Civ.R.)

Modular jurisdiction rule packs β€” add new states/federal circuits without code changes. Ohio included early due to serendipitous research.


πŸ“§ Email Safety Protocol

One of AutoDiscovery's standout features β€” a multi-layered protection system that prevents accidental disclosure to the wrong party.

Threat Level Trigger Action
SAFE All recipients on our team Standard send
CAUTION Court staff, unknown recipients Review content
DANGER Opposing counsel or their team Attachment review + tandem recommended
CRITICAL Judge or magistrate Tandem approval REQUIRED (2 approvers)

Features include recipient auto-detection against the case contacts database, attachment metadata scanning (EXIF, tracked changes, hidden PDF layers), image preview before send, and a tandem approval workflow where N approvers must sign off on sensitive communications.

πŸ“§ Full Protocol Documentation β†’


πŸ‘₯ Team

Spy

@SpyCrypto

Domain Expert Β· Legal Discovery Specialist

20 years complex litigation paralegal experience. Published statistics reports for Idaho government agencies. Jurisdiction expertise across Idaho, Utah, and Washington.

Full Dossier β†’

John

@bytewizard42i

Developer Β· Midnight Builder Β· Architect

Full-stack development, smart contract architecture, and ZK protocol design.


Copyright 2026 AutoDiscovery Team. All rights reserved.

About

A Midnight-based, geographically compliant template for attaining full and legal discovery for a variety of court applications. GeoOracle Auto Compliance: build once, comply everywhere.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors