When a user attaches a file,FileProvenanceTagsearches 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.FileOwnershipClaimhandles 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. RunsuploadAndMatch on mount, then:
- Found — shows the creator name (or match %) with an expandable bundle summary
- Not found +
onClaimprovided — showsFileOwnershipClaiminline - Not found, no
onClaim— shows a plain “No prior provenance” label - Loading — shows a spinner while searching
Props
onClaim callback
TheonClaim 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.
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
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.