Checking whether a TON NFT item belongs to a collection
An item contract can report the address of a well-known collection in its own metadata. A marketplace can verify the claim by querying the collection in the opposite direction.
Resolve the item index through the trusted collection
Read get_nft_data on the item and check that the item is initialized. For an item claiming collection membership, call get_nft_address_by_index on the expected collection with the returned index. Compare that address with the item being indexed. The fixture abbreviates three addresses to show a failed reverse lookup.
const claimed = { item: "contract-X", collection: "collection-C", index: 12n };
const addressAt12 = "contract-Y"; // result returned by the trusted collection
console.log(claimed.item === addressAt12);
Preserve the failed claim for diagnosis
If the lookup yields Y while the listed item is X, record the claimed collection, index and both addresses. Do not attach the collection’s verification badge to X. In production, compare parsed addresses in the same network context. A standalone NFT can have no collection address and should follow the standalone display path. Verified membership alone does not authenticate a third-party image host.