NFT types suggestions
In the nft module, there is the nft/types/nft.go file, which contains utilities for the nft type.
I have some questions/suggestions for these:
- As for point 5 in #159, why do we use
CollectionID,MetadataID, andSequenceNumberfor each NFT as the id? Is there a motivation? - The two functions
IsValidNftIdandNftIdToBytescould be merged in a single function with error if thenftIDis not valid, since they share a very important part of logic.
https://github.com/bitsongofficial/go-bitsong/blob/84691c819214a1f9b9dd844ea2b49b7ccc8ece1b/x/nft/types/nft.go#L19-L52
For 1st one, this was what @angelorc suggested. For 2nd one, I will make changes to use same codebase.
For 2nd one, it's done on this commit. https://github.com/bitsongofficial/go-bitsong/commit/6afb22c08474840168f31eed12907efc1d92bc3a
Yeah, for me, 2nd point is ok after commit 6afb22c.
With respect to the first point
As for point 5 in https://github.com/bitsongofficial/go-bitsong/issues/159, why do we use CollectionID, MetadataID, and SequenceNumber for each NFT as the id? Is there a motivation?
I talked with @angelorc and he said that such a suggestion was valid at the beginning. But giving a look to the other implementation, it could be better to use a global ID for metadata and a sort of "address" (a hash) for the collection.