@carrot-foundation/schemas 0.2.3 → 0.3.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 (27) hide show
  1. package/README.md +144 -116
  2. package/dist/index.cjs +204 -267
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +23 -23
  5. package/dist/index.d.ts +23 -23
  6. package/dist/index.js +204 -267
  7. package/dist/index.js.map +1 -1
  8. package/package.json +20 -20
  9. package/schemas/ipfs/collection/collection.example.json +3 -3
  10. package/schemas/ipfs/collection/collection.schema.json +77 -77
  11. package/schemas/ipfs/credit/credit.example.json +4 -4
  12. package/schemas/ipfs/credit/credit.schema.json +85 -85
  13. package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +15 -15
  14. package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +432 -424
  15. package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +15 -15
  16. package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +465 -457
  17. package/schemas/ipfs/gas-id/gas-id.example.json +9 -9
  18. package/schemas/ipfs/gas-id/gas-id.schema.json +448 -432
  19. package/schemas/ipfs/mass-id/mass-id.example.json +7 -7
  20. package/schemas/ipfs/mass-id/mass-id.schema.json +533 -512
  21. package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +57 -57
  22. package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +225 -217
  23. package/schemas/ipfs/methodology/methodology.example.json +5 -5
  24. package/schemas/ipfs/methodology/methodology.schema.json +124 -124
  25. package/schemas/ipfs/recycled-id/recycled-id.example.json +9 -9
  26. package/schemas/ipfs/recycled-id/recycled-id.schema.json +400 -384
  27. package/schemas/schema-hashes.json +10 -10
@@ -1,58 +1,54 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "CreditPurchaseReceipt NFT IPFS Record",
4
- "description": "Complete CreditPurchaseReceipt NFT IPFS record including attributes and credit purchase data",
5
- "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.2.3/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json",
6
- "version": "0.2.3",
7
3
  "type": "object",
8
4
  "properties": {
9
5
  "$schema": {
6
+ "type": "string",
7
+ "format": "uri",
10
8
  "title": "JSON Schema URI",
11
9
  "description": "URI of the JSON Schema used to validate this record",
12
- "example": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json",
13
- "type": "string",
14
- "format": "uri"
10
+ "example": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json"
15
11
  },
16
12
  "schema": {
17
13
  "type": "object",
18
14
  "properties": {
19
15
  "hash": {
16
+ "type": "string",
17
+ "pattern": "^[0-9a-fA-F]{64}$",
20
18
  "title": "Schema Hash",
21
19
  "description": "SHA-256 hash of the JSON Schema this record was validated against",
22
20
  "examples": [
23
21
  "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
24
- ],
25
- "type": "string",
26
- "pattern": "^[0-9a-fA-F]{64}$"
22
+ ]
27
23
  },
28
24
  "type": {
29
- "title": "CreditPurchaseReceipt Schema Type",
30
- "description": "Schema type identifier for this record",
31
25
  "type": "string",
32
- "const": "CreditPurchaseReceipt"
26
+ "const": "CreditPurchaseReceipt",
27
+ "title": "CreditPurchaseReceipt Schema Type",
28
+ "description": "Discriminator value identifying this record as a CreditPurchaseReceipt transaction proof"
33
29
  },
34
30
  "version": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "pattern": "^v?\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?(\\+[a-zA-Z0-9.-]+)?$",
35
34
  "title": "Schema Version",
36
35
  "description": "Version of the schema, using semantic versioning",
37
36
  "examples": [
38
37
  "0.1.0",
39
38
  "1.0.0",
40
39
  "2.1.3"
41
- ],
42
- "type": "string",
43
- "minLength": 1,
44
- "pattern": "^v?\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?(\\+[a-zA-Z0-9.-]+)?$"
40
+ ]
45
41
  },
46
42
  "ipfs_uri": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
47
46
  "title": "Schema IPFS URI",
48
47
  "description": "IPFS URI for this JSON Schema when the primary schema URI is unavailable",
49
48
  "examples": [
50
49
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
51
50
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
52
- ],
53
- "type": "string",
54
- "minLength": 1,
55
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
51
+ ]
56
52
  }
57
53
  },
58
54
  "required": [
@@ -64,99 +60,97 @@
64
60
  "additionalProperties": false
65
61
  },
66
62
  "created_at": {
63
+ "type": "string",
64
+ "format": "date-time",
65
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
67
66
  "title": "Created At",
68
67
  "description": "ISO 8601 creation timestamp for this record",
69
68
  "examples": [
70
69
  "2024-12-05T11:02:47.000Z"
71
- ],
72
- "type": "string",
73
- "format": "date-time",
74
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
70
+ ]
75
71
  },
76
72
  "external_id": {
73
+ "type": "string",
74
+ "format": "uuid",
75
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
77
76
  "title": "External ID",
78
- "description": "UUID identifier for external system references",
77
+ "description": "UUID v4 identifier linking this IPFS record to its counterpart in the Carrot platform and other consuming systems",
79
78
  "examples": [
80
79
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
81
- ],
82
- "type": "string",
83
- "format": "uuid",
84
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
80
+ ]
85
81
  },
86
82
  "external_url": {
83
+ "type": "string",
84
+ "format": "uri",
87
85
  "title": "External URL",
88
86
  "description": "URL pointing to external resources",
89
87
  "examples": [
90
88
  "https://explore.carrot.eco/",
91
89
  "https://whitepaper.carrot.eco/"
92
- ],
93
- "type": "string",
94
- "format": "uri"
90
+ ]
95
91
  },
96
92
  "viewer_reference": {
97
- "title": "Metadata Viewer Reference",
98
- "description": "References to the metadata viewer dApp, including immutable and latest entry points",
99
93
  "type": "object",
100
94
  "properties": {
101
95
  "ipfs_uri": {
96
+ "type": "string",
97
+ "minLength": 1,
98
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
102
99
  "title": "Viewer IPFS URI",
103
100
  "description": "IPFS URI of the metadata viewer dApp build",
104
101
  "examples": [
105
102
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
106
103
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
107
- ],
108
- "type": "string",
109
- "minLength": 1,
110
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
104
+ ]
111
105
  },
112
106
  "integrity_hash": {
107
+ "type": "string",
108
+ "pattern": "^[0-9a-fA-F]{64}$",
113
109
  "title": "Viewer Integrity Hash",
114
110
  "description": "SHA-256 hash of the published viewer bundle to verify integrity",
115
111
  "examples": [
116
112
  "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
117
- ],
118
- "type": "string",
119
- "pattern": "^[0-9a-fA-F]{64}$"
113
+ ]
120
114
  }
121
115
  },
122
116
  "required": [
123
117
  "ipfs_uri",
124
118
  "integrity_hash"
125
119
  ],
126
- "additionalProperties": false
120
+ "additionalProperties": false,
121
+ "title": "Metadata Viewer Reference",
122
+ "description": "References to the metadata viewer dApp, including immutable and latest entry points"
127
123
  },
128
124
  "environment": {
129
- "title": "Record Environment",
130
- "description": "Environment information for the record",
131
125
  "type": "object",
132
126
  "properties": {
133
127
  "blockchain_network": {
134
- "title": "Blockchain Network",
135
- "description": "Blockchain network where this record is deployed",
136
128
  "type": "string",
137
129
  "enum": [
138
130
  "mainnet",
139
131
  "testnet"
140
- ]
132
+ ],
133
+ "title": "Blockchain Network",
134
+ "description": "Blockchain network where this record is deployed"
141
135
  },
142
136
  "deployment": {
143
- "title": "Deployment Environment",
144
- "description": "System environment where this record was generated",
145
137
  "type": "string",
146
138
  "enum": [
147
139
  "production",
148
140
  "development",
149
141
  "testing"
150
- ]
142
+ ],
143
+ "title": "Deployment Environment",
144
+ "description": "System environment where this record was generated"
151
145
  },
152
146
  "data_set_name": {
153
- "title": "Data Set Name",
154
- "description": "Name of the data set for this record",
155
147
  "type": "string",
156
148
  "enum": [
157
149
  "TEST",
158
150
  "PROD"
159
- ]
151
+ ],
152
+ "title": "Data Set Name",
153
+ "description": "Name of the data set for this record"
160
154
  }
161
155
  },
162
156
  "required": [
@@ -164,62 +158,60 @@
164
158
  "deployment",
165
159
  "data_set_name"
166
160
  ],
167
- "additionalProperties": false
161
+ "additionalProperties": false,
162
+ "title": "Record Environment",
163
+ "description": "Environment information for the record"
168
164
  },
169
165
  "data": {
170
- "title": "Credit Purchase Receipt Data",
171
- "description": "Complete data structure for a credit purchase receipt",
172
166
  "type": "object",
173
167
  "properties": {
174
168
  "summary": {
175
- "title": "Credit Purchase Receipt Summary",
176
- "description": "Summary totals for the credit purchase including amounts and collections represented",
177
169
  "type": "object",
178
170
  "properties": {
179
171
  "total_certificates": {
172
+ "type": "integer",
173
+ "minimum": 1,
174
+ "maximum": 9007199254740991,
180
175
  "title": "Total Certificates",
181
- "description": "Total number of certificates represented in the receipt",
176
+ "description": "Total number of certificates (GasID or RecycledID) included in this receipt",
182
177
  "examples": [
183
178
  1,
184
179
  123,
185
180
  456
186
- ],
187
- "type": "integer",
188
- "minimum": 1,
189
- "maximum": 9007199254740991
181
+ ]
190
182
  },
191
183
  "total_amount_usdc": {
184
+ "type": "number",
185
+ "minimum": 0,
192
186
  "title": "Total Amount (USDC)",
193
- "description": "Total amount paid in USDC for the purchase",
187
+ "description": "Total amount paid in USDC stablecoin for the credit purchase",
194
188
  "examples": [
195
189
  0,
196
190
  100.5,
197
191
  1000.123456,
198
192
  50000.12
199
- ],
200
- "type": "number",
201
- "minimum": 0
193
+ ]
202
194
  },
203
195
  "total_credits": {
196
+ "type": "number",
197
+ "minimum": 0,
204
198
  "title": "Total Credits",
205
- "description": "Total amount of credits purchased",
199
+ "description": "Total number of environmental impact credits purchased in this transaction",
206
200
  "examples": [
207
- 0,
208
- 45.2,
209
- 72.5
210
- ],
211
- "type": "number",
212
- "minimum": 0
201
+ 1.5,
202
+ 100,
203
+ 2500.75
204
+ ]
213
205
  },
214
206
  "purchased_at": {
207
+ "type": "string",
208
+ "format": "date-time",
209
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
215
210
  "title": "Purchased At",
216
211
  "description": "ISO 8601 timestamp when the purchase was completed",
217
212
  "examples": [
218
213
  "2024-12-05T11:02:47.000Z"
219
- ],
220
- "type": "string",
221
- "format": "date-time",
222
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
214
+ ]
223
215
  }
224
216
  },
225
217
  "required": [
@@ -228,67 +220,65 @@
228
220
  "total_credits",
229
221
  "purchased_at"
230
222
  ],
231
- "additionalProperties": false
223
+ "additionalProperties": false,
224
+ "title": "Credit Purchase Receipt Summary",
225
+ "description": "Summary totals for the credit purchase including payment amount, credit quantity, certificate count, and timestamp"
232
226
  },
233
227
  "buyer": {
234
- "title": "Buyer",
235
- "description": "Buyer information including wallet address, optional ID, and optional identity",
236
228
  "type": "object",
237
229
  "properties": {
238
230
  "wallet_address": {
231
+ "type": "string",
232
+ "pattern": "^0x[a-f0-9]{40}$",
239
233
  "title": "Buyer Wallet Address",
240
234
  "description": "Ethereum address receiving the credits",
241
235
  "examples": [
242
236
  "0x1234567890abcdef1234567890abcdef12345678"
243
- ],
244
- "type": "string",
245
- "pattern": "^0x[a-f0-9]{40}$"
237
+ ]
246
238
  },
247
239
  "id": {
248
240
  "title": "Buyer ID",
249
241
  "description": "Unique identifier for the buyer",
250
- "examples": [
251
- "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
252
- ],
253
242
  "type": "string",
254
243
  "format": "uuid",
255
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
244
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
245
+ "examples": [
246
+ "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
247
+ ]
256
248
  },
257
249
  "identity": {
258
- "title": "Identity",
259
- "description": "Participant identity information",
260
250
  "type": "object",
261
251
  "properties": {
262
252
  "name": {
253
+ "type": "string",
254
+ "minLength": 1,
255
+ "maxLength": 100,
263
256
  "title": "Identity Name",
264
- "description": "Display name for the participant",
257
+ "description": "Display name of the buyer or beneficiary on the receipt",
265
258
  "examples": [
266
259
  "EcoTech Solutions Inc.",
267
260
  "Climate Action Corp"
268
- ],
269
- "type": "string",
270
- "minLength": 1,
271
- "maxLength": 100
261
+ ]
272
262
  },
273
263
  "external_id": {
264
+ "type": "string",
265
+ "format": "uuid",
266
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
274
267
  "title": "Identity External ID",
275
- "description": "External identifier for the participant",
268
+ "description": "Unique identifier for the buyer or beneficiary in the Carrot platform",
276
269
  "examples": [
277
270
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
278
- ],
279
- "type": "string",
280
- "format": "uuid",
281
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
271
+ ]
282
272
  },
283
273
  "external_url": {
274
+ "type": "string",
275
+ "format": "uri",
284
276
  "title": "Identity External URL",
285
- "description": "External URL for the participant profile",
277
+ "description": "Link to the buyer or beneficiary profile page on the Carrot platform",
286
278
  "examples": [
287
279
  "https://explore.carrot.eco/",
288
280
  "https://whitepaper.carrot.eco/"
289
- ],
290
- "type": "string",
291
- "format": "uri"
281
+ ]
292
282
  }
293
283
  },
294
284
  "required": [
@@ -296,84 +286,84 @@
296
286
  "external_id",
297
287
  "external_url"
298
288
  ],
299
- "additionalProperties": false
289
+ "additionalProperties": false,
290
+ "title": "Identity",
291
+ "description": "Identity information for the buyer or beneficiary associated with this receipt"
300
292
  }
301
293
  },
302
294
  "required": [
303
295
  "wallet_address"
304
296
  ],
305
- "additionalProperties": false
297
+ "additionalProperties": false,
298
+ "title": "Buyer",
299
+ "description": "Buyer information including wallet address, optional ID, and optional identity"
306
300
  },
307
301
  "collections": {
308
- "title": "Collections",
309
- "description": "Collections included in the purchase",
310
302
  "minItems": 1,
311
303
  "type": "array",
312
304
  "items": {
313
- "title": "Collection",
314
- "description": "Collection included in the purchase",
315
305
  "type": "object",
316
306
  "properties": {
317
307
  "slug": {
318
- "title": "Collection Slug",
319
- "description": "URL-friendly identifier for a collection",
320
- "examples": [
321
- "bold-cold-start-carazinho",
322
- "bold-brazil"
323
- ],
324
308
  "type": "string",
325
309
  "enum": [
326
310
  "bold-innovators",
327
311
  "bold-cold-start-jundiai",
328
312
  "bold-cold-start-carazinho",
329
313
  "bold-brazil"
314
+ ],
315
+ "title": "Collection Slug",
316
+ "description": "URL-friendly identifier for an environmental credit collection, used in URIs and API references",
317
+ "examples": [
318
+ "bold-cold-start-carazinho",
319
+ "bold-brazil"
330
320
  ]
331
321
  },
332
322
  "external_id": {
323
+ "type": "string",
324
+ "format": "uuid",
325
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
333
326
  "title": "Collection External ID",
334
- "description": "External identifier for the collection",
327
+ "description": "Unique identifier for the collection in the Carrot platform",
335
328
  "examples": [
336
329
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
337
- ],
338
- "type": "string",
339
- "format": "uuid",
340
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
330
+ ]
341
331
  },
342
332
  "name": {
343
- "title": "Collection Name",
344
- "description": "Display name of the collection",
345
- "examples": [
346
- "BOLD Cold Start - Carazinho",
347
- "BOLD Brazil"
348
- ],
349
333
  "type": "string",
350
334
  "enum": [
351
335
  "BOLD Innovators",
352
336
  "BOLD Cold Start - Carazinho",
353
337
  "BOLD Cold Start - Jundiaí",
354
338
  "BOLD Brazil"
339
+ ],
340
+ "title": "Collection Name",
341
+ "description": "Human-readable display name for the environmental credit collection",
342
+ "examples": [
343
+ "BOLD Cold Start - Carazinho",
344
+ "BOLD Brazil"
355
345
  ]
356
346
  },
357
347
  "external_url": {
348
+ "type": "string",
349
+ "format": "uri",
358
350
  "title": "Collection External URL",
359
- "description": "External URL for the collection",
351
+ "description": "Link to the collection page on the Carrot platform",
360
352
  "examples": [
361
353
  "https://explore.carrot.eco/",
362
354
  "https://whitepaper.carrot.eco/"
363
- ],
364
- "type": "string",
365
- "format": "uri"
355
+ ]
366
356
  },
367
357
  "ipfs_uri": {
358
+ "type": "string",
359
+ "minLength": 1,
360
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
368
361
  "title": "Collection IPFS URI",
369
- "description": "IPFS URI for the collection metadata",
362
+ "description": "IPFS URI pointing to the immutable collection metadata record",
370
363
  "examples": [
371
364
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
372
365
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
373
- ],
374
- "type": "string",
375
- "minLength": 1,
376
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
366
+ ]
377
367
  }
378
368
  },
379
369
  "required": [
@@ -383,81 +373,81 @@
383
373
  "external_url",
384
374
  "ipfs_uri"
385
375
  ],
386
- "additionalProperties": false
387
- }
376
+ "additionalProperties": false,
377
+ "title": "Collection",
378
+ "description": "Collection included in the purchase"
379
+ },
380
+ "title": "Collections",
381
+ "description": "Impact collections referenced by this purchase, each identified by a unique slug"
388
382
  },
389
383
  "credits": {
390
- "title": "Credits",
391
- "description": "Credits included in the purchase",
392
384
  "minItems": 1,
393
385
  "type": "array",
394
386
  "items": {
395
- "title": "Credit",
396
- "description": "Credit token included in the purchase",
397
387
  "type": "object",
398
388
  "properties": {
399
389
  "external_id": {
390
+ "type": "string",
391
+ "format": "uuid",
392
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
400
393
  "title": "External ID",
401
- "description": "UUID identifier for external system references",
394
+ "description": "UUID v4 identifier linking this IPFS record to its counterpart in the Carrot platform and other consuming systems",
402
395
  "examples": [
403
396
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
404
- ],
405
- "type": "string",
406
- "format": "uuid",
407
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
397
+ ]
408
398
  },
409
399
  "external_url": {
400
+ "type": "string",
401
+ "format": "uri",
410
402
  "title": "External URL",
411
403
  "description": "URL pointing to external resources",
412
404
  "examples": [
413
405
  "https://explore.carrot.eco/",
414
406
  "https://whitepaper.carrot.eco/"
415
- ],
416
- "type": "string",
417
- "format": "uri"
407
+ ]
418
408
  },
419
409
  "ipfs_uri": {
410
+ "type": "string",
411
+ "minLength": 1,
412
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
420
413
  "title": "IPFS URI",
421
414
  "description": "InterPlanetary File System URI pointing to distributed content",
422
415
  "examples": [
423
416
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
424
417
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
425
- ],
426
- "type": "string",
427
- "minLength": 1,
428
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
418
+ ]
429
419
  },
430
420
  "smart_contract_address": {
421
+ "type": "string",
422
+ "pattern": "^0x[a-f0-9]{40}$",
431
423
  "title": "Smart Contract Address",
432
424
  "description": "Ethereum-compatible address of the smart contract that mints and manages this token",
433
425
  "examples": [
434
426
  "0x1234567890abcdef1234567890abcdef12345678"
435
- ],
436
- "type": "string",
437
- "pattern": "^0x[a-f0-9]{40}$"
427
+ ]
438
428
  },
439
429
  "slug": {
440
- "title": "Credit Token Slug",
441
- "description": "URL-friendly identifier for the credit token",
442
- "examples": [
430
+ "type": "string",
431
+ "enum": [
443
432
  "carbon-methane",
444
433
  "biowaste"
445
434
  ],
446
- "type": "string",
447
- "enum": [
435
+ "title": "Credit Token Slug",
436
+ "description": "URL-friendly identifier for the credit token",
437
+ "examples": [
448
438
  "carbon-methane",
449
439
  "biowaste"
450
440
  ]
451
441
  },
452
442
  "symbol": {
453
- "title": "Credit Token Symbol",
454
- "description": "ERC20 token symbol identifier",
455
- "examples": [
443
+ "type": "string",
444
+ "enum": [
456
445
  "C-CARB.CH4",
457
446
  "C-BIOW"
458
447
  ],
459
- "type": "string",
460
- "enum": [
448
+ "title": "Credit Token Symbol",
449
+ "description": "ERC20 token symbol identifier",
450
+ "examples": [
461
451
  "C-CARB.CH4",
462
452
  "C-BIOW"
463
453
  ]
@@ -471,149 +461,147 @@
471
461
  "slug",
472
462
  "symbol"
473
463
  ],
474
- "additionalProperties": false
475
- }
464
+ "additionalProperties": false,
465
+ "title": "Credit",
466
+ "description": "Credit token included in the purchase"
467
+ },
468
+ "title": "Credits",
469
+ "description": "Credit token types involved in this purchase, each identified by a unique slug and symbol"
476
470
  },
477
471
  "certificates": {
478
- "title": "Certificates",
479
- "description": "Certificates involved in the purchase",
480
472
  "minItems": 1,
481
473
  "type": "array",
482
474
  "items": {
483
- "title": "Certificate",
484
- "description": "Certificate associated with the purchase",
485
475
  "type": "object",
486
476
  "properties": {
487
477
  "external_id": {
478
+ "type": "string",
479
+ "format": "uuid",
480
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
488
481
  "title": "External ID",
489
- "description": "UUID identifier for external system references",
482
+ "description": "UUID v4 identifier linking this IPFS record to its counterpart in the Carrot platform and other consuming systems",
490
483
  "examples": [
491
484
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
492
- ],
493
- "type": "string",
494
- "format": "uuid",
495
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
485
+ ]
496
486
  },
497
487
  "external_url": {
488
+ "type": "string",
489
+ "format": "uri",
498
490
  "title": "External URL",
499
491
  "description": "URL pointing to external resources",
500
492
  "examples": [
501
493
  "https://explore.carrot.eco/",
502
494
  "https://whitepaper.carrot.eco/"
503
- ],
504
- "type": "string",
505
- "format": "uri"
495
+ ]
506
496
  },
507
497
  "ipfs_uri": {
498
+ "type": "string",
499
+ "minLength": 1,
500
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
508
501
  "title": "IPFS URI",
509
502
  "description": "InterPlanetary File System URI pointing to distributed content",
510
503
  "examples": [
511
504
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
512
505
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
513
- ],
514
- "type": "string",
515
- "minLength": 1,
516
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
506
+ ]
517
507
  },
518
508
  "smart_contract_address": {
509
+ "type": "string",
510
+ "pattern": "^0x[a-f0-9]{40}$",
519
511
  "title": "Smart Contract Address",
520
512
  "description": "Ethereum-compatible address of the smart contract that mints and manages this token",
521
513
  "examples": [
522
514
  "0x1234567890abcdef1234567890abcdef12345678"
523
- ],
524
- "type": "string",
525
- "pattern": "^0x[a-f0-9]{40}$"
515
+ ]
526
516
  },
527
517
  "token_id": {
518
+ "type": "string",
519
+ "minLength": 1,
520
+ "pattern": "^\\d+$",
528
521
  "title": "Token ID",
529
522
  "description": "Unique token identifier for this NFT within the smart contract",
530
523
  "examples": [
531
524
  "456789",
532
525
  "1000000"
533
- ],
534
- "type": "string",
535
- "minLength": 1,
536
- "pattern": "^\\d+$"
526
+ ]
537
527
  },
538
528
  "type": {
539
- "title": "Certificate Type",
540
- "description": "Type of certificate (e.g., GasID, RecycledID)",
541
- "examples": [
529
+ "type": "string",
530
+ "enum": [
542
531
  "GasID",
543
532
  "RecycledID"
544
533
  ],
545
- "type": "string",
546
- "enum": [
534
+ "title": "Certificate Type",
535
+ "description": "Type of certificate — GasID for methane prevention, RecycledID for waste recycling",
536
+ "examples": [
547
537
  "GasID",
548
538
  "RecycledID"
549
539
  ]
550
540
  },
551
541
  "total_amount": {
542
+ "type": "number",
543
+ "minimum": 0,
552
544
  "title": "Certificate Total Amount",
553
545
  "description": "Total credits available in this certificate",
554
546
  "examples": [
555
- 0,
556
- 45.2,
557
- 72.5
558
- ],
559
- "type": "number",
560
- "minimum": 0
547
+ 1.5,
548
+ 100,
549
+ 2500.75
550
+ ]
561
551
  },
562
552
  "mass_id": {
563
- "title": "MassID Reference",
564
- "description": "Reference to a MassID record",
565
553
  "type": "object",
566
554
  "properties": {
567
555
  "external_id": {
556
+ "type": "string",
557
+ "format": "uuid",
558
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
568
559
  "title": "External ID",
569
- "description": "UUID identifier for external system references",
560
+ "description": "UUID v4 identifier linking this IPFS record to its counterpart in the Carrot platform and other consuming systems",
570
561
  "examples": [
571
562
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
572
- ],
573
- "type": "string",
574
- "format": "uuid",
575
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
563
+ ]
576
564
  },
577
565
  "external_url": {
566
+ "type": "string",
567
+ "format": "uri",
578
568
  "title": "External URL",
579
569
  "description": "URL pointing to external resources",
580
570
  "examples": [
581
571
  "https://explore.carrot.eco/",
582
572
  "https://whitepaper.carrot.eco/"
583
- ],
584
- "type": "string",
585
- "format": "uri"
573
+ ]
586
574
  },
587
575
  "ipfs_uri": {
576
+ "type": "string",
577
+ "minLength": 1,
578
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
588
579
  "title": "IPFS URI",
589
580
  "description": "InterPlanetary File System URI pointing to distributed content",
590
581
  "examples": [
591
582
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
592
583
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
593
- ],
594
- "type": "string",
595
- "minLength": 1,
596
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
584
+ ]
597
585
  },
598
586
  "smart_contract_address": {
587
+ "type": "string",
588
+ "pattern": "^0x[a-f0-9]{40}$",
599
589
  "title": "Smart Contract Address",
600
590
  "description": "Ethereum-compatible address of the smart contract that mints and manages this token",
601
591
  "examples": [
602
592
  "0x1234567890abcdef1234567890abcdef12345678"
603
- ],
604
- "type": "string",
605
- "pattern": "^0x[a-f0-9]{40}$"
593
+ ]
606
594
  },
607
595
  "token_id": {
596
+ "type": "string",
597
+ "minLength": 1,
598
+ "pattern": "^\\d+$",
608
599
  "title": "Token ID",
609
600
  "description": "Unique token identifier for this NFT within the smart contract",
610
601
  "examples": [
611
602
  "456789",
612
603
  "1000000"
613
- ],
614
- "type": "string",
615
- "minLength": 1,
616
- "pattern": "^\\d+$"
604
+ ]
617
605
  }
618
606
  },
619
607
  "required": [
@@ -623,67 +611,65 @@
623
611
  "smart_contract_address",
624
612
  "token_id"
625
613
  ],
626
- "additionalProperties": false
614
+ "additionalProperties": false,
615
+ "title": "MassID Reference",
616
+ "description": "Reference to a MassID record"
627
617
  },
628
618
  "credit_slug": {
629
- "title": "Credit Token Slug",
630
- "description": "Slug of the credit type for this certificate",
631
- "examples": [
619
+ "type": "string",
620
+ "enum": [
632
621
  "carbon-methane",
633
622
  "biowaste"
634
623
  ],
635
- "type": "string",
636
- "enum": [
624
+ "title": "Credit Token Slug",
625
+ "description": "Slug of the credit type for this certificate",
626
+ "examples": [
637
627
  "carbon-methane",
638
628
  "biowaste"
639
629
  ]
640
630
  },
641
631
  "collections": {
642
- "title": "Certificate Collections",
643
- "description": "Collections associated with this certificate, each with purchased and retired amounts",
644
632
  "minItems": 1,
645
633
  "type": "array",
646
634
  "items": {
647
- "title": "Certificate Collection Item (Purchase)",
648
- "description": "Collection reference with purchased and retired amounts for a certificate in a purchase receipt",
649
635
  "type": "object",
650
636
  "properties": {
651
637
  "slug": {
652
- "title": "Collection Slug",
653
- "description": "Slug of the collection",
654
- "examples": [
655
- "bold-cold-start-carazinho",
656
- "bold-brazil"
657
- ],
658
638
  "type": "string",
659
639
  "enum": [
660
640
  "bold-innovators",
661
641
  "bold-cold-start-jundiai",
662
642
  "bold-cold-start-carazinho",
663
643
  "bold-brazil"
644
+ ],
645
+ "title": "Collection Slug",
646
+ "description": "URL-friendly identifier of the collection this certificate belongs to",
647
+ "examples": [
648
+ "bold-cold-start-carazinho",
649
+ "bold-brazil"
664
650
  ]
665
651
  },
666
652
  "purchased_amount": {
667
- "title": "Collection Purchased Amount",
668
- "description": "Credits purchased from this collection for this certificate",
669
- "examples": [
670
- 0,
671
- 45.2,
672
- 72.5
673
- ],
674
653
  "type": "number",
675
- "minimum": 0
654
+ "minimum": 0,
655
+ "title": "Purchased Amount",
656
+ "description": "Number of credits purchased from this collection for this certificate",
657
+ "examples": [
658
+ 1.5,
659
+ 100,
660
+ 2500.75
661
+ ]
676
662
  },
677
663
  "retired_amount": {
664
+ "type": "number",
665
+ "minimum": 0,
678
666
  "title": "Collection Retired Amount",
679
667
  "description": "Credits retired from this collection for this certificate (0 if none)",
680
668
  "examples": [
681
- 0,
682
- 45.2,
683
- 72.5
684
- ],
685
- "type": "number",
686
- "minimum": 0
669
+ 1.5,
670
+ 100,
671
+ 2500.75
672
+ ]
687
673
  }
688
674
  },
689
675
  "required": [
@@ -691,8 +677,12 @@
691
677
  "purchased_amount",
692
678
  "retired_amount"
693
679
  ],
694
- "additionalProperties": false
695
- }
680
+ "additionalProperties": false,
681
+ "title": "Certificate Collection Item (Purchase)",
682
+ "description": "Collection reference with purchased and retired amounts for a certificate in a purchase receipt"
683
+ },
684
+ "title": "Certificate Collections",
685
+ "description": "Collections associated with this certificate, each with purchased and retired amounts"
696
686
  }
697
687
  },
698
688
  "required": [
@@ -707,64 +697,66 @@
707
697
  "credit_slug",
708
698
  "collections"
709
699
  ],
710
- "additionalProperties": false
711
- }
700
+ "additionalProperties": false,
701
+ "title": "Certificate",
702
+ "description": "Certificate associated with the purchase"
703
+ },
704
+ "title": "Certificates",
705
+ "description": "Environmental certificates allocated in this purchase, each linking a credit type to collection-level purchased and retired amounts"
712
706
  },
713
707
  "retirement_receipt": {
714
- "title": "Credit Retirement Receipt Reference",
715
- "description": "Reference to the retirement receipt NFT",
716
708
  "type": "object",
717
709
  "properties": {
718
710
  "external_id": {
711
+ "type": "string",
712
+ "format": "uuid",
713
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
719
714
  "title": "External ID",
720
- "description": "UUID identifier for external system references",
715
+ "description": "UUID v4 identifier linking this IPFS record to its counterpart in the Carrot platform and other consuming systems",
721
716
  "examples": [
722
717
  "ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
723
- ],
724
- "type": "string",
725
- "format": "uuid",
726
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
718
+ ]
727
719
  },
728
720
  "external_url": {
721
+ "type": "string",
722
+ "format": "uri",
729
723
  "title": "External URL",
730
724
  "description": "URL pointing to external resources",
731
725
  "examples": [
732
726
  "https://explore.carrot.eco/",
733
727
  "https://whitepaper.carrot.eco/"
734
- ],
735
- "type": "string",
736
- "format": "uri"
728
+ ]
737
729
  },
738
730
  "ipfs_uri": {
731
+ "type": "string",
732
+ "minLength": 1,
733
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
739
734
  "title": "IPFS URI",
740
735
  "description": "InterPlanetary File System URI pointing to distributed content",
741
736
  "examples": [
742
737
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
743
738
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
744
- ],
745
- "type": "string",
746
- "minLength": 1,
747
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
739
+ ]
748
740
  },
749
741
  "smart_contract_address": {
742
+ "type": "string",
743
+ "pattern": "^0x[a-f0-9]{40}$",
750
744
  "title": "Smart Contract Address",
751
745
  "description": "Ethereum-compatible address of the smart contract that mints and manages this token",
752
746
  "examples": [
753
747
  "0x1234567890abcdef1234567890abcdef12345678"
754
- ],
755
- "type": "string",
756
- "pattern": "^0x[a-f0-9]{40}$"
748
+ ]
757
749
  },
758
750
  "token_id": {
751
+ "type": "string",
752
+ "minLength": 1,
753
+ "pattern": "^\\d+$",
759
754
  "title": "Token ID",
760
755
  "description": "Unique token identifier for this NFT within the smart contract",
761
756
  "examples": [
762
757
  "456789",
763
758
  "1000000"
764
- ],
765
- "type": "string",
766
- "minLength": 1,
767
- "pattern": "^\\d+$"
759
+ ]
768
760
  }
769
761
  },
770
762
  "required": [
@@ -774,7 +766,9 @@
774
766
  "smart_contract_address",
775
767
  "token_id"
776
768
  ],
777
- "additionalProperties": false
769
+ "additionalProperties": false,
770
+ "title": "Credit Retirement Receipt Reference",
771
+ "description": "Reference to the retirement receipt NFT"
778
772
  }
779
773
  },
780
774
  "required": [
@@ -784,38 +778,32 @@
784
778
  "credits",
785
779
  "certificates"
786
780
  ],
787
- "additionalProperties": false
781
+ "additionalProperties": false,
782
+ "title": "Credit Purchase Receipt Data",
783
+ "description": "Complete data structure for a credit purchase receipt"
788
784
  },
789
785
  "audit_data_hash": {
786
+ "type": "string",
787
+ "pattern": "^[0-9a-fA-F]{64}$",
790
788
  "title": "Audit Data Hash",
791
789
  "description": "SHA-256 hash of the original JSON content including private data before schema validation, used for data audit purposes",
792
790
  "examples": [
793
791
  "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
794
- ],
795
- "type": "string",
796
- "pattern": "^[0-9a-fA-F]{64}$"
792
+ ]
797
793
  },
798
794
  "blockchain": {
799
- "title": "Blockchain Information",
800
- "description": "Blockchain deployment information including smart contract address, network, and token identifier",
801
795
  "type": "object",
802
796
  "properties": {
803
797
  "smart_contract_address": {
798
+ "type": "string",
799
+ "pattern": "^0x[a-f0-9]{40}$",
804
800
  "title": "Smart Contract Address",
805
801
  "description": "Ethereum-compatible address of the smart contract that mints and manages this token",
806
802
  "examples": [
807
803
  "0x1234567890abcdef1234567890abcdef12345678"
808
- ],
809
- "type": "string",
810
- "pattern": "^0x[a-f0-9]{40}$"
804
+ ]
811
805
  },
812
806
  "chain_id": {
813
- "title": "Chain ID",
814
- "description": "Blockchain network chain identifier (e.g., 137 for Polygon mainnet, 80002 for Amoy testnet)",
815
- "examples": [
816
- 137,
817
- 80002
818
- ],
819
807
  "anyOf": [
820
808
  {
821
809
  "type": "number",
@@ -825,31 +813,37 @@
825
813
  "type": "number",
826
814
  "const": 80002
827
815
  }
816
+ ],
817
+ "title": "Chain ID",
818
+ "description": "Blockchain network chain identifier (e.g., 137 for Polygon mainnet, 80002 for Amoy testnet)",
819
+ "examples": [
820
+ 137,
821
+ 80002
828
822
  ]
829
823
  },
830
824
  "network_name": {
831
- "title": "Blockchain Network Name",
832
- "description": "Blockchain network name. Supported values include Polygon and Amoy",
833
- "examples": [
825
+ "type": "string",
826
+ "enum": [
834
827
  "Polygon",
835
828
  "Amoy"
836
829
  ],
837
- "type": "string",
838
- "enum": [
830
+ "title": "Blockchain Network Name",
831
+ "description": "Blockchain network name. Supported values include Polygon and Amoy",
832
+ "examples": [
839
833
  "Polygon",
840
834
  "Amoy"
841
835
  ]
842
836
  },
843
837
  "token_id": {
838
+ "type": "string",
839
+ "minLength": 1,
840
+ "pattern": "^\\d+$",
844
841
  "title": "Token ID",
845
842
  "description": "NFT token ID",
846
843
  "examples": [
847
844
  "456789",
848
845
  "1000000"
849
- ],
850
- "type": "string",
851
- "minLength": 1,
852
- "pattern": "^\\d+$"
846
+ ]
853
847
  }
854
848
  },
855
849
  "required": [
@@ -858,64 +852,66 @@
858
852
  "network_name",
859
853
  "token_id"
860
854
  ],
861
- "additionalProperties": false
855
+ "additionalProperties": false,
856
+ "title": "Blockchain Information",
857
+ "description": "Blockchain deployment information including smart contract address, network, and token identifier"
862
858
  },
863
859
  "name": {
860
+ "type": "string",
861
+ "minLength": 1,
862
+ "maxLength": 100,
863
+ "pattern": "^Credit Purchase Receipt #\\d+ • .+ Credits Purchased$",
864
864
  "title": "Credit Purchase Receipt Name",
865
865
  "description": "Full display name for this Credit Purchase Receipt NFT. Format: \"Credit Purchase Receipt #[token_id] • [amount] Credits Purchased\"",
866
866
  "examples": [
867
867
  "Credit Purchase Receipt #987 • 8.5 Credits Purchased",
868
868
  "Credit Purchase Receipt #1200 • 15.0 Credits Purchased"
869
- ],
870
- "type": "string",
871
- "minLength": 1,
872
- "maxLength": 100,
873
- "pattern": "^Credit Purchase Receipt #\\d+ • .+ Credits Purchased$"
869
+ ]
874
870
  },
875
871
  "short_name": {
872
+ "type": "string",
873
+ "minLength": 1,
874
+ "maxLength": 50,
875
+ "pattern": "^Purchase Receipt #\\d+$",
876
876
  "title": "Credit Purchase Receipt Short Name",
877
877
  "description": "Compact name for UI summaries, tables, or tooltips. Format: \"Purchase Receipt #[token_id]\"",
878
878
  "examples": [
879
879
  "Purchase Receipt #987",
880
880
  "Purchase Receipt #1200"
881
- ],
882
- "type": "string",
883
- "minLength": 1,
884
- "maxLength": 50,
885
- "pattern": "^Purchase Receipt #\\d+$"
881
+ ]
886
882
  },
887
883
  "description": {
884
+ "type": "string",
885
+ "minLength": 1,
886
+ "maxLength": 500,
888
887
  "title": "Description",
889
888
  "description": "Human-readable summary describing the waste batch, origin, processing method, and chain of custody. Ideally, maximum 300 characters.",
890
889
  "examples": [
891
890
  "This MassID represents 3 metric tons of organic food waste from Enlatados Produção, tracked through complete chain of custody from generation to composting.",
892
891
  "This RecycledID represents 2.5 metric tons of recycled plastic bottles processed by Green Solutions Ltd."
893
- ],
894
- "type": "string",
895
- "minLength": 1,
896
- "maxLength": 500
892
+ ]
897
893
  },
898
894
  "image": {
895
+ "type": "string",
896
+ "minLength": 1,
897
+ "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
899
898
  "title": "Image URI",
900
899
  "description": "IPFS URI pointing to the NFT preview image displayed in marketplaces and wallets",
901
900
  "examples": [
902
901
  "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
903
902
  "ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
904
- ],
905
- "type": "string",
906
- "minLength": 1,
907
- "pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
903
+ ]
908
904
  },
909
905
  "background_color": {
910
906
  "title": "Background Color",
911
907
  "description": "Hexadecimal color code used as background color in NFT marketplace displays",
908
+ "type": "string",
909
+ "minLength": 1,
910
+ "pattern": "^#[0-9A-F]{6}$",
912
911
  "examples": [
913
912
  "#2D5A27",
914
913
  "#FF5733"
915
- ],
916
- "type": "string",
917
- "minLength": 1,
918
- "pattern": "^#[0-9A-F]{6}$"
914
+ ]
919
915
  },
920
916
  "animation_url": {
921
917
  "title": "Animation URL",
@@ -933,26 +929,28 @@
933
929
  "description": "Optional list of public resource links with labels",
934
930
  "type": "array",
935
931
  "items": {
936
- "title": "External Link",
937
- "description": "External link with label and description",
938
932
  "type": "object",
939
933
  "properties": {
940
934
  "label": {
941
- "title": "Link Label",
942
- "description": "Display name for the external link",
943
935
  "type": "string",
944
936
  "minLength": 1,
945
- "maxLength": 50
937
+ "maxLength": 50,
938
+ "title": "Link Label",
939
+ "description": "Display name for the external link",
940
+ "examples": [
941
+ "example-value",
942
+ "Hello World"
943
+ ]
946
944
  },
947
945
  "url": {
946
+ "type": "string",
947
+ "format": "uri",
948
948
  "title": "Link URL",
949
949
  "description": "Direct URI to the linked resource",
950
950
  "examples": [
951
951
  "https://explore.carrot.eco/",
952
952
  "https://whitepaper.carrot.eco/"
953
- ],
954
- "type": "string",
955
- "format": "uri"
953
+ ]
956
954
  },
957
955
  "description": {
958
956
  "title": "Link Description",
@@ -966,19 +964,17 @@
966
964
  "label",
967
965
  "url"
968
966
  ],
969
- "additionalProperties": false
967
+ "additionalProperties": false,
968
+ "title": "External Link",
969
+ "description": "External link with label and description"
970
970
  }
971
971
  },
972
972
  "attributes": {
973
- "title": "Credit Purchase Receipt NFT Attribute Array",
974
- "description": "Attributes for credit purchase receipts including per-credit breakdowns, totals, buyer, purchase date, and optional retirement info. Fixed required attributes: Total Credits Purchased, Total Amount (USDC), Purchase Date, Certificates Purchased. Conditional attributes: Buyer (required when buyer.identity.name is provided), Retirement Date (optional, when retirement_receipt is present), Retirement Receipt (optional, when retirement_receipt is present). Dynamic attributes: Credit attributes (one per credit symbol in data.credits).\n\nRequired attributes (4): Total Credits Purchased, Total Amount (USDC), Purchase Date, Certificates Purchased",
975
973
  "minItems": 4,
976
974
  "type": "array",
977
975
  "items": {
978
976
  "anyOf": [
979
977
  {
980
- "title": "Total Credits Purchased Attribute",
981
- "description": "Total number of credits purchased across all tokens attribute with numeric display",
982
978
  "type": "object",
983
979
  "properties": {
984
980
  "trait_type": {
@@ -986,15 +982,15 @@
986
982
  "const": "Total Credits Purchased"
987
983
  },
988
984
  "value": {
985
+ "type": "number",
986
+ "minimum": 0,
989
987
  "title": "Total Credits Purchased",
990
988
  "description": "Total number of credits purchased across all tokens",
991
989
  "examples": [
992
- 0,
993
- 45.2,
994
- 72.5
995
- ],
996
- "type": "number",
997
- "minimum": 0
990
+ 1.5,
991
+ 100,
992
+ 2500.75
993
+ ]
998
994
  },
999
995
  "display_type": {
1000
996
  "type": "string",
@@ -1003,13 +999,13 @@
1003
999
  "max_value": {
1004
1000
  "title": "Max Value",
1005
1001
  "description": "Maximum possible value for numeric traits",
1002
+ "type": "number",
1003
+ "minimum": 0,
1006
1004
  "examples": [
1007
1005
  0,
1008
1006
  45.2,
1009
1007
  72.5
1010
- ],
1011
- "type": "number",
1012
- "minimum": 0
1008
+ ]
1013
1009
  }
1014
1010
  },
1015
1011
  "required": [
@@ -1017,11 +1013,11 @@
1017
1013
  "value",
1018
1014
  "display_type"
1019
1015
  ],
1020
- "additionalProperties": false
1016
+ "additionalProperties": false,
1017
+ "title": "Total Credits Purchased Attribute",
1018
+ "description": "Total number of credits purchased across all tokens attribute with numeric display"
1021
1019
  },
1022
1020
  {
1023
- "title": "Total Amount (USDC) Attribute",
1024
- "description": "Total USDC amount paid for the purchase attribute with numeric display",
1025
1021
  "type": "object",
1026
1022
  "properties": {
1027
1023
  "trait_type": {
@@ -1029,15 +1025,15 @@
1029
1025
  "const": "Total Amount (USDC)"
1030
1026
  },
1031
1027
  "value": {
1028
+ "type": "number",
1029
+ "minimum": 0,
1032
1030
  "title": "Total Amount (USDC)",
1033
1031
  "description": "Total USDC amount paid for the purchase",
1034
1032
  "examples": [
1035
- 0,
1036
- 45.2,
1037
- 72.5
1038
- ],
1039
- "type": "number",
1040
- "minimum": 0
1033
+ 1.5,
1034
+ 100,
1035
+ 2500.75
1036
+ ]
1041
1037
  },
1042
1038
  "display_type": {
1043
1039
  "type": "string",
@@ -1046,13 +1042,13 @@
1046
1042
  "max_value": {
1047
1043
  "title": "Max Value",
1048
1044
  "description": "Maximum possible value for numeric traits",
1045
+ "type": "number",
1046
+ "minimum": 0,
1049
1047
  "examples": [
1050
1048
  0,
1051
1049
  45.2,
1052
1050
  72.5
1053
- ],
1054
- "type": "number",
1055
- "minimum": 0
1051
+ ]
1056
1052
  }
1057
1053
  },
1058
1054
  "required": [
@@ -1060,11 +1056,11 @@
1060
1056
  "value",
1061
1057
  "display_type"
1062
1058
  ],
1063
- "additionalProperties": false
1059
+ "additionalProperties": false,
1060
+ "title": "Total Amount (USDC) Attribute",
1061
+ "description": "Total USDC amount paid for the purchase attribute with numeric display"
1064
1062
  },
1065
1063
  {
1066
- "title": "Purchase Date Attribute",
1067
- "description": "Unix timestamp in milliseconds when the purchase was completed attribute",
1068
1064
  "type": "object",
1069
1065
  "properties": {
1070
1066
  "trait_type": {
@@ -1072,14 +1068,14 @@
1072
1068
  "const": "Purchase Date"
1073
1069
  },
1074
1070
  "value": {
1071
+ "type": "integer",
1072
+ "exclusiveMinimum": 0,
1073
+ "maximum": 9007199254740991,
1075
1074
  "title": "Purchase Date",
1076
1075
  "description": "Unix timestamp in milliseconds when the purchase was completed",
1077
1076
  "examples": [
1078
1077
  1704067200000
1079
- ],
1080
- "type": "integer",
1081
- "exclusiveMinimum": 0,
1082
- "maximum": 9007199254740991
1078
+ ]
1083
1079
  },
1084
1080
  "display_type": {
1085
1081
  "type": "string",
@@ -1091,11 +1087,11 @@
1091
1087
  "value",
1092
1088
  "display_type"
1093
1089
  ],
1094
- "additionalProperties": false
1090
+ "additionalProperties": false,
1091
+ "title": "Purchase Date Attribute",
1092
+ "description": "Unix timestamp in milliseconds when the purchase was completed attribute"
1095
1093
  },
1096
1094
  {
1097
- "title": "Certificates Purchased Attribute",
1098
- "description": "Total number of certificates purchased attribute with numeric display",
1099
1095
  "type": "object",
1100
1096
  "properties": {
1101
1097
  "trait_type": {
@@ -1103,16 +1099,16 @@
1103
1099
  "const": "Certificates Purchased"
1104
1100
  },
1105
1101
  "value": {
1102
+ "type": "integer",
1103
+ "minimum": 1,
1104
+ "maximum": 9007199254740991,
1106
1105
  "title": "Certificates Purchased",
1107
1106
  "description": "Total number of certificates purchased",
1108
1107
  "examples": [
1109
1108
  1,
1110
1109
  123,
1111
1110
  456
1112
- ],
1113
- "type": "integer",
1114
- "minimum": 1,
1115
- "maximum": 9007199254740991
1111
+ ]
1116
1112
  },
1117
1113
  "display_type": {
1118
1114
  "type": "string",
@@ -1121,13 +1117,13 @@
1121
1117
  "max_value": {
1122
1118
  "title": "Max Value",
1123
1119
  "description": "Maximum possible value for numeric traits",
1120
+ "type": "number",
1121
+ "minimum": 0,
1124
1122
  "examples": [
1125
1123
  0,
1126
1124
  45.2,
1127
1125
  72.5
1128
- ],
1129
- "type": "number",
1130
- "minimum": 0
1126
+ ]
1131
1127
  }
1132
1128
  },
1133
1129
  "required": [
@@ -1135,11 +1131,11 @@
1135
1131
  "value",
1136
1132
  "display_type"
1137
1133
  ],
1138
- "additionalProperties": false
1134
+ "additionalProperties": false,
1135
+ "title": "Certificates Purchased Attribute",
1136
+ "description": "Total number of certificates purchased attribute with numeric display"
1139
1137
  },
1140
1138
  {
1141
- "title": "Buyer Attribute",
1142
- "description": "Attribute containing the buyer display name",
1143
1139
  "type": "object",
1144
1140
  "properties": {
1145
1141
  "trait_type": {
@@ -1147,25 +1143,25 @@
1147
1143
  "const": "Buyer"
1148
1144
  },
1149
1145
  "value": {
1146
+ "type": "string",
1147
+ "minLength": 1,
1148
+ "maxLength": 100,
1150
1149
  "title": "Buyer",
1151
1150
  "description": "Organization or individual purchasing the credits",
1152
1151
  "examples": [
1153
1152
  "EcoTech Solutions Inc."
1154
- ],
1155
- "type": "string",
1156
- "minLength": 1,
1157
- "maxLength": 100
1153
+ ]
1158
1154
  }
1159
1155
  },
1160
1156
  "required": [
1161
1157
  "trait_type",
1162
1158
  "value"
1163
1159
  ],
1164
- "additionalProperties": false
1160
+ "additionalProperties": false,
1161
+ "title": "Buyer Attribute",
1162
+ "description": "Attribute containing the buyer display name"
1165
1163
  },
1166
1164
  {
1167
- "title": "Retirement Date Attribute",
1168
- "description": "Unix timestamp in milliseconds when credits were retired (if retirement occurred) attribute",
1169
1165
  "type": "object",
1170
1166
  "properties": {
1171
1167
  "trait_type": {
@@ -1173,14 +1169,14 @@
1173
1169
  "const": "Retirement Date"
1174
1170
  },
1175
1171
  "value": {
1172
+ "type": "integer",
1173
+ "exclusiveMinimum": 0,
1174
+ "maximum": 9007199254740991,
1176
1175
  "title": "Retirement Date",
1177
1176
  "description": "Unix timestamp in milliseconds when credits were retired (if retirement occurred)",
1178
1177
  "examples": [
1179
1178
  1704067200000
1180
- ],
1181
- "type": "integer",
1182
- "exclusiveMinimum": 0,
1183
- "maximum": 9007199254740991
1179
+ ]
1184
1180
  },
1185
1181
  "display_type": {
1186
1182
  "type": "string",
@@ -1192,11 +1188,11 @@
1192
1188
  "value",
1193
1189
  "display_type"
1194
1190
  ],
1195
- "additionalProperties": false
1191
+ "additionalProperties": false,
1192
+ "title": "Retirement Date Attribute",
1193
+ "description": "Unix timestamp in milliseconds when credits were retired (if retirement occurred) attribute"
1196
1194
  },
1197
1195
  {
1198
- "title": "Retirement Receipt Attribute",
1199
- "description": "Retirement receipt token ID attribute",
1200
1196
  "type": "object",
1201
1197
  "properties": {
1202
1198
  "trait_type": {
@@ -1204,12 +1200,16 @@
1204
1200
  "const": "Retirement Receipt"
1205
1201
  },
1206
1202
  "value": {
1207
- "title": "Retirement Receipt Token ID",
1208
- "description": "Token ID of the retirement receipt NFT as #<token_id> (if retirement occurred)",
1209
- "example": "#123",
1210
1203
  "type": "string",
1211
1204
  "minLength": 1,
1212
- "pattern": "^#\\d+$"
1205
+ "pattern": "^#\\d+$",
1206
+ "title": "Retirement Receipt Token ID",
1207
+ "description": "Token ID of the retirement receipt NFT as #<token_id> (if retirement occurred)",
1208
+ "examples": [
1209
+ "#456789",
1210
+ "#1000000"
1211
+ ],
1212
+ "example": "#456789"
1213
1213
  },
1214
1214
  "display_type": {
1215
1215
  "title": "Display Type",
@@ -1225,49 +1225,49 @@
1225
1225
  "max_value": {
1226
1226
  "title": "Max Value",
1227
1227
  "description": "Maximum possible value for numeric traits",
1228
+ "type": "number",
1229
+ "minimum": 0,
1228
1230
  "examples": [
1229
1231
  0,
1230
1232
  45.2,
1231
1233
  72.5
1232
- ],
1233
- "type": "number",
1234
- "minimum": 0
1234
+ ]
1235
1235
  }
1236
1236
  },
1237
1237
  "required": [
1238
1238
  "trait_type",
1239
1239
  "value"
1240
1240
  ],
1241
- "additionalProperties": false
1241
+ "additionalProperties": false,
1242
+ "title": "Retirement Receipt Attribute",
1243
+ "description": "Retirement receipt token ID attribute"
1242
1244
  },
1243
1245
  {
1244
- "title": "Credit Attribute",
1245
- "description": "Attribute representing purchased amount per credit token symbol",
1246
1246
  "type": "object",
1247
1247
  "properties": {
1248
1248
  "trait_type": {
1249
- "title": "Credit Token Symbol",
1250
- "description": "ERC20 token symbol identifier",
1251
- "examples": [
1249
+ "type": "string",
1250
+ "enum": [
1252
1251
  "C-CARB.CH4",
1253
1252
  "C-BIOW"
1254
1253
  ],
1255
- "type": "string",
1256
- "enum": [
1254
+ "title": "Credit Token Symbol",
1255
+ "description": "ERC20 token symbol identifier",
1256
+ "examples": [
1257
1257
  "C-CARB.CH4",
1258
1258
  "C-BIOW"
1259
1259
  ]
1260
1260
  },
1261
1261
  "value": {
1262
+ "type": "number",
1263
+ "minimum": 0,
1262
1264
  "title": "Credit Amount",
1263
1265
  "description": "Amount of credits purchased for the token symbol",
1264
1266
  "examples": [
1265
- 0,
1266
- 45.2,
1267
- 72.5
1268
- ],
1269
- "type": "number",
1270
- "minimum": 0
1267
+ 1.5,
1268
+ 100,
1269
+ 2500.75
1270
+ ]
1271
1271
  },
1272
1272
  "display_type": {
1273
1273
  "type": "string",
@@ -1276,13 +1276,13 @@
1276
1276
  "max_value": {
1277
1277
  "title": "Max Value",
1278
1278
  "description": "Maximum possible value for numeric traits",
1279
+ "type": "number",
1280
+ "minimum": 0,
1279
1281
  "examples": [
1280
1282
  0,
1281
1283
  45.2,
1282
1284
  72.5
1283
- ],
1284
- "type": "number",
1285
- "minimum": 0
1285
+ ]
1286
1286
  }
1287
1287
  },
1288
1288
  "required": [
@@ -1290,10 +1290,14 @@
1290
1290
  "value",
1291
1291
  "display_type"
1292
1292
  ],
1293
- "additionalProperties": false
1293
+ "additionalProperties": false,
1294
+ "title": "Credit Attribute",
1295
+ "description": "Attribute representing purchased amount per credit token symbol"
1294
1296
  }
1295
1297
  ]
1296
- }
1298
+ },
1299
+ "title": "Credit Purchase Receipt NFT Attribute Array",
1300
+ "description": "Attributes for credit purchase receipts including per-credit breakdowns, totals, buyer, purchase date, and optional retirement info. Fixed required attributes: Total Credits Purchased, Total Amount (USDC), Purchase Date, Certificates Purchased. Conditional attributes: Buyer (required when buyer.identity.name is provided), Retirement Date (optional, when retirement_receipt is present), Retirement Receipt (optional, when retirement_receipt is present). Dynamic attributes: Credit attributes (one per credit symbol in data.credits).\n\nRequired attributes (4): Total Credits Purchased, Total Amount (USDC), Purchase Date, Certificates Purchased"
1297
1301
  }
1298
1302
  },
1299
1303
  "required": [
@@ -1313,5 +1317,9 @@
1313
1317
  "image",
1314
1318
  "attributes"
1315
1319
  ],
1316
- "additionalProperties": false
1317
- }
1320
+ "additionalProperties": false,
1321
+ "title": "CreditPurchaseReceipt NFT IPFS Record",
1322
+ "description": "Complete CreditPurchaseReceipt NFT IPFS record including purchase summary, buyer details, credit breakdowns, certificate allocations, and NFT display attributes",
1323
+ "$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.3.0/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json",
1324
+ "version": "0.3.0"
1325
+ }