Labels: enhancement
buildGatewayUrl in the desktop bzz: handler can only ever produce one shape
of upstream URL (src/main/swarm/bzz-protocol.js:142, and the ENS branch at
:219):
url: `${antApiUrl}/bzz/${host}${parsed.pathname}${parsed.search}`,
Everything after the reference is treated as a path inside that manifest. So a
page served from bzz:// cannot reach any other Bee API route — notably
/chunks/<ref>, but also /bytes/, /feeds/, /soc/.
iOS does allow this
freedom-browser-ios routes reserved Bee API paths straight through
(Freedom/Freedom/BzzSchemeHandler.swift:259-294):
When the path looks like a reserved Bee API route (/bzz/<ref>,
/bytes/<ref>, /chunks/<ref>, /feeds/<owner>/<topic>, /soc/<owner>/<topic>),
route directly — this is how Swarm SPAs issue relative fetch('/bzz/<ref>/')
calls. Otherwise treat the path as a subpath inside the current origin's
manifest.
…with the discrimination in isBeeGatewayPath (:296). So the same page gets
different capabilities on the two platforms, and the iOS comment suggests
relative-fetch passthrough is considered normal for Swarm SPAs.
Why it matters
/chunks/<ref> is what makes client-side verification possible: fetch a
chunk, BMT-hash it, confirm it matches the reference you asked for. Without it a
page on bzz:// can only take the handler's word for what it received. On
desktop that's tolerable — the request goes to the user's own node — but it means
verification code can't be exercised on the platform where most development
happens, and a page can't offer the same guarantees across platforms.
Concretely this is the blocker for the verified read path in
swarmlite
(js/src/verify.js, js/src/index.js:33-40), which canopy could use to verify
its network index rather than trusting it (filed on canopy separately).
The awkward part
The two platforms currently block different halves of the same feature:
|
desktop |
iOS |
Range → 206 |
works |
dropped (filed separately) |
/chunks reachable |
no |
yes |
So neither platform supports both lazy range reads and client-side verification
today, and any page wanting both has to degrade per platform.
Options
- Mirror iOS: add an
isBeeGatewayPath-style branch. Simplest, and makes the
platforms consistent.
- Narrower: allow only
/chunks/<64-or-128-hex> — enough for verification
without opening the wider API surface.
- Deliberately not: if desktop's manifest-scoping is a security decision
rather than an omission, that's a reasonable answer — but then the iOS
passthrough is the bug, and it'd be worth saying so in one place so the next
person doesn't assume parity.
I don't know which of these is intended, which is why this is a question as much
as a request. Note that /chunks is GET-only and content-addressed, so widening
to it doesn't expose write or node-control surface.
Labels: enhancement
buildGatewayUrlin the desktopbzz:handler can only ever produce one shapeof upstream URL (
src/main/swarm/bzz-protocol.js:142, and the ENS branch at:219):Everything after the reference is treated as a path inside that manifest. So a
page served from
bzz://cannot reach any other Bee API route — notably/chunks/<ref>, but also/bytes/,/feeds/,/soc/.iOS does allow this
freedom-browser-iosroutes reserved Bee API paths straight through(
Freedom/Freedom/BzzSchemeHandler.swift:259-294):…with the discrimination in
isBeeGatewayPath(:296). So the same page getsdifferent capabilities on the two platforms, and the iOS comment suggests
relative-fetch passthrough is considered normal for Swarm SPAs.
Why it matters
/chunks/<ref>is what makes client-side verification possible: fetch achunk, BMT-hash it, confirm it matches the reference you asked for. Without it a
page on
bzz://can only take the handler's word for what it received. Ondesktop that's tolerable — the request goes to the user's own node — but it means
verification code can't be exercised on the platform where most development
happens, and a page can't offer the same guarantees across platforms.
Concretely this is the blocker for the verified read path in
swarmlite
(
js/src/verify.js,js/src/index.js:33-40), which canopy could use to verifyits network index rather than trusting it (filed on canopy separately).
The awkward part
The two platforms currently block different halves of the same feature:
Range→ 206/chunksreachableSo neither platform supports both lazy range reads and client-side verification
today, and any page wanting both has to degrade per platform.
Options
isBeeGatewayPath-style branch. Simplest, and makes theplatforms consistent.
/chunks/<64-or-128-hex>— enough for verificationwithout opening the wider API surface.
rather than an omission, that's a reasonable answer — but then the iOS
passthrough is the bug, and it'd be worth saying so in one place so the next
person doesn't assume parity.
I don't know which of these is intended, which is why this is a question as much
as a request. Note that
/chunksis GET-only and content-addressed, so wideningto it doesn't expose write or node-control surface.