From ac6a5df8ab9d7f96daac86d89452e8b05e18d8d7 Mon Sep 17 00:00:00 2001 From: Joshua Date: Tue, 17 Feb 2026 11:43:31 -0800 Subject: [PATCH] Add v1 offer, entitlement, and issuer manifest schemas --- README.md | 4 + docs/schemas/entitlement.v1.schema.json | 94 ++++++++++++ docs/schemas/issuer-manifest.v1.schema.json | 96 +++++++++++++ docs/schemas/offer.v1.schema.json | 151 ++++++++++++++++++++ 4 files changed, 345 insertions(+) create mode 100644 docs/schemas/entitlement.v1.schema.json create mode 100644 docs/schemas/issuer-manifest.v1.schema.json create mode 100644 docs/schemas/offer.v1.schema.json diff --git a/README.md b/README.md index 0015a60..327e825 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ docs/ roadmap-membership-platform.md review-notes.md platform-spec-alignment-review.md + schemas/ + offer.v1.schema.json + entitlement.v1.schema.json + issuer-manifest.v1.schema.json README.md ``` diff --git a/docs/schemas/entitlement.v1.schema.json b/docs/schemas/entitlement.v1.schema.json new file mode 100644 index 0000000..b469edb --- /dev/null +++ b/docs/schemas/entitlement.v1.schema.json @@ -0,0 +1,94 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://edut.ai/schemas/entitlement.v1.schema.json", + "title": "EDUT Entitlement Schema v1", + "type": "object", + "additionalProperties": false, + "required": [ + "schema_version", + "entitlement_id", + "offer_id", + "issuer_id", + "wallet_address", + "state", + "issued_at" + ], + "properties": { + "schema_version": { + "type": "string", + "const": "entitlement.v1" + }, + "entitlement_id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._:-]{2,191}$" + }, + "offer_id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" + }, + "issuer_id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" + }, + "wallet_address": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "workspace_id": { + "type": [ + "string", + "null" + ], + "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" + }, + "state": { + "type": "string", + "enum": [ + "active", + "suspended", + "revoked", + "expired" + ] + }, + "purchase": { + "type": "object", + "additionalProperties": false, + "required": [ + "tx_hash", + "chain_id", + "currency", + "amount_atomic", + "policy_hash" + ], + "properties": { + "tx_hash": { + "type": "string", + "pattern": "^0x[a-fA-F0-9]{64}$" + }, + "chain_id": { + "type": "integer", + "minimum": 1 + }, + "currency": { + "type": "string" + }, + "amount_atomic": { + "type": "string", + "pattern": "^[0-9]{1,78}$" + }, + "policy_hash": { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$" + } + } + }, + "issued_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } +} diff --git a/docs/schemas/issuer-manifest.v1.schema.json b/docs/schemas/issuer-manifest.v1.schema.json new file mode 100644 index 0000000..9991e32 --- /dev/null +++ b/docs/schemas/issuer-manifest.v1.schema.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://edut.ai/schemas/issuer-manifest.v1.schema.json", + "title": "EDUT Issuer Manifest Schema v1", + "type": "object", + "additionalProperties": false, + "required": [ + "schema_version", + "issuer_id", + "display_name", + "signing_keys", + "capabilities", + "published_at" + ], + "properties": { + "schema_version": { + "type": "string", + "const": "issuer_manifest.v1" + }, + "issuer_id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" + }, + "display_name": { + "type": "string", + "minLength": 1, + "maxLength": 160 + }, + "contact_email": { + "type": "string", + "format": "email" + }, + "signing_keys": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "key_id", + "algorithm", + "public_key", + "status" + ], + "properties": { + "key_id": { + "type": "string", + "pattern": "^[a-zA-Z0-9._:-]{3,128}$" + }, + "algorithm": { + "type": "string", + "enum": [ + "ed25519", + "secp256k1" + ] + }, + "public_key": { + "type": "string", + "minLength": 16, + "maxLength": 2048 + }, + "status": { + "type": "string", + "enum": [ + "active", + "retired" + ] + } + } + } + }, + "capabilities": { + "type": "object", + "additionalProperties": false, + "required": [ + "can_publish_offers", + "can_issue_entitlements" + ], + "properties": { + "can_publish_offers": { + "type": "boolean" + }, + "can_issue_entitlements": { + "type": "boolean" + }, + "requires_review": { + "type": "boolean" + } + } + }, + "published_at": { + "type": "string", + "format": "date-time" + } + } +} diff --git a/docs/schemas/offer.v1.schema.json b/docs/schemas/offer.v1.schema.json new file mode 100644 index 0000000..8358db6 --- /dev/null +++ b/docs/schemas/offer.v1.schema.json @@ -0,0 +1,151 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://edut.ai/schemas/offer.v1.schema.json", + "title": "EDUT Offer Schema v1", + "type": "object", + "additionalProperties": false, + "required": [ + "schema_version", + "offer_id", + "issuer_id", + "title", + "status", + "pricing", + "policies", + "created_at", + "updated_at" + ], + "properties": { + "schema_version": { + "type": "string", + "const": "offer.v1" + }, + "offer_id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" + }, + "issuer_id": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" + }, + "title": { + "type": "string", + "minLength": 1, + "maxLength": 160 + }, + "summary": { + "type": "string", + "maxLength": 400 + }, + "status": { + "type": "string", + "enum": [ + "draft", + "active", + "paused", + "retired" + ] + }, + "pricing": { + "type": "object", + "additionalProperties": false, + "required": [ + "currency", + "amount_atomic", + "decimals" + ], + "properties": { + "currency": { + "type": "string", + "enum": [ + "USDC", + "ETH" + ] + }, + "amount_atomic": { + "type": "string", + "pattern": "^[0-9]{1,78}$" + }, + "decimals": { + "type": "integer", + "minimum": 0, + "maximum": 18 + }, + "chain_id": { + "type": "integer", + "minimum": 1 + } + } + }, + "policies": { + "type": "object", + "additionalProperties": false, + "required": [ + "member_only", + "workspace_bound", + "transferable" + ], + "properties": { + "member_only": { + "type": "boolean" + }, + "workspace_bound": { + "type": "boolean" + }, + "transferable": { + "type": "boolean" + }, + "max_per_wallet": { + "type": [ + "integer", + "null" + ], + "minimum": 1 + }, + "requires_admin_approval": { + "type": "boolean" + } + } + }, + "entitlement": { + "type": "object", + "additionalProperties": false, + "required": [ + "type", + "scope" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "module_license", + "service_plan", + "access_pass" + ] + }, + "scope": { + "type": "string", + "enum": [ + "wallet", + "workspace" + ] + }, + "runtime_policy_ref": { + "type": "string" + } + } + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "metadata": { + "type": "object", + "additionalProperties": true + } + } +}