RPChttps://rpc.vitruveo.ai
Chain ID1490
CurrencyVTRU
Protocol Smart Contract
Go To:

Content Credentials

On-chain C2PA provenance verification for stored files0x00000000000000000000000000000000000000ca2,000 + 5,000/signature

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

// IContentCredentials.sol from contracts/c2pa in the Vitruveo protocol repo.
import {IContentCredentials} from "./IContentCredentials.sol";

contract VerifiedGallery {
    IContentCredentials constant C2PA = IContentCredentials(0x00000000000000000000000000000000000000ca);

    mapping(bytes32 => bool) public listed;

    /// List an artwork only if its Content Credentials were verified on chain
    /// and are still valid (no later revocation, anchor not removed).
    function list(bytes32 fileHash) external {
        (bool valid, , , string memory signerName, , , , ) = C2PA.provenance(fileHash);
        require(valid, "no valid provenance");
        require(bytes(signerName).length > 0, "unsigned");
        listed[fileHash] = true;
    }

    /// Signer fingerprints of each manifest in the verified store, oldest first.
    function history(bytes32 fileHash) external view returns (bytes32[] memory) {
        return C2PA.lineage(fileHash);
    }
}

Why It Matters

C2PA Content Credentials record who created or edited a piece of media and how. This precompile verifies a C2PA manifest store on chain against an on-chain trust list and records the result for a file in File Storage (0x00000000000000000000000000000000000000f1). Any contract can then read the provenance and lineage of an artwork.

Flow

For an artwork with embedded Content Credentials (JPEG or PNG):

  1. Upload it with IFileStore.beginWithCredential, passing the byte range of the embedded manifest store as the exclusion. The file store computes the content hash (file without that range) during upload.
  2. Send verify(fileHash, manifestStore) as a direct transaction (calldata costs 2 gas per byte). It checks every claim signature, assertion hash and ingredient link, that the active signer chains to a trust anchor with all certificates valid and unrevoked at the block time, and that the manifest's data hash equals the file's content hash. The result is stored.
  3. Contracts read provenance(fileHash) / lineage(fileHash).

check(manifestStore) verifies a manifest store without a stored file and without recording anything. provenance() returns valid = false if a certificate on the recorded path was later revoked effective at or before the verification time, or the anchor was removed.

Supported

  • COSE ES256/384/512, PS256/384/512, EdDSA
  • Claim v1 and v2
  • c2pa.hash.data bindings with SHA-256
  • Not supported yet: hash.bmff (MP4/HEIC) and timestamp-authority tokens (certificates are checked at block time)

Trust List

The trust list (anchor certificates and revocations) is changed only by the admin, initially a 2-of-2 native multisig wallet created by setupAdmin() (anyone can call it once; owners are fixed in the node). Admin calls go through IMultisig.execute with this precompile as the target. The admin can hand control to another address with setAdmin(). Fingerprints are the SHA-256 of the DER certificate.

On mainnet the admin is the 2-of-2 multisig 0x71db0c3Df067C0f0b4a81119b1D239BdCa7c94ca, and the trust list holds one anchor: the Vitruveo Content Credentials Root CA (fingerprint 0x66e2bfd431681a9a42d5f8a4a06e7656006bc383db81b7f7d435e49a38c5ab49). Manifests signed with the Vitruveo signer certificate (ES256, issued by that root) pass check() and verify(). Manifests signed with any other certificate, including c2patool's built-in test certificate, revert with "signer not trusted". The root and signer certificates are published in the protocol repository under contracts/c2pa/certs.

Gas

Every call                       2,000 + 1/byte of input
Hashing beyond the input         1 per 32 bytes
Signature checked                5,000 (claims and certificates)
Storage slot written             5,000
View                             2,600

Interface

interface IContentCredentials {
    event AdminChanged(address indexed admin);
    event AnchorAdded(bytes32 indexed fingerprint);
    event AnchorRemoved(bytes32 indexed fingerprint);
    event Revoked(bytes32 indexed fingerprint, uint256 effectiveTime);
    event Unrevoked(bytes32 indexed fingerprint);
    event ProvenanceVerified(bytes32 indexed fileHash, bytes32 indexed signer, bytes32 anchor);

    // Admin
    function setupAdmin() external returns (address wallet);
    function admin() external view returns (address);
    function setAdmin(address newAdmin) external returns (bool);
    function addAnchor(bytes calldata derCertificate) external returns (bytes32 fingerprint);
    function removeAnchor(bytes32 fingerprint) external returns (bool);
    function revoke(bytes32 fingerprint, uint256 effectiveTime) external returns (bool);
    function unrevoke(bytes32 fingerprint) external returns (bool);
    function isAnchor(bytes32 fingerprint) external view returns (bool);
    function revokedAt(bytes32 fingerprint) external view returns (bool revoked, uint256 effectiveTime);

    // Verification
    function verify(bytes32 fileHash, bytes calldata manifestStore) external
        returns (bytes32 signer, bytes32 anchor, string memory signerName, string memory claimGenerator, uint256 manifests);
    function check(bytes calldata manifestStore) external view
        returns (bytes32 signer, bytes32 anchor, string memory signerName, string memory claimGenerator,
                 uint256 manifests, bytes32 dataHash, uint256[] memory exclusionStart, uint256[] memory exclusionLength);
    function provenance(bytes32 fileHash) external view
        returns (bool valid, bytes32 signer, bytes32 anchor, string memory signerName, string memory claimGenerator,
                 uint256 manifests, uint256 blockNumber, address verifiedBy);
    function lineage(bytes32 fileHash) external view returns (bytes32[] memory signers);
}

Source: contracts/c2pa/IContentCredentials.sol in the Vitruveo protocol repository.