QuDAG Exchange Core
Core library for the QuDAG Exchange system with quantum-resistant rUv (Resource Utilization Voucher) token functionality and business plan payout streams.
Features
🏦 Core Exchange Functionality
- rUv Token System: Resource utilization vouchers for quantum-secure transactions
- Dynamic Fee Model: Tiered fee structure based on agent verification and usage
- Immutable Deployment: Lock system configuration with quantum-resistant signatures
- Quantum-Resistant Security: ML-DSA-87 signatures and post-quantum cryptography
💰 Business Plan & Payout Streams
- Vault-Based Distribution: Automatic fee distribution to contributor vaults
- Role-Based Earnings: Support for agent providers, plugin creators, node operators, and bounty agents
- Configurable Splits: Default templates with custom percentage overrides
- Audit Trails: Complete transaction history and payout tracking
- Governance Controls: Optional approval thresholds and voting mechanisms
🔧 Configuration & Management
- Optional Features: All business plan features are opt-in
- Flexible Configuration: Granular control over all system parameters
- WASM Compatibility: no_std support for WebAssembly deployment
- Integration Ready: Works with QuDAG Vault and DAG consensus
Quick Start
Add this to your Cargo.toml:
[]
= "0.3.0"
Basic Usage
use ;
// Create basic exchange configuration
let config = new?;
// Enable business plan features
let config = new
.with_basic_business_plan
.build?;
// Create and transfer rUv tokens
let sender = new;
let receiver = new;
let amount = new;
Business Plan Integration
use ;
// Configure automatic payouts
let payout_config = PayoutConfig ;
let mut fee_router = new;
// Register a contributor
let contributor = ContributorInfo ;
fee_router.register_contributor?;
// Distribute fees automatically
let roles = vec!;
let payout_tx = fee_router.distribute_fees?;
Architecture
Core Components
- ExchangeConfig: Main configuration management with optional business plan features
- FeeRouter: Automatic fee distribution engine with vault-based payouts
- PayoutConfig: Configurable payout parameters and split templates
- ContributorRole: Type-safe representation of different contributor types
- rUv: Quantum-resistant resource utilization voucher token
Payout System
The business plan implements a vault-based payout stream system:
- Fee Collection: Transaction fees are automatically captured
- Role Recognition: Contributors are identified by their roles (agent, plugin, node, bounty)
- Split Calculation: Fees are split according to configurable templates
- Vault Distribution: Payouts are deposited to contributor vaults
- Audit Trail: Complete history is maintained for transparency
Default Payout Splits
- Single-Agent Jobs: 95% agent, 5% infrastructure
- Plugin-Enhanced: 85% agent, 10% plugin, 5% infrastructure
- Node Operations: 80% node operator, 15% network, 5% system
- Bounty Completion: 90% agent, 5% bounty poster, 5% system
Configuration
Basic Configuration
let config = new
.with_chain_id
.with_network_name
.build?;
Business Plan Configuration
let bp_config = BusinessPlanConfig ;
let config = new
.with_business_plan
.build?;
CLI Tool
For command-line interaction, use the standalone CLI:
# Enable business plan features
# Register contributors
# View status and history
Security
- Quantum-Resistant: Uses ML-DSA-87 signatures and post-quantum cryptography
- Vault Integration: Secure payout storage through QuDAG Vault
- Audit Trails: Complete transaction and payout history
- Validation: Comprehensive parameter validation and overflow protection
- Zero-Custody: Contributors control their own vault keys
WASM Support
The library supports WebAssembly deployment with no_std:
[]
= { = "0.3.0", = false }
Examples
See the examples directory for complete usage examples.
Testing
Run the comprehensive test suite:
Documentation
License
Licensed under the MIT License. See LICENSE for details.
Contributing
Contributions are welcome! Please see the contributing guidelines.
Part of the QuDAG quantum-resistant distributed ledger ecosystem.