
Enconomy
Two phones prove they're within close proximity, using sound and then ZKP
Demo
About
AI agents can now earn, own and pay each other with no human in the loop. What does it really mean to capitalism? They will own the means of productions? Once they hold the money, they steer what gets built and what values society prioritizes. I'm very concerned and afraid of that kind future. And I'm not alone. There are lots of papers about it too. We need to protect some of the human economic zones if AI will outperform us in most of them. IRL (In Real Life) activities are the most resilient for this. We need a way to prove IRL events onchain and use it as a gate. Eventually, we want a kind of money only humans can earn, spend, save, and invest. But AI agents will try to sneak into this economic zone once it starts to exist. They will try to get in as fake humans. Text, voices, faces and IDs can all be faked online but very hard to be faked IRL. Proximity ZKP is a new primitive for that. How? Two people standing close each other in the same room. Their phones can emit sounds and record. We can analyze and process the recordings to calculate the distance, provable. Related research: - Proximity Echo: https://ieeexplore.ieee.org/document/9488866/ - BeepBeep: https://www.microsoft.com/en-us/research/publication/beepbeep-a-high-accuracy-acoustic-ranging-system-using-cots-mobile-devices/ Why this wasn't possible before: - GPS and Wi-Fi location can be spoofed from software. - NFC and Bluetooth only prove "I heard the other device". A relay can carry that signal across a city, and nothing notices. - Ultrasound tokens (like Google Nearby) have the same problem: hearing a token is not being close. - True distance bounding needs tight clocks or special chips. Phones have neither: their audio clocks drift and their speakers add hidden delay. - Earlier acoustic approaches uploaded the raw audio to a server. That's a privacy leak, and the phone can still lie about what it recorded. What we do: Sound travels about 34 cm per millisecond, so any relay adds delay you can measure. Each phone plays a short tune with a secret code only it knows. Both record. Each phone finds four arrival times (itself and its partner, in both recordings). Combine them and the two clocks cancel out, leaving the flight time. Under 60 cm reads NEAR. Each phone signs its half with a hardware key (Android Keystore or iOS Secure Enclave). Then it proves the arrival math in zero knowledge, on the device, over a commitment to its recording. The audio, the location and the identity never leave the phone. On-device proving at this size only became practical recently: about 9 s on a Pixel 6. Presence shows two devices were close, not that two different people held them. World ID adds that: two unique humans, no names. ENS or any soft group identity can also work in specific use-cases (It's obvious to humans in IRL that the counter party is a real person or not) Examples of what it enables: - A Safe wallet with extension that only moves money when both owners stand side by side. Japanese traditional banks would love this. - ENS meeting names on Sepolia (ENSv2): every real meeting counts on your name.enconomy.eth. (EthGlobal NFC wristband but without the bands? *wink wink* ) - Privacy pool like Railgun but for in-person payments only, and an economy that runs on people actually meeting. The repository consists of the app, server, prover and contracts and some demos.
How it's made
Lots and lots of scientific paper reading and exploring! Most of the papers claiming that sound proximity calculation is possible did not really disclose how exactly. The most difficult part was getting to the first moment of a result with accurate measurement purely by the sounds! Then the ZK came like a nightmare. Full audio is too big to process by the zk circuit. Mobile hardware secure encrave/strongbox only supports a specific cryptographic algorithm and it made the number of the circuit constraints exploded. The app is Kotlin Multiplatform, one codebase for Android and iOS. It was easier to spike test and learn platform difference and device behaviors. All signal processing lives in common Kotlin: correlation against each phone's code, peak picking, and the arrival rule. Audio is native. On Android we use AAudio in MMAP mode to get honest timestamps; on iOS, AVAudioEngine. Pairing is an NFC tap (HCE on Android, Core NFC on iOS), with a QR fallback. The backend is FastAPI. It issues sessions, checks device attestation at enrollment, and combines the two signed transcripts into a verdict. The ZK part is a circom circuit proven with Spartan2 in a Rust crate that runs on the phone, called over JNI on Android and FFI on iOS. Witness generation goes through zkmopro's witnesscalc adapter. The proof covers the arrival math over a Poseidon commitment of the recording, bound to a credential tied to the phone's hardware key. The proving key is 470 MB raw; we ship it zstd-compressed at 12 MB and memory-map it while loading. A Pixel 6 proves in about 9 s. World ID: IDKit on the phone, verified on our server against the Developer Portal. The action is scoped per session, and the signal carries the session id and role, so a proof can't be moved to another meeting. Safe: a guard contract plus a P-256 owner module. The phones' existing hardware keys are the Safe owners, checked through the RIP-7212 precompile on World Chain Sepolia. No wallet app needed. ENS: a custom MeetResolver on ENSv2 Sepolia serves each name's counters as text records, computed live from the stored meetings. Our server relays the writes, so users never pay gas. Hacky bits: - The Pixel's speaker plays about 12.5 ms later than Android reports. No API fixes that, so we measure it once at enrollment and cap it at 50 ms. - iOS "Measurement" audio mode recorded about 35 dB quieter than we expected. We switched to VideoRecording mode. - We picked the tune by walking around with two phones. A bell jingle looked great until its own harmonics matched early and faked short distances.