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

fix issue with --satpoint when offset > 0. (Fix #2465) #2466

Merged
merged 5 commits into from
Sep 25, 2023

Conversation

felipelincoln
Copy link
Contributor

the prevouts being used to construct the reveal signature is:

let mut prevouts = vec![unsigned_commit_tx.output[0].clone()];

if let Some(parent_info) = parent_info {
  prevouts.insert(0, parent_info.tx_out);
}

but using unsigned_commit_tx.output[0] as one of its elements is a wrong assumption since a inscribe run can be called using --satpoint with offset > 0, which would make the first output of the commit transaction to be a change (part not used of the satpoint), and not the output encoding the taproot spending condition.

Example of a inscribe using --satpoint=cad80aa153050fa300fc539e35fbb2046f4c99d3e09b27437db2232bfec43f71:2:1000
image
(example produced building ord with the code from this pr. https://mempool.space/pt/testnet/tx/aab6b689ec23b60e0943adf6357eb3a2cdb8c50ebfaf10cb972f96155a239f4b#flow=&vout=1)
In this case, unsigned_commit_tx.output[0] is the first output with 1000sat value


this pr fix #2465

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, good catch! I added an error message that is more helpful in case someone runs into issues in the future.

Pro tip: Create a feature branch on your repo with the changes and open a PR with that. Makes development for you easier

@raphjaph raphjaph enabled auto-merge (squash) September 25, 2023 20:54
@raphjaph raphjaph merged commit 41aeb0a into ordinals:master Sep 25, 2023
6 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.

--satpoint flag not working on certain condition
2 participants