2

I am trying to wrap my brain around the Tezos blockchain in regards to NFTs.

I am looking at 2 API's.

TzKT and Baking Bad, there are probably others.

I am totally missing the concept. If a person gives me wallet address, I assume that corresponds to an account address on Tezos. So I am looking at the API's in regards to accounts, and I can get token balances, but I do not seem to see a call that will allow me to list the NFT's (tokens) the person currently owns.

Any help would be appreciated.

Thank you

1 Answer 1

4

NFTs are tokens. When you query token balances from these API's, you are getting a mixture of Fungible and non-Fungible tokens back. Users can have more than 1 of the same NFT, so they also have a balance (think of a trading card game where you can get duplicates). I'm not aware of any API that returns a dedicated list of NFTs versus fungible tokens.

In terms of code/standards. The standard that enabled NFTs is called "Fa2". This added an extra property to the token standard called "TokenID". Non-fungible tokens use a combination of token contract address + tokenID to differentiate each individual NFT.

As an example, look at Pixel potus. Each NFT uses the same token address KT1abc123 but each type of NFT has a unique token ID

Address: `KT1abc123` + TokenID: `1000` = common George Washington
Address: `KT1abc123` + TokenID: `1001` = common John Adams
...
Address: `KT1abc123` + TokenID: `2000` = uncommon George Washington
Address: `KT1abc123` + TokenID: `2001` = uncommon John Adams
...
... and so on

I have seen at least one company use a combination of address + unique token ID to create multiple fungible tokens "grouped" together. So a non-zero ID doesn't necessarily correspond to an NFT either

To the best of my knowledge there is no sure fire way to detect an NFT, as there is nothing in the standard to say the metadata must include NFT: true. There really should be such a thing, but there isn't.

As a rough example, if you get a list of tokens the user owns from BCD / TzKT, query the metadata for each one and then check something like:

isNFT {
    return standard == "fa2" && decimals == 0 && artifactUri != null
}

You will get at least some good results, but i've not tested it against a wide variety of NFT's / tokens. To the best of my knowledge, no NFT has decimals, must be the FA2 standard and should contain a link to some artifact/asset for which the NFT is linked too.

Others suggest using API's to get a list of tokens from dex's like Quipuswap and simply say if the token doesn't appear on this list, theres a high probability its an NFT. This also has issues, as more dApps are being created, people are using other means to launch their tokens other than dexs, resulting in a lot of false positives.

1
  • Thank you let me investigate, I appreciate the info.
    – Bodger
    Jan 7, 2022 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.