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

Add version number to inscriptions #1046

Closed
casey opened this issue Dec 21, 2022 · 3 comments · Fixed by #1107
Closed

Add version number to inscriptions #1046

casey opened this issue Dec 21, 2022 · 3 comments · Fixed by #1107
Milestone

Comments

@casey
Copy link
Collaborator

casey commented Dec 21, 2022

This would be a relatively simple way to do upgrades. Not sure if a good idea though.

@rot13maxi
Copy link
Contributor

I don't think I've ever regretted having a version number.

I think having a version number is an important mechanism for iterating without breaking existing inscriptions (#963)

@casey
Copy link
Collaborator Author

casey commented Dec 22, 2022

I think I agree. I was hoping to avoid having explicit version numbers, but I think it's a good idea. I would feel a lot better about going to mainnet if we had a really good plan for making future upgrades as smooth as possible.

Here's what I'm thinking:

Introduce an "it's okay to be odd" rule in the inscription parser. This is borrowed from Lightning. If a client sees a tag that it doesn't understand that's odd, it ignores that tag but processes the rest of the inscription. If it sees an even tag it doesn't understand, it refuses to parse the inscription entirely and returns an error

This allows us to introduce odd tags that old clients can ignore, for example a license field, and tags that clients can't ignore, like a tag that changes how the inscription is assigned to the outputs of the inscribe transaction, or changes how the inscription transfers.

Then, later, we introduce a version field with an even tag. Old clients will see an even tag that they don't understand and ignore inscriptions with a version field.

New clients will parse the version field, and then, if the value of the version field is higher than the version they understand, they will ignore the inscription entirely.

This would avoid breaking existing signet and mainnet inscriptions, and give us a few different upgrade paths:

  1. Individual features that can be ignored (odd tag)
  2. Individual features that cannot be ignored (even tag)
  3. Drastic changes that make it impossible for old clients to understand the inscription (version bump)

What do you think?

@rot13maxi
Copy link
Contributor

I like it

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

Successfully merging a pull request may close this issue.

2 participants