Is it possible to display nft's belonging to users PID in my app?

I’m prob missing a fundamental understanding of NFT’s (on IC)! But is it possible to display NFT’s that a user owns in my app (that uses II)?

Perhaps querying canisters that hold the NFT registry and asset data, filtering by the owner’s PID, and then retrieving the necessary information to display the NFTs in my application?

Any pointers greatly appreciated :slight_smile:

1 Like

Are you using the DIP-721 standard?

If you are using the v2 version, it looks like these functions would help:

dip721_owner_token_metadata - This function seems to query the metadata of tokens owned by a specific owner.
dip721_owner_token_identifiers - This function seems to query the identifiers of tokens owned by a specific principal.

Here is an example of the full v2 implementation: DIP721/src/main.rs at develop · Psychedelic/DIP721 · GitHub.

1 Like

If you are using the ICRC-7 standard, there is a icrc7_tokens_of function: ICRC/ICRCs/ICRC-7/ICRC-7.md at icrc7-wg-draft · dfinity/ICRC · GitHub

1 Like

To clarify, yes, the principal that is used to connect to Internet Identity on the frontend will be different from the identity of the user who owns the NFTs.

  1. You could ask the user to input the principal that they used to purchase the NFT. This would “reveal” the identity of the user.

  2. As an alternative, you could not use Internet Identity as an authentication. You could require the user to authenticate with the same wallet as they used to get the NFT (ex. Plug).

1 Like

Thank you, that’s very helpful info I’ve not selected the standard I’m going to use yet, currently just validating ideas

1 Like

Hi there, this might be helpful: GitHub - bitfinity-network/DAB-js: JS library that wraps necessary methods to integrate DAB and its NFTs.
specifically the getAllUserNFTs function

1 Like

thanks. I’ve been looking at DAB too