ordinals / ord

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

Unclear inscription ID in handbook #2273

Closed victorkirov closed 1 year ago

victorkirov commented 1 year ago

The handbook states the below.

Ord will output two transactions IDs, one for the commit transaction, and one for the reveal transaction, and the inscription ID. Inscription IDs are of the form TXIDiN, where TXID is the transaction ID of the reveal transaction, and N is the index of the inscription in the reveal transaction.

The commit transaction commits to a tapscript containing the contents of the inscription, and the reveal transaction spends from that tapscript, revealing the contents on chain and inscribing them on the first sat of the first output of the reveal transaction.

What exactly is N? Can you reveal multiple inscriptions in a reveal transaction? With the second paragraph, it mentions that the inscription is inscribed on the first sat of the first output. If there are more than one inscriptions revealed, where are subsequent ones inscribed?

raphjaph commented 1 year ago

Multiple things, first, there is an inconsistency because on https://docs.ordinals.com/inscriptions.html the docs say inscriptions are made "on the first sat of its input" (which is correct). I opened #2276 to make that change.

Secondly, N is the index of the inscription in the transaction. So in theory you can have multiple inscriptions per transaction. Taking the new definition from above a reveal transaction could have multiple inputs where each contains an inscription and they are inscribed on the first sat of their input. Going further you could have multiple inscriptions per input but currently we only assign them inscriptionIDs and make them unbound (not assigned to a sat). In the future these will become reinscriptions.

You can have a look at most of that code in src/inscription.rs and src/index/updater/inscription_updater.rs.

victorkirov commented 1 year ago

Ah, ok, that makes a lot more sense 👍 Thanks for the additional info. I'll leave this ticket open as a request to fix the description on the page I linked 🙏

Edit: I see you already made a PR for this 🙈 Thank you 😊