The field guide to Physical AI & the intelligent city

Building the
City of Bits.

By Vlad M. Trifa — MIT / ETH PhD, co-author of Building the Web of Things (O'Reilly, 2016). Every build in this book has been run on real hardware.

12 chapters9 builds~400 pagesPDF + ePub · DRM-free
Building the City of Bits — book cover
The offer
Free sample
€0
Chapter 1, complete
CityScope builds on GitHub
Newsletter — every Thursday
Founding 500 Patron — annual
€99 €49/yr
Everything in The Book
All book updates while subscribed (not just writing phase — continues after launch)
Exclusive Deep Dives articles
Skill packs (datasets, MCP servers, starter repos)
Video lectures (chapters walked-through)
Private Discord channel (#patrons)

Yearly only · €49 for the first 500 patrons · then €99

Refer 3 builders · unlock chapters 2–4 free

Share City of Bits with three people who build in the physical world. When each one subscribes (free is enough), chapter 2 unlocks for your first, chapter 3 for your second, chapter 4 for your third. No Digital purchase needed — the referral IS your free path.

Get your referral link
What's inside

12 chapters across four parts.

CityScope

9 progressive code builds. Every one runs.

01

Pi + SEN55 sensor → live PM2.5 page

node:http · sensor.ts · zero npm deps
Chapter 02
02

LoRaWAN uplinks via The Things Network

mqtt · TTN topic schema · simulator included
Chapter 03
03

City data bus — Mosquitto + SQLite + live map

node:sqlite · SSE · Leaflet · docker compose --profile sim
Chapter 04
04

First civic agent → Telegram alerts

PSI thresholds · Singapore deployment
Chapter 05
05

MCP server — natural-language sensor queries

Model Context Protocol · tool descriptions · WoT bridge
Chapter 06
06

Two A2A agents coordinating

Shenzhen PCB-coordination scenario · A2A v1.2
Chapter 07
07

Pi AI HAT+ edge inference → anomaly map

Hailo · BanjirWatch flood model · MQTT labels
Chapter 08
08

DePIN node + token reward dashboard

ATECC608B attestation · NodeRegistry contract · 3-tier rewards
Chapter 09
09

x402 priced endpoints + auto-paying agent

HTTP 402 · revenue counter · Málaga SolarStream scenario
Chapter 10
Vlad M. Trifa
“This is not a theoretical book. Every build in it has been run on real hardware — it breaks where reality breaks.

Fifteen years across MIT, ETH Zürich, EPFL and two exited startups. There's a lot more — the full story, the other work, and how to get in touch — on my personal site.

PhD — MITPhD — ETH ZürichMSc — EPFLCo-founder, EVRYTHNG ($85M+, acquired)
Learn more at vladtrifa.com
Questions

Honest answers.

What formats? Is it DRM-free?
PDF and ePub, both DRM-free, both included in every digital purchase. Print is sold separately via Amazon KDP (~€40, link on this page once it lists).
What if the protocols change after I buy?
Lifetime updates for digital buyers. Protocols like MCP, A2A, and x402 are still moving — when a meaningful change lands, you'll get the revised chapter in your account.
Is the code on GitHub?
Yes. github.com/city-of-bits/cityscope — MIT-licensed, runs in simulation mode with zero hardware.
Do I need a Raspberry Pi to follow along?
No. Every build has a simulator that runs on any machine with Node 24 + Docker. A real Pi + SEN55 (~€45 total) makes Build 1 satisfyingly tangible, but it's optional throughout.
Can I buy for my team?
Yes — team license is €99 for five seats. Email [email protected] with your invoicing details and we'll get you set up.
Why is Chapter 1 free?
Because the only way to know whether the voice and depth are right for you is to read a chapter. If Chapter 1 doesn't earn the rest of the book, the rest of the book won't earn it either.