Skip to main content

Module cid

Module cid 

Source
Expand description

Content identifiers (CIDs) for void objects.

Void uses a single canonical CID format for all content-addressed objects:

  • Version: CIDv1
  • Codec: raw (0x55)
  • Multihash: SHA-256 (0x12)

This is intentionally restrictive. Void does not support CIDv0, dag-pb, dag-cbor, or other IPFS CID variants. When fetching from IPFS gateways, CIDs are validated to match this format before any content verification.

The VoidCid newtype wraps cid::Cid and provides Display, eliminating the need for to_string() helper calls at every use site.

Structs§

VoidCid
A content identifier for void objects.

Constants§

CODEC_RAW
Raw codec for CIDv1 (0x55).
MULTIHASH_SHA2_256
SHA-256 multihash code (0x12).

Traits§

ToVoidCid
Extension trait that adds .to_void_cid() and .to_cid_string() to typed CID newtypes from void-crypto (CommitCid, MetadataCid, ShardCid, etc.).

Functions§

create
Creates a CIDv1 from raw bytes using SHA-256.
from_bytes
Parses a CID from raw bytes.
parse
Parses a CID from its string representation.
to_bytes
Converts a CID to its byte representation.
to_string
Converts a CID to its string representation.
validate
Validates that a CID uses void’s canonical format (CIDv1/raw/SHA-256).