Skip to content

Commit 381e321

Browse files
committed
fix: update keri icp schema
1 parent 70c633f commit 381e321

1 file changed

Lines changed: 76 additions & 62 deletions

File tree

schemas/keri-icp-v1.json

Lines changed: 76 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"title": "IcpEvent",
4-
"description": "Inception event — creates a new KERI identity.\n\nThe inception event establishes the identifier prefix and commits to the first rotation key via the `n` (next) field.\n\nNote: The `t` (type) field is handled by the `Event` enum's serde tag.",
4+
"description": "Inception event — creates a new KERI identity.\n\nThe inception event establishes the identifier prefix and commits to the first rotation key via the `n` (next) field.\n\nSpec field order: `[v, t, d, i, s, kt, k, nt, n, bt, b, c, a]`",
55
"type": "object",
66
"required": [
7-
"b",
87
"bt",
98
"i",
109
"k",
@@ -24,15 +23,28 @@
2423
}
2524
},
2625
"b": {
27-
"description": "Witness list (empty)",
26+
"description": "Witness/backer list (ordered AIDs)",
27+
"default": [],
2828
"type": "array",
2929
"items": {
30-
"type": "string"
30+
"$ref": "#/definitions/Prefix"
3131
}
3232
},
3333
"bt": {
34-
"description": "Witness threshold: \"0\" (no witnesses)",
35-
"type": "string"
34+
"description": "Witness/backer threshold",
35+
"allOf": [
36+
{
37+
"$ref": "#/definitions/Threshold"
38+
}
39+
]
40+
},
41+
"c": {
42+
"description": "Configuration traits (e.g., EstablishmentOnly, DoNotDelegate)",
43+
"default": [],
44+
"type": "array",
45+
"items": {
46+
"$ref": "#/definitions/ConfigTrait"
47+
}
3648
},
3749
"d": {
3850
"description": "SAID (Self-Addressing Identifier) — Blake3 hash of event",
@@ -44,34 +56,42 @@
4456
]
4557
},
4658
"i": {
47-
"description": "Identifier prefix (same as `d` for inception)",
59+
"description": "Identifier prefix (same as `d` for self-addressing inception)",
4860
"allOf": [
4961
{
5062
"$ref": "#/definitions/Prefix"
5163
}
5264
]
5365
},
5466
"k": {
55-
"description": "Current public key(s), Base64url encoded with derivation code",
67+
"description": "Current public key(s), CESR-encoded",
5668
"type": "array",
5769
"items": {
58-
"type": "string"
70+
"$ref": "#/definitions/CesrKey"
5971
}
6072
},
6173
"kt": {
62-
"description": "Key threshold: \"1\" for single-sig",
63-
"type": "string"
74+
"description": "Key signing threshold (hex integer or fractional weight list)",
75+
"allOf": [
76+
{
77+
"$ref": "#/definitions/Threshold"
78+
}
79+
]
6480
},
6581
"n": {
66-
"description": "Next key commitment(s) — hash of next public key(s)",
82+
"description": "Next key commitment(s) — Blake3 digests of next public key(s)",
6783
"type": "array",
6884
"items": {
69-
"type": "string"
85+
"$ref": "#/definitions/Said"
7086
}
7187
},
7288
"nt": {
73-
"description": "Next key threshold: \"1\"",
74-
"type": "string"
89+
"description": "Next key signing threshold",
90+
"allOf": [
91+
{
92+
"$ref": "#/definitions/Threshold"
93+
}
94+
]
7595
},
7696
"s": {
7797
"description": "Sequence number (always 0 for inception)",
@@ -82,85 +102,79 @@
82102
]
83103
},
84104
"v": {
85-
"description": "Version string: \"KERI10JSON\"",
86-
"type": "string"
105+
"description": "Version string",
106+
"allOf": [
107+
{
108+
"$ref": "#/definitions/VersionString"
109+
}
110+
]
87111
},
88112
"x": {
89-
"description": "Event signature (Ed25519, base64url-no-pad)",
113+
"description": "Legacy signature field — DEPRECATED. Use `SignedEvent` with externalized signatures. Retained for backwards compatibility with stored events.",
90114
"default": "",
91115
"type": "string"
92116
}
93117
},
94118
"definitions": {
95-
"KeriSequence": {
119+
"CesrKey": {
120+
"description": "A CESR-encoded public key (e.g., `D` + base64url Ed25519).\n\nWraps the qualified string form. Use `parse_ed25519()` to extract the raw 32-byte key for cryptographic operations.\n\nUsage: ``` use auths_keri::CesrKey; let key = CesrKey::new_unchecked(\"DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\".into()); assert!(key.parse_ed25519().is_ok()); ```",
96121
"type": "string"
97122
},
98-
"Prefix": {
99-
"description": "Strongly-typed KERI identifier prefix (e.g., `\"ETest123...\"`).\n\nA prefix is the self-addressing identifier derived from the inception event's Blake3 hash. Always starts with 'E' (Blake3-256 derivation code).\n\nArgs: * Inner `String` should start with `'E'` (enforced by `new()`, not by serde).\n\nUsage: ```ignore let prefix = Prefix::new(\"ETest123abc\".to_string())?; assert_eq!(prefix.as_str(), \"ETest123abc\"); ```",
100-
"type": "string"
101-
},
102-
"Said": {
103-
"description": "KERI Self-Addressing Identifier (SAID).\n\nA Blake3 hash that uniquely identifies a KERI event. Creates the hash chain: each event's `p` (previous) field is the prior event's SAID.\n\nStructurally identical to `Prefix` (both start with 'E') but semantically distinct — a prefix identifies an *identity*, a SAID identifies an *event*.\n\nArgs: * Inner `String` should start with `'E'` (enforced by `new()`, not by serde).\n\nUsage: ```ignore let said = Said::new(\"ESAID123\".to_string())?; assert_eq!(said.as_str(), \"ESAID123\"); ```",
104-
"type": "string"
105-
},
106-
"Seal": {
107-
"description": "A seal anchors external data in a KERI event.\n\nSeals are included in the `a` (anchors) field of KERI events. They contain a digest of the anchored data and a type indicator.",
108-
"type": "object",
109-
"required": [
110-
"d",
111-
"type"
112-
],
113-
"properties": {
114-
"d": {
115-
"description": "SAID (digest) of the anchored data",
116-
"allOf": [
117-
{
118-
"$ref": "#/definitions/Said"
119-
}
123+
"ConfigTrait": {
124+
"description": "KERI configuration trait codes.\n\nThese control identity behavior at inception and may be updated at rotation (for `RB`/`NRB` only). If two conflicting traits appear, the latter supersedes.\n\nUsage: ``` use auths_keri::ConfigTrait; let traits: Vec<ConfigTrait> = serde_json::from_str(r#\"[\"EO\",\"DND\"]\"#).unwrap(); assert!(traits.contains(&ConfigTrait::EstablishmentOnly)); ```",
125+
"oneOf": [
126+
{
127+
"description": "Establishment-Only: only establishment events in KEL.",
128+
"type": "string",
129+
"enum": [
130+
"EO"
120131
]
121132
},
122-
"type": {
123-
"description": "Type of anchored data",
124-
"allOf": [
125-
{
126-
"$ref": "#/definitions/SealType"
127-
}
128-
]
129-
}
130-
}
131-
},
132-
"SealType": {
133-
"description": "Type of data anchored by a seal.",
134-
"oneOf": [
135133
{
136-
"description": "Device attestation seal",
134+
"description": "Do-Not-Delegate: cannot act as delegator.",
137135
"type": "string",
138136
"enum": [
139-
"device-attestation"
137+
"DND"
140138
]
141139
},
142140
{
143-
"description": "Revocation seal",
141+
"description": "Delegate-Is-Delegator: delegated AID treated same as delegator.",
144142
"type": "string",
145143
"enum": [
146-
"revocation"
144+
"DID"
147145
]
148146
},
149147
{
150-
"description": "Capability delegation seal",
148+
"description": "Registrar Backers: backer list provides registrar backer AIDs.",
151149
"type": "string",
152150
"enum": [
153-
"delegation"
151+
"RB"
154152
]
155153
},
156154
{
157-
"description": "Identity provider binding seal",
155+
"description": "No Registrar Backers: switch back to witnesses.",
158156
"type": "string",
159157
"enum": [
160-
"idp-binding"
158+
"NRB"
161159
]
162160
}
163161
]
162+
},
163+
"KeriSequence": {
164+
"type": "string"
165+
},
166+
"Prefix": {
167+
"description": "Strongly-typed KERI identifier prefix (e.g., `\"ETest123...\"`, `\"DKey456...\"`).\n\nA prefix is the autonomous identifier (AID) for a KERI identity. For self-addressing AIDs it starts with `E` (Blake3-256 digest of the inception event); for key-based AIDs it starts with `D` (Ed25519 public key) or another CESR derivation code.\n\nArgs: * Inner `String` must start with a valid CESR derivation code (uppercase letter or digit). Enforced by `new()`, not by serde.\n\nUsage: ```ignore let prefix = Prefix::new(\"ETest123abc\".to_string())?; assert_eq!(prefix.as_str(), \"ETest123abc\"); ```",
168+
"type": "string"
169+
},
170+
"Said": {
171+
"description": "KERI Self-Addressing Identifier (SAID).\n\nA Blake3 hash that uniquely identifies a KERI event. Creates the hash chain: each event's `p` (previous) field is the prior event's SAID.\n\nStructurally identical to `Prefix` (both start with 'E') but semantically distinct — a prefix identifies an *identity*, a SAID identifies an *event*.\n\nArgs: * Inner `String` should start with `'E'` (enforced by `new()`, not by serde).\n\nUsage: ```ignore let said = Said::new(\"ESAID123\".to_string())?; assert_eq!(said.as_str(), \"ESAID123\"); ```",
172+
"type": "string"
173+
},
174+
"Seal": true,
175+
"Threshold": true,
176+
"VersionString": {
177+
"type": "string"
164178
}
165179
}
166180
}

0 commit comments

Comments
 (0)