Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inscription IDs are Potentially Unstable #2590

Closed
Psifour opened this issue Oct 25, 2023 · 1 comment
Closed

Inscription IDs are Potentially Unstable #2590

Psifour opened this issue Oct 25, 2023 · 1 comment

Comments

@Psifour
Copy link
Contributor

Psifour commented Oct 25, 2023

The changes in 7e6eb73 (PR #2145) create the potential for instability of inscription Ids.

Specifically, prior to this commit all values were i0 due to it being 'txid.into()' (where the conversion populated a 0 automatically if not provided). The change makes it the index within the parsed envelopes. This would be fine, except that it relies on the envelopes that are parsed being stable between versions (and more importantly between services). While this is the ideal, it recreates the instability that led to the confusion about inscription numbers.

We can keep this id for backwards compatibility (as it is reliable if we assume that all envelopes are parsed equally by two parties and no one has triggered any of the very specific edgecases), but we should further define an id that uses only on-chain data that doesn't require indexing anything other than the specific envelope that an id references.

While we should explore other options, my kneejerk reaction would be defining identifiers such that they point to the transaction (using txid like we already do) and then further define the location of the envelope within the transaction. This could be done using (vIn, offsetWithinTapscript) or offsetWithinRawTransaction.

The gut reaction of most developers will be to assume this doesn't matter as the ids are stable for any given version, but the purpose of a stable identifier goes beyond individual versions and MUST be stable between versions to be useful (or when we share and use them we would also need to include which version they correspond with).

@casey
Copy link
Collaborator

casey commented Oct 26, 2023

I think the ship has kind of sailed on this one. There is definitely the potential for instability, but it only exists within a single transaction, i.e., you would have to create a transaction which hit an edge case for one inscription, but not the others, and only inscription IDs within that one transaction would change. We could introduce a new inscription ID, and I actually thought about using the offset of the envelope within the tapscript, however having a second type of inscription ID would be very confusing, and getting people to migrate would be hard.

@casey casey closed this as completed Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants