MeshKit
Concepts

Proofs And CIDs

How MeshKit verifies integrity and records provider operations.

A MeshKit CID identifies encrypted envelope bytes or an encrypted stream manifest. It is not a plaintext hash of your application content.

Proofs record how a provider handled that CID: provider name, byte count, envelope version, algorithms, operations, timestamps, and verification state.

CID Flow

MeshKit verifies the returned bytes before it decrypts. If the bytes do not match the expected CID, the read fails before plaintext is returned.

What A CID Proves

ClaimDoes a CID prove it?Notes
These exact encrypted bytes were addressedYesThat is the content-addressed property
The plaintext has a specific valueNot by itselfMeshKit encrypts before storage
The provider is healthyNoUse doctor checks and provider validation
A recipient is authorizedNoAuthorization is checked through identity, capsule, policy, vault, or capability state
Filecoin retrieval is guaranteedNoDeal state and retrieval behavior are separate

Proof Records

Use proofs when you need operational evidence:

const file = await mesh.files.put("report.txt", "private report");
const proof = await mesh.proofs.get(file.cid);

console.log({
  cid: file.cid,
  provider: proof.provider,
  verified: proof.verified,
});

Proofs are useful for debugging, audit trails, and validating production environments. Store proof summaries when later audit matters, but do not treat proofs as plaintext evidence.

Gateway Retrieval

Gateways can return bytes for a CID, but MeshKit should still verify the bytes before decrypting. A gateway response is useful only after the returned bytes match the expected CID and the metadata boundary can authorize the open.

Common Mistakes

  • Treating a MeshKit CID as a hash of plaintext.
  • Copying a CID between environments without copying the required MeshKit metadata.
  • Trusting a gateway response before CID verification.
  • Treating an active Filecoin deal as a retrieval guarantee.
  • Dropping proof summaries when later compliance or support workflows need them.

Failure Modes

SymptomMeaningAction
CID verification failsReturned bytes do not match the requested CIDCheck provider or gateway integrity
Proof missingMetadata service does not know this CIDConfirm the same MeshKit provider boundary created it
Decryption fails after verificationCurrent identity cannot unwrap the keyCheck identity or share capsule
Proof exists but read failsBytes and metadata are out of syncValidate storage, gateway, and metadata retention

Next Steps

On this page