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

Support explicitly setting pointer tag to zero #4

Merged
merged 2 commits into from
Dec 22, 2024

Conversation

t4t5
Copy link
Contributor

@t4t5 t4t5 commented Dec 22, 2024

I noticed that if you try creating an inscription where you explicitly want the pointer to be 0, like this:

const inscription: Inscription = {
  tags: {
    contentType,
    pointer: 0n,
  },
  body,
};

p2tr_ord_reveal(u8RevealPublicKey, [inscription]);

...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

CleanShot 2024-12-22 at 10 05 56@2x

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.

@paulmillr paulmillr merged commit fdfd8e4 into paulmillr:main Dec 22, 2024
2 checks passed
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 this pull request may close these issues.

2 participants