Register a Module
Last updated
Last updated
are smart contracts that are registered in the "Module Registry" and that perform specific validation logic on attestations before they are issued into the registry.
Modules are intended to perform a single specific function. They should be designed to be minimalistic, atomic, and reusable. Modules can be chained together in series so that they are executed in order, with any module in the chain being able to prevent an attestation being issued to the registry by simply reverting if its verification checks fail.
To create a module, you must deploy a smart contract that inherits the AbstractModule
abstract contract, which looks like this:
The run
function accepts four arguments:
attestationPayload
, the raw attestation data that will be stored in the registry
validationPayload
, validation logic that the module needs to execute its verification logic
txSender
, the address of the initial transaction sender
value
, the amount of ETH paid to get this attestation
The validationPayload
can be any data, which may encompass fields from the attestation metadata or additional data such as ZKP proof, a signature, merkle proof, and so on.
Module registration takes 3 parameters, defined as follows:
name
A descriptive name for the module that's stored on-chain
description
A link to an off-chain document that describes the module
moduleAddress
The address of the module smart contract
ModuleRegistry
contractOnce you have deployed your module contract, you can then register it in the ModuleRegistry
contract using the register
function:
A few caveats: a module contract must be first deployed and cannot be registered twice under different names, and it must implement the interfaces described above. Also, the name
parameter must not be empty.
Connect your allow-listed wallet and fill the register
form with the parameters described above
Send the transaction
We have seen rather manual ways to register a Module, now let's focus on the easiest way: via the Verax SDK.
Once you have an SDK instance, you can register a Module like this:
As well as implementing the AbstractModule
interface, the module contract must also implement the interface, which involves including this function:
Instead of crafting the smart contract call by hand, you can benefit from a chain explorer interface. Let's use the Linea Sepolia explorer, .
Retrieve the ModuleRegistry
contract address from the
Access the ModuleRegistry
contract on
Go to the
Go to the
Check to discover how to instantiate the Verax SDK.
To dive deeper on exactly how the ModuleRegistry
contract works, you can check out the .
Once you have deployed one or more schemas and optionally also deployed one or more modules, you are ready to register a and tie them all together so that you can issue your first attestations.
ModuleRegistry
contract