Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Describe mappings more
Browse files Browse the repository at this point in the history
  • Loading branch information
clehner committed Mar 24, 2022
1 parent c9fd397 commit 8f74113
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ <h2><a href="#sotd">Status of This Document</a></h2>
<section id="context">
<h2><a href="#context">Context</a></h2>
<p><a href="https://www.w3.org/TR/json-ld11/#dfn-context">JSON-LD Context</a> file: <a href="https://demo.didkit.dev/2022/cacao-zcap/context/v1.json">https://demo.didkit.dev/2022/cacao-zcap/context/v1.json</a></p>
<p>This context file is expected to be used in <code>@context</code> following the Security Vocabulary context (<a href="https://w3id.org/security/v2">https://w3id.org/security/v2</a>).</p>
<p>This context file is expected to be used in <code>@context</code> following the Security Vocabulary context (<a href="https://w3id.org/security/v2">https://w3id.org/security/v2</a>). i.e.:</p>
<pre>
{
"@context": [
"https://w3id.org/security/v2",
"https://demo.didkit.dev/2022/cacao-zcap/context/v1.json"
],
...
}
</pre>
</section>

<section id="cacao-zcap-mapping">
Expand Down Expand Up @@ -62,7 +71,7 @@ <h2><a href="#cacao-zcap-mapping">CACAO-ZCAP Mapping</a></h2>

<tr>
<td>p.iss</td>
<td>DID &harr; DID URL</td>
<td><a href="#iss-vm-mapping">DID &harr; DID URL</a></td>
<td>proof.verificationMethod</td>
<td>yes</td>
</tr>
Expand Down Expand Up @@ -153,7 +162,7 @@ <h2><a href="#cacao-zcap-mapping">CACAO-ZCAP Mapping</a></h2>

<tr>
<td>p.resources[0]</td>
<td>URL &harr; ZCAP Root URN</td>
<td><a href="#root-zcap-mapping">URL &harr; ZCAP Root URN</a></td>
<td>proof.capabilityChain[0]</td>
<td>no</td>
</tr>
Expand All @@ -174,13 +183,30 @@ <h2><a href="#cacao-zcap-mapping">CACAO-ZCAP Mapping</a></h2>

<tr>
<td>s.s</td>
<td>bytes &harr; multibase</td>
<td><a href="#signature-proof-value-mapping">bytes &harr; multibase</a></td>
<td>proof.proofValue</td>
<td>no</td>
</tr>

</tbody>
</table>

<section id="iss-vm-mapping">
<h3><a href="#iss-vm-mapping">issuer-verificationMethod mapping</a></h3>
<p>The CACAO payload issuer property (<code>p.iss</code>) is defined by the <a href="https://github.com/ChainAgnostic/CAIPs/blob/8fdb5bfd1bdf15c9daf8aacfbcc423533764dfe9/CAIPs/caip-draft_cacao.md#container-format">CACAO CAIP</a> to be a <a href="https://github.com/w3c-ccg/did-pkh/blob/ea93b0a5e0e8b54e572f3a6ca5a294f147901d2d/did-pkh-method-draft.md">did:pkh</a> DID. The proof <a href="https://www.w3.org/TR/did-core/#dfn-verificationmethod"><code>verificationMethod</code></a> property is expected to be a <a href="https://www.w3.org/TR/did-core/#did-url-syntax">DID URL</a> resolving to a <a href="https://w3c-ccg.github.io/data-integrity-spec/#verification-methods">verification method</a>.
CACAO-ZCAP converts between these two fields by assuming that the issuer DID has a <em>default verification method</em>, that the CACAO signature is created using the <a href="https://w3c-ccg.github.io/data-integrity-spec/#verification-material">verification material</a> of that <em>default verification method</em>, and that the <em>default verification method</em> allows creating a proof of type <a href="#CacaoZcapProof2022">CacaoZcapProof2022</a>.</p>
</section>

<section id="root-zcap-mapping">
<h3><a href="#root-zcap-mapping">Root ZCAP mapping</a></h3>
<p>The first value of the CACAO payload resources array is used as the invocation target URI, that is the value of the zcap delegation's <code>invocationTarget</code> property. The invocation target URI is encoded into a root zcap URN to become the root capability id. The root zcap URN is constructed as the concatenation of <code>"urn:zcap:root:"</code> with <code>encodeURIComponent(invocationTarget)</code>. To transform the root zcap URN to the invocation target URI, the prefix <code>"urn:zcap:root:"</code> is removed and the remaining value is URL-decoded to return the invocation target id.</p>
</section>

<section id="signature-proof-value-mapping">
<h3><a href="#signature-proof-value-mapping">signature-proofValue mapping</a></h3>
<p>In CACAO, the signature is represented with an <a href="https://ipld.io/docs/schemas/features/typekinds/">IPLD</a> <em>bytes</em> type. In ZCAP and data integrity proofs, the signature is typically represented in a string in the <a href="https://w3c-ccg.github.io/data-integrity-spec/#dfn-proofvalue">proofValue</a> property of the proof object. CACAO-ZCAP encodes the signature in the proofValue property using <a href="https://datatracker.ietf.org/doc/html/draft-multiformats-multibase">multibase</a>.</p>
</section>

</section>

<section id="terms">
Expand Down

0 comments on commit 8f74113

Please sign in to comment.