Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ Versioning follows [Semantic Versioning](https://semver.org/).

---

## [0.1.0] – 2026-12-05

Breaking Change: DID method renamed from `did:rwp` to `did:rec`. All hashes and proofs in the examples and Annexes A and B were recalculated.

Implemented CfC 13 outcomes. See
- [RWP#54](https://github.com/recordweb/rwp/issues/54)
- [RWP#55](https://github.com/recordweb/rwp/issues/55)
- [RWP#56](https://github.com/recordweb/rwp/issues/56)
- [RWP#57](https://github.com/recordweb/rwp/issues/57)
- [RWP#59](https://github.com/recordweb/rwp/issues/59)
- [RWP#60](https://github.com/recordweb/rwp/issues/60)

Discussion issue [RWP#56](https://github.com/recordweb/rwp/issues/56) led to #57.

## [0.0.17] – 2026-11-18

Implemented CfC 12 outcomes. See
Expand Down
10 changes: 5 additions & 5 deletions chapters/access-control.bs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ A denied access is not an integrity result. How a denial is communicated is defi

## Access Policy Block ## {#section-access-policy}

An implementation claiming this optional capability MAY carry the `accessPolicy` block as an entry in the [=Record=]'s `metadata.extensions` array (see [metadata.extensions](#section-metadata-extensions)), using the reserved type identifier `did:rwp:recordweb.org:extension-access-policy`:
An implementation claiming this optional capability MAY carry the `accessPolicy` block as an entry in the [=Record=]'s `metadata.extensions` array (see [metadata.extensions](#section-metadata-extensions)), using the reserved type identifier `did:rec:recordweb.org:extension-access-policy`:

<pre class='example json' title='accessPolicy'>
{
"type": "did:rwp:recordweb.org:extension-access-policy",
"type": "did:rec:recordweb.org:extension-access-policy",
"accessPolicy": {
"visibility": "restricted",
"readAccess": [
"did:rwp:bern.ch:unit-legal",
"did:rwp:bern.ch:unit-planning"
"did:rec:bern.ch:unit-legal",
"did:rec:bern.ch:unit-planning"
],
"writeAccess": [
"did:rwp:bern.ch:user-petra-muster"
"did:rec:bern.ch:user-petra-muster"
],
"delegationAllowed": true,
"expiresAt": null
Expand Down
18 changes: 9 additions & 9 deletions chapters/annex-a.bs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The text of this specification and its interpretation are still under active rev

## Record Schema ## {#annex-record-schema}

The JSON Schema for the [=Record=], Version and Metadata structures is published at [https://recordweb.org/schemas/rwp/1.0/record.json](https://recordweb.org/schemas/rwp/1.0/record.json). The `$id` of the schema is this URL. This version of RWP refers to the file whose SHA-256 value is `sha256:9f43b391aff10650ed80cbd08a7de460a5260a1d2346e343033d80071492ebb8`. The value is calculated over the serialisation of the file according to [[RFC8785]] ([[#section-integrity-hashing]]).
The JSON Schema for the [=Record=], Version and Metadata structures is published at [https://recordweb.org/schemas/rwp/1.0/record.json](https://recordweb.org/schemas/rwp/1.0/record.json). The `$id` of the schema is this URL. This version of RWP refers to the file whose SHA-256 value is `sha256:ff34cb7cb08f0365b1672a12dc9640b334866035dc4aed429a76c79ae9c157ff`. The value is calculated over the serialisation of the file according to [[RFC8785]] ([[#section-integrity-hashing]]).

This schema defines structural validation only. The requirements for hashes, proofs and states are defined in [[#chapter-integrity]] and [[#section-payload-states]].

Expand All @@ -23,11 +23,11 @@ This schema defines structural validation only. The requirements for hashes, pro
The <dfn>Root Agent</dfn> is the [=AgentRecord=] of the **RecordWeb Trust Association**. It is the initial controller of the Root Schemas ([[#annex-root-schemas]]). It is the owner of the Root Schemas, and the DID documents of the Root Schemas name it as controller.

<table class="data">
<thead><tr><th>Name<th>DID<th>versionHash of the Record<th>versionHash of the first DID document<th>Record URL</thead>
<tr><td>RecordWeb Trust Association<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:agent-recordweb-trust-association</code><td><code>sha256:c389769378c1622ef1d0d7d25c2dee595400bfef6839b5a0cf03af1ee88a2e45</code><td><code>sha256:c389769378c1622ef1d0d7d25c2dee595400bfef6839b5a0cf03af1ee88a2e45</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/agent-recordweb-trust-association">record</a>
<thead><tr><th>Name<th>DID<th>versionHash of the Record<th>Hash of the first DID document<th>Record URL</thead>
<tr><td>RecordWeb Trust Association<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:agent-recordweb-trust-association</code><td><code>sha256:c389769378c1622ef1d0d7d25c2dee595400bfef6839b5a0cf03af1ee88a2e45</code><td><code>sha256:3d5d71d0ec53c1eee665cb2299ddfebdf513c9f7b99f0c0b2699efd28e163319</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/agent-recordweb-trust-association">record</a>
</table>

The `versionHash` of the Record identifies the version of the [=AgentRecord=] that applies to this version of RWP. The `versionHash` of the first DID document identifies the first version of its DID document, which publishes the initial verification methods. A verifier MAY use this value as the starting point of the verification of the DID document history ([[#section-didoc-verification]]).
The `versionHash` of the Record identifies the version of the [=AgentRecord=] that applies to this version of RWP. The hash of the first DID document is the trust anchor of the Root Agent. It identifies the first version of the DID document of the Root Agent, which publishes the initial verification methods. A DID document version is immutable once published ([[#section-didoc-history]]), so this value does not change when later versions are created. A verifier that follows `previousVersionHash` from any version of the DID document back to the version without `previousVersionHash` MUST find the hash listed here, if it accepts this annex as the trust anchor of the Root Agent. Otherwise, the history MUST NOT be accepted as originating from the Root Agent.

A later version of the [=AgentRecord=] or of its DID document is not part of this version of RWP. A change of verification methods creates a new DID document version ([[#section-didoc-history]]) and does not require a new version of RWP.

Expand All @@ -42,11 +42,11 @@ A later version of the same [=SchemaRecord=], reachable from this version throug

<table class="data">
<thead><tr><th>Record type<th>DID<th>versionHash<th>Record URL</thead>
<tr><td>SchemaRecord<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-schemarecord</code><td><code>sha256:f6fa964c6b4ad09af2d1e2d3c8c30fbb2d812796eccd7e592f56dbd3b8299cd2</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-schemarecord">record</a>
<tr><td>AgentRecord<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-agentrecord</code><td><code>sha256:93692f566c244305f2c6ffccf3987a618281ad186247276b2b288c037ede9b2a</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-agentrecord">record</a>
<tr><td>CaseRecord<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-caserecord</code><td><code>sha256:3622a965594d5b9970f2e5c92c66f878ccfb5a972f61ac3b46ef41dbfa1116e9</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-caserecord">record</a>
<tr><td>AssertionRecord<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-assertionrecord</code><td><code>sha256:fe06970166343fd7ca1c7c948617c7f1869d2273727a66333aa459cd7a123ef4</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-assertionrecord">record</a>
<tr><td>DeletionRecord<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-deletionrecord</code><td><code>sha256:ffb5e75db60bab56ce6c97befdaeaafe5e2c8c3f0acf6931e30b79ea6be09c73</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-deletionrecord">record</a>
<tr><td>SchemaRecord<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-schemarecord</code><td><code>sha256:fae389bc6b5b864e7943cb159b1b10dad174c86d585efd3a86f5838953d9eef7</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-schemarecord">record</a>
<tr><td>AgentRecord<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-agentrecord</code><td><code>sha256:93692f566c244305f2c6ffccf3987a618281ad186247276b2b288c037ede9b2a</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-agentrecord">record</a>
<tr><td>CaseRecord<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-caserecord</code><td><code>sha256:c8a718ab424f200c1780d34bfc3be38903cc7178f33eb2534d64ed936d8635bc</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-caserecord">record</a>
<tr><td>AssertionRecord<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-assertionrecord</code><td><code>sha256:fe06970166343fd7ca1c7c948617c7f1869d2273727a66333aa459cd7a123ef4</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-assertionrecord">record</a>
<tr><td>DeletionRecord<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:schema-root-deletionrecord</code><td><code>sha256:e6aafae546e4ad7c78562e846aa5f8750a328b275b7ae7b26e3e0cf2d5292947</code><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/schema-root-deletionrecord">record</a>
</table>

Where the text of this specification and a Root Schema identified in this annex differ, the Root Schema prevails.
Expand Down
44 changes: 31 additions & 13 deletions chapters/annex-b.bs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ An existing application does not have to change its data model to take part in R
1. Assign a stable DID to each object that is to be exposed.
2. Build a Version with at least one Representation from the current data.
3. Calculate `contentHash`, `versionHash` and `recordHash` as defined in [[#chapter-integrity]].
4. Serve the DID document and the Record over HTTP as defined in [[#chapter-didoc]].
4. Serve the DID document and the Record over HTTP as defined in [[#chapter-didoc]], with the @context array defined in [[#section-didoc-context]].

The following sections show the calculation steps. The code is illustrative, not normative and not production ready. For a usable example, see: [https://github.com/recordweb/recordweb-org/tree/main/tools](https://github.com/recordweb/recordweb-org/tree/main/tools)



## Calculating hashes ## {#annex-b-hashes}

All three hashes use the same pattern: select the fields defined for the hash, serialise them as canonical JSON ([[RFC8785]]), and calculate SHA-256 over the UTF-8 bytes.
Expand All @@ -25,6 +26,7 @@ Rules that implementations commonly get wrong:
* `proof` is not part of the `versionHash`. It is part of the `recordHash`, because it is part of `payload`. The `recordHash` therefore has to be recalculated after signing.
* The order is fixed: `contentHash`, then `versionHash`, then (after signing) `recordHash`.
* Timestamps are used exactly as stored. Do not reformat them.
* The `@context` of a DID document is part of the `versionHash` input. It is serialised as the array of strings as given. Contexts are not retrieved or expanded for hashing or for verifying a `proof`.

```js
import { createHash } from 'node:crypto';
Expand Down Expand Up @@ -58,6 +60,7 @@ version.versionHash = sha(pick(version,
```



## Test vectors for hashes ## {#annex-b-vectors-hash}

The following values allow an implementer to check the calculation.
Expand All @@ -75,42 +78,45 @@ Note: The versionHash input uses the prefixed form `sha256:` plus the full 64-ch
Same input without `role`: canonical input `{"content":"# Hello RecordWeb\n","format":"text/markdown","primary":true}`, contentHash `b6c2109c5f51404a685f7fd3d60b2e66ae217f3e9cb2945f19ad16758f28ef22`.



## Complete example: SchemaRecord and instance ## {#annex-b-example}

This example consists of two finalized Records in the namespace `d2d14675-50c9-463d-b564-1ea50644c836`. Both are signed with `eddsa-jcs-2022` by the owner Agent `…:efd09e7b-5f65-4637-b06c-404a9da97f0b` (key `#key-1`). The public key is `z6MkpgYzzH9AJJTnsYYMEaaVPZN2t2iCsz76ShftvkBt5jpP`.
This example consists of two finalized Records in the namespace `d2d14675-50c9-463d-b564-1ea50644c836`. Both are signed with `eddsa-jcs-2022` by the owner Agent `…:agent-recordweb-trust-association` (key `#key-1`). The public key is `z6MkpgYzzH9AJJTnsYYMEaaVPZN2t2iCsz76ShftvkBt5jpP`.

<table>
<tr><th><th>SampleRecord SchemaRecord<th>SampleRecord instance
<tr><td>DID<td><code>…:bf9087ea-10c4-4ea3-94b7-1828f37007f8</code><td><code>…:a95437ee-25e4-469a-a2e1-c2b250b21e15</code>
<tr><td>Type (<code>recordType</code>)<td><code>…:1710c421-bb2b-462e-ad6b-fc47c934c276</code> (Root SchemaRecord)<td><code>…:bf9087ea-10c4-4ea3-94b7-1828f37007f8</code> (the SchemaRecord on the left)
<tr><td><code>schemaVersion</code><td><code>sha256:415f04c714d58c915ff0646c842f79b501d654fe6b586243977bc5550e8d7a77</code><td><code>sha256:b9b5c6ca89de15838077dc5021775938f924fa88f04626bc7496a91d0eaf35fa</code>
<tr><td>Timestamp<td><code>2026-10-28T09:00:00Z</code><td><code>2026-10-28T10:29:00Z</code>
<tr><td>contentHash<td><code>sha256:ce7fe35585911185edb268a09968157d5ae562b5afb7ac94576653bd4cb78fc3</code><td><code>sha256:30b186a5c492b14e2432419905b5343882eb9fc94940fd9e04cfcf7fd4fd058c</code>
<tr><td>versionHash<td><code>sha256:b9b5c6ca89de15838077dc5021775938f924fa88f04626bc7496a91d0eaf35fa</code><td><code>sha256:a86a4b1e25a3b436522a5047e8bf6c485ca502dfeff65fe7a5783228d16fb3e2</code>
<tr><td>recordHash<td><code>sha256:01ff63a9de0efc096c7884c12fcfae7bc1817565f82247126a8e30e20574d662</code><td><code>sha256:57715def0857e907168e5c74240e6e6d2e8679a66f8da7f1d2e7f09e1cf93b06</code>
<tr><td>proofValue<td><code>z49pizqFAyb3fWep2FRLWgoXdrdfh1kTPsQXxZNR61wAhZbEnTYBkvCS9KBZtEgpmkwM8FMkCtzmyBjYR3GTmfSyY</code><td><code>zfLVYZBoebLUnYAHvno1KNdAQztgotFQV9AW1CKNEb2ueqH8xor3PXt971utE9WQyyXcZsEEA3q3VmL5sUi3MSNU</code>
<tr><td>Type (<code>recordType</code>)<td><code>…:schema-root-schemarecord</code> (Root SchemaRecord)<td><code>…:bf9087ea-10c4-4ea3-94b7-1828f37007f8</code> (the SchemaRecord on the left)
<tr><td><code>schemaVersion</code><td><code>sha256:fae389bc6b5b864e7943cb159b1b10dad174c86d585efd3a86f5838953d9eef7</code><td><code>sha256:cb6e6981125295c64ccc5e6440d4e8e81d9939649e930fb07eaa5ccbb2b30660</code>
<tr><td>Timestamp<td><code>2026-11-05T00:00:00Z</code><td><code>2026-11-05T00:00:00Z</code>
<tr><td>contentHash<td><code>sha256:2f9d3eadb5bc708f953e8c7eeb705b9ca90db800e2c6d6c8e00239e0e0b2e37c</code><td><code>sha256:30b186a5c492b14e2432419905b5343882eb9fc94940fd9e04cfcf7fd4fd058c</code>
<tr><td>versionHash<td><code>sha256:cb6e6981125295c64ccc5e6440d4e8e81d9939649e930fb07eaa5ccbb2b30660</code><td><code>sha256:b35ddc0d728e0d6147e42a5ba224ac4952e0c84b3ecb76b0a00541afbb18395e</code>
<tr><td>recordHash<td><code>sha256:506d6ed55f121ea36bff2af4bedc54a4c3bee871a7ec29134ffa985658584704</code><td><code>sha256:24c1d5fcd3c00ccc30fa9a12529722d0b5da3f5b6604a00682104c28f815115b</code>
<tr><td>proofValue<td><code>z56WWQcwaHbZnjacaNgy7fLkuPiEUKKBwMZd3xjivg4qDtbrJnRmqtoq6bG2gTFQ6xyZu4mmFvTiLSScqgxvoAtn5</code><td><code>z2bwCBiKytCaBSE91xjytBqf7WXLaB8Tfvt4arHRYcXe7h4UzdSUGZfLTmbmD5rNN4MGedS7fmUS9z7LzhFHpMWFq</code>
</table>

The instance carries this content: `{"title": "Hello RecordWeb", "description": "First instance of the SampleRecord type."}`. It conforms to the `jsonSchema` of the SchemaRecord (`title` required, `description` optional, no other properties).



## Retrieving the example Records ### {#annex-b-retrieval}

Both Records and their DID documents are published by a productive resolver. The namespace `d2d14675-50c9-463d-b564-1ea50644c836` is registered with the resolver endpoint `https://recordweb.org/resolver/did`. The complete documents, including all fields not shown in the table above, can therefore be retrieved at any time. An implementer can use them as reference data and recalculate every hash and the signature.

<table>
<tr><th>Record<th>DID<th>DID document<th>Record
<tr><td>SampleRecord SchemaRecord<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:bf9087ea-10c4-4ea3-94b7-1828f37007f8</code><td><a href="https://recordweb.org/resolver/did/did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:bf9087ea-10c4-4ea3-94b7-1828f37007f8">resolver/did/…</a><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/bf9087ea-10c4-4ea3-94b7-1828f37007f8">resolver/records/…</a>
<tr><td>SampleRecord instance<td><code>did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:a95437ee-25e4-469a-a2e1-c2b250b21e15</code><td><a href="https://recordweb.org/resolver/did/did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:a95437ee-25e4-469a-a2e1-c2b250b21e15">resolver/did/…</a><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/a95437ee-25e4-469a-a2e1-c2b250b21e15">resolver/records/…</a>
<tr><td>SampleRecord SchemaRecord<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:bf9087ea-10c4-4ea3-94b7-1828f37007f8</code><td><a href="https://recordweb.org/resolver/did/did:rec:d2d14675-50c9-463d-b564-1ea50644c836:bf9087ea-10c4-4ea3-94b7-1828f37007f8">resolver/did/…</a><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/bf9087ea-10c4-4ea3-94b7-1828f37007f8">resolver/records/…</a>
<tr><td>SampleRecord instance<td><code>did:rec:d2d14675-50c9-463d-b564-1ea50644c836:a95437ee-25e4-469a-a2e1-c2b250b21e15</code><td><a href="https://recordweb.org/resolver/did/did:rec:d2d14675-50c9-463d-b564-1ea50644c836:a95437ee-25e4-469a-a2e1-c2b250b21e15">resolver/did/…</a><td><a href="https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/a95437ee-25e4-469a-a2e1-c2b250b21e15">resolver/records/…</a>
</table>

A DID document is resolved by appending the DID to `https://recordweb.org/resolver/did/`. Its `recordEndpoint` member points to the Record, which is retrieved from `https://recordweb.org/resolver/records/<namespace>/<record-id>`. For example:
``` bash
curl -s https://recordweb.org/resolver/did/did:rwp:d2d14675-50c9-463d-b564-1ea50644c836:a95437ee-25e4-469a-a2e1-c2b250b21e15
curl -s https://recordweb.org/resolver/did/did:rec:d2d14675-50c9-463d-b564-1ea50644c836:a95437ee-25e4-469a-a2e1-c2b250b21e15
curl -s https://recordweb.org/resolver/records/d2d14675-50c9-463d-b564-1ea50644c836/a95437ee-25e4-469a-a2e1-c2b250b21e15
```

The `currentVersion` member of the DID document equals the `versionHash` of the last Version in the Record. The `recordHash` in the Record is the value given in the table. These resolver URLs are stable for the lifetime of the example; the Records are finalized and are not modified.
The `currentVersionHash` member of the DID document equals the `versionHash` of the last Version in the Record. The `recordHash` in the Record is the value given in the table. These resolver URLs are stable for the lifetime of the example; the Records are finalized and are not modified.



## Signing ## {#annex-b-signing}
Expand All @@ -125,3 +131,15 @@ The `proof` follows `eddsa-jcs-2022`:

The signature is deterministic: signing the same input again yields the same `proofValue`.



## Signing a DID document ## {#annex-b-signing-didoc}

The `proof` of a DID document version follows `eddsa-jcs-2022`, with the verification relationship `capabilityInvocation`:

1. Build the proof configuration: `type`, `cryptosuite`, `created` (= `updated` of the DID document version), `verificationMethod`, `proofPurpose` (= `capabilityInvocation`) and the `@context` of the DID document.
2. Take the DID document version without `proof`.
3. Calculate SHA-256 over the canonical JSON of each, and concatenate: configuration hash first, then document hash (64 bytes).
4. Sign these bytes with Ed25519 and encode the signature as multibase base58btc (prefix `z`) in `proofValue`. The `proof` object in the DID document does not contain the `@context`.
5. Calculate the `versionHash` of the DID document version over the fields listed in [[#section-didoc-versionhash]], including `proof`.

Loading