keep-starknet-strange / raito

Bitcoin ZK client written in Cairo.
https://raito.wtf
MIT License
40 stars 34 forks source link

[bug] TXIDs in RPC reponses have to be converted into natural order #105

Closed m-kus closed 1 month ago

m-kus commented 2 months ago

TXIDs in RPC responses are in reversed order (see https://learnmeabitcoin.com/technical/general/byte-order/) while we need to deal with natural order in the code. We have to convert the test data either in the script or use alternative from_hex_rev helper for txid (and block hashes) specifically.

Currently this is not an immediate issue because TXIDs are initialised as <hex>_u256.into() however that is not explicitly obvious.

lomasson commented 2 months ago

Hi @m-kus, since I've been working on the script to generate test data, can i take this one ?

onlydustapp[bot] commented 2 months ago

Hey @lomasson! Thanks for showing interest. We've created an application for you to contribute to Raito - Bitcoin ZK Client. Go check it out on OnlyDust!

m-kus commented 2 months ago

Sure @lomasson ! I think from_hex_rev would be a more explicit option and also can be used in unit tests, since reversed byte order applies to block hashes and merkle roots as well.

lomasson commented 1 month ago

@m-kus i think this issue would be closed