POST {server}/api/PublishBlobs is the one write endpoint of a Seed site that Seed Exact uses. The app builds content-addressed blobs, signs them on the device with an identity's Ed25519 key, and uploads them. The server needs no session or token: the signatures inside the blobs are the authorization. Two features write this way: comments (Discuss) and profile edits (Profile).
Request
POST {server}/api/PublishBlobs
Content-Type: application/cbor
Accept: application/json
DAG-CBOR of {blobs: [{cid?: string, data: bytes}, ...]}The body is encoded with the app's own CBOR encoder (src/crypto/cbor, see Crypto: vendored CBOR and gzip codecs). data is the blob's bytes; cid is included when the builder supplies one and omitted otherwise. Both callers use the same mapping: b.cid ? {cid: b.cid, data: b.data} : {data: b.data}.
Deadline: exactTimeout: 15000 in both callers.
The call is a direct fetch, not the read client, because that client is GET only.
{server} has trailing slashes trimmed. For comments it is readContextServer (the server of the visible reader); for profiles it is the configured server.
What gets signed
Caller | Blobs, in order | Builder |
|---|---|---|
One |
| |
A genesis Change (only for a home that does not exist yet), a Change with |
|
A Comment blob carries type: "Comment", body (blocks), space (the target account's key bytes), path, version (the document's head CIDs), optional replyParent and threadRoot CIDs, signer, ts and sig. The profile Ref carries the space, an empty path, the genesis, the new head and the generation. The Bun test for profiles shows the Ref blob is sent without a cid. The exact encodings and signing rules are documented in Crypto: changes, refs, comments and profiles and Crypto: primitives and key derivation.
The signer is always built the same way: signerFor(store, account) from Identity gives the key, and the caller adapts it to {principal: principalFromEd25519(publicKey), sign}.
Time
Blob timestamps are not read in the data module. The Contract action computes time.epochAtZero + performanceNow() and passes it as nowMs; both callers use Math.round(nowMs). See State, refresh and stale-reply patterns. The app does not enforce a time window here, and none is visible in the app's code or mocks for this endpoint.
Reads before a write
Both callers read current state first, through the read API, so the blob references real versions:
Comment: Resource for the document's version; for a reply, Resource for the parent comment (its version and threadRootVersion).
Profile: Resource for the home document, then ListChanges to compute genesis, heads, depth and generation. Anything other than a clean document or not-found refuses the save, so a network failure can never create a second home.
Responses
Only the HTTP status is relied on.
Caller | Non-2xx handling | After success |
|---|---|---|
Comment |
| Derive the comment id from the blob ( |
Profile |
| Re-read |
Thrown errors (offline, timeout) become Couldn't post: {message} for comments and the raw message for profiles. Neither caller retries, and a failed post keeps the person's draft.
In tests
Contract write tests use https://dev.hyper.media with the public BIP39 test-vector identity: one in discuss.test.contract (a comment and two replies), one in profile.test.contract (two saves). app.ts lists net.fetch https://dev.hyper.media for them. Both files state that they never write to production.
profile.test.contract uses fail fetch "https://dev.hyper.media/api/PublishBlobs" to prove a failed upload keeps the form.
The local test server forwards only GET requests to hyper.media, so a publish to it cannot reach production. In the thread scenario of the mock notify service, POST /api/PublishBlobs answers 409 {"error": "Reply received by local fixture"}, which open-site-activity.test.contract asserts in the composer.
Bun tests decode the uploaded CBOR: the discuss test checks the signed reply's replyParent, threadRoot, version and path and the 15000 ms deadline; the profile test verifies every blob's signature (discuss load.test.ts, profile profile.test.ts).
Known limits
No media upload: comments have no attachments and profiles cannot set an icon.
Documents cannot be created or edited from the mobile app; only comments and profile metadata are published. See Current limits and known gaps.
User stories
The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).
US-DISC-03 Comment on a document: POST /api/PublishBlobs with DAG-CBOR
US-DISC-04 Reply in a thread: POST /api/PublishBlobs
US-ID-07 Edit my public profile: The PublishBlobs request and its responses
US-APP-09 Know the app only reaches what it must: Signed blobs published without transport credentials
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime