Skip to content

Motus-DAO/prism-protocol

Repository files navigation

Prism Protocol

Privacy infrastructure for Solana

Your wallet's invisible shield. Build anonymous voting, wallet protection, token gating, dark pool trading, and any privacy-preserving application with one SDK.

Try the Dark Pool Demo Β· Install SDK Β· Read the docs Β· GitHub

πŸš€ Quick Links


🎯 What Prism Provides

Prism Protocol is privacy infrastructure – identity containers, ZK proofs, and encryption so developers can build privacy into their Solana apps.

  • 🎭 Identity Containers with Cryptographic Context Bindings – Root identity plus disposable context identities (DeFi, Social, Gaming, etc.). Each context is a tamper-proof container where identity, proofs, and encrypted data are cryptographically bound together. Your DeFi context can't leak into your social context. True compartmentalization at the protocol level.
  • πŸ” ZK Solvency Proofs – Prove "balance β‰₯ threshold" without revealing the amount (Noir circuits). Selective disclosure: prove what's needed, hide the rest.
  • πŸ”’ Arcium MPC Encryption – Encrypt balances and data; commitments cryptographically bound to contexts for maximum privacy.

Use it for: anonymous DAO voting, anti-drain wallet protection, token gating, private DeFi/dark pools, cross-app reputation, and custom privacy-preserving flows.

πŸ› οΈ Why This is Privacy Tooling (Not Just a Demo)

Prism Protocol is a privacy SDK that integrates into any Solana application. The dark pool demo is one example use case.

  • One SDK integrates into any Solana app – Developers install @prism-protocol/sdk and get context identities, ZK proofs, and encrypted commitments in minutes
  • Context identities + ZK solvency + encrypted commitments – Complete privacy primitives: disposable identities, selective disclosure proofs, and MPC encryption all in one package
  • Dark pool is one example – The same SDK powers anonymous voting, token gating, wallet protection, and any privacy-preserving flow. See EXAMPLES.md for more

πŸ’‘ Example: The Dark Pool Problem

Dark pool traders face an impossible choice:

  • Prove you're solvent to access the pool β†’ Reveal holdings β†’ Get front-run
  • Hide your holdings β†’ Can't prove solvency β†’ Locked out

With Prism: create a disposable context, generate a ZK solvency proof ("balance β‰₯ $10K"), access the pool without exposing your real balance, then burn the context. Same primitives work for voting, gating, and other use cases. More: Dark Pools and Solana.


πŸ”‘ Key Innovations

1. Context-Based Identities

The Flow:

Step 1: Create Root Identity (One-time, Soulbound, encrypted)
    ↓
Step 2: Derive Context Identities
    ↓
Root Identity (Hidden, Permanent)
└── Context (DeFi, Social, Gaming, etc.)
    β”œβ”€β”€ Fresh wallet address (PDA)
    β”œβ”€β”€ Spending limits enforced
    └── Burns after use

Why it matters: You create a permanent root identity once, then derive unlimited disposable contexts from it. Main wallet never exposed to apps, pools, or other parties. One root identity refracts into many context-bound addresses (like light through a prism into colors).

2. Noir ZK Solvency Proofs

// Prove balance threshold without revealing amount
fn verify_solvency(
    actual_balance: Field,    // Private: $500K
    threshold: pub Field       // Public: $10K
) -> pub bool {
    actual_balance >= threshold
}

Why it matters: Selective disclosure - prove what's needed, hide what's not.

3. Arcium MPC Encryption

// Encrypt balance before proving
const encrypted = await arcium.encrypt({
  balance: wallet.balance,
  context: contextPubkey
});

// Proof uses encrypted value
const proof = await noir.prove(encrypted, threshold);

Why it matters: End-to-end encryption ensures even proof generation is private. Commitments bound to specific contexts for isolation.

πŸ” Arcium MPC Integration

Prism Protocol is the first stack to combine Arcium MPC encryption with Noir ZK proofs and Solana contexts.

The Arcium-First Approach

Each encrypted balance is cryptographically bound to a disposable context identity. The dark pool sees only:

  • A commitment hash (from Arcium)
  • A ZK proof (from Noir)
  • A context address (from Solana)

The actual balance and root wallet remain completely hidden.

Cryptographic Flow

User Wallet ($500K SOL)
    ↓
[STEP 1: Create Root Identity] (One-time, Soulbound PDA)
    ↓
[STEP 2: Derive Context PDA] β†’ 9CyUh3VM... (disposable identity)
    ↓
Arcium MPC Encryption
    β”œβ”€β”€ X25519 key agreement with MXE
    β”œβ”€β”€ CSplRescueCipher encryption
    β”œβ”€β”€ Commitment: H(balance || contextPubkey || nonce)
    └── Guarantee: "Only decryptable with this specific context"
    ↓
Noir ZK Proof
    β”œβ”€β”€ Private: encrypted balance (from Arcium)
    β”œβ”€β”€ Public: threshold ($10K)
    └── Proof: "Balance β‰₯ threshold" (without revealing)
    ↓
Dark Pool Verification
    β”œβ”€β”€ Verify ZK proof
    β”œβ”€β”€ Check Arcium commitment
    └── Grant access (balance never revealed, context isolated)

Why Context Binding Matters

By including the contextPubkey in the Arcium commitment, we ensure:

  • Context Isolation: Each context has its own encryption
  • Non-transferability: A commitment from one context can't be used for another
  • Binding Guarantee: The commitment proves the balance was encrypted for THIS specific context

Technical Details

  • X25519 Key Agreement: Establishes shared secret with Arcium MXE
  • CSplRescueCipher: Arcium's threshold encryption cipher
  • Commitment Generation: H(balance || contextPubkey || nonce) for verification
  • MPC Network: Real Arcium multi-party computation (when configured)

See ARCIUM_INTEGRATION_DEEP_DIVE.md for complete technical documentation.


🎯 Use Cases (SDK-Powered)

The Prism SDK (@prism-protocol/sdk) supports many use cases; the demo app showcases dark pool trading.

Demo: Dark Pool Trading

  1. Create root identity (one-time setup) β†’ Create DeFi context β†’ Generate ZK solvency proof β†’ Access pool β†’ Execute trade β†’ Burn context. Main wallet never exposed.

Other Use Cases (Same SDK)

  • πŸ—³οΈ Anonymous DAO voting – Vote without revealing token holdings
  • πŸ›‘οΈ Wallet drain protection – Disposable contexts with low limits for unknown sites
  • 🎫 Token gating – Prove "hold β‰₯ N tokens" without revealing amount
  • πŸ’± Private DeFi – Trade without linking to main wallet
  • ⭐ Cross-app reputation – Build reputation across dApps without linking activities
  • πŸ‘€ Social / professional – Contexts for different identities and limits

See packages/sdk/EXAMPLES.md for full code examples and packages/sdk/README.md for API docs.


πŸ› οΈ For Developers

Install & 5-Line Example

Install from npm: @prism-protocol/sdk

npm install @prism-protocol/sdk
# or: yarn add @prism-protocol/sdk
# or: pnpm add @prism-protocol/sdk
import { PrismProtocol, ContextType } from '@prism-protocol/sdk';

const prism = new PrismProtocol({ rpcUrl: 'https://api.devnet.solana.com', wallet });
await prism.initialize();

// Step 1: Create your root identity (one-time, soulbound)
await prism.createRootIdentity();

// Step 2: Create a context from your root identity
const context = await prism.createContext({ type: ContextType.DeFi, maxPerTransaction: 1_000_000_000n });

// Step 3: Generate proofs using your context
const proof = await prism.generateSolvencyProof({ actualBalance: 500_000_000n, threshold: 100_000_000n });
// Use proof for voting, gating, dark pool access, etc.

Full API and use-case examples: packages/sdk/README.md and packages/sdk/EXAMPLES.md.

Why use Prism

  • βœ… One SDK, many use cases – Voting, gating, dark pools, wallet protection, reputation, and more
  • βœ… Simple API – Identity containers, contexts, proofs, encryption
  • βœ… Open source – MIT license
  • βœ… Composable – Works with existing Solana apps
  • βœ… Novel architecture – Context-based identities with cryptographic bindings

πŸ—οΈ Technical Stack

Smart Contracts (Solana/Anchor)

// Two core contracts:
1. Root Identity - Soulbound master identity
2. Context Manager - Create/revoke contexts with limits

ZK Proofs (Noir)

// One production circuit:
solvency_proof.nr - Balance threshold verification

Encryption (Arcium)

// MPC encryption for sensitive data:
- Balance amounts
- Context metadata
- Cryptographic commitment binding

SDK (@prism-protocol/sdk)

// Developer interface:
class PrismProtocol {
  createRootIdentity()
  createContext(type, limits)
  generateSolvencyProof(threshold)
  revokeContext(pubkey)
}

Demo Application

Dark Pool Trading Simulator
- Built with Next.js + React
- Solana wallet integration
- Real-time proof generation
- Context lifecycle visualization

πŸ“ Project Structure

Path Description
prism/ Solana on-chain program (Anchor) β€” root identity, context manager
prism/programs/prism/src/ Rust source for the program
packages/sdk/ TypeScript SDK β€” @prism-protocol/sdk
apps/demo/ Demo app (Next.js) β€” landing + dark pool flow
circuits/solvency_proof/ Noir ZK circuit β€” balance β‰₯ threshold
docs/ Reference docs

πŸš€ Quick Start

Prerequisites

  • Solana CLI 2.1.x / 3.x
  • Rust 1.79+ (for Anchor)
  • Node.js 18+
  • npm or yarn
  • Noir (for circuit build; SDK uses pre-built artifacts)
  • Anchor (for program build)

Run the Demo

For Judges / Quick Start:

# From repo root
npm install
npm run dev
# Demo app: http://localhost:3000
# Dark pool flow: http://localhost:3000/demo
# SDK Dashboard: http://localhost:3000/dashboard

What to try:

  1. Dark Pool Demo (/demo): Create root identity β†’ Create DeFi context β†’ Generate ZK solvency proof β†’ Access pool β†’ Execute trade β†’ Burn context
  2. SDK Dashboard (/dashboard): Developer console with RPC config, Arcium status, context types, parameters, and copy-paste code snippets
  3. Requirements: Solana wallet (Phantom/Solflare) connected to devnet. If something already exists (root identity, context), the UI handles it gracefully.

Or use the deployed demo:

Build the Anchor Program

Navigate to the program directory:

cd prism

Build the program

anchor build

Run tests

anchor test
# or from repo root: cargo test in prism/programs/prism

Deploy to devnet

Program ID (devnet): DkD3vtS6K8dJFnGmm9X9CphNDU5LYTYyP8Ve5EEVENdu

anchor build
anchor deploy --provider.cluster devnet

(Use your own keypair and cluster config as needed; see prism/Anchor.toml.)


πŸ† Hackathon Track + Bounty Alignment

Track Selection

  • Primary Track: Privacy Tooling
  • Secondary Track: Open Track

Bounties Targeted

Bounty Prize How Prism Fulfills It
Privacy Tooling Track $15,000 Complete SDK for privacy-preserving applications. One package provides context identities, ZK proofs, and encrypted commitments. Integrates into any Solana app.
Aztec/Noir $7,500 First Noir-based identity SDK on Solana. Production circuit (solvency_proof.nr) proves balance β‰₯ threshold without revealing amount. Selective disclosure for voting, gating, dark pools.
Arcium $8,000 End-to-end private DeFi with MPC encryption. Encrypted balances and commitments cryptographically bound to contexts. X25519 key agreement + CSplRescueCipher. First stack combining Arcium MPC + Noir ZK + Solana contexts.
Helius (optional) - RPC/tooling integration for reliable Solana network access

Why We Win

  • βœ… Actually works - Fully functional, not vaporware
  • βœ… Novel architecture - Context-based identities (never seen before)
  • βœ… Technical depth - Noir + Arcium + Solana smart contracts
  • βœ… Real problem - Whale front-running costs millions in MEV
  • βœ… One SDK, multiple bounties - Maximum ROI on time invested

See WINNING_STRATEGY.md for detailed execution plan.


πŸ“š Documentation

Root (start here)

docs/ – Reference

Code


πŸ“Š SDK Dashboard / Dev Console

The SDK Dashboard is a developer console for configuring and testing Prism Protocol. Access it at /dashboard in the demo app or https://prism-protocol-seven.vercel.app/dashboard.

Features:

  • RPC & Network Configuration – View and configure Solana RPC endpoints
  • Program Information – Devnet program ID and deployment status
  • Arcium MPC Status – Encryption mode (simulation/live), MXE address, cluster ID
  • Context Types – Reference table of all context types (DeFi, Social, Gaming, etc.)
  • Parameters – Interactive parameter tuning with live code snippet generation
  • Config Snippet – Copy-paste ready initialization code for your app

The dashboard demonstrates how developers integrate Prism into their applications. All configuration generates ready-to-use code snippets.

πŸ”’ Transparency: What We Do and Don't Claim

What this SDK provides: Context-based identities (one address per use case), ZK solvency proofs (prove balance β‰₯ threshold without revealing amount), Arcium encryption binding balances to contexts, and spending limits / revocable contexts. Application-level isolation so dApps see a context PDA, not your main wallet.

What we do not provide: Signer anonymity. On Solana, the fee-payer wallet is always visible on every transaction. Root and context PDAs are derivable from the signer, so an on-chain analyst can link contexts to the same wallet. We do not break that link.

Honesty / Limitations: We do not provide signer anonymity on Solana; fee payer remains visible. We provide application-level privacy via contexts + proofs.

Full technical explanation: docs/TECHNICAL_WHAT_THE_SDK_ACTUALLY_DOES.md


🎯 Project Philosophy

"One feature, fully working, maximum prizes."

We're building ONE killer demo that:

  • Actually works (deployed and functional)
  • Solves a real problem (whale front-running)
  • Demonstrates technical mastery (Noir + Arcium + Solana)
  • Targets multiple bounties ($32K potential)

Not building:

  • ❌ 8 half-finished features
  • ❌ Vaporware architecture diagrams
  • ❌ Concept demos without real code

We've learned: Judges reward what works, not what's promised.


πŸ“„ License

MIT License - Open source for the Solana ecosystem


πŸ™ Acknowledgments

Built with:

Built for Solana Privacy Hackathon 2026
Privacy infrastructure that actually works


Questions? Open an issue or check the docs.

Releases

No releases published

Packages

 
 
 

Contributors