Skip to content

Commit 731c69a

Browse files
authored
Merge pull request #50 from nostrability/feat/mip-00
Introduces MIP-00 support by adding Kind 443 (KeyPackage) and Kind 10051 (KeyPackage relay list) event schemas, plus auxiliary MLS tag schemas (protocol version, ciphersuite, extensions, client) with matching aliases. Tightens content validation for Kind 443 to require even-length hex.
2 parents 612d109 + e5ca73a commit 731c69a

File tree

10 files changed

+112
-0
lines changed

10 files changed

+112
-0
lines changed

@/tag/mls_ciphersuite.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allOf:
2+
- $ref: "nips/mip-00/tag/ciphersuite/schema.yaml"

@/tag/mls_client.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allOf:
2+
- $ref: "nips/mip-00/tag/client/schema.yaml"

@/tag/mls_extensions.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allOf:
2+
- $ref: "nips/mip-00/tag/extensions/schema.yaml"

@/tag/mls_protocol_version.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allOf:
2+
- $ref: "nips/mip-00/tag/mls_protocol_version/schema.yaml"

nips/mip-00/kind-10051/schema.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$schema: http://json-schema.org/draft-07/schema#
2+
title: kind10051
3+
description: Marmot KeyPackage relay list event (MIP-00)
4+
allOf:
5+
- $ref: "@/note.yaml"
6+
- type: object
7+
properties:
8+
kind:
9+
const: 10051
10+
description: "Kind number for publishing relays that host Marmot KeyPackages"
11+
tags:
12+
type: array
13+
items:
14+
$ref: "@/tag.yaml"
15+
minItems: 1
16+
contains:
17+
$ref: "@/tag/relay.yaml"
18+
errorMessage:
19+
contains: "tags must include at least one relay tag identifying a KeyPackage relay"
20+
required:
21+
- kind
22+
- tags

nips/mip-00/kind-443/schema.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
$schema: http://json-schema.org/draft-07/schema#
2+
title: kind443
3+
description: Marmot KeyPackage event (MIP-00)
4+
allOf:
5+
- $ref: "@/note.yaml"
6+
- type: object
7+
properties:
8+
kind:
9+
const: 443
10+
description: "Kind number reserved for Marmot KeyPackage events"
11+
content:
12+
type: string
13+
pattern: "^[0-9a-fA-F]+$"
14+
minLength: 2
15+
errorMessage: "content must be a hex-encoded MLS KeyPackage bundle"
16+
description: "Hex-encoded TLS-serialized MLS KeyPackageBundle"
17+
tags:
18+
type: array
19+
items:
20+
$ref: "@/tag.yaml"
21+
minItems: 4
22+
allOf:
23+
- contains:
24+
$ref: "@/tag/mls_protocol_version.yaml"
25+
- contains:
26+
$ref: "@/tag/mls_ciphersuite.yaml"
27+
- contains:
28+
$ref: "@/tag/mls_extensions.yaml"
29+
- contains:
30+
$ref: "@/tag/relays.yaml"
31+
errorMessage:
32+
contains: "tags must include mls_protocol_version, ciphersuite, extensions, and relays tags"
33+
required:
34+
- kind
35+
- tags
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$schema: "http://json-schema.org/draft-07/schema#"
2+
allOf:
3+
- $ref: "@/tag.yaml"
4+
- type: array
5+
minItems: 2
6+
maxItems: 2
7+
items:
8+
- const: "ciphersuite"
9+
- type: string
10+
pattern: "^0x[0-9a-fA-F]{4}$"
11+
description: "MLS ciphersuite identifier in 0xXXXX format"

nips/mip-00/tag/client/schema.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
$schema: "http://json-schema.org/draft-07/schema#"
2+
allOf:
3+
- $ref: "@/tag.yaml"
4+
- type: array
5+
minItems: 2
6+
items:
7+
- const: "client"
8+
- type: string
9+
minLength: 1
10+
description: "Client display name or identifier"
11+
additionalItems:
12+
type: string
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$schema: "http://json-schema.org/draft-07/schema#"
2+
allOf:
3+
- $ref: "@/tag.yaml"
4+
- type: array
5+
minItems: 2
6+
items:
7+
- const: "extensions"
8+
- type: string
9+
pattern: "^0x[0-9a-fA-F]{4}$"
10+
description: "MLS extension identifier"
11+
additionalItems:
12+
type: string
13+
pattern: "^0x[0-9a-fA-F]{4}$"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$schema: "http://json-schema.org/draft-07/schema#"
2+
allOf:
3+
- $ref: "@/tag.yaml"
4+
- type: array
5+
minItems: 2
6+
maxItems: 2
7+
items:
8+
- const: "mls_protocol_version"
9+
- type: string
10+
pattern: "^[0-9]+(\\.[0-9]+)*$"
11+
description: "MLS protocol version identifier"

0 commit comments

Comments
 (0)