Skip to content

Commit

Permalink
Sign a DDA template, Publish signed DDA to intermediary
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <george.padayatti@igrant.io>
  • Loading branch information
georgepadayatti committed May 17, 2022
1 parent fb0d5a1 commit afda95e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 24 deletions.
Binary file added docs/images/publish-dda-to-marketplace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 54 additions & 9 deletions docs/protocol/datadisclosure-agreement-protocol-specification.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Data Disclosure Agreement Protocol Specification

## Abstract
Data disclosure agreements focuses on enables automated agreement handling to enable data sharing and exchange between data sources and data using services. It helps organisations to continue leveraging data while being transparent and legitimate in their data usage in a scalable manner while adhering to data regulations. It also provides individuals control over how their data is used and exchanged.
Data disclosure agreements focuses on enables automated agreement handling to enable data sharing and exchange between data sources and data using services. It helps organisations to continue leveraging data while being transparent and legitimate in their data usage in a scalable manner while adhering to data **regulations**. It also provides individuals control over how their data is used and exchanged.

## Status of This Document
Work in progress, version 0.9
Expand All @@ -17,19 +17,60 @@ Ms. Lotta Lundin (iGrant.io, Sweden)

## Introduction

## Requirements
To be written...

- Publish DDA to Marketplace.
- DDA negotiation between Data Source and Data Using Service.
- Personal data exchange between DS and DUS
- DA negotiation between DS and Individual (Use existing DA protocol)
- DA negotiation between DUS and Individual (Use existing DA protocol)
- Publish transactions to central source of truth
### Actors

## Use Cases
1. Data Using Service
2. Data Source
3. Individual
4. Data Intermediary
5. Data Marketplace

## Protocol flow

### Pre-requisite

All the actors involved in the protocol flow is a DIDComm agent. Each interaction between the actors require a DIDComm message. Prior to the PS-SDA protocol flow, actors must establish connection [1] between each other and identify themselves by presenting the necessary proofs [2]. All the actors will have a wallet address and an associated public / private key pair. A wallet address is an external owned account ethereum address. Ethereum addresses are composed of the prefix "0x" (a common identifier for hexadecimal) concatenated with the rightmost 20 bytes of the Keccak-256 hash of the ECDSA public key with the curve secp256k1.

### DS publish DDA to Marketplace


![](../images/publish-dda-to-marketplace.png)

#### Sign a DDA template

Data Sources prepares a DDA template and signs it using the secp256k1 private key. The signature is prepared by performing the proof algorithm described by W3C Data Integrity 1.0 specification [3].

#### Publish signed DDA template to Data Intermediary

DS constructs a `dda/1.0/publish` DIDComm message and send it to Data Intermediary DIDComm agent. An example is provided below.

```
{
"@type": "https://didcomm.org/dda/1.0/publish",
"@id": "999f6c2b-b0e5-4123-aab0-b5f7bfc780c4",
"created_time": "1639288911",
"@from": "<sender did>",
"@to": "<receipient did>",
"body": {},
"attachments": [
{
"id": "1",
"description": "Data Disclosure Agreement",
"data": {
"base64": "<base64 encoded canonicalised dda>"
}
}
]
}
```

1. Data Intermediary stores the signed DDA to IPFS.
2. Execute the smart contract function `publishDDADoc` to publish the hash.
3. Data marketplace will subscribe to the smart contract events and display them.


## Security Considerations

## Privacy Considerations
Expand All @@ -38,3 +79,7 @@ Ms. Lotta Lundin (iGrant.io, Sweden)

## References

1. Aries RFC 0160 Connection protocol - https://github.com/hyperledger/aries-rfcs/tree/main/features/0160-connection-protocol
2. Aries RFC 0037 Present Proof protocol - https://github.com/hyperledger/aries-rfcs/tree/main/features/0037-present-proof
3. W3C Data Integrity 1.0 specification - https://w3c-ccg.github.io/data-integrity-spec

Binary file added docs/www/images/publish-dda-to-marketplace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 62 additions & 15 deletions docs/www/protocol/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<article id="content">
<h1 id="data-disclosure-agreement-protocol-specification"><a class="toc-anchor" href="#data-disclosure-agreement-protocol-specification" >§</a> Data Disclosure Agreement Protocol Specification</h1>
<h2 id="abstract"><a class="toc-anchor" href="#abstract" >§</a> Abstract</h2>
<p>Data disclosure agreements focuses on enables automated agreement handling to enable data sharing and exchange between data sources and data using services. It helps organisations to continue leveraging data while being transparent and legitimate in their data usage in a scalable manner while adhering to data regulations. It also provides individuals control over how their data is used and exchanged.</p>
<p>Data disclosure agreements focuses on enables automated agreement handling to enable data sharing and exchange between data sources and data using services. It helps organisations to continue leveraging data while being transparent and legitimate in their data usage in a scalable manner while adhering to data <strong>regulations</strong>. It also provides individuals control over how their data is used and exchanged.</p>
<h2 id="status-of-this-document"><a class="toc-anchor" href="#status-of-this-document" >§</a> Status of This Document</h2>
<p>Work in progress, version 0.9</p>
<h2 id="authors"><a class="toc-anchor" href="#authors" >§</a> Authors</h2>
Expand All @@ -60,21 +60,56 @@ <h2 id="contributors-and-reviwers"><a class="toc-anchor" href="#contributors-and
Mr. Jan Linquist (Linaltec, Sweden)<br>
Ms. Lotta Lundin (<a path-0="iGrant.io"href="http://iGrant.io" ><span>iGrant.io</span></a>, Sweden)</p>
<h2 id="introduction"><a class="toc-anchor" href="#introduction" >§</a> Introduction</h2>
<h2 id="requirements"><a class="toc-anchor" href="#requirements" >§</a> Requirements</h2>
<ul>
<li>Publish DDA to Marketplace.</li>
<li>DDA negotiation between Data Source and Data Using Service.</li>
<li>Personal data exchange between DS and DUS</li>
<li>DA negotiation between DS and Individual (Use existing DA protocol)</li>
<li>DA negotiation between DUS and Individual (Use existing DA protocol)</li>
<li>Publish transactions to central source of truth</li>
</ul>
<h2 id="use-cases"><a class="toc-anchor" href="#use-cases" >§</a> Use Cases</h2>
<p>To be written…</p>
<h3 id="actors"><a class="toc-anchor" href="#actors" >§</a> Actors</h3>
<ol>
<li>Data Using Service</li>
<li>Data Source</li>
<li>Individual</li>
<li>Data Intermediary</li>
<li>Data Marketplace</li>
</ol>
<h2 id="protocol-flow"><a class="toc-anchor" href="#protocol-flow" >§</a> Protocol flow</h2>
<h3 id="pre-requisite"><a class="toc-anchor" href="#pre-requisite" >§</a> Pre-requisite</h3>
<p>All the actors involved in the protocol flow is a DIDComm agent. Each interaction between the actors require a DIDComm message. Prior to the PS-SDA protocol flow, actors must establish connection [1] between each other and identify themselves by presenting the necessary proofs [2]. All the actors will have a wallet address and an associated public / private key pair. A wallet address is an external owned account ethereum address. Ethereum addresses are composed of the prefix “0x” (a common identifier for hexadecimal) concatenated with the rightmost 20 bytes of the Keccak-256 hash of the ECDSA public key with the curve secp256k1.</p>
<h3 id="ds-publish-dda-to-marketplace"><a class="toc-anchor" href="#ds-publish-dda-to-marketplace" >§</a> DS publish DDA to Marketplace</h3>
<p><img src="../images/publish-dda-to-marketplace.png" alt=""></p>
<h4 id="sign-a-dda-template"><a class="toc-anchor" href="#sign-a-dda-template" >§</a> Sign a DDA template</h4>
<p>Data Sources prepares a DDA template and signs it using the secp256k1 private key. The signature is prepared by performing the proof algorithm described by W3C Data Integrity 1.0 specification [3].</p>
<h4 id="publish-signed-dda-template-to-data-intermediary"><a class="toc-anchor" href="#publish-signed-dda-template-to-data-intermediary" >§</a> Publish signed DDA template to Data Intermediary</h4>
<p>DS constructs a <code>dda/1.0/publish</code> DIDComm message and send it to Data Intermediary DIDComm agent. An example is provided below.</p>
<pre><code>{
&quot;@type&quot;: &quot;https://didcomm.org/dda/1.0/publish&quot;,
&quot;@id&quot;: &quot;999f6c2b-b0e5-4123-aab0-b5f7bfc780c4&quot;,
&quot;created_time&quot;: &quot;1639288911&quot;,
&quot;@from&quot;: &quot;&lt;sender did&gt;&quot;,
&quot;@to&quot;: &quot;&lt;receipient did&gt;&quot;,
&quot;body&quot;: {},
&quot;attachments&quot;: [
{
&quot;id&quot;: &quot;1&quot;,
&quot;description&quot;: &quot;Data Disclosure Agreement&quot;,
&quot;data&quot;: {
&quot;base64&quot;: &quot;&lt;base64 encoded canonicalised dda&gt;&quot;
}
}
]
}
</code></pre>
<ol>
<li>Data Intermediary stores the signed DDA to IPFS.</li>
<li>Execute the smart contract function <code>publishDDADoc</code> to publish the hash.</li>
<li>Data marketplace will subscribe to the smart contract events and display them.</li>
</ol>
<h2 id="security-considerations"><a class="toc-anchor" href="#security-considerations" >§</a> Security Considerations</h2>
<h2 id="privacy-considerations"><a class="toc-anchor" href="#privacy-considerations" >§</a> Privacy Considerations</h2>
<h2 id="implementation-considerations"><a class="toc-anchor" href="#implementation-considerations" >§</a> Implementation Considerations</h2>
<h2 id="references"><a class="toc-anchor" href="#references" >§</a> References</h2>
<ol>
<li>Aries RFC 0160 Connection protocol - <a path-0="github.com"path-1="hyperledger"path-2="aries-rfcs"path-3="tree"path-4="main"path-5="features"path-6="0160-connection-protocol"href="https://github.com/hyperledger/aries-rfcs/tree/main/features/0160-connection-protocol" ><span>https://github.com/hyperledger/aries-rfcs/tree/main/features/0160-connection-protocol</span></a></li>
<li>Aries RFC 0037 Present Proof protocol - <a path-0="github.com"path-1="hyperledger"path-2="aries-rfcs"path-3="tree"path-4="main"path-5="features"path-6="0037-present-proof"href="https://github.com/hyperledger/aries-rfcs/tree/main/features/0037-present-proof" ><span>https://github.com/hyperledger/aries-rfcs/tree/main/features/0037-present-proof</span></a></li>
<li>W3C Data Integrity 1.0 specification - <a path-0="w3c-ccg.github.io"path-1="data-integrity-spec"href="https://w3c-ccg.github.io/data-integrity-spec" ><span>https://w3c-ccg.github.io/data-integrity-spec</span></a></li>
</ol>

</article>

Expand Down Expand Up @@ -103,10 +138,22 @@ <h2 id="references"><a class="toc-anchor" href="#references" >§</a> References<
<li><a href="#status-of-this-document" >Status of This Document</a></li>
<li><a href="#authors" >Authors</a></li>
<li><a href="#contributors-and-reviwers" >Contributors and Reviwers</a></li>
<li><a href="#introduction" >Introduction</a></li>
<li><a href="#requirements" >Requirements</a></li>
<li><a href="#use-cases" >Use Cases</a></li>
<li><a href="#protocol-flow" >Protocol flow</a></li>
<li><a href="#introduction" >Introduction</a>
<ul>
<li><a href="#actors" >Actors</a></li>
</ul>
</li>
<li><a href="#protocol-flow" >Protocol flow</a>
<ul>
<li><a href="#pre-requisite" >Pre-requisite</a></li>
<li><a href="#ds-publish-dda-to-marketplace" >DS publish DDA to Marketplace</a>
<ul>
<li><a href="#sign-a-dda-template" >Sign a DDA template</a></li>
<li><a href="#publish-signed-dda-template-to-data-intermediary" >Publish signed DDA template to Data Intermediary</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#security-considerations" >Security Considerations</a></li>
<li><a href="#privacy-considerations" >Privacy Considerations</a></li>
<li><a href="#implementation-considerations" >Implementation Considerations</a></li>
Expand Down

0 comments on commit afda95e

Please sign in to comment.