Skip to main content
When a user attaches a file, FileProvenanceTag searches the provenance system in the background and shows one of three states: found (the file is known), not found (the file is new — show ownership claim), or loading. FileOwnershipClaim handles the not-found state: it asks the user whether they own the file, records it on-chain, and returns the CID.

FileProvenanceTag

Shows below an uploaded file attachment. Runs uploadAndMatch on mount, then:
  • Found — shows the creator name (or match %) with an expandable bundle summary
  • Not found + onClaim provided — shows FileOwnershipClaim inline
  • Not found, no onClaim — shows a plain “No prior provenance” label
  • Loading — shows a spinner while searching

Props

onClaim callback

The onClaim callback receives a boolean: The callback must return { cid: string; status: "claimed" | "referenced" }. The returned CID should be included as inputCids on any downstream provenance action.

FileOwnershipClaim

A standalone component that shows the ownership question, handles loading and success states. FileProvenanceTag renders this automatically in the not-found state when onClaim is provided — but you can also use it directly.
States rendered:

Props


Full Integration Example

Here is the full integration pattern used in the PK Chat example app:

1. Upload route stores file to IPFS and returns a CID

2. Claim route records ownership in ProvenanceKit

3. AttachmentChip wires everything together

4. CID flows into the AI response provenance action

The provenance graph then shows the full chain:

Ownership Semantics

Both cases result in a CID that can be referenced in downstream provenance actions. The difference is the action type and whether a human creator entity is recorded alongside the resource.
Ownership is asserted, not verified. ProvenanceKit records the assertion — trust is established by the completeness and consistency of the provenance graph over time.
For files that already have a 100% match in the system (returned by FileProvenanceTag), no ownership claim is needed — the existing CID should be reused directly as an inputCid.