Understanding Credential Types (cTypes)

Introduction to Credential Types (cTypes)

The reputation system on the Toto Chain is built on verifiable claims, or attestations, that are linked to a user's Decentralized Identity (DID). To ensure these attestations are standardized and understood by the entire network, the chain uses a schema system called Credential Types, or cTypes.

This document explains what cTypes are, how they are structured, and how they are managed on the Toto Chain.

What is a cType?

A cType is a schema that defines the structure and data fields of a specific type of credential. Think of it as a template or a blueprint for a claim. It ensures that every time a credential of a certain type is issued (for example, an email verification) it follows the exact same format.

This standardization is crucial because it allows applications and the chain itself to reliably interpret and validate the information contained within a credential.

The Anatomy of a cType

A cType is fundamentally a JSON object that describes the properties of a credential. These schemas can be simple or complex, containing various fields.

Example: An Email cType A simple cType for verifying an email address could be defined like this using a compatible library (like the Kilt SDK):

const ctype = Kilt.CType.fromProperties('Email', {
  email: { type: 'string' },
});

This cType, titled "Email," specifies that any credential of this type must contain a single property called email, and the value of that property must be a string.

When a cType is registered on the Toto Chain, two key pieces of information are stored:

  1. ctypeHash: This is a unique, cryptographic hash of the cType's JSON structure. Instead of storing the entire JSON object on-chain, this hash serves as its unique identifier. When an Attestation Provider issues a credential, it references this hash to specify the type of claim being made.

  2. ctypeWeight: This is a numerical value that represents the amount of reputation a user gains when an attestation of this cType is successfully linked to their DID. The weight is set by the Technical Committee and reflects how much trust or value that particular credential adds to a user's identity.

Predefined cTypes on Toto Chain

To provide a foundational layer of trust, the Toto Chain is launched with a set of predefined cTypes configured in its genesis block.

Currently, the primary predefined cType is for Email verification. More foundational cTypes for other common credentials (like social media handles) may be added in the future by the Technical Committee.

Creating and Adding New cTypes

The cType system is designed to be extensible. While the chain starts with a few core types, anyone can define a new, custom cType for any purpose imaginable. For example, a "Conference Attendee" credential or a "DAO Membership" credential.

However, for a new cType to be officially recognized by the chain and assigned a reputation weight, it must be approved by the Technical Committee through the governance proposal system.

The process is as follows:

  1. A developer defines the cType structure as a JSON object.

  2. A ctypeHash is calculated from this JSON structure.

  3. A member of the Technical Committee submits a proposal to add the new cType. This proposal includes the ctypeHash and a proposed ctypeWeight.

  4. If the committee votes to approve the proposal, the new cType is officially registered on-chain and can be used by Attestation Providers to issue new types of verifiable credentials.

This governance-led process ensures that the Toto Chain's reputation system can evolve over time while maintaining a high standard of trust and security.

Last updated