<p>I have applied the technique described in <a href="https://havoc.io/post/deterministic-protobuf/" rel="nofollow">this</a> article to switch out the maps into arrays like so:</p>
<pre><code>message TempProposalPayload {
    Proposal proposal = 1;
    bytes owner_pub_key_encoded = 2;
    map<string, string> extra_data = 3;
</code></pre>
<p>becomes:</p>
<pre><code>message TempProposalPayload {¬
    Proposal proposal = 1;
    bytes owner_pub_key_encoded = 2;
    repeated StringKV extra_data = 3;
}

message StringKV {
    string key = 1;
    string value = 2;
}
</code></pre>
<p>The result is both backwards compatible and currently deterministic for both java and rust.<br>
There is no guarantee that this will not break in the future and relies on current implementation details of the individual libraries.<br>
In other words this is a risky work-around that could blow up in the future but seems okay for the time beeing.</p>
<p>I will be using that as the bases for messages in my rust implementation going forward.</p>
<p>If there is interest I'm happy to invest the work to make the required changes in Java as well. Please comment if you think this makes sense!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/issues/3367?email_source=notifications&email_token=AJFFTNVULI34JLY6DZI5ARDQN3XINA5CNFSM4I55W3J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3Q3YA#issuecomment-540478944">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNWEEYP7UYWE4P3EB33QN3XINANCNFSM4I55W3JQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNUBXTM757GWCZFR7HTQN3XINA5CNFSM4I55W3J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3Q3YA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/issues/3367?email_source=notifications\u0026email_token=AJFFTNVULI34JLY6DZI5ARDQN3XINA5CNFSM4I55W3J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3Q3YA#issuecomment-540478944",
"url": "https://github.com/bisq-network/bisq/issues/3367?email_source=notifications\u0026email_token=AJFFTNVULI34JLY6DZI5ARDQN3XINA5CNFSM4I55W3J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA3Q3YA#issuecomment-540478944",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>