What is a Schema?
A schema defines the structure of attestation data. All attestations reference a schema.Creating a Schema
Schema Syntax
Supported Types
| Type | Description | Example |
|---|---|---|
bool | Boolean | true, false |
string | Text | "hello" |
u32 | Unsigned 32-bit | 42 |
u64 | Unsigned 64-bit | 1234567890 |
i32 | Signed 32-bit | -42 |
i64 | Signed 64-bit | -1234567890 |
bytes | Binary data | 0x1234... |
Example Schemas
KYC Verification
Professional Credential
Reputation Score
Generating Schema UID
Schema UIDs are deterministic based on definition + authority:Querying Schemas
Best Practices
- Keep it simple - Only include necessary fields
- Use appropriate types -
u64for timestamps,boolfor flags - Consider revocability - Set
revocable: truefor credentials that may need invalidation - Version schemas - Include version in name:
struct KYC_v2 { ... }