<h2>Trying to make the data less public</h2>
<p>User <code>A</code> wants to use part of a bond as security for an interaction with <code>B</code>, in this case a trade. First <code>A</code> needs to prove ownership of a bond by signing some data with the EC keys used for the bond lockup. This data is the <code>contract</code>. <code>A</code> doesn't want the <code>contract</code> to be public to everyone on the network. <code>A</code> also doesn't want the claim on the bond to be held longer than necessary.</p>
<p><code>B</code> wants to verify that <code>A</code> is the bondholder and that the <code>contract</code> is correct.</p>
<p><code>A</code> will sign a hash of the <code>contract</code> that includes the amount claimed towards the bond for this interaction and any other contract specifics and then publish the TransactionStartedWitness</p>
<pre><code>String bondTxId
byte[] hashOfContract
byte[] sigA
byte[] pubkeyB
long timeout
</code></pre>
<p><code>B</code> has the contract and can verify that the contract is correct. <code>B</code> also needs all the other contracts currently in effect for this bondTxId to be able to see the total amount the bond is already covering. <code>A</code> will provide them.</p>
<p>Once the transaction is done <code>B</code> publish the TransactionCompletedWitness</p>
<pre><code>byte[] hashOfContract
byte[] sigB
</code></pre>
<p>A timeout would be needed in case <code>B</code> doesn't publish the TransactionCompletedWitness</p>
<p>This method would avoid displaying the amount covered by each bond but the number of transactions per bond would be open.</p>
<h2>Bond opreturn salt hash</h2>
<p>It would be nicer if <code>bondTxId</code> wasn't public. A hash of a secret <code>salt</code> could be included in the opreturn of the bond transaction. The TransactionStartedWitness then includes the hash of bondTxId + <code>salt</code> instead of the clear text bondTxId. <code>A</code> will send the <code>salt</code> and bondTxId to <code>B</code> who can now verify which bond it is. Over longer running bonds there is still a risk that the <code>salt</code> becomes known to an attacker but the risks are still lower than a clear text bondTxId.</p>
<pre><code>byte[] hashOfSaltedBondTxId
byte[] hashOfContract
byte[] sigA
byte[] pubkeyB
long timeout
</code></pre>

<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/proposals/issues/32#issuecomment-416378121">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AkpZtkNNndAxnrI2B81ldPXrz5mahGpIks5uVGdegaJpZM4VbfgM">mute the thread</a>.<img src="https://github.com/notifications/beacon/AkpZtqfGAIqaEwZcnOXFk_2CatCgKpKfks5uVGdegaJpZM4VbfgM.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/bisq-network/proposals","title":"bisq-network/proposals","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/bisq-network/proposals"}},"updates":{"snippets":[{"icon":"PERSON","message":"@sqrrm in #32: ## Trying to make the data less public\r\nUser `A` wants to use part of a bond as security for an interaction with `B`, in this case a trade. First `A` needs to prove ownership of a bond by signing some data with the EC keys used for the bond lockup. This data is the `contract`. `A` doesn't want the `contract` to be public to everyone on the network. `A` also doesn't want the claim on the bond to be held longer than necessary.\r\n\r\n`B` wants to verify that `A` is the bondholder and that the `contract` is correct.\r\n\r\n`A` will sign a hash of the `contract` that includes the amount claimed towards the bond for this interaction and any other contract specifics and then publish the TransactionStartedWitness\r\n```\r\nString bondTxId\r\nbyte[] hashOfContract\r\nbyte[] sigA\r\nbyte[] pubkeyB\r\nlong timeout\r\n```\r\n\r\n`B` has the contract and can verify that the contract is correct. `B` also needs all the other contracts currently in effect for this bondTxId to be able to see the total amount the bond is already covering. `A` will provide them.\r\n\r\nOnce the transaction is done `B` publish the TransactionCompletedWitness\r\n```\r\nbyte[] hashOfContract\r\nbyte[] sigB\r\n```\r\n\r\nA timeout would be needed in case `B` doesn't publish the TransactionCompletedWitness\r\n\r\nThis method would avoid displaying the amount covered by each bond but the number of transactions per bond would be open.\r\n\r\n## Bond opreturn salt hash\r\nIt would be nicer if `bondTxId` wasn't public. A hash of a secret `salt` could be included in the opreturn of the bond transaction. The TransactionStartedWitness then includes the hash of bondTxId + `salt` instead of the clear text bondTxId. `A` will send the `salt` and bondTxId to `B` who can now verify which bond it is. Over longer running bonds there is still a risk that the `salt` becomes known to an attacker but the risks are still lower than a clear text bondTxId.\r\n```\r\nbyte[] hashOfSaltedBondTxId\r\nbyte[] hashOfContract\r\nbyte[] sigA\r\nbyte[] pubkeyB\r\nlong timeout\r\n```\r\n"}],"action":{"name":"View Issue","url":"https://github.com/bisq-network/proposals/issues/32#issuecomment-416378121"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/proposals/issues/32#issuecomment-416378121",
"url": "https://github.com/bisq-network/proposals/issues/32#issuecomment-416378121",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [bisq-network/proposals] Future off chain trade protocol (#32)",
"sections": [
{
"text": "",
"activityTitle": "**sqrrm**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@sqrrm",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"bisq-network/proposals\",\n\"issueId\": 32,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"bisq-network/proposals\",\n\"issueId\": 32\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/bisq-network/proposals/issues/32#issuecomment-416378121"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 359528460\n}"
}
],
"themeColor": "26292E"
}
]</script>