Skip to content

1BDO/shadow_match

Repository files navigation

Shadow Match: Privacy-Preserving Decentralized Order Book 🔒

Enabling fully private order matching on Solana using Arcium's encrypted compute platform

Overview

Shadow Match is a decentralized order book implementation that leverages Arcium's encrypted compute capabilities to enable fully private order matching on Solana. It protects sensitive order information while maintaining the transparency and composability benefits of DeFi.

Key Features

  • 🔐 Encrypted Order Matching: Orders are matched privately using Arcium's FHE circuits
  • 🏃 High Performance: Process matches at Solana speed with encrypted compute
  • 🔍 Zero Knowledge: Orders are committed and executed without revealing details
  • 💰 Escrow System: Secure token handling with automated settlement
  • 🔄 Composable: Integrate with other DeFi protocols while maintaining privacy

Technical Architecture

The system consists of four main components:

  1. Anchor Program (/programs/shadow_match)

    • Handles on-chain state and account management
    • Processes order commitments and settlement
    • Manages token escrow and user accounts
  2. Encrypted Instructions (/encrypted-ixs)

    • Implements private order matching logic using Arcium circuits
    • Processes orders without revealing price or quantity
    • Generates zero-knowledge proofs for valid matches
  3. Relayer Service (/relayer)

    • Facilitates communication between clients and Arcium network
    • Manages encrypted order queue and matching
    • Submits proofs and executes matches on-chain
  4. TypeScript SDK (/sdk)

    • Client library for interacting with Shadow Match
    • Handles order encryption and commitment generation
    • Provides easy-to-use APIs for traders

Quick Start

Prerequisites

  • Rust toolchain (nightly)
  • Node.js >= 16
  • Solana CLI tools
  • Arcium SDK and CLI

Installation

# Clone the repository
git clone https://github.com/yourusername/shadow-match.git
cd shadow-match

# Install dependencies
yarn install

# Build Anchor program and encrypted circuits
anchor build
arcium build

Running Tests

# Start local validator
solana-test-validator

# Run integration tests
yarn test

Documentation

Detailed documentation is available in the /docs directory:

About

Enabling fully private order matching on Solana using Arcium's encrypted compute platform

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors