xTitle.io Technical Architecture

Production System - Structured Field Hashing + PhoneLock Protocol™ Protocol

System Architecture

Edge Layer (Global CDN)
Cloudflare Workers
JavaScript • Edge Computing
WAF & DDoS Protection
Rate Limiting • Security Rules
KV Store
Edge Caching • 200+ Locations
API Layer
Node.js API
Express • TypeScript • REST
Authentication
JWT • OAuth 2.0 • API Keys
Load Balancer
ALB • Auto-scaling • Health Checks
Core Processing
Attestation Service
Structured Hashing • SHA-256
PhoneLock Protocol™ Protocol
SMS Verification • Time Windows
Fraud Detection
ML Models • Pattern Analysis
XRPL Integration
xrpl.js • WebSocket • Hooks
Data Layer
PostgreSQL
Primary DB • Multi-AZ • Encrypted
Redis Cache
Session Store • Rate Limiting
S3 Storage
Audit Logs • Backups • Archives

PhoneLock Protocol™ Protocol - NEW Security Layer

// PhoneLock Protocol™ Protocol - Eliminating 100% of Human Error
class PhoneLockProtocol {
  private verificationWindow = 5 * 60 * 1000; // 5 minutes
  private smsTimeout = 60 * 1000; // 1 minute for SMS
  
  // Create phone-locked attestation
  async createPhoneLockedAttestation(
    wireDetails: WireInstructions,
    buyerInfo: BuyerInfo
  ): Promise<AttestationId> {
    // Validate and hash phone number
    const phoneHash = this.hashPhoneNumber(buyerInfo.phone);
    
    // Create attestation with phone binding
    const attestation = {
      wireDetails,
      phoneNumberHash: phoneHash,
      requiresPhoneLock: true,
      verificationWindow: this.verificationWindow,
      fieldHashes: this.createFieldHashes(wireDetails)
    };
    
    // Store on blockchain with phone lock
    return await this.storeOnBlockchain(attestation);
  }
  
  // Request verification (ONLY works from registered phone)
  async requestVerification(
    attestationId: string,
    phoneNumber: string
  ): Promise<SessionId> {
    // Verify phone matches attestation
    if (!this.verifyPhoneMatch(attestationId, phoneNumber)) {
      throw new Error('Phone not authorized for this wire');
    }
    
    // Send SMS with time-locked link
    const session = await this.createSecureSession();
    await this.sendSMS(phoneNumber, {
      message: `xTitle Wire Verification\nCode: ${session.code}\nLink: verify.xtitle.io/s/${session.id}\nExpires in 60 seconds`
    });
    
    return session.id;
  }
}

Structured Field Hashing Algorithm

// Enhanced Wire Attestation with Field-Level Detection
interface WireInstructions {
  bank: string;
  account: string;
  routing: string;
  amount: number;
}

class StructuredHashingService {
  // Create individual field hashes for granular detection
  private createFieldHashes(wire: WireInstructions): FieldHashes {
    return {
      bank: this.hashField(wire.bank, 'BANK'),
      account: this.hashField(wire.account, 'ACCOUNT'),
      routing: this.hashField(wire.routing, 'ROUTING'),
      amount: this.hashField(wire.amount.toString(), 'AMOUNT')
    };
  }

  // Verify with specific field detection
  public async verifyWire(
    attestationId: string,
    wire: WireInstructions
  ): VerificationResult {
    const stored = await this.getStoredHashes(attestationId);
    const current = this.createFieldHashes(wire);
    
    const mismatches = [];
    for (const field in current) {
      if (stored[field] !== current[field]) {
        mismatches.push({
          field,
          severity: this.calculateSeverity(field),
          message: `${field} has been modified`
        });
      }
    }
    
    return {
      valid: mismatches.length === 0,
      mismatches,
      fraudScore: this.calculateFraudScore(mismatches)
    };
  }
}

API Endpoints

POST /api/attestations/wire
Create wire attestation with structured hashing
POST /api/attestations/verify-wire
Verify wire with field-level mismatch detection
GET /api/attestations/{id}
Retrieve attestation details
POST /api/fraud/report
Report fraud attempt with evidence

Enhanced Data Flow - With PhoneLock Protocol™ Protocol

1. Input
Wire + Phone
2. Hash
Fields + Phone
3. XRPL
Store Locked
4. SMS
Send Link
5. Phone
Verify Access
6. Display
5 Min Window

Performance Metrics

1.2ms
Hash Generation
45ms
XRPL Write
8ms
Verification Time
99.99%
Uptime SLA
10k/sec
Max Throughput
256-bit
Hash Security

Security Implementation - Two-Layer Protection

📱 PhoneLock Protocol™ Protocol (NEW)
SMS verification to registered phone only, 5-minute viewing windows, no screenshots
🔐 End-to-End Encryption
TLS 1.3 for all API communications, AES-256 for data at rest
🛡️ Rate Limiting
Adaptive rate limiting with exponential backoff, IP-based and token-based limits
🔍 Fraud Detection ML
Real-time anomaly detection using trained models on fraud patterns
🚨 Instant Alerts
PagerDuty integration for critical fraud, Slack/Email for warnings

Live System Demo - PhoneLock Protocol™ Protocol Active

$ xTitle CLI v3.0.0 - Production Environment (PhoneLock Protocol™ Enabled)
$ xtitle create-attestation --file wire.json --phone 303-555-0123
✅ Creating phone-locked attestation with structured field hashing...
PhoneLock Protocol™ Applied: Number: ***-***-0123 (hashed: 8c7f9b2a...) Window: 5 minutes SMS Required: Yes
Field Hashes Generated: Bank: 7f3a9b2c... (SHA-256) Account: 4e8d1f5a... (SHA-256) Routing: 9c2b7e3d... (SHA-256) Amount: 1a5f8c9e... (SHA-256)
✅ Merkle root: 8b4c9d2e7f3a1b5c6e8d9f0a
✅ XRPL Transaction: 4A7B9C2D8E3F1A5B6C7D8E9F0A1B2C3D
✅ Attestation ID: ATT-2024-08-22-7B3F9
📱 PhoneLock Protocol™: Wire can ONLY be accessed from ***-***-0123
$ xtitle verify --id ATT-2024-08-22-7B3F9 --tamper account
❌ FRAUD DETECTED - Verification Failed
Modified Fields Detected: - Account Number (HIGH SEVERITY) Original Hash: 4e8d1f5a... Current Hash: 7c9b2a3e...
🚨 Fraud alerts triggered - Check dashboard

Infrastructure & Deployment

# AWS Infrastructure (Terraform)
# Multi-AZ deployment for high availability
resource "aws_autoscaling_group" "api" {
  name                = "xtitle-api-asg"
  min_size            = 3
  max_size            = 10
  desired_capacity    = 3
  vpc_zone_identifier = aws_subnet.private[*].id
  
  launch_template {
    id      = aws_launch_template.api.id
    version = "$Latest"
  }
}

# RDS PostgreSQL with encryption
resource "aws_db_instance" "main" {
  engine              = "postgres"
  engine_version      = "15.3"
  instance_class      = "db.r6g.xlarge"
  storage_encrypted   = true
  multi_az            = true
}
// Cloudflare Worker - Edge Security
export default {
  async fetch(request, env, ctx) {
    // Rate limiting check
    const ip = request.headers.get('CF-Connecting-IP');
    const rateLimit = await checkRateLimit(ip, env);
    
    if (rateLimit.exceeded) {
      return new Response('Too Many Requests', { 
        status: 429 
      });
    }
    
    // Fraud detection at edge
    if (await detectSuspiciousPattern(request)) {
      ctx.waitUntil(logSecurityEvent(request, env));
      return new Response('Forbidden', { 
        status: 403 
      });
    }
    
    return fetch(request);
  }
}
# Prometheus Metrics
# Custom metrics for fraud detection
wire_verification_total{status="success"} 8547
wire_verification_total{status="failed"} 23
field_hash_mismatches_total{field="account"} 12
field_hash_mismatches_total{field="routing"} 7
fraud_detection_score_histogram{le="0.5"} 8523
fraud_detection_score_histogram{le="0.9"} 8540
xrpl_transaction_duration_seconds{quantile="0.95"} 0.045
# GitHub Actions CI/CD Pipeline
name: Deploy Production
on:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Run Tests
        run: |
          npm test
          npm run test:integration
          npm run test:security
  
  deploy:
    needs: test
    steps:
      - name: Deploy to AWS
        run: |
          terraform apply -auto-approve
          ./scripts/deploy.sh production

System Performance

95%
98%
100%
85%
92%
API Response
Cache Hit
Uptime
Fraud Detection
XRPL Success