""" VALIS — Variable Arrived Location In Superposition Built for the Build Small Hackathon 2026. A peer-to-peer mesh network on $10 microcontrollers. Messages don't exist in transit. It's a walkie-talkie with math. """ import gradio as gr import os import secrets # === MEILONG SCATTER PROTOCOL === def xor_bytes(a, b): return bytes(x ^ y for x, y in zip(a, b)) def scatter(message): """Split a message into 3 XOR shares. Any 1 or 2 = noise. All 3 = message.""" data = message.encode('utf-8') share1 = secrets.token_bytes(len(data)) share2 = secrets.token_bytes(len(data)) share3 = xor_bytes(xor_bytes(data, share1), share2) return share1, share2, share3 def reassemble(s1, s2, s3): """Reassemble 3 XOR shares back into the original message.""" return xor_bytes(xor_bytes(s1, s2), s3).decode('utf-8') def demo_scatter(message): """Interactive Meilong scatter demo.""" if not message or not message.strip(): return "", "", "", "", "", "" s1, s2, s3 = scatter(message) # Show shares as hex (proving they're noise) hex1 = s1.hex() hex2 = s2.hex() hex3 = s3.hex() # Try to "read" individual shares (you can't) try: attempt1 = s1.decode('utf-8', errors='replace') except: attempt1 = "[binary noise]" try: attempt2 = s2.decode('utf-8', errors='replace') except: attempt2 = "[binary noise]" # Reassemble recovered = reassemble(s1, s2, s3) # Stats stats = f"Original: {len(message)} bytes\nEach share: {len(s1)} bytes\nShares are random: share1 and share2 are crypto-random, share3 = message XOR share1 XOR share2\nIntercept 1 share: random noise\nIntercept 2 shares: random noise\nAll 3 shares: message recovers perfectly" return hex1[:80] + "...", hex2[:80] + "...", hex3[:80] + "...", recovered, f"Decoded share 1 alone: {attempt1[:60]}...\nDecoded share 2 alone: {attempt2[:60]}...\n\nMeaningless. The message doesn't exist until all three arrive.", stats def demo_tamper(message, tampered_char): """Show what happens when you tamper with a share.""" if not message or not message.strip(): return "Enter a message first." s1, s2, s3 = scatter(message) # Tamper with share 2 — flip one byte s2_tampered = bytearray(s2) if len(s2_tampered) > 0: pos = len(s2_tampered) // 2 s2_tampered[pos] = s2_tampered[pos] ^ 0xFF s2_tampered = bytes(s2_tampered) # Try to reassemble with tampered share try: corrupted = xor_bytes(xor_bytes(s1, s2_tampered), s3).decode('utf-8', errors='replace') except: corrupted = "[decode failed]" original = reassemble(s1, s2, s3) return f"Original message: {original}\n\nTampered reassembly: {corrupted}\n\nOne flipped byte in one share = garbage output.\nThe dragon knows when someone touched the shares." # === CSS === CUSTOM_CSS = """ @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap'); .gradio-container { background: #0a0a12 !important; max-width: 900px !important; margin: 0 auto !important; } .gr-button-primary { background: #00d4ff !important; color: #0a0a12 !important; border: none !important; font-family: 'JetBrains Mono', monospace !important; font-weight: bold !important; } .gr-button-primary:hover { background: #00b8e0 !important; } footer { display: none !important; } """ SPEC_MD = """ ## Protocol Stack ``` Layer 5: VALIS Application — Meilong scatter (3 XOR shares, 3 routes) Layer 4: Identity — Presence-based (no accounts, no IP, no identity) Layer 3: Mesh Routing — 802.15.4 mesh, multi-hop, self-healing Layer 2: Transport — Zigbee / Thread / Wi-SUN (open standards) Layer 1: Physical — 2.4GHz ISM band (license-free worldwide) ``` ## Hardware Per Node | Component | Spec | Cost | |-----------|------|------| | ESP32-C6 or ESP32-H2 | Zigbee/Thread/802.15.4 + WiFi + BLE | $8 | | USB-C cable | Powered by any outlet or battery bank | $0 | | Enclosure | 3D printed or bare board | $2 | | **Total** | | **$10** | 100 nodes = $1,000 (a neighborhood). 1,000 nodes = $10,000 (a town). The electrical grid already wired the topology. ## Security Model | Attack | Result | |--------|--------| | **Intercept a message** | Can't. Message doesn't exist in transit. Three shares of noise on three paths. | | **Identify a user** | Can't. No user identities. Nodes are anonymous. | | **Shut down the network** | Can't. No server to kill. No domain to seize. Every node is independent. Kill one, traffic reroutes. | | **Block the frequency** | Illegal. 2.4GHz ISM is protected by international treaty. Jamming also kills WiFi and baby monitors. | | **Regulate it** | Regulate what? Open hardware, open protocols, license-free spectrum. It's a walkie-talkie with math. | ## vs. The Internet | Feature | Internet | VALIS | |---------|----------|-------| | Requires ISP | Yes | No | | Central servers | Yes | No | | Can be censored | Yes | No | | Can be surveilled | Yes | No | | Requires identity | Yes | No | | Can be shut down | Yes | No | | Cost per node | $50-100/mo | $10 one time | | Who owns it | Corporations | Nobody | """ POWERLINE_MD = """ ## Power Line Communication — The Part Nobody Will Believe Smart meters already send data through the electrical grid. This is not theory. It's deployed in millions of homes right now. The protocol is called G3-PLC / PRIME / IEEE 1901.2. **The insight:** Transformers don't destroy signals — they transform them at known, predictable ratios. ### Grid Harmonics as Communication Channels The electrical grid runs at 60Hz (US) / 50Hz (EU). But the wire carries harmonics: - **120Hz** — 2nd harmonic - **180Hz** — 3rd harmonic - **240Hz** — 4th harmonic - **300Hz** — 5th harmonic These harmonics are *unused bandwidth*. They're considered noise by the power company. But noise is just a signal nobody's listening to. ### The Resonance Angle Every wire has a resonant frequency determined by its length, gauge, and impedance. A VALIS node could: 1. **Listen** to the power line's harmonic signature (passive, legal, like tuning a radio) 2. **Inject** a tiny modulated signal on an unused harmonic (like power-line Ethernet, already legal) 3. **Relay** data through the grid wiring itself — no radio needed, no spectrum needed The grid becomes the mesh. Every outlet is a node. The wiring is already there. ### 7.83Hz — The Schumann Resonance The Earth-ionosphere cavity resonates at 7.83Hz. Tesla knew this. It's the frequency of the planet itself. At this frequency: - Signal propagates through the ground - Wavelength = ~38,000 km (circumference of Earth) - Extremely low power can travel extremely far - Already used by submarines for communication A VALIS node could use Schumann resonance as a *heartbeat* — a presence signal that says "I'm here" without carrying data. The data travels on the grid harmonics. The heartbeat travels through the planet. ### Why This Works Power Line Communication is already FCC-approved, already deployed, already proven. VALIS just: 1. Uses open frequencies the power company considers noise 2. Adds Meilong scatter so the data is meaningless in transit 3. Adds mesh routing so there's no center to attack The grid is the largest mesh network ever built. It just doesn't know it yet. """ # === APP === with gr.Blocks(css=CUSTOM_CSS, title="VALIS", theme=gr.themes.Base()) as app: gr.HTML("""
Variable Arrived Location In Superposition
Peer-to-peer mesh network. $10 nodes. Messages don't exist in transit. No server. No company. No identity. It's a walkie-talkie with math.
Protocol stack, power line communication, node build guide, security model. Grab it and go.