ordinals / ord

👁‍🗨 Rare and exotic sats
https://ordinals.com
Creative Commons Zero v1.0 Universal
3.81k stars 1.35k forks source link

Can Ordinal be self aware of its blockheight regardless of the ordinal browser being used? #3880

Open shiftshapr opened 1 month ago

shiftshapr commented 1 month ago

Hey Raph

Great to meet you at Inscribing Nashville!

As I mentioned, I want the ordinal I am building to be self-aware of its own blockheight and inscriptionId. I understand that I can get the block information within an ordinal if I parse the query_string to get the inscription id, and then use /r/inscription/[INSCRIPTIONID] to get the blockheight... This works on Ordinals.com but some other ordinal browsers like ord.io use the inscription number rather than the inscription Id in the query string. e.g., https://ord.io/0. With such browsers, I am unable to get the inscriptionId from the query string so the ordinal would not know it's block number and therefore not function correctly.

Am I missing something or do we need a new endpoint to get the ordinal's inscriptionId so we can use /r/inscription/[INSCRIPTIONID] endpoint to get the blockheight or /r/inscription/[INSCRIPTION NUMBER]?

vinkim commented 1 month ago

The example you linked to is an image, and it seems ord.io just caches that mimetype, and serves it from their cdn.

If you have look at this example HTML (which I assume is what you'll be inscribing aswell) , you'll see that its being served inside an iframe, so the window.location.pathname should point to something where you'll be able to extract the inscription id. In the end it depends on what you're using to actually extract the inscription id.

raphjaph commented 1 month ago

ord.io should really start using the inscription id. nobody cares about the numbers anymore

shiftshapr commented 3 weeks ago

Thanks for the responses, @raphjaph and @vinkim. I agree that ordinal numbers are not as useful anymore. However, I still think they provide a sense of when an inscription was made and offer a shorter number that can be easily remembered or shared.

I believe having an endpoint that allows an inscription to quickly find its inscription number would be transformative. There is one specific use case that could make ordinals more resilient and adaptable: by retrieving the inscription number, obtaining the corresponding satoshi number, and checking for any more recent inscriptions, we could evaluate the most up-to-date version. This approach would allow for corrections, updates, or added functionality to existing inscriptions by simply reinscribing the new information onto the same satoshi. (This process could also be automated if specified in the metadata.)

raphjaph commented 1 week ago

You can retrieve the inscription number through the /r/inscription/<ID> endpoint. It's really on ord.io to support this. The docs clearly specify it here: https://docs.ordinals.com/inscriptions/recursion.html