Skip to content

tryRAMCloud/RamCloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RAM Cloud

RAM Cloud

Typing SVG


Website Β  Twitter Β  Base


Next.js React TypeScript Tailwind viem WebLLM

πŸ“– Table of Contents

🧩 Overview

RAM Cloud is a decentralized network for memory & compute on Base. Rent a node and run real workloads, or share your machine's spare capacity and earn real USDC for every task it handles. Rentals are priced per gigabyte-hour and paid in ETH or USDC; worker payouts settle on-chain and are verifiable on Basescan.

Every rented node speaks the Redis protocol β€” drop it into your stack as a cache, session store, scratch space, or rate-limiter β€” and can run compute tasks with the RUN command.

The whole thing is a Next.js 16 app with MetaMask wallet auth, real ETH/USDC payments on Base, a server-backed memory console, real in-browser GPU compute (WebLLM/WebGPU), proof-of-work verification, and real USDC worker payouts.

πŸ’‘ The Problem & The Solution

The problem. Cloud compute and memory are expensive, billed in rigid reserved blocks, and locked to a few centralized providers. Meanwhile billions of gigabytes of RAM and countless idle GPUs sit unused in gaming rigs, home servers, and data-center overflow β€” doing nothing.

The solution. RAM Cloud connects the two. Providers share genuinely idle capacity straight from the browser; developers rent exactly what they need by the hour, settled trustlessly on Base.

Traditional cloud RAM Cloud
Monthly reserved blocks Pay per GB-hour
One vendor, lock-in Decentralized mesh of nodes
Fiat billing, contracts Crypto-native β€” ETH / USDC on Base
Trust the provider Proof-of-work + on-chain payouts

✨ Features

πŸ›’ Marketplace

Browse and filter nodes by DDR generation, ECC, frequency, region, health score, price, and live benchmarks. Sort by recency, health, uptime, price, or benchmark.

πŸ’Έ Real Payments

Rent priced per GB-hour, payable in ETH or USDC on Base via MetaMask. Live ETH→USD conversion, and a Basescan link for every transaction.

πŸ–₯️ Earn From Your GPU

Click Start Worker on the Earn page β€” a compute node spins up in your browser tab via WebGPU, no install. Your machine handles real tasks and you earn USDC per job.

🧠 Live RAM Console

Every rental opens a real, server-backed Redis-style console. SET/GET travel to the server and persist in real memory namespaced by your API key β€” plus RUN to offload a compute task to the node.

πŸ›‘οΈ Proof of Work

Nodes are audited with hidden verification challenges, a timing floor, and slashing β€” a worker can't fake its way to a payout.

🏦 Real USDC Payouts

Connect a wallet, sign once to register, and withdraw real USDC on Base on demand. Every payout is an on-chain tx with a Basescan link, shown in your dashboard. Daily caps keep the treasury safe.

🎁 Free to Try

Every visitor gets $1 of credit on a shared node β€” no wallet, no signup. Run real tasks in seconds on the Try page.

πŸ“ˆ Live Network & Docs

A real-time protocol dashboard (TB online, active nodes, leases, volume), a secondary market for active leases, reviews, and full docs.

🧠 How It Works

   Renter (browser)                    Provider (browser)
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Marketplace   β”‚                   β”‚ Browser Worker   β”‚
   β”‚ RAM Console   β”‚                   β”‚ (WebGPU compute) β”‚
   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚  run task                  heartbeat β”‚  poll / result
          β–Ό                                       β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚              Orchestrator                  β”‚
        β”‚  β€’ live-node registry (heartbeats)         β”‚
        β”‚  β€’ routes each task to an idle worker      β”‚
        β”‚  β€’ proof-of-work audits + slashing         β”‚
        β”‚  β€’ managed fallback when no worker is live β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚  settle
                             β–Ό
                     Base  Β·  ETH / USDC
  1. Provide β€” anyone goes live in one browser click. A node loads onto their GPU (WebGPU) and joins the mesh.
  2. Route β€” the orchestrator assigns each task to an idle node, audits it for honesty, and relays the result. If no worker is online, a managed fallback handles it so renters are never stuck.
  3. Settle β€” renters pay in ETH/USDC; workers earn per task and withdraw real USDC β€” all on Base.

πŸ’» The RAM Console

Each rental gets a live console backed by /api/ram β€” a real in-memory key-value store, namespaced per rental by API key. Data you SET persists server-side and returns on GET.

Command Description
PING [msg] Health check β†’ PONG
SET key val [EX secs] Store a value, optional TTL
GET key Retrieve a value
DEL key … Delete one or more keys
INCR key Atomically increment an integer
TTL key Seconds until a key expires
KEYS Β· DBSIZE Β· INFO Inspect the namespace
FLUSHALL Clear the namespace
RUN <task> Offload a compute task to the node
HELP / CLEAR Console helpers
> SET session:abc alice
OK                                   0.04ms
> GET session:abc
"alice"                              0.05ms
> RUN summarize the redis use-cases for a cache
A cache stores hot data in memory for sub-ms reads…   Β· served by a community GPU node

πŸ’Έ Payments

  • Currencies β€” pay in ETH (native) or USDC (ERC-20) on Base.
  • Wallet β€” connect MetaMask; the app switches/adds the Base network automatically.
  • Pricing β€” every listing is priced per GB-hour. Total = GB Γ— hours Γ— price, with an optional burst overflow reserve.
  • Settlement β€” funds move on Base; every tx links to Basescan.
  • Escrow (roadmap) β€” on-chain escrow with SLA-based auto-refund is planned; today payments transfer directly to the treasury.

🏦 Earning β€” Share Your GPU

Become a provider in one click β€” no install, no signup.

  1. Go live β€” open the Earn page β†’ Start Worker. A compute node loads onto your GPU in the tab (WebGPU; ~0.9 GB model, cached after first load).
  2. Earn per task β€” your machine handles real jobs from the network. Earnings accrue live.
  3. Get paid β€” connect a wallet, sign once (free, no gas) to register your payout address, then Withdraw real USDC on Base.

Payout safety limits

Setting Value
Per task $0.04
Minimum withdrawal $0.50
Daily cap $1.00 per wallet
Overall ceiling the treasury's USDC balance

Every payout is an on-chain transaction with a Verify on Basescan link in your dashboard, so earnings are independently verifiable.

Have a dedicated machine? The agent/ directory holds a Node CLI for always-on nodes (advanced).

πŸ›‘οΈ Proof of Work

Because nodes report their own results, the network verifies the work before paying:

  • Hidden audits β€” the orchestrator randomly slips in tasks it already knows the answer to, indistinguishable from real jobs.
  • New nodes are vetted first β€” you can't earn-and-withdraw until you've passed a check.
  • Timing floor β€” results returned faster than real compute is possible are rejected.
  • Slashing β€” repeated failures flag the node, zero its accrued earnings, and block withdrawals.

No cheap method proves a specific model ran (that needs zkML/TEE β€” on the roadmap), but this makes faking cost real work, and the daily payout cap is the hard backstop.

πŸ”Œ API Reference

Route Method Purpose
/api/ram POST Real KV memory store + RUN task dispatch (worker or hosted fallback)
/api/worker GET Β· POST Worker register / poll / submit result Β· register payout Β· withdraw
/api/listings GET Β· POST Β· DELETE Shared, server-side node registry
/api/providers GET Provider directory with spec/price/health filters
/api/secondary-market GET Β· POST Secondary listings (fixed-price + auction)

The job queue, worker registry, and KV store are in-memory / single-process. On serverless hosts they reset between invocations β€” see Deployment.

πŸ› οΈ Tech Stack

Layer Stack
Framework Next.js 16 (App Router Β· Turbopack) Β· React 19 Β· TypeScript
Design Tailwind CSS v4 Β· Base-blue design system Β· framer-motion Β· 3D tilt / magnetic buttons / confetti / ambient background
Chain Base (Ethereum L2) Β· viem Β· MetaMask Β· ETH + USDC
Compute @mlc-ai/web-llm (in-browser GPU inference via WebGPU) Β· poll-based orchestrator Β· proof-of-work audits
Fallback AI OpenRouter β€” hosted model when no community worker is online
Payouts viem wallet client signs USDC transfer from a treasury key, with per-wallet daily caps

πŸš€ Quick Start

# clone
git clone https://github.com/ctrlshifthash/Ram.git
cd Ram/ram-marketplace

# install
npm install

# configure β€” fill in your keys
cp .env.local.example .env.local

# run
npm run dev          # β†’ http://localhost:3000

Requires Node 18+. An OpenRouter key powers the hosted-fallback RUN. Real worker payouts need a funded Base treasury key (optional β€” the app runs fine without it, payouts just stay disabled).

πŸ”‘ Environment Variables

Copy ram-marketplace/.env.local.example β†’ .env.local (local) or add them in your host's settings (production).

Variable Scope Description
OPENROUTER_API_KEY secret OpenRouter key β€” hosted fallback for RUN
NEXT_PUBLIC_TREASURY_ADDRESS public Base 0x… wallet that receives rent and pays workers
TREASURY_PRIVATE_KEY secret Burner key for that wallet β€” enables real USDC payouts. Leave blank to keep payouts disabled. Fund with a few $ of USDC + a little ETH for gas.
BASE_RPC_URL optional Base RPC (defaults to https://mainnet.base.org)

⚠️ TREASURY_PRIVATE_KEY is a hot wallet on the server β€” use a burner with small funds only, never your main wallet.

πŸ“ Project Structure

Ram/
β”œβ”€β”€ ram-marketplace/                # the Next.js app (deploy this)
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ page.tsx                # home β€” hero, pillars, how it works
β”‚   β”‚   β”œβ”€β”€ try/                    # free $1 trial β€” run tasks, no wallet
β”‚   β”‚   β”œβ”€β”€ marketplace/            # browse + filter nodes
β”‚   β”‚   β”œβ”€β”€ rent/[id]/              # node detail + rent flow (ETH/USDC)
β”‚   β”‚   β”œβ”€β”€ earn/                   # browser worker + payouts + task history
β”‚   β”‚   β”œβ”€β”€ dashboard/              # rentals, metrics, console, worker payouts
β”‚   β”‚   β”œβ”€β”€ secondary-market/       # buy / auction active leases
β”‚   β”‚   β”œβ”€β”€ network/                # live protocol stats + activity feed
β”‚   β”‚   β”œβ”€β”€ docs/                   # full documentation
β”‚   β”‚   └── api/                    # ram Β· worker Β· listings Β· providers Β· secondary-market
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ fx/                     # CursorGlow Β· Tilt Β· Magnetic Β· AmbientBg
β”‚   β”‚   β”œβ”€β”€ BrowserWorker, RamTerminal, RamModule, ProvisionFlow, Reviews …
β”‚   └── lib/
β”‚       β”œβ”€β”€ walletContext.ts        # MetaMask + Base
β”‚       β”œβ”€β”€ tokens.ts               # USDC (Base) helpers
β”‚       β”œβ”€β”€ jobQueue.ts             # orchestrator (register/poll/claim/complete)
β”‚       β”œβ”€β”€ challenges.ts           # proof-of-work audits
β”‚       β”œβ”€β”€ payouts.ts              # caps + payout accounting
β”‚       β”œβ”€β”€ treasury.ts             # viem USDC payouts + signature verify
β”‚       └── store.ts Β· useStore.ts  # rentals Β· worker tasks Β· payouts
└── agent/                          # dedicated provider agent (advanced)

🌐 Deployment

Railway / a long-running Node host (recommended)

The orchestrator, worker registry, and KV store live in memory in a single process, so a persistent Node server keeps live nodes, earnings, and the queue intact.

  1. New Project β†’ Deploy from the GitHub repo.
  2. Point the service at ram-marketplace (npm install && npm run build && npm start).
  3. Add the environment variables.
Vercel
  1. Import the repo; set Root Directory β†’ ram-marketplace (it's a subfolder).
  2. Add the environment variables.
  3. Deploy.

⚠️ Vercel's serverless functions reset memory between requests, so the in-memory worker queue / live registry won't hold. Back them with a shared store (e.g. Upstash Redis) for production, or use Railway.

πŸ—ΊοΈ Roadmap

Shipped

  • Browser workers β€” real in-browser GPU compute (WebGPU)
  • Orchestrator with live-node registry + hybrid fallback
  • Proof-of-work verification (hidden audits, timing floor, slashing)
  • ETH & USDC payments on Base via MetaMask
  • Real USDC worker payouts + on-chain (Basescan) verification
  • Free $1 trial β€” run tasks with no wallet

Next

  • Streaming results β€” tokens stream back live
  • Persistent accounting (database) β€” earnings & history survive restarts
  • Native provider nodes β€” bigger capacity beyond the browser
  • Token buyback-and-burn β€” route network fees into $RAM

Planned

  • On-chain escrow + SLA enforcement with auto-refunds
  • Cryptographic proof-of-execution
  • On-chain secondary-market auctions Β· provider reputation Β· public SDK

❓ FAQ

What chain is this on?
Base (an Ethereum L2). You pay and get paid in ETH or USDC, and connect with MetaMask.
Is the compute real?
Yes β€” when a worker is online, tasks run on a real model on their GPU via WebGPU. If no worker is live, a managed fallback handles the task so it never fails.
How do workers get paid, and how do I know they earned it?
Per task in USDC, withdrawable on demand to any Base wallet. Nodes must pass hidden proof-of-work audits before they can withdraw, and every payout is an on-chain transaction you can verify on Basescan.
Do I need crypto to try it?
No β€” the Try page gives every visitor $1 of credit on a shared node, no wallet or signup required.

πŸ”— Connect

Website Β  Twitter Β  Base


Idle RAM & GPUs are everywhere. We made them rentable.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors