Layer 5 · §21 transport & push
Canonical reference:
digstore-remote(axum server + reqwestDigClient) and its crypto/codec indigstore-core/digstore-crypto. This is the transport half of the scheme split:chia://= content addressing;dig://here = the §21 transport locator. Browser/agent reads use the POST JSON-RPC; CLI/peer sync + publishing use these authenticated REST routes.
Under the dual-transport tier model: the §21 GET content routes (content / proof / roots / descriptor) are on the PUBLIC READ tier — anonymous, CORS-enabled, browser-reachable, client-verified, decoy-on-miss. The §21 PUSH / WRITE routes (module/upload, module PUT, module/complete, tombstone) are on the PEER / CONTROL tier — mTLS-authenticated plus the per-request BLS signature below, and never reachable anonymously. See the tier map.
The dig:// transport locator
dig:// is not spoken on the wire — it resolves client-side to https://<host>/stores/<id> (config.rs:89). The 32-byte store id is the wire address.
| You write… | Resolves to… |
|---|---|
dig://<64hex> | https://rpc.dig.net/stores/<64hex> |
dig://<user>@<64hex> | same (user stripped — informational only) |
dig://<host>[:port]/<64hex> | https://<host>[:port]/stores/<64hex> |
dig://<host>/stores/<64hex> | passthrough |
The REST surface (under /stores/:id)
descriptor, roots, module (GET/HEAD/PUT), module/upload + module/complete (the 2-leg push), content, proof, delta, tombstone (router server.rs:66-117). Middleware order: auth THEN rate-limit (an unauthenticated request is rejected before consuming a token). Status mapping (§21.8): UnknownStore/Root = 404, Unauthorized = 403, AuthFailed/MissingBearer = 401, NonFastForward = 409, TooLarge = 413, Validation = 422, RateLimited = 429. A content miss is never 404 — 200 + decoy.
Wire envelope: JSON outer / Chia-codec inner
REST metadata (descriptor/roots/delta) is JSON for ergonomics; all content/proof/key-table blobs stay Chia-custom-streamable-codec encoded and base64-wrapped inside the JSON (lib.rs:3-7). The codec is big-endian fixed-width (codec/mod.rs:3-4), matching Chia framing: uintN BE; Option<T> = 1 tag byte + T; Vec<T> = u32 BE count + items; String = u32 BE byte-length + utf8; Bytes32/48/96 raw, no length prefix. The same codec frames the MerkleProof on the wire.