RAYSTYLUS

ON-CHAIN ENGINE
> Executing complex ray tracing logic on-chain.

Experience the first fully on-chain ray tracer with AI-powered aesthetics built with Rust and WebAssembly. Neural Network inference directly on the Arbitrum blockchain.

The 3D graphics you create are rendered on the blockchain using Dot Product, Normalization, Quadratic Formula - powered by on-chain ML.

sphere_renderer.rs
32x32 Upscaled

UNDER THE HOOD: THE COMPUTE ENGINE

RayStylus is not a contract; it's a Proof-of-Compute architecture that redefines on-chain performance and user experience.

Rust Logo

Rust Logic

Vector math & ray tracing algorithms written in Rust.

WASM Compilation

Compiled to WebAssembly for near-native execution speed.

Arbitrum Logo

Arbitrum Stylus

Executed on-chain at 10x-100x lower gas cost than Solidity.

Computational Dominance

RayStylus executes massive computational throughput running thousands of vector algebra and quadratic equations per transaction. This is a far heavier benchmark than single formula financial models, proving Stylus's ability to handle the most demanding physics and array processing tasks.

Zero-Lag Interactive Studio

We defeated blockchain latency. By utilizing instantaneous `eth_call` simulation, users can adjust Color, Position (XYZ), and Background in real-time. This is the first true Zero-Lag UX in a dApp, proving Stylus can deliver Web2 standards of interactivity.

Live Demo

Try RayStylus AI

Experience the future of natural language control. Ask the AI to modify the scene or explain the technology.

AI Integrated
WASM Raytracing
Arbitrum Stylus

RayStylus AI

Creative Assistant

Ask me to change colors, move camera,
or explain RayStylus.

Why It Matters

Bringing ray tracing logic into smart contracts requires a paradigm shift in architecture.

The Problem

Why Is Heavy Computation Always Off-Chain?

  • Expensive Costs: EVM is not designed for complex floating-point math. Simple 3D rendering can cost thousands of dollars in gas.
  • Array Limitations: Large pixel array manipulation often hits block gas limits.
  • Off-chain Reliance: Most NFTs only store URLs to IPFS/S3, not the actual image data.

The Solution

StylusCanvas: Native Rust RayTracer

  • Stylus Efficiency: We move vector, shading, and lighting logic to Rust Smart Contracts compiled to WASM.
  • 10-100x Cheaper: Instant computation with a fraction of the cost of traditional EVM.
  • True On-Chain: Images are generated deterministically by contract code, forever on the blockchain.

Why Neural Network on Blockchain Matters

Combining AI with verifiable on-chain computation creates a new paradigm: trustless AI inference with deterministic results.

AI on Blockchain

First-ever 3→4→2 neural network running on smart contracts. AI inference without off-chain APIs or centralized servers.

GPU-Like Performance

Fixed-point i64 arithmetic enables fast matrix operations. 4 hidden neurons with ReLU activation and sigmoid output layer.

Deterministic & Verifiable

Every ML inference result is on-chain and immutable. No randomness, no server inconsistency—pure mathematics.

Aesthetic Generation

Train ML model off-chain, deploy weights on-chain. Users input 3 parameters (Warmth, Intensity, Depth), get deterministic RGB colors.

Minimal Footprint

28 weights + 6 biases = ~1KB of data. Efficient enough to run millions of inferences within gas constraints.

Trust Minimized

No centralized service controlling aesthetic generation. Model weights are public, auditable, and unchangeable on-chain.

Neural Network Pipeline

1

1000 Samples Training

Trained on synthetic data: Warmth × Intensity × Depth → RGB sphere color outputs with noise to improve generalization.

TensorFlow + Keras
2

Fixed-Point Conversion

Weights & biases converted to i64 fixed-point (scale 10^18) for Rust contract. Maintains precision across blockchain.

Python numpy
3

On-Chain Inference

Layer 1: 3 inputs → 4 hidden (ReLU). Layer 2: 4 hidden → 2 outputs (Sigmoid). Free VIEW function, no gas required.

Rust + Stylus VM
4

Aesthetic NFT Minting

After inference, render raytraced sphere with predicted colors. Store rendering params (21 bytes) on-chain permanently.

Arbitrum Stylus

Why This Changes Everything

Before: AI services were centralized. Users had to trust servers. Models could be changed without notice.

Now: ML runs on blockchain. Weights are immutable. Every inference is verifiable. Trustless AI for the first time.

RayStylus + MNN: Raytracing (geometric computation) + Neural Network (aesthetic inference) = complete on-chain 3D graphics with AI. No servers. No APIs. Pure blockchain.

System Architecture

RayTracing + Neural Network on-chain using Arbitrum Stylus. GPU-like computation with ML inference on blockchain.

CLIENT LAYER

RayStylus Studio

Configuration UI
Resolution, Camera Offset, Colors
ML Parameters
Warmth, Intensity, Depth → Preview
Wagmi + Viem
Web3 Contract Interaction
Canvas Engine
Hex Decoding & Rendering
AI Integration
AI-powered config & chat
RPC Endpoint
Arbitrum Sepolia
Stylus VM
WASM Execution
CONTRACT LAYER

Rust Contract

fn view_aesthetic() / fn mint() / fn render_token()
Three-phase: Preview (free view), Mint, Render on-demand
Neural Network Pipeline
1. Input: Warmth, Intensity, Depth (3 values)
2. Hidden: 4 neurons with fixed-point weights
3. Output: RGB sphere color (ML inference)
4. Render: Ray trace with aesthetic colors
1. Setup: Unpack data, init scene
2. Loop: 32x32 ray generation
3. Math: Fixed-point (scale 1024)
4. Output: BMP + RGB bytes
ML

Neural Network

3→4→2 Mini Neural Network inference with fixed-point i64 arithmetic. AI-powered aesthetic parameter generation on-chain.

Integer Math

Custom fixed-point arithmetic (Scale 1024) ensures deterministic rendering across all nodes.

Ray Tracing

Full ray-sphere intersection with diffuse lighting and shadow calculations on-chain.

NFT Minting

Mint unique NFTs with rendering parameters stored permanently on-chain (21 bytes).

Ultra-Efficient

Mint: 5K gas | Render: 120K gas | Traditional EVM: impossible or $5000+.

PERFORMANCE METRICS

Performance Benchmark

Quantitative proof why Stylus is the future of on-chain computation.

Rendering Cost (32x32)

Stylus

$0.001 - $0.005

Ultra Cheap

Traditional EVM

Est. $5,000+

Gas Limit Exceeded

1,000,000x Better

Computation Time

Stylus

~120ms

Native Code Speed

Traditional EVM

Timeout / Fail

Impossible

Better

Math Precision

Stylus

Fixed Point (Scale 1024)

Deterministic

Traditional EVM

Workarounds

Complex

Superior Better

Ready to RenderOn-Chain?

Experience the power of Arbitrum Stylus. Enter the RayStylus Studio to configure your scene in real time, connect your wallet, and run a full Rust-based ray tracer directly on the blockchain.

Arbitrum Sepolia
Rust Stylus V1
WASM Powered
AI Integrated