3 ms·
That explanation is so simple it just can't be right. :) Usually if two objects are equal their hashes should be identical too. That's the whole point of hashin
by bjourne 13y ago
That explanation is so simple it just can't be right. :) Usually if two objects are equal their hashes should be identical too. That's the whole point of hashing since otherwise O(1) lookups aren't possible. Apparently the bitcoin protocol breaks that expectation since two semantically equal transactions can have different hashes.
- pmorici 13y agoIt doesn't break that expectation it's just a misunderstanding of what data is included in the hash.
- makomk 13y agoThe main and most important use of transaction hashes in Bitcoin is to ensure that, when blocks are mined, the transactions contained within those blocks are locked in and any modification of those transactions can be detected and rejected. Transaction malleability is meant to change the hash of the transaction, because that ensures no-one can mutate transactions after they're in a block. If you really need to track transactions in the way MtGox is doing, you should construct your own transaction ID that hashes everything except the scriptSigs (which are malleable).
- bjourne 13y ago> Transaction malleability is meant to change the hash of the transaction, because that ensures no-one can mutate transactions after they're in a block. Huh? > If you really need to track transactions in the way MtGox is doing, you should construct your own transaction ID that hashes everything except the scriptSigs (which are malleable). Yeah. Except the Bitcoin network also apparently produces its own hashes of transactions and those hashes include mutable data leading to undesirable situations like hash(txn1) != hash(txn2) even though txn1 == txn2. It's like hashing people by their name and age instead of name and date of birth. Next year you won't find them in your table because their age is different.