Verax Attestation Registry
  • 👋Introduction
  • ⚒️Getting Started
  • Core Concepts
    • High-Level Overview
    • Attestations
    • Schemas
    • Linked Data
    • Modules
    • Portals
    • Ecosystem
  • Developer Guides
    • ♒For Attestation Issuers
      • Create and register a Schema
      • Create a Module
      • Register a Module
      • Create a Portal
      • Register a Portal
      • Create an Attestation
      • Encoding Attestation Data
      • Revoke an Attestation
      • Replace an Attestation
      • Link Attestations
      • Bulk Create Attestations
      • EAS compatibility
    • 🧑‍🏫Tutorials
      • From a Schema to an Attestation
      • Using Ceramic to store the Attestation Payload
    • 🚀Examples
    • 🌐Using the Subgraph
    • 🛠️Using the SDK
  • Discover
    • 📚Modules Standard Library
      • ECDSAModule
      • ERC1271Module
      • FeeModule
      • IndexerModule
      • IssuersModule
      • SchemaModule
      • SenderModule
    • 🤝Integrations
  • Get Involved
    • Get in Touch
    • Contribute
    • Governance
      • Governance Charter
      • Governance Parameters
      • Overview of Governance
      • Proposal Templates
Powered by GitBook
On this page
  • Portal creation
  • Lifecycle Hooks
  • Portal registration
  • Manually registering a deployed Portal in the PortalRegistry contract
  • Using a blockchain explorer
  • Using the official Verax SDK
  • Using a default Portal
  1. Developer Guides
  2. For Attestation Issuers

Register a Portal

PreviousCreate a PortalNextCreate an Attestation

Last updated 7 months ago

are smart contracts that are registered in the "Portal Registry" and that you can consider as the entrypoint to the Verax Attestation Registry. This is where the payloads to be attested start their journey.

Portal creation

To create a Portal, you must first deploy a contract that inherits the abstract contract. This portal contract is where you create attestations in the registry. You have full control over the logic in this contract, so long as it inherits the base AbstractPortal contract. The function that you will call to issue an attestation is:

function attest(
    AttestationPayload memory attestationPayload,
    bytes[] memory validationPayload
  ) public payable;

We are also introducing an attestV2 function with the same signature, to cover the new "" feature.

The attest function accepts 2 arguments:

  1. attestationPayload, the raw attestation data that will be stored in the registry

  2. validationPayload, validation logic that the module needs to execute its verification logic

This function allows you to actually create attestations, you can call the various modules and/or apply any other logic you need to. The convention is to keep as much logic as possible in modules, but it is up to you how you implement your own domain logic. You can choose to override this function and add your own logic, or use the function as defined in AbstractPortal.

While you can put whatever logic you want to in your portal contracts, it is strongly advised that you keep your portal as modular as possible, which means keeping your logic in modules. In the future, we may pivot to no-code portals, which have no contract, and which simply execute a specific chain of modules!

As well as implementing the AbstractPortal interface, the Portal contract must also implement the interface, which involves including this function:

function supportsInterface(bytes4 interfaceID) public pure override returns (bool) {
  return interfaceID == type(AbstractPortal).interfaceId || interfaceID == type(IERC165Upgradeable).interfaceId;
}

Lifecycle Hooks

The AbstractPortal contract defines the following life cycle hooks:

  • onAttest

  • onReplace

  • onBulkAttest

  • onBulkReplace

  • onRevoke

  • onBulkRevoke

These lifecycle hooks can be overridden in the concrete implementation of the Portal, and can be used to implement additional logic and specific points in the lifecycle of an attestation.

Portal registration

Portal registration takes 5 parameters, defined as follows:

Parameter
Datatype
Description

id

address

Address of the Portal

name

string

A descriptive name for the Portal

description

string

A description of the Portal's functionality

isRevocable

bool

Whether attestations issued by the portal can be revoked

ownerName

string

The portal owner's name

Manually registering a deployed Portal in the PortalRegistry contract

Once you have deployed your Portal contract, you can then register it in the PortalRegistry contract using the register function:

function register(
    address id,
    string memory name,
    string memory description,
    bool isRevocable,
    string memory ownerName
  );

A few caveats: a Portal contract must be first deployed and cannot be registered twice under different names. Also, the name, description and owner name must not be empty.

Using a blockchain explorer

  1. Connect your wallet and fill the register form with the parameters described above

  2. Send the transaction

Using the official Verax SDK

We have seen rather manual ways to register a Portal, now let's focus on the easiest way: via the Verax SDK.

Once you have an SDK instance, you can register a Portal like this:

await veraxSdk.portal.register(
        id: "0xD39c439cD3Ae5E1F3c7d13985aDAC90846284904",
        name: "ExamplePortal",
        description: "This Portal is used as an example",
        isRevocable: true,
        ownerName: "Verax",
);

Using a default Portal

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 PortalRegistry contract address from the

Access the PortalRegistry contract on

Go to the

Go to the

Check to discover how to instantiate the Verax SDK.

If you opted for a default Portal as described , good news: it was registered while being deployed!

♒
Portals
AbstractPortal
Modules V2
IERC165Upgradeable
Lineascan
project README
Lineascan
"Contract" tab
"Write as Proxy" tab
this page
here
The form generated by Lineascan to interact with the PortalRegistry contract