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

BlockTransactionRequest: Non-conformity of BIP-152 in rust bitcoin #57

Open
hax0kartik opened this issue Jul 6, 2024 · 3 comments
Open

Comments

@hax0kartik
Copy link
Contributor

I got a crash in BlockTransactionRequest deserialization target as rust-bitcoin does not conform to BIP-152 and treats indexes as uint64_t values when according to BIP and Core, they should be treated as uint16_t values.

This also makes it possible to theoretically create a non-conformant BlockTransactions/BlockTxn message with more than U16_MAX transactions in a Block. ("Theoretically" because I am not sure whether a node would have a Block with such a large number of transactions anyway)

I think at the bare minimum, rust-bitcoin should return an error with an index greater than u16 max while deserializing a BlockTransactionRequest.

@apoelstra
Copy link

@hax0kartik
Copy link
Contributor Author

cc rust-bitcoin/rust-bitcoin#2970

Hi, please correct me if I am wrong but I think that's an unrelated issue in HeaderandShortIds while this is a issue with BlockTransactionRequest

@apoelstra
Copy link

Oh! You're right, sorry. I saw "BIP-152" and thought it was a dupe.

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

No branches or pull requests

2 participants