MORP OS Documentation
Private Finance Operating System on Solana. Non-custodial privacy layer for payments, swaps, and portfolio management.
Core Features
- Shadow Balances - Balances hidden from public blockchain explorers
- Stealth Payments - Private P2P transfers with claim codes via escrow
- ZK Commitment Scheme - Optional maximum privacy mode hiding amounts
- Selective Disclosure - Generate cryptographic proofs for auditors
- Batch Processing - Transactions grouped to obscure individual activity
- Non-Custodial - Users sign all transactions client-side
Architecture
Technology Stack
| Layer | Technology |
|---|---|
| Frontend | React, TailwindCSS, Shadcn/UI |
| Wallet | @solana/wallet-adapter (Phantom, Solflare) |
| State | TanStack Query v5 |
| Backend | Express.js, TypeScript |
| Database | PostgreSQL + Drizzle ORM |
| Blockchain | Solana, Jupiter DEX |
Key Components
âââ client/src/
â âââ pages/
â â âââ dashboard.tsx # Portfolio overview
â â âââ swap.tsx # Jupiter DEX integration
â â âââ stealth.tsx # Private payments
â â âââ portfolio.tsx # Holdings & positions
â â âââ analytics.tsx # P&L charts
â â âââ yield.tsx # Yield farming
â â âââ disclosure.tsx # Selective proofs
â â âââ compliance.tsx # Audit trail
â âââ components/
â âââ wallet-provider.tsx
â âââ privacy-shield.tsx
âââ server/
â âââ routes.ts # API endpoints
â âââ storage.ts # Database operations
â âââ solana.ts # RPC & transactions
â âââ zk-commitment.ts # ZK crypto functions
âââ shared/
âââ schema.ts # Data models
Stealth Payments
Stealth payments enable private peer-to-peer token transfers where there is no direct blockchain link between sender and recipient.
Escrow Flow
Sender signs their own deposit transactions. Escrow only holds tokens temporarily until claimed.
ZK Commitment Scheme
Optional maximum privacy mode that hides payment amounts using SHA-256 cryptographic commitments.
How It Works
commitment = SHA-256(amount + secret + salt)Only the hash is stored, NOT the actual amount.
ZK Claim Data Format
{
"code": "abc123xyz789",
"amount": "10.5",
"secret": "randomSecret456"
}
Verification Process
// Server-side verification
function verifyZkCommitment(
storedCommitment: string,
providedAmount: string,
providedSecret: string,
storedSalt: string
): boolean {
const dataToHash = `${providedAmount}:${providedSecret}:${storedSalt}`;
const computedHash = sha256(dataToHash);
return computedHash === storedCommitment;
}
If ZK claim data is lost, tokens cannot be recovered. The amount is not stored anywhere - only the cryptographic hash exists.
Privacy Scope
MORP OS provides database/application-level privacy, NOT full on-chain anonymity. Transactions remain visible on Solana block explorers like Solscan.
What Is Visible On-Chain (Solscan)
| Transaction | Sender Address | Recipient Address | Amount | Timestamp |
|---|---|---|---|---|
| Sender â Escrow | â Visible | Escrow (shared) | â Visible | â Visible |
| Escrow â Recipient | Escrow (shared) | â Visible | â Visible | â Visible |
What Is Protected
| Location | Amount Hidden? | Link Broken? |
|---|---|---|
| MORP OS Database | â Yes (ZK mode) | â Yes |
| MORP OS API | â Yes (ZK mode) | â Yes |
| Off-chain Sharing | â Only sender/recipient know | â Yes |
| Blockchain/Solscan | â No | â No (via escrow timing) |
Current Limitations
- All transactions visible on Solana explorers with full amounts
- Shared escrow wallet creates timing correlation between deposits and claims
- Recipient address exposed at claim time
- No mixing or routing through multiple addresses
Future Improvements (Possible)
- Light Protocol - ZK compressed accounts for true on-chain privacy
- Token-2022 Confidential Transfer - Solana's native privacy extension
- One-time Escrow - Generate new escrow address per payment
- Timing Obfuscation - Random delays between deposit and claim
API Reference
Stealth Payment Endpoints
Get the escrow wallet public address.
Response:{ "escrowAddress": "EscrowWallet..." }
Build unsigned deposit transaction for wallet signing.
Request:{
"senderWallet": "SenderPublicKey...",
"tokenMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "10.5",
"zkEnabled": true // Optional: enable ZK mode
}
Response:
{
"transaction": "base64EncodedTx...",
"claimCode": "abc123xyz",
"zkSecret": "randomSecret456" // Only if zkEnabled
}
Build claim transaction. For ZK payments, must include proof.
Request:{
"claimCode": "abc123xyz",
"claimerWallet": "RecipientPublicKey...",
"zkProof": { // Required for ZK payments
"amount": "10.5",
"secret": "randomSecret456"
}
}
Response:
{
"success": true,
"transaction": "base64EncodedTx...",
"amount": "10.5",
"tokenSymbol": "USDC",
"zkVerified": true
}
Look up payment details by claim code. Amount hidden for ZK payments.
Response (ZK Payment):{
"id": "payment-id",
"tokenSymbol": "USDC",
"amount": null, // Hidden for ZK
"status": "pending",
"zkEnabled": true,
"zkCommitment": "sha256hash...",
"requiresZkProof": true
}
Portfolio Endpoints
Get token holdings with shadow/public balance split.
Get portfolio statistics (total value, shadow value, etc).
Security Model
Non-Custodial Guarantees
- All deposit transactions signed by user's wallet client-side
- Private keys never leave user's wallet
- Phantom/Solflare manifest for trusted dApp recognition
- Transaction simulation before signing
Escrow Security
- Escrow private key stored in encrypted Replit Secrets
- Server only releases funds on valid claim code (and ZK proof if enabled)
- Cancellation returns funds to original sender
- Expiration mechanism for unclaimed payments
ZK Commitment Security
- SHA-256 cryptographic hash function
- Random salt prevents rainbow table attacks
- Amount never stored - only the hash commitment
- Invalid proofs rejected with clear error message
All actions generate cryptographic audit entries for compliance and selective disclosure.