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 12, 2021
1 parent 390c6ee commit a1f52c3
Showing 1 changed file with 158 additions and 9 deletions.
167 changes: 158 additions & 9 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
company: "Transmute",
companyURL: "https://transmute.industries/",
},
{
name: "Sudesh Shetty",
url: "https://www.linkedin.com/in/sudesh-r-shetty-6bb67b7/",
company: "SecureKey",
companyURL: "https://securekey.com/",
},
],
// authors, add as many as you like.
// This is optional, uncomment if you have authors as well as editors.
Expand Down Expand Up @@ -493,7 +499,7 @@ <h3 id="CachedDIDDocument">Cached DID Document</h3>
]
}
}

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

<p>
A wallet implementation MAY NOT implement all the interfaces defined below.

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

</p>

<section>
<h3>Import</h3>
<p>
Expand All @@ -1156,6 +1174,20 @@ <h3>Import</h3>
</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 Down Expand Up @@ -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 may not implement this interface since it adds proofs using `Issue,Prove` interfaces.
</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 may not implement this interface since it can verify credential proofs using `Verify` 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>
Here are the options that can be used to produce a verifiable credentials.
Refer <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">doman </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>
Here are the options that can be used to produce a verifiable credentials.
Refer <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">doman </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 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 a1f52c3

Please sign in to comment.