Skip to content

Sets

A Set is a meta-object from which other objects are created.

Descriptor

Sets are themselves objects: they have their own kind and are minted from a set. The Kind of Set and the Set of Set are genesis objects created during protocol initialization.

A set’s descriptor is initialized with the following values:

FieldValueDescription
flags0Reserved flags
rev1Initially 1, increments as the kind itself evolves
krevlatestRevision of the Kind of Set at creation (increments over time)
srevlatestRevision of the Set of Set at creation (increments over time)
kind1ID of the Kind of Set
set1ID of the Set of Set

Elements

Each set has 2 elements, as defined in the Kind of Set object's eltys field.

IndexElementTypeMutableDescription
0codeMatterYesAddress of the set contract
1dataMatterYesMatter hash of the set data

Set Contract

The code field stores the address of the set contract that governs all objects minted from this set.

The address is stored as a bytes32, derived from an Ethereum address as follows:

bytes32(uint256(uint160(addr)))

A periphery library is available to help users write set contracts. You can learn more in the guide: Register a Set.

Set Data

The data field stores a matter hash referencing a piece of data associated with the set.

This data is available to the set’s own kind contract and may also be used by the kind contracts of objects minted from it. We will explore more in later chapters.

Set Registry

When a set is registered in the Set Registry, it is assigned a set ID.

The set ID and set revision must be specified in an object's descriptor whenever the object is created or modified.

©2025 every