Skip to content

Commit ed20b67

Browse files
committed
fix: add MAT- prefix to MaterialDNA id pattern; update all examples to v0.2.0
- material-dna.schema.json: id pattern updated to ^MAT-[A-Z]{2}-[A-Z]{3}-\d{4}-[A-Z]+-[A-Z0-9]{6,}$ - offer, match, transfer, material-status: material_id pattern updated with MAT- prefix - transaction.schema.json: both material references updated - loopcoin.schema.json: material_ref pattern updated - product-dna.schema.json: material_ids array item pattern updated - All 15 examples: schema_version bumped to 0.2.0, @context updated to loop-v0.2.0.jsonld, MaterialDNA id/reference fields prefixed with MAT- - SPECIFICATION.md: added §3.6 entity status-transition reference table
1 parent e09464c commit ed20b67

25 files changed

Lines changed: 83 additions & 58 deletions

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.2] - 2026-05-26
11+
12+
### Fixed
13+
- MaterialDNA `id` pattern in `material-dna.schema.json` updated to require the `MAT-` prefix (`^MAT-[A-Z]{2}-[A-Z]{3}-\d{4}-[A-Z]+-[A-Z0-9]{6,}$`), consistent with the spec and symmetric with ProductDNA's `PRD-` prefix
14+
- Same `MAT-` prefix pattern applied to all schemas that reference MaterialDNA IDs: `offer`, `match`, `transfer`, `material-status`, `transaction`, `loopcoin`, `product-dna`
15+
- All 15 example payloads updated: `schema_version` bumped to `"0.2.0"`, `@context` updated to `loop-v0.2.0.jsonld`, and all MaterialDNA `id`/reference fields prefixed with `MAT-`
16+
17+
### Changed
18+
- `SPECIFICATION.md` §3.6 added: entity status-transition reference table for `Offer`, `Match`, `Transfer`, `MaterialStatusUpdate`, and `Transaction`
19+
1020
## [0.2.1] - 2026-05-26
1121

1222
### Added
@@ -187,7 +197,8 @@ This changelog is maintained by the LOOP core team.
187197

188198
---
189199

190-
[Unreleased]: https://github.com/local-loop-io/loop-protocol/compare/v0.2.1...HEAD
200+
[Unreleased]: https://github.com/local-loop-io/loop-protocol/compare/v0.2.2...HEAD
201+
[0.2.2]: https://github.com/local-loop-io/loop-protocol/compare/v0.2.1...v0.2.2
191202
[0.2.1]: https://github.com/local-loop-io/loop-protocol/compare/v0.2.0...v0.2.1
192203
[0.2.0]: https://github.com/local-loop-io/loop-protocol/compare/v0.1.1-demo...v0.2.0
193204
[0.1.1]: https://github.com/local-loop-io/loop-protocol/releases/tag/v0.1.1

SPECIFICATION.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,20 @@ These extensions:
231231
- SHOULD use the canonical JSON-LD context or explicit namespaced terms
232232
- SHOULD preserve unknown fields when relaying payloads between nodes
233233

234+
### 3.6 Entity Status Transitions
235+
236+
The table below defines the valid status values and allowed transitions for each protocol entity. State machines are enforced by node implementations; the protocol defines valid values only.
237+
238+
| Entity | Status values | Terminal states |
239+
|--------|---------------|-----------------|
240+
| **Offer** | `open``reserved` / `withdrawn` | `withdrawn` |
241+
| **Match** | `proposed``accepted` / `rejected`; `accepted``expired` | `rejected`, `expired` |
242+
| **Transfer** | `scheduled``in_transit``completed` / `cancelled` | `completed`, `cancelled` |
243+
| **MaterialStatusUpdate** | `available``reserved``withdrawn` | `withdrawn` |
244+
| **Transaction** | `pending``confirmed``in_transit``delivered``completed` / `cancelled` / `disputed` | `completed`, `cancelled`, `disputed` |
245+
246+
> An entity MUST NOT transition to a non-terminal status once it has reached a terminal state. Nodes that receive a status update contradicting this rule SHOULD reject it with a `409 Conflict` response.
247+
234248
---
235249

236250
## 4. MaterialDNA Specification

examples/01-material-registration.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "MaterialDNA",
4-
"schema_version": "0.1.1",
5-
"id": "DE-MUC-2025-PLASTIC-B847F3",
4+
"schema_version": "0.2.0",
5+
"id": "MAT-DE-MUC-2025-PLASTIC-B847F3",
66
"category": "plastic-pet",
77
"quantity": {
88
"value": 1000,

examples/02-loopcoin-transfer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "LoopCoinTransfer",
44
"id": "550e8400-e29b-41d4-a716-446655440000",
55
"from": "user:maria@munich.loop",
66
"to": "business:brewery@munich.loop",
77
"amount": 50,
88
"currency": "LC-MUC",
9-
"material_ref": "DE-MUC-2025-FOOD-B847F3",
9+
"material_ref": "MAT-DE-MUC-2025-FOOD-B847F3",
1010
"timestamp": "2025-05-27T14:30:00Z",
1111
"memo": "Payment for spent grain",
1212
"signature": "MEUCIQDmexampleSignature..."

examples/03-signal-voting.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "LoopVote",
44
"node": "munich.loop",
55
"vote_id": "2025-06-plastic-increase",

examples/04-cross-city-trade.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "MaterialTransaction",
44
"id": "TXN-2025-05-27-001",
5-
"material": "DE-MUC-2025-PLASTIC-B847F3",
5+
"material": "MAT-DE-MUC-2025-PLASTIC-B847F3",
66
"seller": "munich.loop",
77
"buyer": "berlin.loop",
88
"offer": {

examples/05-complete-flow.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[
22
{
3-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
3+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
44
"@type": "MaterialDNA",
5-
"schema_version": "0.1.1",
6-
"id": "DE-MUC-2025-FOOD-B847F3",
5+
"schema_version": "0.2.0",
6+
"id": "MAT-DE-MUC-2025-FOOD-B847F3",
77
"category": "organic-food",
88
"quantity": {
99
"value": 500,
@@ -20,7 +20,7 @@
2020
"expires": "2025-05-30T08:00:00Z"
2121
},
2222
{
23-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
23+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
2424
"@type": "LoopSignalConfig",
2525
"node": "munich.loop",
2626
"signals": {
@@ -32,7 +32,7 @@
3232
"valid_until": "2025-06-30T23:59:59Z"
3333
},
3434
{
35-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
35+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
3636
"@type": "LoopCoinConfig",
3737
"issuer": "munich.loop",
3838
"currency_code": "LC-MUC",
@@ -41,10 +41,10 @@
4141
"expiry_months": 6
4242
},
4343
{
44-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
44+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
4545
"@type": "MaterialTransaction",
4646
"id": "TXN-2025-05-27-002",
47-
"material": "DE-MUC-2025-FOOD-B847F3",
47+
"material": "MAT-DE-MUC-2025-FOOD-B847F3",
4848
"seller": "munich.loop",
4949
"buyer": "vienna.loop",
5050
"offer": {
@@ -60,10 +60,10 @@
6060
"status": "confirmed"
6161
},
6262
{
63-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
63+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
6464
"@type": "Settlement",
6565
"transaction_id": "TXN-2025-05-27-002",
66-
"material": "DE-MUC-2025-FOOD-B847F3",
66+
"material": "MAT-DE-MUC-2025-FOOD-B847F3",
6767
"seller": "munich.loop",
6868
"buyer": "vienna.loop",
6969
"final_cost": 104,
@@ -76,14 +76,14 @@
7676
"settled_at": "2025-05-27T11:00:00Z"
7777
},
7878
{
79-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
79+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
8080
"@type": "TransactionStatus",
8181
"transaction_id": "TXN-2025-05-27-002",
8282
"status": "completed",
8383
"updated_at": "2025-05-27T11:00:00Z"
8484
},
8585
{
86-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
86+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
8787
"@type": "NodeInfo",
8888
"id": "munich.loop",
8989
"name": "Munich LOOP Node",
@@ -98,7 +98,7 @@
9898
"endpoint": "https://munich.loop/api/v1"
9999
},
100100
{
101-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
101+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
102102
"@type": "NodeRegistry",
103103
"version": "2025-05-27",
104104
"nodes": [

examples/06-offer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "Offer",
4-
"schema_version": "0.1.1",
4+
"schema_version": "0.2.0",
55
"id": "OFR-2F7A6B9C",
6-
"material_id": "DE-MUC-2025-PLASTIC-B847F3",
6+
"material_id": "MAT-DE-MUC-2025-PLASTIC-B847F3",
77
"from_city": "Munich",
88
"to_city": "Berlin",
99
"quantity": {

examples/07-match.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "Match",
4-
"schema_version": "0.1.1",
4+
"schema_version": "0.2.0",
55
"id": "MCH-9B3C8A12",
6-
"material_id": "DE-MUC-2025-PLASTIC-B847F3",
6+
"material_id": "MAT-DE-MUC-2025-PLASTIC-B847F3",
77
"offer_id": "OFR-2F7A6B9C",
88
"from_city": "Munich",
99
"to_city": "Berlin",

examples/08-transfer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.1.1.jsonld",
2+
"@context": "https://local-loop-io.github.io/projects/loop-protocol/contexts/loop-v0.2.0.jsonld",
33
"@type": "Transfer",
4-
"schema_version": "0.1.1",
4+
"schema_version": "0.2.0",
55
"id": "TRF-5D8A23F1",
6-
"material_id": "DE-MUC-2025-PLASTIC-B847F3",
6+
"material_id": "MAT-DE-MUC-2025-PLASTIC-B847F3",
77
"match_id": "MCH-9B3C8A12",
88
"status": "completed",
99
"handoff_at": "2025-06-02T09:00:00Z",

0 commit comments

Comments
 (0)