[bisq-network/bisq] Hash of ProtectedStoragePayload is non-deterministic (#3367)

Justin Carter notifications at github.com
Wed Oct 9 13:25:40 UTC 2019


Since I think there is some confusion about what the problem _really_ is (and the way it manifests itself in the java code is a bit different than in my rust code) here is a high level description of a bug that can result from this issue:

Alice creates Offer A -> serializes to aliceBytes -> creates aliceHash from aliceBytes (for storing and referencing) -> then broadcasts aliceBytes to the network

Bob receives aliceBytes -> deserializes to Offer A -> re-rerializes to bobsBytes and creates bobsHash from bobsBytes for storing

so the step Offer -> bytes results in 2 different hashes on Alice and Bobs respective machine (this is the non-deterministic aspect of the serialization at play).

So far they each have Offer A in their Offer Book but the hashes are different on Alice and Bobs machine.

Now the offer is about to expire so Alice creates `RefreshOfferMessage` referencing aliceHash as the payload hash.
Bob receives RefreshOfferMessage and looks up the payloadHash (= aliceHash) but doesn't find the matching offer (as he has it stored under bobsHash. So for Bob the offer will expire even though alice wants to refresh the TTL.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/issues/3367#issuecomment-539999517
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191009/29393462/attachment-0001.html>


More information about the bisq-github mailing list