1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3479],{7552:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return c},contentTitle:function(){return s},metadata:function(){return l},toc:function(){return d},default:function(){return u}});var a=n(7462),i=n(3366),r=(n(7294),n(3905)),o=["components"],c={id:"contract_service_specifications",title:"Contract Service Specifications",description:"Contract Service Specifications"},s="Contract Service",l={unversionedId:"contract_service_specifications",id:"contract_service_specifications",title:"Contract Service Specifications",description:"Contract Service Specifications",source:"@site/internal/training/contract_service_specifications.md",sourceDirName:".",slug:"/contract_service_specifications",permalink:"/training/contract_service_specifications",editUrl:"https://github.com/iSPIRT/depa/edit/main/internal/training/contract_service_specifications.md",tags:[],version:"current",lastUpdatedAt:1693846884,formattedLastUpdatedAt:"9/4/2023",frontMatter:{id:"contract_service_specifications",title:"Contract Service Specifications",description:"Contract Service Specifications"},sidebar:"training",previous:{title:"Dataset References and Contracts",permalink:"/training/contracts"},next:{title:"Payment Flows",permalink:"/training/payments"}},d=[{value:"Participant Identity",id:"participant-identity",children:[],level:2},{value:"Dataset Reference and Contract Issuance and Registration",id:"dataset-reference-and-contract-issuance-and-registration",children:[{value:"Signed Dataset Reference Format",id:"signed-dataset-reference-format",children:[],level:3},{value:"Signed Contract Format",id:"signed-contract-format",children:[],level:3}],level:2},{value:"Signed Contract Issuance",id:"signed-contract-issuance",children:[],level:2},{value:"Registering Signed Contracts",id:"registering-signed-contracts",children:[],level:2}],p={toc:d};function u(e){var t=e.components,n=(0,i.Z)(e,o);return(0,r.kt)("wrapper",(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"contract-service"},"Contract Service"),(0,r.kt)("p",null,"The contract service plays a crucial role within the DEPA Training Framework, facilitating secure data collaboration and contractual agreements between various participants, including Training Data Providers (TDPs), Training Data Consumers (TDCs), and Confidential Clean Room (CCR) providers."),(0,r.kt)("p",null,"The contract service maintains a registry, a verifiable data structure that records signed dataset references and contracts, and enforces contract registration policies. It also maintains a service key, which is used to endorse the state of the registry in receipts. All contract services MUST expose standard endpoints for registration of datasets and signed contracts and receipt issuance. Each contract service also defines its registration policy, which MUST apply to all entries in the registry."),(0,r.kt)("p",null,"The combination of registry, identity, registration policy evaluation, and registration endpoint constitute the trusted part of the contract service. Each of these components SHOULD be carefully protected against both external attacks and internal misbehaviour by some or all of the operators of the contract service."),(0,r.kt)("p",null,"Beyond the trusted components, contract services MAY operate additional endpoints for auditing, for instance to query for the history of dataset references and signed contracts registered by a given participant."),(0,r.kt)("h2",{id:"participant-identity"},"Participant Identity"),(0,r.kt)("p",null,"The DEPA Training Framework uses ",(0,r.kt)("a",{parentName:"p",href:"https://www.ietf.org/archive/id/draft-ietf-scitt-architecture-01.html#DID-CORE"},"decentralized identities")," to establish the identities of participants involved in sharing or consuming datasets."),(0,r.kt)("p",null,"Before a participant is able to share or consume datasets, they must create a decentralized identifier (also known as a DID). A DID is a unique string identifier associated with the participant. A DID can be resolved
1into a key manifest (a list of public keys indexed by a key identifier) using many different DID methods."),(0,r.kt)("p",null,"Participants MAY choose the DID method they prefer, but with no guarantee that all contract services will be able to register their signed contracts. To promote interoperability, all contract service implementations SHOULD support the did:web method ","[DID-WEB]",". For instance, if the participants publishes its manifest at ",(0,r.kt)("a",{parentName:"p",href:"https://sample.participant/user/alice/did.json"},"https://sample.participant/user/alice/did.json"),", the DID of the participant is did:web:sample.participant:user:alice."),(0,r.kt)("p",null,"Participants SHOULD use consistent decentralized identifiers for all their contracts. They MAY update their DID manifest, for instance to refresh their signing keys or algorithms, but they SHOULD NOT remove or change any prior keys unless they intend to revoke all contracts that are registered with those keys. This DID appears in the protected header of signed dataset and contracts."),(0,r.kt)("h2",{id:"dataset-reference-and-contract-issuance-and-registration"},"Dataset Reference and Contract Issuance and Registration"),(0,r.kt)("p",null,"This section details the interoperability requirements for implementers of dataset reference and signed contract issuance and validation libraries, and of contract services."),(0,r.kt)("h3",{id:"signed-dataset-reference-format"},"Signed Dataset Reference Format"),(0,r.kt)("p",null,"The formats of signed dataset references and receipts are based on CBOR Object Signing and Encryption (COSE ","[RFC9052]","). The choice of CBOR ","[RFC8949]"," is a trade-off between safety (in particular, non-malleability: each signed Contract has a unique serialization), ease of processing and availability of implementations."),(0,r.kt)("p",null,"A signed dataset reference is a COSE signed object (i.e., a COSE_Sign1) following the ",(0,r.kt)("a",{parentName:"p",href:"https://www.ietf.org/archive/id/draft-ietf-scitt-architecture-01.html"},"SCITT")," specifications. All signed dataset references MUST include the following protected headers."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"payload type (label: 3): media-type of contract payload as a string, for example application/json"),(0,r.kt)("li",{parentName:"ul"},"owner info (label: TBD, temporary 491):")),(0,r.kt)("h3",{id:"signed-contract-format"},"Signed Contract Format"),(0,r.kt)("p",null,"The formats of signed contracts and receipts are based on CBOR Object Signing and Encryption (COSE ","[RFC9052]",")."),(0,r.kt)("p",null,"A signed contract is a COSE signed object (i.e., a COSE_Sign) signed by multiple participants. All signed contracts MUST include the following protected headers."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"payload type (label: 3): media-type of contract payload as a string, for example application/json"),(0,r.kt)("li",{parentName:"ul"},"participant info (label: TBD, temporary 491): an array containing the list of participant identifiers")),(0,r.kt)("p",null,"Although participants may attach unprotected headers to signed dataset references and contracts, contract services MUST NOT rely on the presence or value of additional unprotected headers in signed contracts during registration and validation."),(0,r.kt)("p",null,"Participants sign contracts by attaching a CoseSignature object to an existing contract. All CoseSignature objects MUST contain the following protected headers."),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"algorithm (label: 1): Asymmetric signature algorithm used by the participant of a Signed contract, as an integer, for example -35 for ECDSA with SHA-384, see COSE Algorithms registry ","[IANA.cose]",";"),(0,r.kt)("li",{parentName:"ul"},"Key ID (label: 4): Key ID"),(0,r.kt)("li",{parentName:"ul"},"Participant identity (label: TBD, temporary: 493): DID (Decentralized Identifier ","[DID-CORE]",") of the participant, as a string, for example did:web:example.com;")),(0,r.kt)("p",null,"In CDDL ","[RFC8610]"," notation, the Envelope is defined as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-cddl"},"Contract_Envelope = COSE_Sign_Tagged\n\nCOSE_Sign_Tagged = #6.98(COSE_Sign)\n\nCOSE_Sign = [\n protected : bstr .cbor Protected_Header,\n unprotected : Unprotected_Header,\n payload : bstr,\n signatures : [+ Cose_Signature]\n]\n\n;
1 All protected headers are mandatory.\nProtected_Header = {\n 3 => tstr ; payload type\n 491 => [+ tstr] ; list of participants\n 492 => tstr ; feed\n}\n\nUnprotected_Header = {\n ; TBD, Labels are temporary\n ? 493 => [+ Contract_Receipt]\n}\n\nCOSE_Signature = [\n signature_protected : bstr .cbor Signature_Protected_Header,\n signature : bstr\n]\n\nSignature_Protected_Header = {\n 1 => int ; algorithm identifier\n 3 => tstr ; payload type\n 4 => bstr ; Key ID\n ; TBD, Labels are temporary\n 494 => tstr ; DID of participant\n}\n")),(0,r.kt)("h2",{id:"signed-contract-issuance"},"Signed Contract Issuance"),(0,r.kt)("p",null,"Once all the Envelope headers are set, an participant MUST use a standard COSE implementation to produce an appropriately serialized Signed Contract (the tag of COSE_Sign_Tagged is outside the scope of COSE, and used to indicate that a signed object is a signed Contract)."),(0,r.kt)("h2",{id:"registering-signed-contracts"},"Registering Signed Contracts"),(0,r.kt)("p",null,"The same signed Contracts may be independently registered in multiple Contract Services. To register a signed Contract, the service performs the following steps:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Client authentication. This is implementation-specific and MAY be unrelated to the participant identity. Signed Contracts may be registered by a different party on behalf of the participant."),(0,r.kt)("li",{parentName:"ul"},"Participant identification. The Contract Service MUST store evidence of the DID resolution for the participant protected header of the Envelope and the resolved key manifest at the time of Registration for auditing. This MAY require that the service resolves the participant DID and record the resulting document, or rely on a cache of recent resolutions."),(0,r.kt)("li",{parentName:"ul"},"Envelope signature verification, as described in COSE signature, using the signature algorithm and verification key of the participant DID document. li"),(0,r.kt)("li",{parentName:"ul"},"Envelope validation. The service MUST check that the Envelope includes a contract payload and the protected headers listed above. The service MUST additionally verify the contract payload format and content."),(0,r.kt)("li",{parentName:"ul"},"Commit (register) the new signed Contract to the Registry Sign and return the Receipt.")),(0,r.kt)("p",null,"A Contract Service MUST ensure that a signed Contract is registered before releasing its Receipt, so that it can always back up the Receipt by releasing the corresponding entry in the Registry."))}u.isMDXComponent=!0},3905:function(e,t,n){n.d(t,{Zo:function(){return d},kt:function(){return f}});var a=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),l=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=l(e.components);return a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,r=e.originalType,s=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),u=l(n),f=i,g=u["".concat(s,".").concat(f)]||u[f]||p[f]||r;return n?a.createElement(g,o(o({ref:t},d),{},{components:n}
1)):a.createElement(g,o({ref:t},d))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var r=n.length,o=new Array(r);o[0]=u;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var l=2;l<r;l++)o[l]=n[l];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.