Payment Flow
Overview
┌─────────────────────────────────────────────────────────────────────────────┐
│ Payment Flow Overview │
│ │
│ 1. Request 2. Validate 3. Pay 4. Compute │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Client │──────▶│Validators│─────▶│Blockchain│─────▶│ Compute │ │
│ │ │ │ (M-of-N) │ │ (Escrow) │ │ Node │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │ │
│ 8. Result 7. Validate 6. Complete 5. Sign │ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌──────▼──┐ │
│ │ Client │◀──────│Validators│◀─────│Blockchain│◀─────│ Result │ │
│ │ │ │ (M-of-N) │ │(Distribute)│ │ │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘Payment Tree
Structure
Distribution Breakdown
Recipient
Purpose
Typical %
Example Payment Tree
Fee Calculation
Compute Price
Factor
Description
Example
Gateway Gas
Validator Reward
Treasury Fee
Payment Lifecycle
Phase 1: Fee Estimation
Phase 2: Preprocessing Validation
Phase 3: Payment Initiation
Phase 4: Execution
Phase 5: Completion Validation
Phase 6: Payment Distribution
Smart Contract Interface
InferencePayment Contract
initiateInferenceRequest
initiateInferenceRequestcompleteInferenceRequest
completeInferenceRequesthandleExpiredRequest
handleExpiredRequestEvents
Failure Handling
Compute Failure
Validator Rejection
Transaction Failure
Security Considerations
Double-Spend Prevention
Signature Verification
Expiry Protection
Reentrancy Protection
Token Flow Diagram
Configuration
Gateway Payment Settings
Pricing Configuration
Monitoring
Key Metrics
Metric
Description
Events to Monitor
Next Steps
Last updated
