My office as entropy
4 min read
Turning my office's environmental data into verifiable randomness.
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.
50 wave machines running in unison to produce entropy, used to secure the web.
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. |
I've been using the values for an ongoing visualization project, which can be viewed here: https://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 unreproducible (you'd need the exact same readings in the exact same order), deterministic (same data, same secret), and privacy-preserving (reveals 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 promises: I know the master secret without revealing it, I used real sensor data without exposing the readings, I processed everything through the correct algorithm, and nothing got tampered with. 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
Everything works. You can go to the site and generate verifiable randomness powered by whatever's happening in my office at that moment. The full pipeline from sensors to ZK proof to blockchain is running and has processed hundreds of proofs.
I keep thinking about a network of sensor operators contributing entropy to a shared pool. Cross-chain bridges for randomness on other blockchains. Batching proofs together, recursive proofs to compress things further. Maybe someone defines standards for environmental randomness beacons.
LavaRand and Chainlink VRF already provide APIs at scale. Dust particles, air currents, and temperature swings as a randomness source feels different. Entropy is everywhere.
Whatever someone builds next will be random in its own right.