Peer-to-peer GPU compute · Freivalds-verified · Lightning-settled
Multiply giant matrices on other people's GPUs — and trust every result.
Matrix Compute splits your GEMM across a global pool of GPU workers. Each tile you receive is checked locally in O(n²) with Freivalds' algorithm before a Lightning HODL invoice settles — so you only pay for math that's correct.
$ pip install matrix-compute-sdk
import numpy as np
from matrix_compute import distributed_matmul
A = np.random.randn(16384, 16384).astype(np.float32)
B = np.random.randn(16384, 16384).astype(np.float32)
C = distributed_matmul(A, B) # tiled → P2P GPUs → Freivalds-verified → paid
# Linux / macOS — detects GPU/TEE, generates keys, joins the network
$ curl -sSL https://matrix-compute.com/worker.sh | bash
# Windows (PowerShell)
PS> irm https://matrix-compute.com/worker.ps1 | iex
# Outbound-only reverse tunnel: no port forwarding needed.
// claude_desktop_config.json · Cursor · Antigravity
{
"mcpServers": {
"matrix-compute": {
"command": "uvx",
"args": ["matrix-compute-mcp", "--live-mode"],
"env": {
"MATRIX_L402_MACAROON": "<macaroon>"
}
}
}
}
Trust the math, not the worker.
No reputation scores, no KYC'd data centres. Correctness is enforced cryptographically and economically.
Discover
Workers announce GPU model, VRAM, price and bond as Nostr Kind 30000 events. The SDK ranks them by price, VRAM and reputation.
Tile & stream
Your matrices are split with a bandwidth-aware strategy (OUTPUT_GRID_2D, OUTER_PRODUCT_1D, BLOCK_3D) and streamed over gRPC.
Verify in O(n²)
Each tile is checked with Freivalds (A(Br) = Cr, error ≤ 2−k) using a Higham floating-point bound. Cheaters get a signed fraud proof.
Settle per GFLOP
Lightning HODL invoices only settle after verification passes. Fraud slashes the worker's staked bond instead.
Workers online right now
Streamed directly from the matrix-compute-relay WebSocket (NIP-01, Kind 30000 WORKER_ANNOUNCE). Nothing here is cached or curated.
?demo=1). Switch to the live relay →
?relay=ws://localhost:8008.
By device type
peak FP32 · sats/GFLOP| Device | Online | VRAM | Compute | Floor | Median |
|---|
Relay health
—- Uptime
- —
- Announcements processed
- —
- Matchmaking success
- —
- Query latency (p50)
- —
From GET /health and GET /telemetry/summary. Query the relay yourself — see the relay API docs.
Transparent, per-GFLOP market rates
Workers set their own sats_per_gflop. You set a ceiling (max_price_per_gflop) and only pay for verified tiles. No subscriptions, no minimum spend.
USD comparison vs. cloud GPUs
BTC/USD —| Provider | USD / PFLOP | USD / TFLOP-hour |
|---|
estimate_job_cost tool.
Built for high compute-to-bandwidth workloads
Matrix multiplication is O(n³) compute over O(n²) data — the bigger the matrix, the more the WAN round-trip disappears into GPU time.
Batched offline LLM inference & embedding search
Score millions of queries against a corpus with exact cosine similarity. OUTPUT_GRID_2D downloads every output element exactly once — zero reduction on your machine.
from matrix_compute_mcp.ai import distributed_cosine_similarity
scores, idx = distributed_cosine_similarity(queries, corpus, top_k=10)
Iterative scientific solvers
Power iteration, PageRank, spectral clustering. Lease remote VRAM so A uploads once, then stream only vectors — with probabilistic Freivalds spot checks each step.
from matrix_compute import distributed_power_iteration
v = distributed_power_iteration(A, iterations=200)
Autonomous agents that pay their own way
Agents call the MCP server, pay per matrix batch with an L402 macaroon and never need a credit card or cloud account.
Edge & constrained-device offloading
A Raspberry Pi or edge camera ships batched photogrammetry / neural-field matrices to remote GPUs and verifies the answer locally in O(n²).
Give your agent a verified GPU supercomputer
matrix-compute-mcp exposes the network to Claude Desktop, Cursor, Antigravity, LangChain and any MCP client over stdio JSON-RPC 2.0 — with L402 macaroon or trial-key auth.
Exposed tools
5 toolsget_network_status | Live worker count, VRAM, TEE enclaves and sats_per_gflop from the relay. |
estimate_job_cost | Exact upload/download MB, task count, GFLOPs and sat cost before you run. |
execute_distributed_matmul | Verified C = A × B from .npy, .npz, .safetensors or inline arrays. |
batch_similarity_search | Exact top-k cosine similarity with zero-reduction OUTPUT_GRID_2D tiling. |
compute_pca_svd | Verified top-k randomized SVD or stateful power-iteration PCA. |
# Try it instantly — hermetic mock network, no wallet needed
$ uvx matrix-compute-mcp --mock-mode
# Real network with your L402 macaroon (or a trial key)
$ uvx matrix-compute-mcp --live-mode \
--l402-macaroon "$MATRIX_L402_MACAROON"
# Same verified primitives, straight from Python
from matrix_compute_mcp.ai import DistributedLinear, distributed_pca_svd
layer = DistributedLinear(in_features=4096, out_features=4096)
U, S, Vt = distributed_pca_svd(embeddings, k=32, method="randomized")
Your idle GPU, paid per GFLOP in sats
Current network median: — sats/GFLOP. You set your own price; payouts stream to your Lightning node as tiles verify.
- Run the installer
Auto-detects NVIDIA / AMD GPUs, AMD SEV-SNP and Intel TDX enclaves, checks Docker and generates your worker Nostr keypair.
- Point it at your Lightning wallet
Paste your payout address or node pubkey. The operator dashboard shows a QR code for funding your bond.
- Stake a bond, go live
Your bond backs your results — it's only slashed if a consumer proves fraud with a signed Freivalds fraud proof. Auto-bond can sweep a share of early earnings for you.
- Watch it appear above
Your announcement shows up in the live dashboard within seconds. No port forwarding — outbound-only reverse tunnels handle NAT.
curl -sSL https://matrix-compute.com/worker.sh | bash
# or with explicit pricing
curl -sSL https://matrix-compute.com/worker.sh | bash -s -- \
--sats-per-gflop 0.0005 --min-task-sats 10
irm https://matrix-compute.com/worker.ps1 | iex
# or download and pass options
.\worker.ps1 -SatsPerGflop 0.0005 -MinTaskSats 10 -PayoutAddress [email protected]
docker run -d --name matrix-worker --gpus all \
-p 50051:50051 \
-e MATRIX_WORKER_SATS_PER_GFLOP=0.0005 \
-e MATRIX_WORKER_DTYPE_PREFERENCE=fp16 \
matrix-compute-node:gpu
Technical paper
Trustless Distributed Matrix Multiplication: Verifying O(n³) GPU Compute in O(n²) with Freivalds' Algorithm, Zero-Reduction Spatial Tiling, and Lightning L402.
The complete engineering paper — dynamic Higham verification bounds, WAN spatial rooflines for 1D/2D/iterative tiling, multi-vendor confidential computing (AMD SEV-SNP/NVIDIA CCA), sub-millisecond L402 batch settlement, and NAT reverse tunneling — is published in full with empirical benchmarks.
Get help, report bugs, meet other operators
#consumer-sdk
SDK, partitioning and L402 payment questions.
#worker-nodes
Hardware, attestation, NAT and payout help for operators.
GitHub Issues
Bug reports and feature requests. Include SDK version and logs.
Documentation
Searchable SDK, worker, MCP and protocol reference.
Troubleshooting FAQ
My worker is running but doesn't appear on the dashboard.
Check that MATRIX_WORKER_NOSTR_RELAYS includes wss://relay.matrix-compute.net and that the node logs show an OK (NIP-20) response for its Kind 30000 announcement. Announcements older than the relay TTL (1 hour by default) are pruned, so the daemon must stay up to keep re-announcing.
Do I need to open ports / configure NAT?
No. The installer defaults to nat_mode=reverse_tunnel: your node opens an outbound gRPC tunnel to the relay, which proxies consumer traffic. If you have a public IP, set MATRIX_NAT_MODE=direct and expose port 50051 for lower latency.
My L402 payment fails with a macaroon / preimage error.
L402 tokens are macaroon:preimage pairs. Make sure the macaroon was minted by the same settlement service your client points at (MATRIX_SETTLEMENT_API_URL) and hasn't expired. With a local LND wallet, enable MATRIX_LND_PAYER_ENABLED=true and set CONSUMER_LND_REST_URL plus the macaroon/TLS paths.
How do I verify a worker's TEE attestation?
The SDK does it for you: with require_confidential_compute=True (the default) it verifies the hardware attestation chain and encrypts tiles end-to-end with AES-256-GCM. Pin a specific architecture with required_tee_type="amd-sev-snp", "intel-tdx" or "nvidia-cca". See Confidential computing.
How are fraudulent results handled? Can my bond be slashed unfairly?
A consumer can only slash a bond with a signed FreivaldsFraudProof containing the SHA-256 hashes of A, B and your signed result C, the random vector r, the vectors Br, A(Br), Cr and your signature over the result. The settlement oracle independently re-checks those vectors, so honest results can't be slashed. Floating-point noise is covered by a Higham error bound scaled to the matrix norms.
What precisions are supported?
fp32, fp16 and bf16. Verification tolerances scale with the unit roundoff of the chosen dtype.