Support explicitly setting pointer tag to zero #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that if you try creating an inscription where you explicitly want the pointer to be 0, like this:
...the library will simply ignore the pointer tag and not encode it (presumably because it's assumed to be the default?)
However, being able to explicitly define a pointer of 0 is very useful in cases where you want to inscribe something on a rare sat, where the first input might not contain the inscription witness.
Below is an example transaction. If
pointer: 0
wasn't set, the inscription would be made on the first sat of the remaining fee output, instead of on the rare sat:https://ordiscan.com/tx/bd63b470242919cbd32de382ba91d2f5140d5296dc2d0ff2c7c8a3deaaa387c1
I made a quick fix for this and wrote a simple test for it, but there might be a more elegant way of solving this.