Last active
July 20, 2023 14:57
-
-
Save sidarth16/12dc23f53c48fbbcf18644c935c770b1 to your computer and use it in GitHub Desktop.
Opensea token id format decoded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Token Id (as given in Opensea) | |
id = 73424079983647210902572285069973579475843508985221180214989722260978404425729 | |
print("Id \t : ",id) | |
# Convert Id to Hexadecimal | |
print("Hex(id) : ", hex(id)) | |
# First 20 bytes represent maker address | |
print("Maker \t : ",hex(id >> 96)) | |
# Next 7 bytes represent nft ID | |
print("NFT id \t : ",(id & 0x0000000000000000000000000000000000000000ffffffffffffff0000000000) >> 40) | |
# Last 5 bytes represent Quantity / Supply of this Id | |
print("Quantity : ",id & 0x000000000000000000000000000000000000000000000000000000ffffffffff) | |
#---OUTPUT---# | |
# Id : 73424079983647210902572285069973579475843508985221180214989722260978404425729 | |
# Hex(id) : 0xa2548e7ad6cee01eeb19d49bedb359aea3d8ad1d000000000000070000000001 | |
# Maker : 0xa2548e7ad6cee01eeb19d49bedb359aea3d8ad1d | |
# NFT id : 7 | |
# Quantity : 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment