Skip to content

Question: Creating action assertions that reference ingredients #102

Description

@kostiantynperehuda

The Specification says that some actions (e.g. c2pa.opened) must reference an ingredient that the action was performed on by the URI of the ingredient assertion. However, the api for adding ingredients to the manifest doesn't provide a way to get their URI once they were added.
Can you please provide any guidance as to how I can use the API to add such assertions into the manifest?
Thank you.

Activity

  1. tmathern commented on Oct 16, 2025

    @tmathern
    Collaborator

    Hello,

    The trick lies in how you handle the manifests you give to the builder.
    For instance, when you set the ingredient json, you can already set the relationship (see here).

    If you add an instance_id to the ingredient's JSON and reuse that instance_id in the action's IngredientIds array, the ingredient will properly be linked to the action by the SDK. I jsut wrote an example here: https://github.com/contentauth/c2pa-c/blob/651f673f9ff3244c4bf423bf57682f820cb43ac3/tests/builder.test.cpp#L1082-L1142

    Note that in the future there will be additional APIs to facilitate that.

  2. self-assigned this
    on Oct 16, 2025
  3. tmathern commented on Oct 16, 2025

    @tmathern
    Collaborator

    The ened version of the examples got merged into main branch here: https://github.com/contentauth/c2pa-c/blob/main/tests/builder.test.cpp#L1082-L1206

    Let us know if you have follow up questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions