{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://real-life.org/trust-tasks/membership-invite/0.1",
  "title": "Payload: membership-invite/0.1 (rltp-membership@0.11, target Trust Tasks framework 0.4)",
  "description": "Payload schema per Trust Tasks 6.3 ($id = Type URI, describes only the payload). The invitation carries NO key material and NO operation. invitee is signed into the payload so consent cannot be transplanted (accept.subject MUST equal invitee); card is the inviter's contact card, whose key-agreement key the accept is sealed to; validUntil bounds the invite's answerable life and the inviter's reply-key retention. inviter MUST equal the document issuer, invitee MUST equal the document recipient, and the document MUST carry a proof verifying under the issuer (normative in Membership Tasks 3.1, 2).",
  "type": "object",
  "required": ["invite"],
  "additionalProperties": false,
  "properties": {
    "invite": {
      "type": "object",
      "required": ["group", "inviter", "invitee", "card", "genesisDigest", "validUntil"],
      "additionalProperties": false,
      "properties": {
        "group": { "$ref": "#/$defs/didKey" },
        "inviter": { "$ref": "#/$defs/didKey" },
        "invitee": { "$ref": "#/$defs/didKey" },
        "card": {
          "$ref": "https://real-life.org/rltp/v1/schemas/contact-card.schema.json",
          "description": "the inviter's contact card (displayed form): carries the key-agreement key the accept will be sealed to"
        },
        "genesisDigest": { "$ref": "#/$defs/multibaseMultihash" },
        "validUntil": { "$ref": "#/$defs/rfc3339utc" },
        "name": { "type": "string", "maxLength": 200 },
        "note": { "type": "string", "maxLength": 2000 }
      }
    }
  },
  "$defs": {
    "didKey": {
      "type": "string",
      "pattern": "^did:key:z6Mk[1-9A-HJ-NP-Za-km-z]{44}$"
    },
    "multibaseMultihash": {
      "type": "string",
      "pattern": "^(u[A-Za-z0-9_-]{46}|z[1-9A-HJ-NP-Za-km-z]{44,48})$",
      "description": "multibase(multihash sha2-256) per Encounter 2.3: emit u, accept u/z"
    },
    "rfc3339utc": {
      "type": "string",
      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?Z$"
    }
  }
}
