home iammatthias menu

My office as entropy

On this page

I was in the shower around 5am on Labor Day, watching the soapy water swirl and run down the drain. It reminded me of sea foam, and my thoughts drifted from waves to Nazaré before settling on Chaos in Lisbon. Cloudflare uses 50 wave machines moving in unison to produce entropy for securing the web, an unusually literal collision of form and function.

On January 2nd, 2025 I started tracking the conditions of my home office using a Raspberry Pi 0 W 2 and a Waveshare Environment Sensor HAT (ESH).

Sensor Measurement Range / Specs
TSL25911 Ambient Light 0 ~ 88,000 Lux
BME280 Temp/Humidity/Pressure -40 ~ 85 °C (±1 °C); 0 ~ 100 %RH (±3 %RH); 300 ~ 1100 hPa (±1 hPa)
ICM20948 Motion (9-DOF) Accel: ±2/4/8/16 g; Gyro: ±250/500/1000/2000 °/s; Mag: ±4900 µT
LTR390-UV-1 UV 280 ~ 430 nm wavelength
SGP40 VOC 0 ~ 1,000 ppm ethanol eq.; <10 s response; <60 s startup; on-chip humidity comp.

The readings also feed an ongoing visualization at office.pure---internet.com.

This was an opportunity to dig deeper into ZK. The documentation for tooling like Circom and Noir keeps improving and LLMs close the gap fast. I had a shower thought, Claude Code, and Cursor.

I picked Circom. Noir's backend-agnostic approach was tempting and the docs felt slightly more approachable, but the Barretenberg prover has issues on ARM.

329k rows → single seed

The master secret is the foundation of this system. The pipeline runs over 329,000+ sensor readings collected since January 2nd, with measurements from six environmental sensors (ambient light, temperature, humidity, pressure, UV, VOC).

The historical data gets chunked into windows of 100 readings. Each window collapses to a fingerprint built from mean, variance, and min/max across the sensors. Poseidon hash (ZK-friendly) turns each window into a deterministic value. Iterative hashing across all the window fingerprints produces a single 256-bit master secret.

The master secret is impractical to reproduce without the exact readings in the exact order, deterministic for the same input, and designed to reveal nothing about the underlying values.

The pipeline also pulls frequency patterns out of the motion data. Vibrations from passing trucks, footsteps, or the washing machine leave signatures that are nearly impossible to replicate.

Generation combines the master secret (hidden), a user-provided seed (public), and a timestamp, so every output is unique.

The result is a ZK proof that says "this randomness came from real sensor data, processed correctly," without exposing my office. Reusing the same seed produces different randomness, because my office is always changing.

Building the proof

The proof makes four claims: I know the master secret without revealing it, I used the committed sensor data without exposing the readings, I processed it through the specified algorithm, and the result was not altered afterward. A digital wax seal.

The secret inputs (sensor readings, master secret, intermediate calculations) stay locked. The public inputs (seed, timestamp, final random number, sensor data fingerprint) are open for anyone to verify.

Keeping receipts

These proofs are small, about 2KB each. I use IPFS through Pinata to store them, and when a proof is generated and uploaded the CID and random number are stored onchain.

The whole thing lives at 0xCf5Ea3Acb389b8a89935BD542273290F05f3054D on Base Sepolia testnet.

What's next

The pipeline is running and has processed hundreds of proofs. A request produces verifiable randomness from whatever is happening in my office at that moment, then carries the proof through IPFS and Base Sepolia.

I keep thinking about a network of sensor operators contributing entropy to a shared pool, with batched or recursive proofs compressing the output and bridges carrying the result elsewhere. That would require standards for what an environmental randomness beacon actually promises.

LavaRand and Chainlink VRF already provide randomness at scale. This version is one office, six sensors, and a proof small enough to pin to IPFS.

collection
posts
rkey
1756826230035-my-office-as-entropy
record cid
bafkreieiymtmfagv4rgotmt6dvfhit6pdfkugjqiiis4m4smxnlwery3pq
record
https://content.farfield.systems/api/entries/1756826230035-my-office-as-entropy
created
updated