NFT | Verification
Verify ownership of data NFTs
The goal of the NFT Kit is to provide a simple library and web service for NFT-based access management. Therefore the ownership of NFTs, aligned with OCEAN protocols specifications, must be verified.
The library provides a VerificationService which exposed the method dataNftVerification that takes the following parameter:
- chain: the EVM-compatible chain name or chain ID 
- factorycontractAddress: The address of the factory contract 
- erc721contractAddress: The address of the custom contract 
- account: The account to be verified 
- propertyKey: The NFT meta data property key that should exist 
- propertyValue: The NFT meta data property value that should exist 
Verify data NFT
The verification function is shown in the following screenshot.

A test deployment of the NFT kit and the oceanDao data NFT verification API can be accessed here https://nftkit.walt.id/nftkit/swagger#/NFT%20verification/OceanDaoVerification
    val chain= Chain.ROPSTEN
    val factorycontractAddress= "0x13d474cc837549cd8106d6b945cf591a32a84e88"
    val erc721contractAddress= "0x0310aC2748616Ce399Ba83051DdE35126807c4DE"
    val account= "0xf31fc0d18a24c6ae4225a0d4eeb709ac0a18e993"
    val propertyKey= "color"
    val propertyValue="green"
    val verififcationResult= VerificationService.dataNftVerification(chain, factorycontractAddress, erc721contractAddress, account, propertyKey,propertyValue)In the verification process, the NFT is fetched from the chain per contract and account address, and it is checked if it was created by the particular factory contract and if the properties match. Note the properties might be any key/value pair of the JSON-structure. Either of the main data or of the nested structures (e.g. traits). By implementing the property-based validation in this generic way the NFT kit is future proof for any modifications to the meta data.
Last updated
Was this helpful?
