Skip to main content
Back to Overview

Section 04

Technology Architecture

Hybrid blockchain model and dual-chain implementation

The Technology Stack

Frontend

  • Next.js 15 - React with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • shadcn/ui - Component library

Backend

  • Firebase Auth - User authentication
  • Firestore - NoSQL database
  • Firebase Storage - File storage
  • Next.js API Routes - Serverless

Blockchain

  • Arweave - Permanent storage
  • Bundlr Network - Fast uploads
  • Polygon - ERC-721 NFTs
  • MetaMask - Wallet integration

AI & Payments

  • OpenAI GPT-4o - Vision & language
  • Whisper - Audio transcription
  • Qdrant - Vector database
  • Stripe - Payment processing

Arweave: Permanent Storage

Arweave is a blockchain designed specifically for permanent data storage. Unlike traditional blockchains that store state, Arweave stores data permanently.

How Arweave Works

  • One-time payment: Pay once, store for 200+ years
  • Economic model: Endowment covers declining storage costs
  • Cost: ~$5 per GB (decreasing over time)
  • Immutable: Once uploaded, cannot be changed or deleted

Arweave vs Traditional Storage

FeatureArweaveAWS S3IPFS
Duration200+ yearsUntil you stop payingUntil pinned
Cost ModelOne-timeMonthly foreverPin or pay gateway
CensorshipResistantPlatform controlledGateway dependent
VerifiableYes (on-chain)NoContent hash only

SmartWeave Contract Integration

Neural Salvage NFTs use Arweave's SmartWeave standard for BazAR marketplace compatibility:

// SmartWeave Contract Tags
{
  "App-Name": "SmartWeaveContract",
  "Contract-Src": "Of9pi--Gj7hCTawhgxOwbuWnFI1h24TTgO5pw8ENJNQ",
  "Init-State": { 
    "balances": { 
      "[userWallet]": 100 
    } 
  },
  "Creator": "[User's Arweave Address]",
  "Indexed-By": "ucm"
}

Polygon: Marketplace Access

While Arweave provides permanent storage, Polygon provides marketplace liquidity through the ERC-721 standard.

Why Polygon?

  • ERC-721 Compatible: Works with OpenSea, Rarible, LooksRare
  • Low Fees: ~$0.01 per transaction
  • Ethereum Ecosystem: Access to largest NFT market
  • Fast Confirmation: 2-second block times

Dual-Chain Synchronization

Every Neural Salvage NFT mint creates TWO permanent records:

1
Upload to Arweave
File + metadata stored permanently. Returns transaction ID.
2
Tag with User Wallet
Creator tag points to user's Arweave address for ownership proof.
3
Mint on Polygon
ERC-721 token minted with Arweave URL as tokenURI.
4
Transfer to User
Polygon NFT transferred to user's wallet. User now owns on both chains.

AI Analysis Pipeline

Every upload triggers a multi-stage AI analysis pipeline:

Analysis Workflow

1
File Upload: Firebase Storage with resumable uploads
2
GPT-4o Vision: Image/video captioning and description
3
Tag Generation: AI-suggested tags based on content
4
NSFW Detection: Content moderation scoring
5
Vector Embedding: Create semantic search embedding
6
Store in Qdrant: Enable natural language search

Security Architecture

Multi-Layer Protection

  • Rate Limiting: 5 mints/min per IP to prevent abuse
  • Cost Caps: $50/day platform spend limit
  • Wallet Security: 3-location encrypted backup (local + cloud + paper)
  • Firestore Rules: User data isolation and validation
  • HTTPS Only: All connections encrypted end-to-end

Data Backup Strategy

  • Firebase: Automatic daily backups to separate region
  • Arweave: Already permanent by design
  • Code: GitHub with semantic versioning
  • Platform Wallet: Seed phrase + encrypted JWK file

API Architecture

Neural Salvage exposes clean REST APIs for all core functionality:

EndpointMethodPurpose
/api/nft/mint-dual-chainPOSTMint on Arweave + Polygon
/api/payment/create-checkoutPOSTStripe payment session
/api/nft/by-walletGETFetch user's NFTs
/api/upload/processPOSTAI analysis pipeline

Performance Optimization

  • Edge Caching: Static assets on Vercel Edge Network
  • Lazy Loading: Images load as user scrolls
  • Firebase Indexes: Optimized queries for gallery views
  • Vector Caching: Qdrant embeddings cached for 24 hours
  • Streaming Uploads: Large files chunked and streamed