Skip to content

Conversation

koofree
Copy link

@koofree koofree commented Aug 30, 2025

Overview

This PR contains the following change(s):

  • Added blockchain information display for NFT assertions: Implements support for displaying blockchain transaction details from the c2pa.nft assertion in the Content Credentials verification UI
  • External blockchain explorer links: Users can now click "View on Explorer" to navigate directly to the blockchain transaction on the external explorer
  • Multi-language support: Added translations for blockchain-related UI elements across all 21 supported languages

Key Features

  • Extracts and displays NFT information including:
    • Token ID
    • Blockchain network name and type (mainnet/testnet)
    • Transaction hash (truncated for display)
    • Direct link to blockchain explorer
  • Handles both standard c2pa.nft assertions and indexed variants (e.g., c2pa.nft__1)

Technical Implementation

Files Changed

  • src/lib/selectors/nftInfo.ts - New selector to extract NFT data from C2PA manifest assertions
  • src/lib/selectors/nftInfo.spec.ts - Comprehensive unit tests for NFT selector
  • src/routes/verify/components/DetailedInfo/ProcessSection/BlockchainSection.svelte - New component for displaying blockchain information
  • src/routes/verify/components/DetailedInfo/ProcessSection/ProcessSection.svelte - Integration of blockchain section
  • src/lib/asset.ts - Added NFT info to manifest data structure
  • locales/*.json - Added translations for all 21 language files

Assertion Structure Support

{
  "label": "c2pa.nft",
  "data": {
    "token_id": "9",
    "blockchain": {
      "name": "firmachain",
      "network": "testnet",
      "chain_id": 1337
    },
    "explorer_url": "https://explorer-testnet.firmachain.dev/transactions/...",
    "transaction_hash": "488714A76188BCE587697FD7E27A3EAD2F1BCDF2E47D9E30B6A1C5B6784CA4FA"
  }
}

Checklist

  • End-to-end or unit tests (where applicable) have been added that cover this change/bug fix
  • Any UI changes display properly on mobile breakpoints
  • Any user-visible strings have accompanying translation tags
  • Accessibility support has been added
  • Analytics are being sent (where applicable)

Issue link (optional)

@koofree
Copy link
Author

koofree commented Aug 30, 2025

This update is written to help you understand how to add this to the tool. But, I know it needs to consider the standard documents before this happens for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant