@hypercerts-org/lexicon 0.9.0-beta.0 → 0.10.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +249 -180
  2. package/README.md.orig +267 -0
  3. package/lexicons/app/certified/badge/award.json +36 -0
  4. package/lexicons/app/certified/badge/definition.json +53 -0
  5. package/lexicons/app/certified/badge/response.json +36 -0
  6. package/lexicons/app/certified/defs.json +4 -16
  7. package/lexicons/app/certified/location.json +5 -8
  8. package/lexicons/com/atproto/repo/strongRef.json +1 -1
  9. package/lexicons/org/hypercerts/claim/activity.json +135 -0
  10. package/lexicons/org/hypercerts/claim/collection.json +54 -0
  11. package/lexicons/org/hypercerts/claim/contribution.json +4 -11
  12. package/lexicons/org/hypercerts/claim/evaluation.json +50 -9
  13. package/lexicons/org/hypercerts/claim/evidence.json +29 -16
  14. package/lexicons/org/hypercerts/claim/measurement.json +18 -8
  15. package/lexicons/org/hypercerts/claim/project.json +64 -0
  16. package/lexicons/org/hypercerts/claim/rights.json +16 -3
  17. package/lexicons/org/hypercerts/defs.json +71 -0
  18. package/lexicons/org/hypercerts/funding/receipt.json +66 -0
  19. package/package.json +31 -38
  20. package/types/index.ts +1257 -0
  21. package/types/lexicons.ts +1071 -0
  22. package/types/types/app/certified/badge/award.ts +48 -0
  23. package/types/types/app/certified/badge/definition.ts +49 -0
  24. package/types/types/app/certified/badge/response.ts +44 -0
  25. package/types/types/app/certified/defs.ts +14 -0
  26. package/types/types/app/certified/location.ts +49 -0
  27. package/types/types/com/atproto/repo/strongRef.ts +31 -0
  28. package/types/types/org/hypercerts/claim/activity.ts +99 -0
  29. package/types/types/org/hypercerts/claim/collection.ts +49 -0
  30. package/types/types/org/hypercerts/claim/contribution.ts +48 -0
  31. package/types/types/org/hypercerts/claim/evaluation.ts +77 -0
  32. package/types/types/org/hypercerts/claim/evidence.ts +53 -0
  33. package/types/types/org/hypercerts/claim/measurement.ts +54 -0
  34. package/types/types/org/hypercerts/claim/project.ts +53 -0
  35. package/types/types/org/hypercerts/claim/rights.ts +49 -0
  36. package/types/types/org/hypercerts/defs.ts +96 -0
  37. package/types/types/org/hypercerts/funding/receipt.ts +58 -0
  38. package/types/util.ts +82 -0
  39. package/dist/index.cjs +0 -1472
  40. package/dist/index.cjs.map +0 -1
  41. package/dist/index.d.ts +0 -2094
  42. package/dist/index.mjs +0 -1441
  43. package/dist/index.mjs.map +0 -1
  44. package/lexicons/org/hypercerts/claim.json +0 -95
  45. package/lexicons/org/hypercerts/collection.json +0 -62
package/README.md CHANGED
@@ -1,127 +1,92 @@
1
- # @hypercerts-org/lexicon
1
+ # Hypercerts Lexicon Documentation
2
2
 
3
- ATProto lexicon definitions and generated TypeScript types for the Hypercerts protocol.
3
+ This repository contains ATProto lexicon definitions for the
4
+ Hypercerts protocol. Each lexicon defines a record type that can be
5
+ stored on the ATProto network.
4
6
 
5
- ## Installation
7
+ ## Entity Relationship Diagram
6
8
 
7
- ```bash
8
- pnpm add @hypercerts-org/lexicon
9
- ```
9
+ The following diagrams show the relationship between:
10
10
 
11
- ## Features
11
+ - data classes represented by ATProto lexicons, which model the data
12
+ sets relating to hypercerts
12
13
 
13
- - **Lexicon JSON Definitions**: ATProto-compliant lexicon schemas for all Hypercerts record types
14
- - **Generated TypeScript Types**: Strongly-typed interfaces generated via `@atproto/lex-cli`
15
- - **Runtime Validation**: `isRecord` and `validateRecord` functions for each type
16
- - **Lexicon Registry**: Pre-configured registry for schema validation
17
-
18
- ## Usage
14
+ - contributors to activity records (modelled/identified by ATProto
15
+ DIDs rather than lexicons)
19
16
 
20
- ### Using Types
21
-
22
- ```typescript
23
- import type {
24
- OrgHypercertsClaim,
25
- OrgHypercertsCollection,
26
- OrgHypercertsClaimRights
27
- } from '@hypercerts-org/lexicon';
28
-
29
- // Use the Main type for full records (includes $type)
30
- const claim: OrgHypercertsClaim.Main = {
31
- $type: 'org.hypercerts.claim',
32
- title: 'My Impact Work',
33
- shortDescription: 'Description here',
34
- workScope: 'Scope of work',
35
- workTimeFrameFrom: '2023-01-01T00:00:00Z',
36
- workTimeFrameTo: '2023-12-31T23:59:59Z',
37
- createdAt: new Date().toISOString()
38
- };
39
- ```
17
+ - hypercerts protocol tokens which are onchain representations of
18
+ activity records in ATProto
40
19
 
41
- ### Runtime Validation
20
+ Note that contributors and tokens do not require lexicons.
42
21
 
43
- ```typescript
44
- import { OrgHypercertsClaim } from '@hypercerts-org/lexicon';
45
-
46
- // Check if a value matches the type
47
- if (OrgHypercertsClaim.isRecord(unknownValue)) {
48
- // unknownValue is now typed as OrgHypercertsClaim.Main
49
- console.log(unknownValue.title);
50
- }
51
-
52
- // Validate with detailed error information
53
- const result = OrgHypercertsClaim.validateRecord(data);
54
- if (result.success) {
55
- // data is valid
56
- } else {
57
- console.error(result.error);
58
- }
59
- ```
22
+ To distinguish these in the diagrams, each class has one of the
23
+ following icons:
60
24
 
61
- ### Using Lexicon Constants
25
+ - "D" means "data class"
26
+ - "E" means "entity"
27
+ - "P" means "protocol"
62
28
 
63
- ```typescript
64
- import { HYPERCERT_LEXICONS, HYPERCERT_COLLECTIONS } from '@hypercerts-org/lexicon';
29
+ ![Hypercert ERD](ERD.svg)
65
30
 
66
- // Collection names for ATProto operations
67
- console.log(HYPERCERT_COLLECTIONS.CLAIM); // 'org.hypercerts.claim'
68
- console.log(HYPERCERT_COLLECTIONS.COLLECTION); // 'org.hypercerts.collection'
69
- console.log(HYPERCERT_COLLECTIONS.RIGHTS); // 'org.hypercerts.claim.rights'
31
+ <details>
32
+ <summary>View ERD with field details</summary>
70
33
 
71
- // Full lexicon documents for registry
72
- import { Lexicons } from '@atproto/lexicon';
73
- const registry = new Lexicons(HYPERCERT_LEXICONS);
74
- ```
34
+ ![Hypercert ERD with fields](ERD-with-fields.svg)
75
35
 
76
- ## Type Inheritance
36
+ </details>
77
37
 
78
- This package is the source of truth for Hypercerts types. The SDK packages re-export these types with friendly aliases:
38
+ ## Installation
79
39
 
40
+ ```bash
41
+ npm i @hypercerts-org/lexicon
80
42
  ```
81
- @hypercerts-org/lexicon
82
- ├── OrgHypercertsClaim.Main → sdk-core: HypercertClaim
83
- ├── OrgHypercertsClaimRights.Main → sdk-core: HypercertRights
84
- ├── OrgHypercertsCollection.Main → sdk-core: HypercertCollection
85
- └── ...etc
86
- ```
87
-
88
- **Recommendation**: Import types from `@hypercerts-org/sdk-core` for cleaner imports, unless you need direct access to validation functions.
89
-
90
- ## Development
91
43
 
92
- ### Regenerating Types
44
+ ## Usage
93
45
 
94
- Types are generated from the lexicon JSON files using `@atproto/lex-cli`:
46
+ ```typescript
47
+ import { AtpBaseClient } from "@hypercerts-org/lexicon";
48
+ import type { HypercertClaim } from "@hypercerts-org/lexicon";
49
+
50
+ const client = new AtpBaseClient({
51
+ service: "https://bsky.social",
52
+ headers: { Authorization: `Bearer ${token}` },
53
+ });
54
+
55
+ const hypercert: HypercertClaim = {
56
+ $type: "org.hypercerts.claim.activity",
57
+ title: "My Impact Work",
58
+ shortDescription: "Description here",
59
+ workScope: "Scope of work",
60
+ startDate: "2023-01-01T00:00:00Z",
61
+ endDate: "2023-12-31T23:59:59Z",
62
+ createdAt: new Date().toISOString(),
63
+ };
95
64
 
96
- ```bash
97
- pnpm generate # Regenerates src/types/ from lexicons/
98
- pnpm build # Build the package
65
+ await client.org.hypercerts.claim.activity.create(
66
+ { repo: "did:plc:example" },
67
+ hypercert,
68
+ );
99
69
  ```
100
70
 
101
- ### Adding New Lexicons
102
-
103
- 1. Add lexicon JSON file to `lexicons/` directory
104
- 2. Run `pnpm generate` to regenerate types
105
- 3. Export new types from `src/index.ts`
106
- 4. Update `HYPERCERT_COLLECTIONS` if adding a new collection
107
-
108
71
  ## Certified Lexicons
109
72
 
110
73
  Certified lexicons are common/shared lexicons that can be used across multiple protocols.
111
74
 
112
75
  ### Common Definitions
113
76
 
114
- **Lexicon ID:** `app.certified.defs`
77
+ **Lexicon ID:** `org.hypercerts.defs`
115
78
 
116
79
  **Description:** Common type definitions used across all certified protocols.
117
80
 
118
81
  #### Defs
119
82
 
120
- | Def | Type | Description | Comments |
121
- |-----|------|-------------|----------|
122
- | `uri` | `string` | URI to external data | |
123
- | `smallBlob` | `blob` | Data stored in a PDS (up to 10MB) | |
124
- | `largeBlob` | `blob` | Data stored in a PDS (up to 100MB) | |
83
+ | Def | Type | Description | Comments |
84
+ | ------------ | -------- | ----------------------------------------- | --------------------------------------- |
85
+ | `uri` | `object` | Object containing a URI to external data | Has `uri` property (string, format uri) |
86
+ | `smallBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 10MB) |
87
+ | `largeBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 100MB) |
88
+ | `smallImage` | `object` | Object containing a small image | Has `image` property (blob, up to 5MB) |
89
+ | `largeImage` | `object` | Object containing a large image | Has `image` property (blob, up to 10MB) |
125
90
 
126
91
  ---
127
92
 
@@ -129,21 +94,68 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
129
94
 
130
95
  **Lexicon ID:** `app.certified.location`
131
96
 
132
- **Description:** A location reference for use across certified protocols. For more information about
97
+ **Description:** A location reference for use across certified protocols. For more information about
133
98
 
134
- **Key:** `any`
99
+ **Key:** `tid`
135
100
 
136
101
  #### Properties
137
102
 
138
- | Property | Type | Required | Description | Comments |
139
- |----------|------|----------|-------------|----------|
140
- | `lpVersion` | `string` | ✅ | The version of the Location Protocol | |
141
- | `srs` | `string` | ✅ | The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system. | |
142
- | `locationType` | `string` | ✅ | An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point) | |
143
- | `location` | `union` | ✅ | The location of where the work was performed as a URI or blob. | |
144
- | `name` | `string` | ❌ | Optional name for this location | |
145
- | `description` | `string` | ❌ | Optional description for this location | |
146
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
103
+ | Property | Type | Required | Description |
104
+ | -------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
105
+ | `lpVersion` | `string` | ✅ | The version of the Location Protocol |
106
+ | `srs` | `string` | ✅ | The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system. |
107
+ | `locationType` | `string` | ✅ | An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point) |
108
+ | `location` | `union` | ✅ | The location of where the work was performed as a URI or blob. |
109
+ | `name` | `string` | ❌ | Optional name for this location |
110
+ | `description` | `string` | ❌ | Optional description for this location |
111
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created |
112
+
113
+ ### Badges Lexicon
114
+
115
+ **Lexicon IDs:** `app.certified.badge.definition`, `app.certified.badge.award`, `app.certified.badge.response`
116
+
117
+ **Description:** Defines badge metadata, award records, and recipient responses for certified badges that can be used across protocols.
118
+
119
+ #### Badge Definition
120
+
121
+ **Lexicon ID:** `app.certified.badge.definition`
122
+
123
+ **Key:** `tid`
124
+
125
+ | Property | Type | Required | Description |
126
+ | ---------------- | -------- | -------- | ---------------------------------------------------------------------- |
127
+ | `badgeType` | `string` | ✅ | Category of the badge (e.g., endorsement, participation, affiliation). |
128
+ | `title` | `string` | ✅ | Human-readable title of the badge. |
129
+ | `icon` | `blob` | ✅ | Icon representing the badge (accepted `image/*` types, maxSize 1MB). |
130
+ | `description` | `string` | ❌ | Optional short statement describing the badge. |
131
+ | `allowedIssuers` | `array` | ❌ | Optional allowlist of DIDs allowed to issue this badge. |
132
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
133
+
134
+ #### Badge Award
135
+
136
+ **Lexicon ID:** `app.certified.badge.award`
137
+
138
+ **Key:** `tid`
139
+
140
+ | Property | Type | Required | Description |
141
+ | ----------- | -------- | -------- | ------------------------------------------------------------------------------------ |
142
+ | `badge` | `ref` | ✅ | Reference to the badge definition for this award (`app.certified.badge.definition`). |
143
+ | `subject` | `union` | ✅ | Entity the badge award is for (either a DID or a specific AT Protocol record). |
144
+ | `note` | `string` | ❌ | Optional explanation for the award. |
145
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
146
+
147
+ #### Badge Response
148
+
149
+ **Lexicon ID:** `app.certified.badge.response`
150
+
151
+ **Key:** `tid`
152
+
153
+ | Property | Type | Required | Description |
154
+ | ------------ | -------- | -------- | ---------------------------------------------------------------------- |
155
+ | `badgeAward` | `ref` | ✅ | Reference to the badge award (`app.certified.badge.award`). |
156
+ | `response` | `string` | ✅ | Enum: `accepted` or `rejected`. |
157
+ | `weight` | `string` | ❌ | Optional relative weight assigned by the recipient (stored as string). |
158
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
147
159
 
148
160
  ---
149
161
 
@@ -151,9 +163,9 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
151
163
 
152
164
  Hypercerts-specific lexicons for tracking impact work and claims.
153
165
 
154
- ### Hypercerts Record
166
+ ### Hypercerts Activity Claim
155
167
 
156
- **Lexicon ID:** `org.hypercerts.claim.record`
168
+ **Lexicon ID:** `org.hypercerts.claim.activity`
157
169
 
158
170
  **Description:** The main lexicon where everything is connected to. This is the hypercert record that tracks impact work.
159
171
 
@@ -161,42 +173,50 @@ Hypercerts-specific lexicons for tracking impact work and claims.
161
173
 
162
174
  #### Properties
163
175
 
164
- | Property | Type | Required | Description | Comments |
165
- |----------|------|----------|-------------|----------|
166
- | `title` | `string` | ✅ | Title of the hypercert | |
167
- | `shortDescription` | `string` | ✅ | Short blurb of the impact work done. | |
168
- | `description` | `string` | ❌ | Optional longer description of the impact work done. | |
169
- | `image` | `union` | ❌ | The hypercert visual representation as a URI or blob | |
170
- | `workScope` | `string` | | Scope of the work performed | |
171
- | `workTimeframeFrom` | `string` | ✅ | When the work began | |
172
- | `workTimeFrameTo` | `string` | ✅ | When the work ended | |
173
- | `evidence` | `array` | ❌ | Supporting evidence, documentation, or external data URIs | References must conform to `org.hypercerts.claim.evidence` |
174
- | `contributions` | `array` | ❌ | A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contributions` |
175
- | `rights` | `ref` | ❌ | A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
176
- | `location` | `ref` | ❌ | A strong reference to the location where the work for done hypercert was located | References must conform to `org.hypercerts.claim.location` |
177
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
176
+ | Property | Type | Required | Description | Comments |
177
+ | ------------------ | -------- | -------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
178
+ | `title` | `string` | ✅ | Title of the hypercert | |
179
+ | `shortDescription` | `string` | ✅ | Short blurb of the impact work done. | |
180
+ | `description` | `string` | ❌ | Optional longer description of the impact work done. | |
181
+ | `image` | `union` | ❌ | The hypercert visual representation as a URI or image blob | |
182
+ | `workScope` | `object` | | Logical scope of the work using label-based conditions | Object with `withinAllOf`, `withinAnyOf`, `withinNoneOf` arrays of labels |
183
+ | `startDate` | `string` | ✅ | When the work began | |
184
+ | `endDate` | `string` | ✅ | When the work ended | |
185
+ | `contributions` | `array` | ❌ | A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contribution` |
186
+ | `rights` | `ref` | ❌ | A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
187
+ | `location` | `ref` | ❌ | A strong reference to the location where the work for done hypercert was located | References must conform to `app.certified.location` |
188
+ | `project` | `string` | ❌ | A reference (AT-URI) to the project record that this activity is part of | References must conform to `org.hypercerts.claim.project` |
189
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
190
+
191
+ #### Defs
192
+
193
+ ##### activityWeight
194
+
195
+ | Property | Type | Required | Description |
196
+ | ---------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197
+ | `activity` | `ref` | ✅ | A strong reference to a hypercert activity record. This activity must conform to the lexicon org.hypercerts.claim.activity |
198
+ | `weight` | `string` | ✅ | The relative weight/importance of this hypercert activity (stored as a string to avoid float precision issues). Weights can be any positive numeric values and do not need to sum to a specific total; normalization can be performed by the consuming application as needed. |
178
199
 
179
200
  ---
180
201
 
181
- ### Hypercerts Contributor
202
+ ### Hypercerts Contribution
182
203
 
183
204
  **Lexicon ID:** `org.hypercerts.claim.contribution`
184
205
 
185
206
  **Description:** A contribution made toward a hypercert's impact.
186
207
 
187
- **Key:** `any`
208
+ **Key:** `tid`
188
209
 
189
210
  #### Properties
190
211
 
191
- | Property | Type | Required | Description | Comments |
192
- |----------|------|----------|-------------|----------|
193
- | `hypercert` | `ref` | | A strong reference to the hypercert this contribution is for | The record referenced must conform with the lexicon `org.hypercerts.claim.record` |
194
- | `role` | `string` | | Role or title of the contributor(s). | |
195
- | `contributors` | `array` | | List of the contributors (names, pseudonyms, or DIDs). If multiple contributors are stored in the same hypercertContribution, then they would have the exact same role. | |
196
- | `description` | `string` | ❌ | What the contribution concretely achieved | |
197
- | `workTimeframeFrom` | `string` | ❌ | When this contribution started. This should be a subset of the hypercert timeframe. | |
198
- | `workTimeframeTo` | `string` | | When this contribution finished. This should be a subset of the hypercert timeframe. | |
199
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
212
+ | Property | Type | Required | Description |
213
+ | -------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
214
+ | `role` | `string` | | Role or title of the contributor(s). |
215
+ | `contributors` | `array` | | List of the contributors (names, pseudonyms, or DIDs). If multiple contributors are stored in the same hypercertContribution, then they would have the exact same role. |
216
+ | `description` | `string` | | What the contribution concretely achieved |
217
+ | `startDate` | `string` | ❌ | When this contribution started. This should be a subset of the hypercert timeframe. |
218
+ | `endDate` | `string` | ❌ | When this contribution finished. This should be a subset of the hypercert timeframe. |
219
+ | `createdAt` | `string` | | Client-declared timestamp when this record was originally created |
200
220
 
201
221
  ---
202
222
 
@@ -204,19 +224,22 @@ Hypercerts-specific lexicons for tracking impact work and claims.
204
224
 
205
225
  **Lexicon ID:** `org.hypercerts.claim.evaluation`
206
226
 
207
- **Description:** An evaluation of a hypercert or other claim
227
+ **Description:** An evaluation of a hypercert record (e.g. an activity and its impact).
208
228
 
209
229
  **Key:** `tid`
210
230
 
211
231
  #### Properties
212
232
 
213
- | Property | Type | Required | Description | Comments |
214
- |----------|------|----------|-------------|----------|
215
- | `subject` | `ref` | | A strong reference to the evaluated claim | (e.g measurement, hypercert, contribution, etc) |
216
- | `evaluators` | `array` | ✅ | DIDs of the evaluators | |
217
- | `evaluations` | `array` | ❌ | Evaluation data (URIs or blobs) containing detailed reports or methodology | |
218
- | `summary` | `string` | | Brief evaluation summary | |
219
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
233
+ | Property | Type | Required | Description | Comments |
234
+ | -------------- | -------- | -------- | --------------------------------------------------------------------------- | ------------------------------------------------------------- |
235
+ | `subject` | `ref` | | A strong reference to what is being evaluated | (e.g activity, measurement, contribution, etc.) |
236
+ | `evaluators` | `array` | ✅ | DIDs of the evaluators | |
237
+ | `content` | `array` | ❌ | Evaluation data (URIs or blobs) containing detailed reports or methodology | |
238
+ | `measurements` | `array` | | Optional references to the measurements that contributed to this evaluation | References must conform to `org.hypercerts.claim.measurement` |
239
+ | `summary` | `string` | ✅ | Brief evaluation summary | |
240
+ | `score` | `object` | ❌ | Optional overall score for this evaluation on a numeric scale | Object with `min`, `max`, and `value` (integers) |
241
+ | `location` | `ref` | ❌ | An optional reference for georeferenced evaluations | References must conform to `app.certified.location` |
242
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
220
243
 
221
244
  ---
222
245
 
@@ -224,19 +247,21 @@ Hypercerts-specific lexicons for tracking impact work and claims.
224
247
 
225
248
  **Lexicon ID:** `org.hypercerts.claim.evidence`
226
249
 
227
- **Description:** A piece of evidence supporting a hypercert claim
250
+ **Description:** A piece of evidence related to a hypercert record (e.g. an activity, project, claim, or evaluation). Evidence may support, clarify, or challenge the referenced subject.
228
251
 
229
- **Key:** `any`
252
+ **Key:** `tid`
230
253
 
231
254
  #### Properties
232
255
 
233
- | Property | Type | Required | Description | Comments |
234
- |----------|------|----------|-------------|----------|
235
- | `content` | `union` | | A piece of evidence (URI or blobs) supporting a hypercert claim | |
236
- | `title` | `string` | | Optional title to describe the nature of the evidence | |
237
- | `shortDescription` | `string` | ✅ | Short description explaining what this evidence demonstrates or proves | |
238
- | `description` | `string` | ❌ | Optional longer description describing the impact claim evidence. | |
239
- | `createdAt` | `string` | | Client-declared timestamp when this hypercert claim was originally created | |
256
+ | Property | Type | Required | Description | Comments |
257
+ | ------------------ | -------- | -------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
258
+ | `subject` | `ref` | | A strong reference to the record this evidence relates to | (e.g. an activity, project, claim, or evaluation) |
259
+ | `content` | `union` | | A piece of evidence (URI or blob) related to the subject record | May support, clarify, or challenge a hypercert claim |
260
+ | `title` | `string` | ✅ | Title to describe the nature of the evidence | |
261
+ | `shortDescription` | `string` | ❌ | Short description explaining what this evidence shows | |
262
+ | `description` | `string` | | Longer description describing the evidence in more detail | |
263
+ | `relationType` | `string` | ❌ | How this evidence relates to the subject | Known values: `supports`, `challenges`, `clarifies` |
264
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
240
265
 
241
266
  ---
242
267
 
@@ -244,27 +269,29 @@ Hypercerts-specific lexicons for tracking impact work and claims.
244
269
 
245
270
  **Lexicon ID:** `org.hypercerts.claim.measurement`
246
271
 
247
- **Description:** External measurement data supporting a hypercert claim
272
+ **Description:** Measurement data related to a hypercert record (e.g. an activity and its impact).
248
273
 
249
274
  **Key:** `tid`
250
275
 
251
276
  #### Properties
252
277
 
253
- | Property | Type | Required | Description | Comments |
254
- |----------|------|----------|-------------|----------|
255
- | `hypercert` | `ref` | | A strong reference to the hypercert that this measurement is for | The record referenced must conform with the lexicon `org.hypercerts.claim.record` |
256
- | `measurers` | `array` | ✅ | DIDs of the entity (or entities) that measured this data. | |
257
- | `metric` | `string` | ✅ | The metric being measured | |
258
- | `value` | `string` | ✅ | The measured value | |
259
- | `measurementMethodURI` | `string` | ❌ | URI to methodology documentation, standard protocol, or measurement procedure | |
260
- | `evidenceURI` | `array` | ❌ | URIs to supporting evidence or data | |
261
- | `createdAt` | `string` | | Client-declared timestamp when this record was originally created | |
278
+ | Property | Type | Required | Description | Comments |
279
+ | ------------- | -------- | -------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------ |
280
+ | `subject` | `ref` | | A strong reference to the record this measurement refers to | (e.g. an activity, project, or claim) |
281
+ | `measurers` | `array` | ✅ | DIDs of the entity (or entities) that measured this data | |
282
+ | `metric` | `string` | ✅ | The metric being measured | |
283
+ | `value` | `string` | ✅ | The measured value | |
284
+ | `methodType` | `string` | ❌ | Short identifier for the measurement methodology | |
285
+ | `methodURI` | `string` | ❌ | URI to methodology documentation, standard protocol, or measurement procedure | |
286
+ | `evidenceURI` | `array` | | URIs to related evidence or underlying data | (e.g. org.hypercerts.claim.evidence records or raw datasets) |
287
+ | `location` | `ref` | ❌ | A strong reference to the location where the measurement was taken | References must conform to `app.certified.location` |
288
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
262
289
 
263
290
  ---
264
291
 
265
- ### org.hypercerts.collection
292
+ ### org.hypercerts.claim.collection
266
293
 
267
- **Lexicon ID:** `org.hypercerts.collection`
294
+ **Lexicon ID:** `org.hypercerts.claim.collection`
268
295
 
269
296
  **Description:** A collection/group of hypercerts that have a specific property.
270
297
 
@@ -272,22 +299,37 @@ Hypercerts-specific lexicons for tracking impact work and claims.
272
299
 
273
300
  #### Properties
274
301
 
275
- | Property | Type | Required | Description | Comments |
276
- |----------|------|----------|-------------|----------|
277
- | `title` | `string` | ✅ | The title of this collection | |
278
- | `shortDescription` | `string` | ❌ | A short description of this collection | |
279
- | `coverPhoto` | `union` | ❌ | The cover photo of this collection (either in URI format or in a blob). | |
280
- | `claims` | `array` | | Array of claims with their associated weights in this collection | Each item references `#claimItem` |
281
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
302
+ | Property | Type | Required | Description | Comments |
303
+ | ------------------ | -------- | -------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------- |
304
+ | `title` | `string` | ✅ | The title of this collection | |
305
+ | `shortDescription` | `string` | ❌ | A short description of this collection | |
306
+ | `avatar` | `blob` | ❌ | Primary avatar image representing this collection across apps and views | Typically a square image |
307
+ | `coverPhoto` | `blob` | | The cover photo of this collection | |
308
+ | `activities` | `array` | ✅ | Array of activities with their associated weights in this collection | Each item references `org.hypercerts.claim.activity#activityWeight` |
309
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
282
310
 
283
- #### Defs
311
+ ---
284
312
 
285
- ##### claimItem
313
+ ### org.hypercerts.claim.project
286
314
 
287
- | Property | Type | Required | Description | Comments |
288
- |----------|------|----------|-------------|----------|
289
- | `claim` | `ref` | | A strong reference to a hypercert claim record. This claim must conform to the lexicon org.hypercerts.claim.record | |
290
- | `weight` | `string` | ✅ | The weight/importance of this hypercert claim in the collection (a percentage from 0-100, stored as a string to avoid float precision issues). The total claim weights should add up to 100. | |
315
+ **Lexicon ID:** `org.hypercerts.claim.project`
316
+
317
+ **Description:** A project that can include multiple activities, each of which may be linked to at most one project.
318
+
319
+ **Key:** `tid`
320
+
321
+ #### Properties
322
+
323
+ | Property | Type | Required | Description | Comments |
324
+ | ------------------ | -------- | -------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
325
+ | `title` | `string` | ✅ | Title of this project | |
326
+ | `shortDescription` | `string` | ✅ | Short summary of this project, suitable for previews and list views | |
327
+ | `description` | `ref` | ❌ | Rich-text description of this project, represented as a Leaflet linear document | References must conform to `pub.leaflet.pages.linearDocument#main` |
328
+ | `avatar` | `blob` | ❌ | Primary avatar image representing this project across apps and views | Typically a square logo or project identity image |
329
+ | `coverPhoto` | `blob` | ❌ | The cover photo of this project | |
330
+ | `activities` | `array` | ❌ | Array of activities with their associated weights in this project | Each item references `org.hypercerts.claim.activity#activityWeight` |
331
+ | `location` | `ref` | ❌ | A strong reference to a location record describing where the work took place | References must conform to `app.certified.location` |
332
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
291
333
 
292
334
  ---
293
335
 
@@ -295,18 +337,45 @@ Hypercerts-specific lexicons for tracking impact work and claims.
295
337
 
296
338
  **Lexicon ID:** `org.hypercerts.claim.rights`
297
339
 
298
- **Description:** Describes the rights that a user has with a hypercert, such as whether it can be sold, transferred, and under what conditions.
340
+ **Description:** Describes the rights that a contributor and/or an owner has, such as whether the hypercert can be sold, transferred, and under what conditions.
299
341
 
300
- **Key:** `any`
342
+ **Key:** `tid`
343
+
344
+ #### Properties
345
+
346
+ | Property | Type | Required | Description | Comments |
347
+ | ------------------- | -------- | -------- | ----------------------------------------------------------------- | ----------- |
348
+ | `rightsName` | `string` | ✅ | Full name of the rights | |
349
+ | `rightsType` | `string` | ✅ | Short rights identifier for easier search | |
350
+ | `rightsDescription` | `string` | ✅ | Description of the rights of this hypercert | |
351
+ | `attachment` | `union` | ❌ | An attachment to define the rights further, e.g. a legal document | URI or blob |
352
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
353
+
354
+ ---
355
+
356
+ ### org.hypercerts.funding.receipt
357
+
358
+ **Lexicon ID:** `org.hypercerts.funding.receipt`
359
+
360
+ **Description:** Records a funding receipt for a payment from one user to another user. It may be recorded by the recipient, by the sender, or by a third party. The sender may remain anonymous.
361
+
362
+ **Key:** `tid`
301
363
 
302
364
  #### Properties
303
365
 
304
- | Property | Type | Required | Description | Comments |
305
- |----------|------|----------|-------------|----------|
306
- | `rightsName` | `string` | ✅ | Full name of the rights | |
307
- | `rightsType` | `string` | ✅ | Short rights identifier for easier search | |
308
- | `rightsDescription` | `string` | ✅ | Description of the rights of this hypercert | |
309
- | `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
366
+ | Property | Type | Required | Description | Comments |
367
+ | ---------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
368
+ | `from` | `string` | ✅ | DID of the sender who transferred the funds. If sender wants to stay anonymous, mark this explicitly. | Format: did |
369
+ | `to` | `string` | ✅ | The recipient of the funds, who can be identified by DID or a clear-text name. | |
370
+ | `amount` | `string` | ✅ | Amount of funding received. | |
371
+ | `currency` | `string` | ✅ | Currency of the payment (e.g. EUR, USD, ETH). | |
372
+ | `paymentRail` | `string` | ❌ | How the funds were transferred (e.g. bank_transfer, credit_card, onchain, cash, check, payment_processor). | |
373
+ | `paymentNetwork` | `string` | ❌ | Optional network within the payment rail (e.g. arbitrum, ethereum, sepa, visa, paypal). | |
374
+ | `transactionId` | `string` | ❌ | Identifier of the underlying payment transaction (e.g. bank reference, onchain transaction hash, or processor-specific ID). | Use paymentNetwork to specify the network where applicable. |
375
+ | `for` | `string` | ❌ | Optional reference to the activity, project, or organization this funding relates to. | Format: at-uri |
376
+ | `notes` | `string` | ❌ | Optional notes or additional context for this funding receipt. | maxLength: 500 |
377
+ | `occurredAt` | `string` | ❌ | Timestamp when the payment occurred. | Format: datetime |
378
+ | `createdAt` | `string` | ✅ | Client-declared timestamp when this receipt record was created. | Format: datetime |
310
379
 
311
380
  ---
312
381