Implementation of Data Sharing Agreements (DSA) using Smart Contracts. A DSA contains obligations agreed upon data provider and consumer.
Here is the DSA smart contract project repository.
-
Create agreement
-
Input: Contractual parameters (providerPublicKey, consumerPublicKey, dataExchangeAgreementHash, signatures, dataOffering, purpose, dates, intendedUse, licenseGrant, pricingModel, typeOfData)
-
Action: Create an agreement with the contractual parameters
-
Output: Emit an AgreementActive event with the provider and consumer public key and agreement id.
-
-
Get agreement
-
Input: Agreement id
-
Action: Retrieve the agreement with the given id.
-
Output: Agreement
-
-
Get agreement state
-
Input: Agreement id
-
Action: Return the state of the agreement.
-
Output: Active - 0 / Violated - 1 / Terminated - 2
-
-
Retrieve pricing model
-
Input: Agreement id
-
Action: Retrieve pricing model for an agreement
-
Output: Pricing model
-
-
Get agreement by provider
-
Input: Provider public key
-
Action: Return the provider’s agreement.
-
Output: Agreement
-
-
Get agreement by consumer
-
Input: Consumer public key
-
Action: Return the consumer’s agreement
-
Output: Agreement
-
-
Get agreements by data offering id
-
Input: Data offering id
-
Action: Return the agreement ids based on a data offering id
-
Output: Array of agreement ids
-
-
Evaluate signed resolution
-
Input: Agreement id, proof type, type, resolution, data exchange id, iat, iss, sub
-
Action: Evaluate signed resolution and return penalties if the resolution is not-completed (verification) or accepted (dispute)
-
Output: Emit PenaltyChoices event with consumer public key, agreement id, penalty choices
-
-
Terminate agreement
-
Input: Agreement id
-
Action: Terminate agreement
-
Output: Emit an AgreementTerminated event with the provider and consumer public key and agreement id.
-
-
Enforce penalty
-
Input: Agreement id, chosen penalty, price, fee, new end date
-
Action: The provider enforces the penalty chosen by the consumer.
-
Output: Emit an AgreeOnPenalty event with provider and consumer public keys, agreement id, chosen penalty, new end date, price, fee
-
-
Notify consent revoked
-
Input: Data offering id
-
Action: Returns an array of consumers who have an agreement for that data offering id
-
Output: Consumer public keys
-
-
Give consent
-
Input: Data offering id, consent subjects (a list of identifiers of the data owner), consent from hash, start
and end date -
Action: Give consent for a data offering and publish the consent for multiple consent subjects
-
Output: Emit event ConsentGiven with data offering id and consent subjects
-
-
Check consent status
-
Input: Data offering id, consent subjects
-
Action: Check the status of the consent
-
Output: Consent status
- Given - end date
- Revoked - 0
-
-
Revoke consent
-
Input: Data offering id, consent subjects
-
Action: Revoke consent for the consent subjects
-
Output: Emit event ConsentRevoked with data offering id, consent subjects and consumers (who will be notified
that their consent has been revoked)
-