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

elip200: fix discount weight calculation for asset and nonce #21

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

delta1
Copy link
Member

@delta1 delta1 commented Sep 25, 2024

output amount and nonce discount must be weighted by the witness scaling factor as they form part of the base transaction, not the witness data

see ElementsProject/elements#1366 and ElementsProject/rust-elements#218

@apoelstra
Copy link
Member

I think you should change bytes to weight units or wu. Multiplying a number of bytes by 4 looks wrong.

@delta1
Copy link
Member Author

delta1 commented Sep 26, 2024

I think you should change bytes to weight units or wu. Multiplying a number of bytes by 4 looks wrong.

Thanks, done in b80157c

@apoelstra
Copy link
Member

Now it descrbes the commitment as beeing "33 wu" which is incorrect. It is either "33 bytes" or "132 wu". Same for the "no nonce" case.

Also the text "multiplied by 4 as part of the base transaction weight" is confusing. I'm not sure what it's supposed to mean. I guess you mean "the number of bytes is multiplied by 4 since this is non-witness data" but the number of bytes is not the subject of this sentence.

@delta1
Copy link
Member Author

delta1 commented Sep 27, 2024

updated in 9f08b81

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 9f08b81

@apoelstra apoelstra merged commit 915a8ea into ElementsProject:main Sep 27, 2024
@delta1 delta1 deleted the discountweight branch September 28, 2024 05:40
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