Create and Register a Schema
Before issuing attestations, you need a registered schema or a schema that already exists in the target Verax deployment.
Onchain interface
Schemas are created in SchemaRegistry:
function createSchema(
string calldata name,
string calldata description,
string calldata context,
string calldata schemaString
) public;
Protocol checks:
namemust be non-empty;schemaStringmust be non-empty;- the schema ID must not already be registered.
| Parameter | Type | Meaning |
|---|---|---|
name | string | Human-readable schema name |
description | string | Link or text describing intended use |
context | string | Semantic context hint or vocabulary pointer |
schemaString | string | ABI-like schema definition |
warning
On mainnets, schema creation is gated by issuer allowlisting. On testnets, the deployment is permissionless.
Recommended flow
- Compute the schema ID first.
- Check whether it is already registered.
- Create it only if needed.
info
Because schema IDs are deterministic, recomputing the ID locally is usually easier and more reliable than scraping it from explorer logs.
SDK
const schemaString = "(bool isExample, uint16 score)";
const schemaId = await veraxSdk.schema.getIdFromSchemaString(schemaString);
const exists = await veraxSdk.schema.isRegistered(schemaId);
if (!exists) {
await veraxSdk.schema.create(
"Example Schema",
"Example schema used in documentation",
"https://schema.org/Thing",
schemaString,
{ waitForConfirmation: true },
);
}
Explorer or manual contract call

Example explorer form for calling createSchema on SchemaRegistry.
- Find the
SchemaRegistryaddress for your network in Networks and Addresses. - Open the contract page in your network explorer.
- Go to the contract write interface.
- Call
createSchema(name, description, context, schemaString). - Read the emitted
SchemaCreatedevent or recompute the ID locally withgetIdFromSchemaString(schemaString).
Using the deterministic ID is usually easier than scraping explorer logs.
Updating the context later
The schema creator can later update context with:
function updateContext(bytes32 schemaId, string calldata context) public;
The caller must be the assigned issuer for that schema.