Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for initial-state #23

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
be24691
Add support for initial-state
dhh1128 Aug 29, 2020
3c02a57
PR feedback: base64url sans pad, other params
dhh1128 Aug 31, 2020
f97b972
Method 3 Initial
TelegramSam Jan 14, 2021
593cb53
Full Multi-key Example
TelegramSam Jan 16, 2021
0b41731
Added purpose indicators
TelegramSam Feb 10, 2021
712abc2
Addition of endpoints
TelegramSam Feb 19, 2021
07e6fd3
fixed service encoding
TelegramSam Mar 6, 2021
283a67b
refactor: publicKey -> verificationMethod
Mar 15, 2021
0b8a06b
Update core.html
TelegramSam Mar 19, 2021
a1f3b2c
Merge pull request #26 from TelegramSam/method3
dhh1128 Mar 20, 2021
2f4b4e8
Merge pull request #27 from llorllale/publickey_to_verificationMethod
dhh1128 Mar 22, 2021
a9a8149
fixes spec rendering
brianorwhatever Mar 24, 2021
f1c40df
Merge pull request #29 from brianorwhatever/patch-1
dhh1128 Mar 24, 2021
b4f200b
typo, regex finesse
sklump Apr 1, 2021
202a913
Merge pull request #30 from sklump/sklump-quality-pass
dhh1128 Apr 2, 2021
da3c396
fix json syntax
letmaik Jul 12, 2021
b448a49
Merge pull request #32 from letmaik/patch-1
dhh1128 Jul 13, 2021
2b2fcca
fix of regex and example 4
DenisRybas Sep 17, 2021
3bbda3b
Merge pull request #33 from DenisRybas/fix-001
dhh1128 Sep 20, 2021
6fa62b0
Updated examples
ashcherbakov Sep 29, 2021
fd2da4a
Support "accept" field in services
ashcherbakov Sep 30, 2021
009dd7c
fix of service encoding in numalgo2
DenisRybas Sep 30, 2021
bcc1076
fix of service encoding in numalgo2
DenisRybas Sep 30, 2021
997cc29
fix of service encoding in numalgo2
DenisRybas Sep 30, 2021
ee789eb
Mention no padding for bse64 URL safe encoding of services
ashcherbakov Sep 30, 2021
e7f2447
Merge pull request #35 from ashcherbakov/master
dhh1128 Oct 1, 2021
dad9ad2
Merge branch 'master' of https://github.com/decentralized-identity/pe…
DenisRybas Oct 4, 2021
9f50801
conflicts resolved
DenisRybas Oct 4, 2021
d0c3c96
Add additional authors
Oct 4, 2021
eabe65f
Merge pull request #37 from dhh1128/master
dhh1128 Oct 5, 2021
4fe3eaf
Merge pull request #36 from DenisRybas/fix-service-encoding
dhh1128 Oct 6, 2021
0e7cc37
Fix peer DID Doc example
ashcherbakov Oct 12, 2021
0f14981
Merge pull request #38 from ashcherbakov/example-fix
dhh1128 Oct 12, 2021
f125900
apply Kyle's suggestions and resolve merge conflict
dhh1128 Mar 30, 2022
7affb38
resolve merge conflicts
dhh1128 Mar 30, 2022
4223e00
change to camelCase for initialState
dhh1128 Mar 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ <h2>Recognizing and handling peer DIDs</h2>
capture group 1, <code>transform</code> in capture group 2, and <code>encnumbasis</code> in capture group 3.
</p>

<p>Note that peer DIDs can also be used in DID URIs, with query parameters. Currently, the only query parameter formally defined for peer DIDs is <code>initial-state</code>, discussed <a target="#initial-state">below</a>. However, support for `hl` and `version-id` will be specified soon,
Copy link
Contributor

@kdenhartog kdenhartog Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>Note that peer DIDs can also be used in DID URIs, with query parameters. Currently, the only query parameter formally defined for peer DIDs is <code>initial-state</code>, discussed <a target="#initial-state">below</a>. However, support for `hl` and `version-id` will be specified soon,
<p>Note that peer DIDs can also be used in DID URLs, with query parameters. Currently, the only query parameter formally defined for peer DIDs is <code>initial-state</code>, discussed <a target="#initial-state">below</a>. Peer DIDs also support `hl` and `version-id` which are defined in <a target="https://www.w3.org/TR/did-core/#did-parameters">DID-Core</a>.

and other parameters may be used by a given implementation, so recipients of a peer DID URI should at least be prepared to parse the DID into its base DID value and its query string portion (which begins with the <code>?</code> character. All query parameter values in peer DID URIs are base64url encoded without padding (consistent with JOSE conventions).</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and other parameters may be used by a given implementation, so recipients of a peer DID URI should at least be prepared to parse the DID into its base DID value and its query string portion (which begins with the <code>?</code> character. All query parameter values in peer DID URIs are base64url encoded without padding (consistent with JOSE conventions).</p>
Other parameters MAY be used by a given implementation, so recipients of a peer DID URL should at least be prepared to parse the DID into its base DID value and its did parameters. All query parameter values in peer DID URLs MUST be base64url encoded without padding (consistent with JOSE conventions).</p>


<p>A few peer DID values are reserved and convey special meaning. See <a href="#reserved-values">Reserved Values</a>
in the appendix.
</p>
Expand Down
33 changes: 31 additions & 2 deletions did-docs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<h1>DID docs</h1>

<p>A special, ultra-simple form of DID doc is supported.</p>

<section>
<h2>Backing Storage</h2>

Expand Down Expand Up @@ -114,6 +112,37 @@ <h2>CRDTs</h2>

</section>

<section>
<h2><code>initial-state</code></h2>
<p>
Sometimes it is useful (or even required) to communicate a doc-capable peer DID value
(one with <code>numalgo</code> != 0) and its genesis or evolved DID doc as a single
combined value, instead of sharing the DID as one piece of data, and its DID doc and
deltas as another. This situation commonly occurs in connection protocols that are
built on <a target="_blank" href="https://identity.foundation/didcomm-messaging/docs/spec/">
DIDComm messaging</a>, for example: <var>A</var> wants to share with <var>B</var> the new
pairwise DID they've allocated (A.did@A:B), plus the DID's full DID doc (A.diddoc@A:B),
and DIDComm requires all information about the sender to be passed in a single
<code>from</code> field.
</p>
<p>
The way to do this is to use the <code>initial-state</code> query parameter of a peer
DID URI. All implementations of peer DIDs are required to recognize the meaning of this
Copy link
Contributor

@kdenhartog kdenhartog Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DID URI. All implementations of peer DIDs are required to recognize the meaning of this
DID URL. All implementations of peer DID implementations MUST recognize the meaning of this

query parameter, though only implementations that support deltas (layer 2 or 3) need to
process it. The parameter value can be extracted from a peer DID URI with the following
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
process it. The parameter value can be extracted from a peer DID URI with the following
process it. The parameter value can be extracted from a peer DID URL with the following

regex:
</p>
<pre class="example nohighlight" title="Regex to extract initial-state" id="initial-state-regex">
^did:peer:[^0].+[?](.*&)?initial-state=([^&]*)(?:&|$)
</pre>
<p>
This places the value of the <code>initial-state</code> parameter in capture group 1.
</p>
<p>To interpret the parameter value, it must first be base64url (minus padding) decoded. The
result MUST be a JSON array containing zero or more deltas. An empty parameter value is
also allowed, and is considered equivalent to an empty JSON array.</p>
</section>

<section>
<h2><code><dfn>publicKey</dfn></code></h2>

Expand Down