Tunnel

Arkiv through firewalls and offline

Visit Repo
Tunnel banner

About

## Challenges I ran into

- **Offline signing with the real SDK.** `createEntity` reads the head block before signing, which an offline device can't do. Reading the SDK source showed that `ExpirationTime.fromDays(n)` goes on the wire as a lifetime *relative to the inclusion block*, so the head is only a sanity check. We answer it locally in a no-network transport (the test asserts `fetch` is never called) and refuse absolute expiries. A notice carried three days later still lives its full 90 days. - **Making relay answers comparable.** Honest relays return entities and attributes in different orders, and the head moves between calls. We canonicalise the raw RPC results (sort by key and attribute name, lowercase hex, stable JSON) and pin `atBlock` for every relay. - **Read-your-writes.** Our first live write read back as empty, because reads were pinned 2 blocks behind the head, below the write. The transport now never pins below a block it has seen a receipt for. - **Rate limits.** The anonymous `arkiv_query` budget was already exhausted at our first query (HTTP 429 with a body that isn't JSON-RPC shaped), and it is per IP, which is exactly what a relay is. Relays now hold an Arkiv Hub key as a secret, and the client rotates on 429 using `Retry-After`. - **SMS-sized transactions.** A signed create is 2.3 KB of mostly ABI zero padding (17 SMS). Deflating it gets it to about 530 characters: 4 SMS, or one QR code. - **Live registry updates.** WebSocket entity events carry only keys, so spotting a *new* relay means re-querying after every create on the whole testnet (80 events in 70 s). We debounce, and filed it in friction.md with a suggested fix.

## The problem it solves

**"Read it from Arkiv, not from our backend" fails for two groups of people:**

  • **People whose network blocks the Arkiv RPC domain:** national firewalls, campus and office filters, carriers. Block one domain and every Arkiv app goes dark, however decentralised the data is.
  • **People with no connection at all:** shutdowns, disasters, SMS-only phones. They can neither write to Arkiv nor check that a copy of Arkiv data someone hands them is genuine.

**Tunnel** is a viem transport plus tiny stateless relays. Change `transport: http()` to `transport: tunnel(relays)` in any Arkiv dApp, and every user of that app gets:

  • **Writes through relays that can't alter them.** The tx is signed on the device and sent to every relay at once (Cloudflare Workers and Vercel today). One honest, reachable relay is enough.
  • **Reads that catch lying relays.** The same query goes to several relays pinned to the same block (`atBlock`), and canonical result hashes are compared. The minority is flagged and dropped; with no majority, nothing is shown.
  • **Offline writes.** Sign with a pre-funded one-shot "stamp" in airplane mode and hand it over as a QR code, a file or 4 SMS. Any carrier can broadcast it, and `$creator` stays the author, never the carrier.
  • **Offline reads.** A *certified copy* is a snapshot at one block that independent witnesses re-read, sign and attest to on Arkiv. A single 64 KB HTML file verifies it with no network; change one byte and it turns red.
  • **A relay registry that keeps itself honest.** Relays are Arkiv entities with 2-hour leases, renewed hourly with `extendEntity` only while healthy. Dead relays disappear on their own.

Why not a VPN? It needs every user to install something, it is itself blocked or criminalised in places, and it does nothing offline.

Screenshots

Tunnel screenshot 1Tunnel screenshot 2Tunnel screenshot 3Tunnel screenshot 4Tunnel screenshot 5

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.