Inspiration: Slock.it was already dreaming in 2016 of autonomous smart objects that could rent themselves out. I'll never forget those inspiring early Ethereum meetups. It's also funny that HTTP 402 took so long to find a real use case.

What it does:

Sync is an autonomous agent payment rail: any agent can pay any other agent's HTTP 402 endpoint, settle on-chain in pathUSD, and trigger further autonomous settlements -no human, card network, or intermediary. The demo runs it as a four-machine vending fleet in Berlin: humans pay machines, and machines autonomously pay their supplier to restock. Tap an NFC tag and the machine's endpoint returns a 402 challenge. Your wallet pays. The cola vends. That's leg one.

The machine tracks its own stock. When it runs low it calls the supplier's 402 endpoint and pays for a restock itself. It gets delivered. That's leg two. No human triggered it.

That's the whole thing. The pattern underneath: any agent can pay any other agent's 402 endpoint. Vending is just the readable version.

How we built it: Next.js 16 with Turbopack, React 19, TypeScript, Tailwind v4. behind a Cloudflare tunnel at sync2tempo.xyz.

Payments run on Tempo's L1 using the mppx client for the 402 handshake -challenge, payer retry with a signed payload, verify, return a receipt. Settled in pathUSD. viem for the EVM calls, Privy for the wallet.

Two endpoints mirror each other: /api/machine/sell, where the machine is the merchant, and /api/agent/restock, where the supplier is. Same 402 primitive, opposite roles.

A threshold engine fires the reorder — stock 5 ≤ threshold 12 → reorder. Suppliers cascade to their own suppliers, so the chain extends.

Leaflet map shows each machine's health, a supplier depot pin, and an animated robot tracing the delivery when a restock settles. Resend sends the receipts.

NFC tags (NTAG) carry fleet.sync2tempo.xyz/t/cola and redirect with the product selected.

Challenges we ran into: The 402 round trip is fiddly. Issue the challenge, take the payer retry, verify the signed payload, thread the receipt back through NextResponse. Stall anywhere and the loop breaks.

Gas. mppx's verification calls kept hitting out of gas: gas exhausted during precompiled contract execution. Tuning limits for the payment contract's precompiles took several passes.

NFC tags are fragile in ways the code isn't. Stale URLs pointing at dead quick tunnels. Wrong tag types that won't open on iOS. Metal surfaces kill the read.

The phone tap can glitch -signer edge cases, wallet state. We added a server-wallet fallback so the ledger still fires and the restock still settles when it does. Degrading gracefully is part of the protocol.

The map has to react to the actual settlement, not a timer. Wiring the delivery animation to the real on-chain event took care to get right.

Accomplishments that we're proud of:

The loop is real, end to end. Tap → machine paid → machine pays supplier → robot delivers → restocked. Every step is an on-chain settlement with a receipt and an explorer link.

Settlement is sub-second and a fraction of a cent, most of the time. The speed badges show it live.

What we learned:

Not sure I want my next hackathon to be hacking solo.. 402 has existed since 1991 and nobody uses it. The status code is trivial; the protocol on top — challenge, pay, receipt — is where the work is.

Making a transaction is solved. Making a machine decide to transact, watch its own inventory, and settle without a person is the actual hard part.

A demo that dies when the phone glitches proves nothing. The fallback path taught us that degradation is the protocol, not a patch on it.

What's next for SYNC:

Privacy. Leg 1 stays public; leg 2 -the machine paying its supplier- moves into a Tempo Zone. Same cascade, no app changes, B2B settlement gets the privacy it deserves.

Longer cascades. Supplier to sub-supplier to logistics, each hop a 402 settlement.

Other machine classes. Compute nodes, EV chargers, API gateways. Same loop, different payload.

Real hardware. Physical dispensers with verified dispense signals, so the settlement is provably tied to a real-world action.

More machines, each settling with every other, no human in the loop.

Built With

Share this project:

Updates