Skip to content

Commit

Permalink
Updates to interfaces in spec
Browse files Browse the repository at this point in the history
This update is based on discussions related to universal wallet
interfaces w3c-ccg#46 .
- added Query interface with query types `QueryByFrame` and
`PresentationExchange`.
- defined options in `Issue/Prove` interfaces.
- and few minor updates based on discussions in the issuer w3c-ccg#46.

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Feb 16, 2021
1 parent 390c6ee commit 394c7fb
Showing 1 changed file with 163 additions and 14 deletions.
177 changes: 163 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@
company: "mesur.io",
companyURL: "https://mesur.io/",
},
{
name: "Sudesh Shetty",
url: "https://www.linkedin.com/in/sudesh-r-shetty-6bb67b7/",
company: "SecureKey",
companyURL: "https://securekey.com/",
},
],
// name of the WG
wg: "Credentials Community Group",
Expand Down Expand Up @@ -493,7 +499,7 @@ <h3 id="CachedDIDDocument">Cached DID Document</h3>
]
}
}

</pre
>
</section>
Expand Down Expand Up @@ -1144,18 +1150,44 @@ <h2>Interface</h2>
types of object.
</p>

<p>
A wallet implementation MAY implement a subset of the interfaces defined below.

For example:
<ul>
<li>A verifiable credential wallet might not implement the <code>Transfer</code> interface.
Also, the <code>Query</code> interface of a verifiable credential wallet might be specific to credential search.</li>
<li>Similarly, a wallet implementation which relies on an external storage, such as encrypted data vaults, might choose not to implement <code>Export</code>, <code>Import</code>, <code>Lock</code>, and/or <code>Unlock</code> interfaces.</li>
</ul>

</p>

<section>
<h3>Import</h3>
<p>
Takes a serialized exported wallet representation as input. Loads the
representation into wallet software.
</p>
<p>
This method may not be necessary, for implementations that rely on
This method may not be necessary for implementations that rely on
external storage, such as Encrypted Data Vaults.
</p>
</section>

<section>
<h3>Export</h3>

<p>Only ciphertext wallet contents can be exported.</p>

<p>Produces a serialized exported wallet representation.</p>

<p>
This method may not be necessary for implementations that rely on
external storage, such as Encrypted Data Vaults.
</p>
</section>


<section>
<h3>Unlock</h3>
<p>
Expand All @@ -1165,7 +1197,7 @@ <h3>Unlock</h3>
<p>Requires knowledge of the password used to lock the wallet.</p>

<p>
This method may not be necessary, for implementations that rely on
This method may not be necessary for implementations that rely on
external storage, such as Encrypted Data Vaults.
</p>
</section>
Expand All @@ -1178,7 +1210,7 @@ <h3>Lock</h3>
<p>Requires knowledge of the password used to lock the wallet.</p>

<p>
This method may not be necessary, for implementations that rely on
This method may not be necessary for implementations that rely on
external storage, such as Encrypted Data Vaults.
</p>

Expand All @@ -1198,6 +1230,13 @@ <h3>SignRaw</h3>
</p>

<p>Must support detached signatures.</p>

<p>
This method may not be necessary for implementations that rely on
other dedicated interface function to perform signing.

For example, a verifiable credential wallet that adds proofs using `Issue,Prove` interfaces might not implement this interface.
</p>
</section>

<section>
Expand All @@ -1210,6 +1249,13 @@ <h3>VerifyRaw</h3>
</p>

<p>Must support detached signatures.</p>

<p>
This method may not be necessary for implementations that rely on
other dedicated interface functions to verify signatures.

For example, a verifiable credential wallet that can verify credential proofs using `Verify` interface might not implement this interface.
</p>
</section>

<section>
Expand All @@ -1227,22 +1273,76 @@ <h3>Issue</h3>

<p>
Takes a Verifiable Credential without a <code>proof</code>, and an
<code>options</code> object, which contains at least a
<code>verificationMethod</code>, and <code>proofPurpose</code>.
<code>options</code> object.
</p>

<p>Produces as Verifiable Credential.</p>
<p>Produces a Verifiable Credential.</p>

<p>
Here are the options that can be used to produce a verifiable credential.
Refer to <a href="https://www.w3.org/TR/vc-data-model/#proofs-signatures">proofs-signatures</a> for various proof options:
<ul>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-verification-method">verificationMethod</a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-proofpurpose">proofPurpose </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-created">created </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-controller">controller </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-domain">domain </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-challenge">challenge </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-proof-type">proofType </a> </li>
</ul>
</p>

<pre class="example highlight" title="Issue credential example">
let credential = {...} // a verifiable credential without proof
let options = {
verificationMethod: "did:example:1234#key-1",
proofPurpose: "assertionMethod",
created: "2017-06-18T21:19:10Z"
controller: "did:example:1234",
domain: "https://www.example.com",
challenge: "0b4e419a-1410-4739-a58d-b37f4db10181",
proofType: "Ed25519Signature2018"
}
let verifiableCredential = wallet.Issue(credential, options)
</pre>
</section>

<section>
<h3>Prove</h3>
<p>
Takes an id of a Verifiable Credential, and an
<code>options</code> object, which contains at least a
<code>challenge</code>.
<code>options</code> object.
</p>

<p>Produces as Verifiable Presentation.</p>
<p>Produces a Verifiable Presentation.</p>

<p>
Here are the options that can be used to produce a verifiable credentials
Refer to <a href="https://www.w3.org/TR/vc-data-model/#proofs-signatures">proofs-signatures</a> for various proof options:
<ul>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-verification-method">verificationMethod</a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-proofpurpose">proofPurpose </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-created">created </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-controller">controller </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-domain">domain </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-challenge">challenge </a> </li>
<li><a href="https://w3c-ccg.github.io/ld-proofs/#dfn-proof-type">proofType </a> </li>
</ul>
</p>

<pre class="example highlight" title="Prove credential example">
let verifiableCredential = {...} // a verifiable credential
let options = {
verificationMethod: "did:example:1234#key-1",
proofPurpose: "assertionMethod",
created: "2017-06-18T21:19:10Z"
controller: "did:example:1234",
domain: "https://www.example.com",
challenge: "0b4e419a-1410-4739-a58d-b37f4db10181",
proofType: "Ed25519Signature2018"
}
let verifiableCredential = wallet.Prove(credential, options)
</pre>
</section>

<section>
Expand All @@ -1253,12 +1353,61 @@ <h3>Transfer</h3>
</section>

<section>
<h3>Export</h3>

<p>Only ciphertext wallet contents can be exported.</p>
<h3>Query</h3>
<p>Takes a Query and Type as input, and returns a collection of results based on current wallet contents.</p>

<p>Type input can be wallet implementation specific.</p>

<p>Since all universal wallet data models are JSON object types, here are the query types that can be supported:</p>
<ul>
<li><a href="https://www.w3.org/TR/json-ld11-framing/">QueryByFrame:</a> Can be supported by all data models.</li>
<li><a href="https://identity.foundation/presentation-exchange/">PresentationExchange:</a> Can be supported by verifiable credential data model only.</li>
</ul>

<pre class="example highlight" title="QueryByFrame example">
let search = {
"type": "QueryByFrame",
"query": {
"@context": {
"@vocab": "http://example.org/"
},
"@type": "Library",
"contains": {
"@type": "Book",
"contains": {
"@type": "Chapter"
}
}
}
}
let results = wallet.Query(search)
</pre>

<p>Produces a serialized exported wallet representation.</p>
<pre class="example highlight" title="PresentationExchange example">
let search = {
"type": "PresentationExchange",
"query": {
"presentation_definition": {
"id": "32f54163-7166-48f1-93d8-ff217bdb0653",
"locale": "en-US",
"input_descriptors": [{
"id": "name_input",
"name": "Full Legal Name",
"purpose": "We need your full legal name.",
"schema": [
{
"uri": "https://name-standards.com/name.json",
"required": true
}
]
}]
}
}
}
let results = vcWallet.Query(search)
</pre>
</section>

</section>

<section id="integration" class="informative">
Expand Down

0 comments on commit 394c7fb

Please sign in to comment.