Decentralized Dispute Resolution Protocol for Voluntary, Contract-Based Justice
VoluntaryJustice is a maximally on-chain dispute resolution protocol that enables individuals and organizations to resolve disputes without state courts. The system uses economic incentives, insurance, reputation, and arbitration to create a self-sustaining justice marketplace.
Status: Working Draft — Unaudited. Not yet deployed. See Project Status before using.
┌─────────────────────────────────────────────────────────────────┐
│ Protocol Layer │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────────────┐│
│ │ Identity │ │ Contract │ │Arbitration│ │ Governance ││
│ │ Registry │ │ Engine │ │ Courts │ │ (Governor+Token) ││
│ └───────────┘ └───────────┘ └───────────┘ └───────────────────┘│
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────────────┐│
│ │ Insurance │ │Enforcement│ │Reputation │ │ Oracle/Legacy ││
│ │ Pools │ │ Engine │ │ Scoring │ │ Integration ││
│ └───────────┘ └───────────┘ └───────────┘ └───────────────────┘│
└─────────────────────────────────────────────────────────────────┘
This is a working draft built for research and demonstration. It is not production-ready and has not been deployed to any network.
| Area | State |
|---|---|
| Smart contracts | 22 contracts implemented; compile clean on Solidity 0.8.25 |
| Tests | 849 passing, 0 pending; overall 82.3% branch / 98.8% statement coverage |
| Core coverage | All high-stakes contracts (dispute, governance, insurance, enforcement, bounty, bridge, juror pool) are at 80%+ branch coverage |
| Remaining coverage gaps | A few registry/view contracts (CourtRegistry, EscrowVault, OracleRegistry, RulingAnchor, LegacyCourtBridge, …) are still below 80% branch, though overall is now above target |
| Security | Internal review only — no external audit, no static analysis, no bug bounty |
| Frontend | Next.js app wired to contract hooks, but contract addresses are unset and the root landing page is still scaffolding |
| Deployment | Scripts exist; nothing deployed; addresses not wired into the frontend |
Do not use with real funds. See the Internal Security Review for known gaps.
| Feature | Description |
|---|---|
| Tiered Arbitration | Single arbitrator → Jury appeal |
| Multi-Dimensional Reputation | Compliance, dispute rate, payment history, ratings |
| Insurance System | Protocol baseline + open market |
| Economic Enforcement | Escrow, insurance, staking, reputation, exclusion |
| Template Contracts | DAO-approved contract templates |
| On-Chain Governance | OpenZeppelin Governor with constitutional constraints |
| Oracle Integration | Chainlink price feeds and VRF for jury selection |
| Legacy Court Bridge | Off-chain court ruling imports with verification |
| Contract | Purpose |
|---|---|
VJToken.sol |
ERC-20 governance token with staking hooks |
IdentityRegistry.sol |
Identity registration with sybil protection |
ReputationScoring.sol |
Multi-dimensional on-chain reputation |
ContractTemplateRegistry.sol |
DAO-managed contract templates |
ContractFactory.sol |
Contract creation and signing |
CourtRegistry.sol |
Arbitration court registration and staking |
DisputeResolution.sol |
Dispute lifecycle with appeals |
EscrowVault.sol |
Secure escrow management |
StakingRewards.sol |
Multi-role staking with rewards |
| Contract | Purpose |
|---|---|
JurorPool.sol |
Juror staking and VRF-ready jury selection |
BaselineInsurancePool.sol |
Community insurance coverage |
InsurerRegistry.sol |
Private insurer registration |
InsurancePolicy.sol |
Policy purchase, renewal, claims |
EnforcementEngine.sol |
Ruling execution and escalation |
| Contract | Purpose |
|---|---|
ExclusionRegistry.sol |
Permanent exclusion records for non-compliance |
BountyMarket.sol |
Recovery bounties with oracle/court/debtor verification |
| Contract | Purpose |
|---|---|
VJGovernor.sol |
OpenZeppelin Governor with built-in timelock (GovernorTimelockControl) and constitutional constraints (forbidden-selector checks that block defining crimes, overriding contracts, granting immunity, or compelling participation) |
RulingAnchor.sol |
Anchors final dispute rulings for cross-layer reference |
| Contract | Purpose |
|---|---|
OracleRegistry.sol |
Trusted oracle network for recovery attestations (staking, quorum, slashing) |
LegacyCourtBridge.sol |
Off-chain court ruling imports with multi-jurisdiction support and a challenge period |
| Contract | Purpose |
|---|---|
VRFConsumer.sol |
Chainlink VRF v2.5 consumer for random jury selection |
CrossChainBridge.sol |
L2 ↔ mainnet messaging for ruling anchoring (Arbitrum, Optimism, Base) |
A
MockVRFCoordinator.solmock lives undercontracts/mocks/for testing VRF flows.
Total: 22 production contracts.
A complete Next.js frontend application is included in the frontend/ directory.
- Framework: Next.js 16 (App Router)
- Wallet: RainbowKit + wagmi v2
- Styling: shadcn/ui + Tailwind CSS
- State: TanStack Query
- Forms: React Hook Form + zod
- Dashboard - Overview stats, quick actions
- Contracts - Create, view, sign contracts
- Disputes - File disputes, submit evidence, view rulings
- Insurance - Browse insurers, purchase policies
- Courts - Browse courts, register as arbitrator
- Governance - View proposals, cast votes
cd frontend
npm install
npm run dev┌──────────┐ ┌───────────┐ ┌──────────┐ ┌─────────┐
│ Filed │───►│ Evidence │───►│ Ruling │───►│ Enforce │
└──────────┘ └───────────┘ └──────────┘ └─────────┘
│
▼ (if appealed)
┌──────────────┐
│ Jury Panel │
└──────────────┘
- Escrow Transfer - Smart contract releases to victor
- Insurance Claim - Protocol triggers claim against debtor's insurer
- Bond Slashing - Slash debtor's staked tokens
- Reputation Downgrade - Compliance score impacts future access
- Exclusion Registry - Barred from system participation
- Node.js 18+
- npm or yarn
git clone https://github.com/EricGrill/voluntaryjustice.git
cd voluntaryjustice
npm installnpx hardhat compilenpm test
# 849 tests passingnpx hardhat node
npx hardhat run scripts/deploy-full.js --network localhost# Set environment variables
export SEPOLIA_RPC_URL=<your-rpc-url>
export PRIVATE_KEY=<deployer-private-key>
npx hardhat run scripts/deploy-testnet.js --network sepoliaDeploy scripts write the resulting addresses to
deployments/<network>-latest.json. The frontend'sfrontend/lib/contracts/addresses.tsis not yet auto-populated — addresses must currently be copied in manually.
Utilities:
- Court staking (required to operate as arbitrator)
- Juror staking (required to join jury pool)
- Insurer staking (required to offer coverage)
- Governance voting
- Registry access fees
Staking Roles:
- Court - 50% of rewards
- Juror - 30% of rewards
- Insurer - 20% of rewards
| Tier | Coverage | Contract Limits |
|---|---|---|
| Uninsured | None | Max 0.1 ETH, 100% escrow |
| Baseline | Protocol pool | Max 1 ETH, 50% escrow |
| Standard | Baseline + supplemental | Max 10 ETH, 25% escrow |
| Premium | High-limit | Unlimited, flexible escrow |
Full architecture design: docs/plans/2026-01-28-aegis-architecture-design.md
| Decision | Choice |
|---|---|
| Blockchain | Ethereum/EVM |
| On-chain approach | Maximally on-chain |
| Scaling | L2 operations + mainnet anchoring |
| Identity | Hybrid (native + existing primitives) |
| Arbitration | Tiered (single + jury appeal) |
| Enforcement | Court-directed escalation |
| Insurance | Protocol baseline + open market |
| Governance | OpenZeppelin Governor + built-in Timelock |
| Upgrades | Non-upgradeable (contracts are immutable once deployed; no proxy layer yet) |
- Phase 1 - Core MVP (Identity, Contracts, Disputes, Escrow)
- Phase 2 - Insurance & Appeals (Jury, Insurance, Enforcement)
- Phase 3 - Bounty Market & Exclusion (ExclusionRegistry, BountyMarket)
- Phase 4 - Governance & Anchoring (Governor with timelock + constitutional constraints, RulingAnchor)
- Phase 5 - Oracle & Legacy Integration (OracleRegistry, LegacyCourtBridge)
- Phase 6 - Cross-Chain & Randomness (VRFConsumer, CrossChainBridge)
- Phase 7 - Frontend Application (Next.js, RainbowKit, shadcn/ui)
- Phase 8 - Internal review & coverage reports
- Phase 9 - Overall branch coverage raised above 80% (all high-stakes contracts at 80%+)
- Phase 10 - Raise the remaining registry/view contracts to 80%+ branch
- Phase 11 - External security audit + bug bounty
- Phase 12 - Testnet deployment & full user-flow testing
- Phase 13 - Mainnet preparation
- Internal review only (not an external audit)
- Test coverage: 98.8% statements, 82.3% branches, 99.1% lines (full table in the audit report)
- Overall branch coverage above the 80% target; all high-stakes contracts at 80%+
- A few registry/view contracts (CourtRegistry, EscrowVault, OracleRegistry, …) still below 80% branch
- External security audit — not started
- Static analysis (Slither/Mythril) — not yet run
- Bug bounty — not launched
- Role-based access control (OpenZeppelin AccessControl)
- Reentrancy guards on state-changing functions
- Timelock on governance actions (OpenZeppelin
GovernorTimelockControl) - Constitutional constraints in the Governor (forbidden-selector checks)
- Staking + slashing for courts, jurors, insurers, and oracles
Not yet implemented (despite being on the roadmap): an enforced global pause / circuit breaker (the Governor has a
pausedflag, but no other contract reads it), rate limiting, a dedicated emergency-multisig contract, and an upgrade/proxy layer.
Contributions are welcome. Please read CONTRIBUTING.md for development setup, smart contract guidelines, and the PR process.
For security issues, see SECURITY.md.
MIT License - see LICENSE for details.
Built by Eric Grill