Skip to main content

Module interchange

Module interchange 

Source
Expand description

Canonical serialization, content hashing, export and import.

The interchange format is a JSON Bundle: records with their full (or viewer-filtered) histories. Hashes are SHA-256 over the canonical JSON form: UTF-8, object keys sorted by code point, no insignificant whitespace, numbers and strings as produced by serde_json.

Imported bundles are untrusted: size limits, format/version checks, hash verification, origin policy, history replay and full validation are all applied before anything is written.

Structs§

Bundle
BundleEntry
ImportPolicy
Rules for accepting a bundle from elsewhere.
ImportReport

Enums§

Completeness
Whether a bundle carries complete histories or a viewer-filtered view.

Constants§

BUNDLE_FORMAT

Functions§

canonical_json
Serialize to canonical JSON bytes.
content_hash
SHA-256 of the canonical JSON form.
export
Export records (and their histories) as viewer may see them. Records the viewer cannot see are silently omitted.
import
Import a verified, complete bundle. Events already present (same event id at the same position) are skipped, so re-importing is idempotent and a newer export of the same records only appends what is new.
parse_bundle
Parse and verify an untrusted bundle without writing anything.
verify_bundle