How is txoutset_hash calculated by dumptxoutset?

1 reply 77 views
Posts: 2 · Reputation: 52
#1Oct 25, 2018, 03:26 AM
I've been trying to figure out how the hashing works for the RPC command dumptxoutset in the latest version 28.0. Maybe someone here can point me in the right direction. I think it’s using the HASH_SERIALIZED type instead of that MUHASH thing. So, I figured it's just a straightforward SHA256 of all the "Coin" entries, laid out like in the file created by dumptxoutset. From the source code, it seems like each entry is fed into the hasher one after the other. After that, I do another SHA256 on the whole output. But it’s not working for me, since I’m not getting the same value as the "txoutset_hash" returned by dumptxoutset. Is there possibly a script_length field lurking between the Amount and the script itself?
2 Reply Quote Share
Posts: 2 · Reputation: 52
#2Oct 25, 2018, 09:19 AM
Never mind, already figured it out. There is a variable length filed between the amount and the script.
5 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics