@carrot-foundation/schemas 0.1.6

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 (47) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +45 -0
  3. package/dist/index.js +1 -0
  4. package/dist/mass-id/index.js +2 -0
  5. package/dist/mass-id/mass-id.data.schema.js +346 -0
  6. package/dist/mass-id/mass-id.schema.js +162 -0
  7. package/dist/shared/base.schema.js +127 -0
  8. package/dist/shared/definitions.schema.js +283 -0
  9. package/dist/shared/entities/location.schema.js +68 -0
  10. package/dist/shared/entities/participant.schema.js +24 -0
  11. package/dist/shared/helpers.schema.js +16 -0
  12. package/dist/shared/nft.schema.js +193 -0
  13. package/package.json +89 -0
  14. package/schemas/ipfs/collection/collection.example.json +25 -0
  15. package/schemas/ipfs/collection/collection.schema.json +47 -0
  16. package/schemas/ipfs/credit/credit.example.json +27 -0
  17. package/schemas/ipfs/credit/credit.schema.json +61 -0
  18. package/schemas/ipfs/gas-id/gas-id.attributes.schema.json +219 -0
  19. package/schemas/ipfs/gas-id/gas-id.data.schema.json +120 -0
  20. package/schemas/ipfs/gas-id/gas-id.example.json +245 -0
  21. package/schemas/ipfs/gas-id/gas-id.schema.json +29 -0
  22. package/schemas/ipfs/mass-id/mass-id.example.json +318 -0
  23. package/schemas/ipfs/mass-id/mass-id.schema.json +1325 -0
  24. package/schemas/ipfs/mass-id-audit/mass-id-audit.data.schema.json +130 -0
  25. package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +291 -0
  26. package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +26 -0
  27. package/schemas/ipfs/methodology/methodology.data.schema.json +121 -0
  28. package/schemas/ipfs/methodology/methodology.example.json +222 -0
  29. package/schemas/ipfs/methodology/methodology.schema.json +26 -0
  30. package/schemas/ipfs/purchase-id/purchase-id.attributes.schema.json +91 -0
  31. package/schemas/ipfs/purchase-id/purchase-id.data.schema.json +337 -0
  32. package/schemas/ipfs/purchase-id/purchase-id.example.json +224 -0
  33. package/schemas/ipfs/purchase-id/purchase-id.schema.json +29 -0
  34. package/schemas/ipfs/recycled-id/recycled-id.attributes.schema.json +202 -0
  35. package/schemas/ipfs/recycled-id/recycled-id.data.schema.json +63 -0
  36. package/schemas/ipfs/recycled-id/recycled-id.example.json +213 -0
  37. package/schemas/ipfs/recycled-id/recycled-id.schema.json +29 -0
  38. package/schemas/ipfs/shared/base/base.schema.json +163 -0
  39. package/schemas/ipfs/shared/certificate/certificate.schema.json +145 -0
  40. package/schemas/ipfs/shared/definitions/definitions.schema.json +250 -0
  41. package/schemas/ipfs/shared/entities/location/location.schema.json +95 -0
  42. package/schemas/ipfs/shared/entities/participant/participant.schema.json +28 -0
  43. package/schemas/ipfs/shared/nft/nft.schema.json +182 -0
  44. package/schemas/ipfs/shared/references/audit-reference/audit-reference.schema.json +42 -0
  45. package/schemas/ipfs/shared/references/gas-id-reference/gas-id-reference.schema.json +27 -0
  46. package/schemas/ipfs/shared/references/mass-id-reference/mass-id-reference.schema.json +27 -0
  47. package/schemas/ipfs/shared/references/methodology-reference/methodology-reference.schema.json +34 -0
@@ -0,0 +1,202 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/recycled-id/recycled-id.attributes.schema.json",
4
+ "$defs": {
5
+ "attribute_methodology": {
6
+ "type": "object",
7
+ "required": ["trait_type", "value"],
8
+ "properties": {
9
+ "trait_type": {
10
+ "const": "Methodology"
11
+ },
12
+ "value": {
13
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
14
+ "maxLength": 100,
15
+ "description": "Name of the recycling methodology used for certification",
16
+ "example": "BOLD Recycling"
17
+ }
18
+ },
19
+ "additionalProperties": false
20
+ },
21
+ "attribute_recycled_mass_weight": {
22
+ "type": "object",
23
+ "required": ["trait_type", "value", "display_type"],
24
+ "properties": {
25
+ "trait_type": {
26
+ "const": "Recycled Mass Weight (kg)"
27
+ },
28
+ "value": {
29
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/weight_kg",
30
+ "description": "Total weight of recycled materials in kilograms"
31
+ },
32
+ "display_type": {
33
+ "const": "number"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "attribute_credit_amount": {
39
+ "type": "object",
40
+ "required": ["trait_type", "value", "display_type"],
41
+ "properties": {
42
+ "trait_type": {
43
+ "const": "Credit Amount"
44
+ },
45
+ "value": {
46
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_negative_float",
47
+ "description": "Amount of credits issued"
48
+ },
49
+ "display_type": {
50
+ "const": "number"
51
+ }
52
+ },
53
+ "additionalProperties": false
54
+ },
55
+ "attribute_credit_type": {
56
+ "type": "object",
57
+ "required": ["trait_type", "value"],
58
+ "properties": {
59
+ "trait_type": {
60
+ "const": "Credit Type"
61
+ },
62
+ "value": {
63
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
64
+ "maxLength": 100,
65
+ "description": "Type of credit issued",
66
+ "example": "Carrot Organic"
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ },
71
+ "attribute_source_waste_type": {
72
+ "type": "object",
73
+ "required": ["trait_type", "value"],
74
+ "properties": {
75
+ "trait_type": {
76
+ "const": "Source Waste Type"
77
+ },
78
+ "value": {
79
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/waste_type"
80
+ }
81
+ },
82
+ "additionalProperties": false
83
+ },
84
+ "attribute_source_weight": {
85
+ "type": "object",
86
+ "required": ["trait_type", "value", "display_type"],
87
+ "properties": {
88
+ "trait_type": {
89
+ "const": "Source Weight (kg)"
90
+ },
91
+ "value": {
92
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/weight_kg"
93
+ },
94
+ "display_type": {
95
+ "const": "number"
96
+ }
97
+ },
98
+ "additionalProperties": false
99
+ },
100
+ "attribute_origin_country": {
101
+ "type": "object",
102
+ "required": ["trait_type", "value"],
103
+ "properties": {
104
+ "trait_type": {
105
+ "const": "Origin Country"
106
+ },
107
+ "value": {
108
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
109
+ "maxLength": 100,
110
+ "description": "Country where the waste was generated",
111
+ "example": "Brazil"
112
+ }
113
+ },
114
+ "additionalProperties": false
115
+ },
116
+ "attribute_origin_municipality": {
117
+ "type": "object",
118
+ "required": ["trait_type", "value"],
119
+ "properties": {
120
+ "trait_type": {
121
+ "const": "Origin Municipality"
122
+ },
123
+ "value": {
124
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
125
+ "maxLength": 100,
126
+ "description": "Municipality where the waste was generated",
127
+ "example": "Macapá"
128
+ }
129
+ },
130
+ "additionalProperties": false
131
+ },
132
+ "attribute_recycler": {
133
+ "type": "object",
134
+ "required": ["trait_type", "value"],
135
+ "properties": {
136
+ "trait_type": {
137
+ "const": "Recycler"
138
+ },
139
+ "value": {
140
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
141
+ "maxLength": 100,
142
+ "description": "Organization that processed the waste",
143
+ "example": "Eco Reciclagem"
144
+ }
145
+ },
146
+ "additionalProperties": false
147
+ },
148
+ "attribute_mass_id_token_id": {
149
+ "type": "object",
150
+ "required": ["trait_type", "value"],
151
+ "properties": {
152
+ "trait_type": {
153
+ "const": "MassID"
154
+ },
155
+ "value": {
156
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
157
+ "pattern": "^#[0-9]+$",
158
+ "description": "Token ID of the source MassID NFT",
159
+ "example": "#123"
160
+ }
161
+ },
162
+ "additionalProperties": false
163
+ },
164
+ "attribute_mass_id_recycling_date": {
165
+ "type": "object",
166
+ "required": ["trait_type", "value", "display_type"],
167
+ "properties": {
168
+ "trait_type": {
169
+ "const": "MassID Recycling Date"
170
+ },
171
+ "value": {
172
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/iso_date",
173
+ "description": "Date when the source waste was recycled",
174
+ "example": "2025-02-22"
175
+ },
176
+ "display_type": {
177
+ "const": "date"
178
+ }
179
+ },
180
+ "additionalProperties": false
181
+ }
182
+ },
183
+ "title": "RecycledID NFT Attribute Array",
184
+ "description": "Schema for the fixed set of RecycledID NFT attributes, enforcing order and type for each trait.",
185
+ "type": "array",
186
+ "prefixItems": [
187
+ { "$ref": "#/$defs/attribute_methodology" },
188
+ { "$ref": "#/$defs/attribute_recycled_mass_weight" },
189
+ { "$ref": "#/$defs/attribute_credit_amount" },
190
+ { "$ref": "#/$defs/attribute_credit_type" },
191
+ { "$ref": "#/$defs/attribute_source_waste_type" },
192
+ { "$ref": "#/$defs/attribute_source_weight" },
193
+ { "$ref": "#/$defs/attribute_origin_country" },
194
+ { "$ref": "#/$defs/attribute_origin_municipality" },
195
+ { "$ref": "#/$defs/attribute_recycler" },
196
+ { "$ref": "#/$defs/attribute_mass_id_token_id" },
197
+ { "$ref": "#/$defs/attribute_mass_id_recycling_date" }
198
+ ],
199
+ "items": false,
200
+ "minItems": 11,
201
+ "maxItems": 11
202
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/recycled-id/recycled-id.data.schema.json",
4
+ "title": "RecycledID Data",
5
+ "type": "object",
6
+ "required": [
7
+ "summary",
8
+ "methodology",
9
+ "audit",
10
+ "mass_id",
11
+ "waste_classification",
12
+ "origin_location",
13
+ "accredited_participants"
14
+ ],
15
+ "properties": {
16
+ "summary": {
17
+ "type": "object",
18
+ "required": ["recycled_mass_kg", "credit_type", "credit_amount"],
19
+ "properties": {
20
+ "recycled_mass_kg": {
21
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/weight_kg",
22
+ "title": "Recycled Mass Weight",
23
+ "description": "Total weight of materials successfully recycled"
24
+ },
25
+ "credit_type": {
26
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
27
+ "title": "Credit Type",
28
+ "description": "Type of credit issued"
29
+ },
30
+ "credit_amount": {
31
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_negative_float",
32
+ "title": "Credit Amount",
33
+ "description": "Amount of credits issued"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "methodology": {
39
+ "$ref": "../shared/references/methodology-reference/methodology-reference.schema.json"
40
+ },
41
+ "audit": {
42
+ "$ref": "../shared/references/audit-reference/audit-reference.schema.json"
43
+ },
44
+ "mass_id": {
45
+ "$ref": "../shared/references/mass-id-reference/mass-id-reference.schema.json"
46
+ },
47
+ "waste_classification": {
48
+ "$ref": "../shared/certificate/certificate.schema.json#/$defs/waste_classification"
49
+ },
50
+ "origin_location": {
51
+ "$ref": "../shared/entities/location/location.schema.json",
52
+ "title": "Source Waste Origin Location",
53
+ "description": "Location of the waste origin"
54
+ },
55
+ "accredited_participants": {
56
+ "$ref": "../shared/certificate/certificate.schema.json#/$defs/accredited_participants"
57
+ },
58
+ "participant_rewards": {
59
+ "$ref": "../shared/certificate/certificate.schema.json#/$defs/participant_rewards"
60
+ }
61
+ },
62
+ "additionalProperties": false
63
+ }
@@ -0,0 +1,213 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/recycled-id/recycled-id.schema.json",
3
+ "schema": {
4
+ "hash": "0xa1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
5
+ "type": "RecycledID",
6
+ "version": "v0.1.0"
7
+ },
8
+ "environment": {
9
+ "blockchain_network": "mainnet",
10
+ "deployment": "production",
11
+ "data_set_name": "TEST"
12
+ },
13
+ "blockchain": {
14
+ "smart_contract_address": "0x742d35cc6634c0532925a3b8d8b5c2d4c7f8e1a9",
15
+ "chain_id": 1,
16
+ "network_name": "Ethereum Mainnet",
17
+ "token_id": "789"
18
+ },
19
+ "created_at": "2025-06-24T13:02:25.000Z",
20
+ "external_id": "f47ac10b-58cc-4372-a567-0e02b2c3d489",
21
+ "external_url": "https://explore.carrot.eco/document/f47ac10b-58cc-4372-a567-0e02b2c3d489",
22
+ "content_hash": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
23
+ "creator": {
24
+ "name": "Carrot Foundation",
25
+ "id": "7601e741-8c05-4b6f-b3af-dba92e1b4ed2"
26
+ },
27
+ "name": "RecycledID #789 • BOLD Recycling • 3.0t Recycled",
28
+ "short_name": "RecycledID #789",
29
+ "description": "This RecycledID certifies 3.0 metric tons of organic waste successfully recycled through BOLD Recycling methodology from Macapá, Brazil, producing high-quality compost and organic fertilizer.",
30
+ "image": "ipfs://QmRecycledIdHash789/recycled-id-bold-recycling.png",
31
+ "background_color": "#2D5016",
32
+ "external_links": [
33
+ {
34
+ "label": "View on Carrot Explorer",
35
+ "url": "https://explore.carrot.eco/document/f47ac10b-58cc-4372-a567-0e02b2c3d489",
36
+ "description": "Complete RecycledID details and audit trail"
37
+ },
38
+ {
39
+ "label": "MassID",
40
+ "url": "https://explore.carrot.eco/document/6f520d88-864d-432d-bf9f-5c3166c4818f",
41
+ "description": "Originating waste batch with full chain of custody"
42
+ },
43
+ {
44
+ "label": "BOLD Recycling Methodology",
45
+ "url": "https://explore.carrot.eco/document/bold-recycling",
46
+ "description": "Complete methodology specification and rules"
47
+ },
48
+ {
49
+ "label": "Carrot White Paper",
50
+ "url": "https://carrot.eco/whitepaper",
51
+ "description": "Carrot ecosystem overview and technical foundation"
52
+ }
53
+ ],
54
+ "attributes": [
55
+ {
56
+ "trait_type": "Methodology",
57
+ "value": "BOLD Recycling"
58
+ },
59
+ {
60
+ "trait_type": "Recycled Mass Weight (kg)",
61
+ "value": 3000,
62
+ "display_type": "number"
63
+ },
64
+ {
65
+ "trait_type": "Credit Amount",
66
+ "value": 3,
67
+ "display_type": "number"
68
+ },
69
+ {
70
+ "trait_type": "Credit Type",
71
+ "value": "Carrot Organic"
72
+ },
73
+ {
74
+ "trait_type": "Source Waste Type",
75
+ "value": "Organic"
76
+ },
77
+ {
78
+ "trait_type": "Source Weight (kg)",
79
+ "value": 3000,
80
+ "display_type": "number"
81
+ },
82
+ {
83
+ "trait_type": "Origin Country",
84
+ "value": "Brazil"
85
+ },
86
+ {
87
+ "trait_type": "Origin Municipality",
88
+ "value": "Macapá"
89
+ },
90
+ {
91
+ "trait_type": "Recycler",
92
+ "value": "Eco Reciclagem"
93
+ },
94
+ {
95
+ "trait_type": "MassID",
96
+ "value": "#123"
97
+ },
98
+ {
99
+ "trait_type": "MassID Recycling Date",
100
+ "value": "2025-02-22",
101
+ "display_type": "date"
102
+ }
103
+ ],
104
+ "data": {
105
+ "summary": {
106
+ "recycled_mass_kg": 3000,
107
+ "credit_type": "Carrot Organic (C-BIOW)",
108
+ "credit_amount": 3
109
+ },
110
+ "methodology": {
111
+ "external_id": "f47ac10b-58cc-4372-a567-0e02b2c3d490",
112
+ "name": "BOLD Recycling",
113
+ "version": "1.2.0",
114
+ "external_url": "https://explore.carrot.eco/document/f47ac10b-58cc-4372-a567-0e02b2c3d490",
115
+ "uri": "ipfs://QmMethodologyHash/bold-recycling-v1.2.0.pdf"
116
+ },
117
+ "audit": {
118
+ "date": "2025-06-24",
119
+ "external_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
120
+ "external_url": "https://explore.carrot.eco/document/a1b2c3d4-e5f6-7890-1234-567890abcdef",
121
+ "methodology_compliance": "PASSED",
122
+ "rules_executed": 18,
123
+ "report": "ipfs://QmVerificationHash/recycled-id-audit.json"
124
+ },
125
+ "mass_id": {
126
+ "external_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
127
+ "token_id": "123",
128
+ "external_url": "https://explore.carrot.eco/document/6f520d88-864d-432d-bf9f-5c3166c4818f",
129
+ "uri": "ipfs://QmYx8FdKl2mN9pQ7rS6tV8wB3cE4fG5hI9jK0lM1nO2pQ3r/mass-id.json"
130
+ },
131
+ "waste_classification": {
132
+ "primary_type": "Organic",
133
+ "subtype": "Food, Food Waste and Beverages",
134
+ "net_weight_kg": 3000
135
+ },
136
+ "origin_location": {
137
+ "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
138
+ "municipality": "Macapá",
139
+ "administrative_division": "Amapá",
140
+ "administrative_division_code": "BR-AP",
141
+ "country": "Brazil",
142
+ "country_code": "BR",
143
+ "coordinates": {
144
+ "latitude": -0.034934,
145
+ "longitude": -51.07045,
146
+ "precision_level": "city"
147
+ },
148
+ "facility_type": "Waste Generation",
149
+ "responsible_participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf"
150
+ },
151
+ "accredited_participants": [
152
+ {
153
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
154
+ "name": "Eco Reciclagem",
155
+ "role": "Recycler",
156
+ "accreditation_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
157
+ "external_url": "https://explore.carrot.eco/document/acc-5021ea45-5b35-4749-8a85-83dc0c6f7cbf"
158
+ },
159
+ {
160
+ "participant_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
161
+ "name": "Enlatados Produção",
162
+ "role": "Waste Generator",
163
+ "accreditation_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
164
+ "external_url": "https://explore.carrot.eco/document/acc-6f520d88-864d-432d-bf9f-5c3166c4818f"
165
+ }
166
+ ],
167
+ "participant_rewards": {
168
+ "distribution_basis": "BOLD Recycling methodology rewards calculation",
169
+ "reward_allocations": [
170
+ {
171
+ "participant_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
172
+ "participant_name": "Enlatados Produção",
173
+ "role": "Waste Generator",
174
+ "reward_percentage": 30.0,
175
+ "large_business_discount_applied": true,
176
+ "effective_percentage": 15.0
177
+ },
178
+ {
179
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
180
+ "participant_name": "Eco Reciclagem",
181
+ "role": "Hauler",
182
+ "reward_percentage": 20.0,
183
+ "effective_percentage": 20.0
184
+ },
185
+ {
186
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
187
+ "participant_name": "Eco Reciclagem",
188
+ "role": "Processor",
189
+ "reward_percentage": 20.0,
190
+ "effective_percentage": 20.0
191
+ },
192
+ {
193
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
194
+ "participant_name": "Eco Reciclagem",
195
+ "role": "Recycler",
196
+ "reward_percentage": 15.0,
197
+ "effective_percentage": 15.0
198
+ },
199
+ {
200
+ "participant_id": "e710790f-5909-4a54-ab89-6a59819472ee",
201
+ "participant_name": "Carrot Foundation",
202
+ "role": "Network Integrator",
203
+ "reward_percentage": 15.0,
204
+ "effective_percentage": 15.0
205
+ }
206
+ ],
207
+ "distribution_notes": {
208
+ "large_business_discount_applied": "50% reduction applied to participants with >$4M annual revenue",
209
+ "redirected_rewards": "Discounted rewards from large businesses redirected to accredited NGOs"
210
+ }
211
+ }
212
+ }
213
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/recycled-id/recycled-id.schema.json",
4
+ "title": "RecycledID NFT IPFS Record",
5
+ "unevaluatedProperties": false,
6
+ "allOf": [
7
+ {
8
+ "$ref": "../shared/nft/nft.schema.json"
9
+ },
10
+ {
11
+ "type": "object",
12
+ "properties": {
13
+ "schema": {
14
+ "properties": {
15
+ "type": {
16
+ "const": "RecycledID"
17
+ }
18
+ }
19
+ },
20
+ "attributes": {
21
+ "$ref": "./recycled-id.attributes.schema.json"
22
+ },
23
+ "data": {
24
+ "$ref": "./recycled-id.data.schema.json"
25
+ }
26
+ }
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,163 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json",
4
+ "title": "Carrot Base IPFS Record",
5
+ "description": "Base fields for all Carrot IPFS records, providing common structure for any JSON content stored in IPFS.",
6
+ "type": "object",
7
+ "required": [
8
+ "$schema",
9
+ "schema",
10
+ "created_at",
11
+ "external_id",
12
+ "external_url",
13
+ "content_hash",
14
+ "creator"
15
+ ],
16
+ "properties": {
17
+ "$schema": {
18
+ "type": "string",
19
+ "format": "uri",
20
+ "title": "Schema URI",
21
+ "description": "URI of the JSON Schema used to validate this record.",
22
+ "example": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/mass-id/mass-id.schema.json"
23
+ },
24
+ "schema": {
25
+ "type": "object",
26
+ "description": "Schema information.",
27
+ "required": ["hash", "type", "version"],
28
+ "properties": {
29
+ "hash": {
30
+ "$ref": "../definitions/definitions.schema.json#/$defs/keccak256_hash",
31
+ "title": "Schema Hash",
32
+ "description": "Keccak256 hash of the JSON Schema this record was validated against (32 bytes as hex string)."
33
+ },
34
+ "type": {
35
+ "type": "string",
36
+ "enum": [
37
+ "MassID",
38
+ "MassID Audit",
39
+ "RecycledID",
40
+ "GasID",
41
+ "PurchaseID",
42
+ "Methodology",
43
+ "Credit",
44
+ "Collection"
45
+ ],
46
+ "title": "Schema Type",
47
+ "description": "Type/category of this schema.",
48
+ "example": "MassID"
49
+ },
50
+ "version": {
51
+ "$ref": "../definitions/definitions.schema.json#/$defs/semantic_version",
52
+ "title": "Schema Version",
53
+ "description": "Version of the schema, using semantic versioning (https://semver.org/)."
54
+ }
55
+ },
56
+ "additionalProperties": false
57
+ },
58
+ "created_at": {
59
+ "$ref": "../definitions/definitions.schema.json#/$defs/iso_timestamp",
60
+ "title": "Record Creation Timestamp",
61
+ "description": "ISO 8601 creation timestamp for this record."
62
+ },
63
+ "external_id": {
64
+ "$ref": "../definitions/definitions.schema.json#/$defs/external_id"
65
+ },
66
+ "external_url": {
67
+ "$ref": "../definitions/definitions.schema.json#/$defs/external_url"
68
+ },
69
+ "content_hash": {
70
+ "type": "string",
71
+ "pattern": "^[a-fA-F0-9]{64}$",
72
+ "title": "Content Hash",
73
+ "description": "SHA-256 hash of RFC 8785 canonicalized JSON after schema validation."
74
+ },
75
+ "original_content_hash": {
76
+ "type": "string",
77
+ "pattern": "^[a-fA-F0-9]{64}$",
78
+ "title": "Original Content Hash",
79
+ "description": "SHA-256 hash of the original JSON content including private data before schema validation."
80
+ },
81
+ "creator": {
82
+ "type": "object",
83
+ "description": "Entity that created this record.",
84
+ "required": ["name", "id"],
85
+ "properties": {
86
+ "name": {
87
+ "type": "string",
88
+ "description": "Company or individual name that created this record."
89
+ },
90
+ "id": {
91
+ "$ref": "../definitions/definitions.schema.json#/$defs/uuid",
92
+ "description": "Unique identifier for the creator."
93
+ }
94
+ },
95
+ "additionalProperties": false
96
+ },
97
+ "relationships": {
98
+ "type": "array",
99
+ "description": "References to other IPFS records this record relates to.",
100
+ "items": {
101
+ "type": "object",
102
+ "required": ["target_cid", "type"],
103
+ "properties": {
104
+ "target_cid": {
105
+ "type": "string",
106
+ "pattern": "^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[a-z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]+)$",
107
+ "description": "IPFS Content Identifier (CID) of the referenced record."
108
+ },
109
+ "type": {
110
+ "type": "string",
111
+ "enum": [
112
+ "collection",
113
+ "credit",
114
+ "audit",
115
+ "update",
116
+ "derivation",
117
+ "reference"
118
+ ],
119
+ "description": "Type of relationship to the referenced record."
120
+ },
121
+ "description": {
122
+ "type": "string",
123
+ "description": "Human-readable description of the relationship."
124
+ }
125
+ },
126
+ "additionalProperties": false
127
+ }
128
+ },
129
+ "environment": {
130
+ "type": "object",
131
+ "description": "Environment information.",
132
+ "required": ["blockchain_network", "deployment", "data_set_name"],
133
+ "properties": {
134
+ "blockchain_network": {
135
+ "type": "string",
136
+ "enum": ["mainnet", "testnet"],
137
+ "title": "Blockchain Network Environment",
138
+ "example": "mainnet"
139
+ },
140
+ "deployment": {
141
+ "type": "string",
142
+ "enum": ["production", "development", "testing"],
143
+ "title": "Deployment Environment",
144
+ "description": "System environment where this record was generated.",
145
+ "example": "production"
146
+ },
147
+ "data_set_name": {
148
+ "type": "string",
149
+ "enum": ["TEST", "PROD"],
150
+ "title": "Data Set Name",
151
+ "description": "Name of the data set for this record.",
152
+ "example": "TEST"
153
+ }
154
+ },
155
+ "additionalProperties": false
156
+ },
157
+ "data": {
158
+ "type": "object",
159
+ "description": "Custom data block that includes the record's data.",
160
+ "additionalProperties": true
161
+ }
162
+ }
163
+ }