Skip to content

Instantly share code, notes, and snippets.

@sidarth16
Last active July 20, 2023 14:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidarth16/12dc23f53c48fbbcf18644c935c770b1 to your computer and use it in GitHub Desktop.
Save sidarth16/12dc23f53c48fbbcf18644c935c770b1 to your computer and use it in GitHub Desktop.
Opensea token id format decoded.
# 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