Crate qudag_exchange

Crate qudag_exchange 

Source
Expand description

§QuDAG Exchange

A modular, quantum-secure, multi-agent resource exchange protocol that enables trustless computational resource trading through rUv (Resource Utilization Voucher) tokens.

§Overview

QuDAG Exchange provides a decentralized marketplace for computational resources, allowing providers to offer CPU, GPU, memory, storage, and bandwidth in exchange for rUv tokens. The system uses post-quantum cryptography to ensure long-term security and integrates with QuDAG’s DAG-based consensus for fast transaction finality.

§Features

  • Quantum-Resistant Security: Uses ML-DSA signatures and ML-KEM encryption
  • Resource Trading: Trade computational resources for rUv tokens
  • DAG Consensus: Fast finality with QR-Avalanche consensus
  • Cross-Platform: Native, WASM, and API support
  • Secure Vault: Encrypted key storage with QuDAG Vault integration

§Quick Start

use qudag_exchange::{Exchange, Account, Transaction};

// Create exchange instance
let exchange = Exchange::new("mainnet").await?;

// Create account
let account = exchange.create_account("alice", "secure_password").await?;

// Transfer tokens
let tx = Transaction::builder()
    .from(&account)
    .to("qd1recipient...")
    .amount(100.0)
    .memo("Payment for resources")
    .build()?;

let result = exchange.submit_transaction(tx).await?;

Re-exports§

pub use error::ExchangeError as Error;
pub use error::Result;

Modules§

account
Account management for QuDAG Exchange
config
Configuration management for QuDAG Exchange
consensus
Consensus integration for QuDAG Exchange
error
Error types for QuDAG Exchange with security-focused error handling
fee_model
Dynamic Tiered Fee Model for QuDAG Exchange
immutable
Immutable Deployment System for QuDAG Exchange
ledger
Ledger management for QuDAG Exchange
metering
Resource metering for QuDAG Exchange
payout
Payout System for QuDAG Exchange Business Plan
state
State management for QuDAG Exchange
transaction
Transaction handling for QuDAG Exchange
types
Core types for QuDAG Exchange

Structs§

Account
Account structure representing a user in the system
AccountId
Account identifier - a unique ID for each account
AgentStatus
Agent verification status and usage statistics
BusinessPlanConfig
Business plan features configuration
BusinessPlanSummary
Business plan features summary for display
ConfigSummary
Summary of configuration for display purposes
ConsensusAdapter
Consensus adapter for integrating with QR-Avalanche DAG
ConsensusConfig
Consensus configuration parameters.
ContributorInfo
Information about a registered contributor
Exchange
The main exchange interface for interacting with the QuDAG Exchange network.
ExchangeConfig
Configuration options for the Exchange.
ExchangeConfigBuilder
Configuration builder for easier setup
FeeCalculator
Fee calculation utilities
FeeModel
Dynamic fee model calculator
FeeModelParams
Fee model parameters based on the mathematical specification
FeeRouter
Fee router for automatic payout distribution
GovernanceConfig
Governance configuration for business plan features
ImmutableConfig
Immutable deployment configuration
ImmutableDeployment
Immutable deployment manager
ImmutableSignature
Quantum-resistant signature for immutable deployment
ImmutableStatus
Status information for immutable deployment
Ledger
The main ledger structure that maintains all account states
LedgerState
Main ledger state containing all exchange data
LockableConfig
System configuration that can be made immutable
Market
Market interface for searching and trading resources.
MarketStats
Market statistics and metrics.
NetworkConfig
Network configuration
OperationCost
Cost configuration for different operations
PayoutConfig
Payout configuration for different contributor types
PayoutEntry
Payout entry for tracking individual distributions
PayoutSplit
Payout split definition
PayoutSplitTemplates
Default payout split templates
PayoutTransaction
Payout transaction mapping multiple recipients
Provider
Resource provider interface for offering computational resources.
ProviderBuilder
Builder for creating a Provider instance.
ProviderStats
Statistics for a resource provider.
Reservation
A reservation for computational resources.
ResourceMeter
Resource meter for tracking and calculating costs
SecurityConfig
Security configuration
Transaction
Main transaction structure
TransactionId
Transaction identifier
TransactionResult
Result of a transaction submission.
rUv
rUv (Resource Utilization Voucher) - the fundamental unit of resource credits

Enums§

ContributorRole
Contributor role types for payout distribution
ContributorType
Generic contributor types for payout splits
TransactionStatus
Transaction status in the system

Constants§

VERSION
Core version string

Functions§

version
Get the version of the QuDAG Exchange Core library

Type Aliases§

Balance
Balance type alias for clarity