Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-5851, a proposal for managing verifiable credentials using Soulbound Tokens (SBTs) to support on-chain KYC verification.

The explanation below translates, summarizes, and expands on the original proposal.

I also cover a range of other EIPs.

Overview

ERC-5851 proposes a mechanism for certifying that a particular address satisfies specified conditions, or claims, and verifying those claims using on-chain metadata. A claim is an assertion that a subject possesses a particular attribute, such as being at least 18 years old. An issuer can certify that assertion using a Soulbound Token (SBT).

Using SBTs allows issuers to associate the results of off-chain identity verification with blockchain addresses. Issuers and verifiers can then use that information through smart contracts.

Motivation

ERC-5851 aims to improve reliability and efficiency in use cases such as the following.

  • Mitigating Sybil attacks in one-person-one-vote systems.
  • Restricting event participation to eligible users.
  • Streamlining identity verification (KYC) for compliance with financial regulations.

Conventional KYC and identity verification processes take place off-chain, and individual projects often implement their own systems, increasing the technical burden. ERC-5851 defines smart contract interfaces that allow issuers and verifiers to exchange claims in a standardized format, making KYC results reusable and interoperable on-chain.

A common standard could allow users to share certified attributes with multiple services after a single verification process. Issuers and verifiers could adapt their systems to changing regulatory requirements. The goal is a more convenient and trustworthy Web3 ecosystem that also accounts for user privacy. Compliance and privacy still depend on the implementation and the information disclosed on-chain.

Specification

Terminology

  • Zero-Knowledge Proof (ZKP)

    • A cryptographic technique for proving that an assertion is true without disclosing the underlying private information.
  • Soulbound Token (SBT)

    • A non-transferable NFT used to represent identity-related information.
  • SBT Certificate

    • An SBT indicating that its holder possesses an identity signature corresponding to a claim.
  • Verifiable Credential (VC)

    • A set of assertions made by an issuer, such as passport information or assets held in a wallet.
    • A credential is tamper-evident and allows its holder to demonstrate attributes to a verifier.
  • Claim

    • A condition that a DID holder must satisfy, such as being at least 18 years old.
  • Holder

    • An entity that holds and presents claims. The original proposal's terminology associates this role with identity infrastructure such as a DID registry or digital identity provider.
  • Claimer

    • The party asserting a claim about itself.
  • Issuer

    • An entity issuing verifiable credentials based on claims, such as a government agency, company, or organization.
  • Verifier

    • An entity that checks the validity and authenticity of a VC.

Metadata standard

ERC-5851 defines claim information using the following three structs.

Metadata struct

Stores descriptive information about a claim.

javascript
struct Metadata {
    string title;
    string _type;
    string description;
}

This struct defines the name, type, and description of a claim. It describes what the claim represents and contains its title, data type, and detailed explanation.

Parameters

  • title
    • The name of the claim.
  • _type
    • The data type, such as uint, string, or bool.
  • description
    • Additional information describing the claim.

Values struct

Defines a format for storing values associated with claims, based on EIP-3475.

javascript
struct Values {
    string stringValue;
    uint uintValue;
    address addressValue;
    bool boolValue;
}

For more on ERC-3475, see the following article.

[ERC-3475] Tokenizing Bonds for Issuance and Redemption

This struct defines the actual values used by a Claim. It stores the expected value, or expectation, of the claim. The applicable field is selected according to the required data type.

Parameters

  • stringValue
    • A string value.
  • uintValue
    • An unsigned integer value.
  • addressValue
    • An address value.
  • boolValue
    • A Boolean value.

Claim struct

Contains the verification condition, metadata, and expected value.

javascript
struct Claim {
    Metadata metadata;
    string logic;
    Values expectation;
}

This struct defines a claim, including its verification condition and expected value. It describes the condition the holder must satisfy and is used during claim verification. For example, it can contain a comparison operator and a corresponding expectation of 18.

Parameters

  • metadata
    • Descriptive information about the claim.
  • logic
    • The logical operator used in verification, such as >=, ==, or ⊂.
  • expectation
    • The value or condition that must be satisfied.
Symbol Meaning
⊄ Indicates that the value is not within the specified set or range.
⊂ Indicates that the value belongs to the specified set.
< Indicates that the value is less than the specified value.
== Indicates that the value exactly matches the specified value.
  • Example: a claim certifying that the subject is at least 18 years old.
json
{
  "title": "age",
  "type": "uint",
  "description": "age of the person based on the birth date on the legal document",
  "logic": ">=",
  "value": "18"
}

Interfaces

The specification defines the functions that verifier and issuer contracts should provide.

Verifier interface
  • ifVerified(address claimer, uint256 SBTID)
    • Returns whether the specified address satisfies the claim associated with the specified SBT certificate ID.
Issuer interface
  • standardClaim(uint256 SBTID)

    • Retrieves all claim structs associated with a particular SBT ID.
  • changeStandardClaim(uint256 SBTID, Claim[] memory _claims)

    • Sets or changes the claim definitions associated with an SBT ID.
  • certify(address claimer, uint256 SBTID)

    • Grants the specified address an SBT certificate. The certification process can use zero-knowledge proofs.
  • revoke(address certifying, uint256 SBTID)

    • Revokes the SBT certificate associated with the specified address.

Events

StandardChanged
javascript
event StandardChanged(uint256 SBTID, Claim[] _claims);

An event emitted when the claim definitions associated with an SBT change. It notifies observers when new claim conditions are defined or a new SBT certificate type is created.

Parameters

  • SBTID
    • The SBT ID whose claim conditions have changed.
  • _claims
    • An array of the newly configured Claim structs.
Certified
javascript
event Certified(address claimer, uint256 SBTID);

An event emitted when an SBT certificate is issued to a particular address. It notifies observers that an SBT has been assigned to a user.

Parameters

  • claimer
    • The address receiving the SBT certificate.
  • SBTID
    • The ID of the issued SBT.
Revoked
javascript
event Revoked(address claimer, uint256 SBTID);

An event emitted when an SBT certificate is revoked. It indicates that a previously issued certificate has been invalidated.

Parameters

  • claimer
    • The address whose SBT certificate was revoked.
  • SBTID
    • The ID of the revoked SBT.

Verifier

js
/// @notice getter function to validate if the address `claimer` is the holder of the claim defined by the tokenId `SBTID`
/// @dev it MUST be defining the conditional operator (logic explained below) to allow the application to convert it into code logic 
/// @dev logic given here MUST be the conditiaonl operator, MUST be one of ("⊄", "⊂", "<", "<=", "==", "!=", ">=", ">")
/// @param claimer is the EOA address that wants to validate the SBT issued to it by the issuer. 
/// @param SBTID is the Id of the SBT that user is the claimer.
/// @return true if the assertion is valid, else false
/**
example ifVerified(0xfoo, 1) => true will mean that 0xfoo is the holder of the SBT identity token defined by tokenId of the given collection. 
*/
function ifVerified(address claimer, uint256 SBTID) external view returns (bool);
ifVerified
javascript
function ifVerified(address claimer, uint256 SBTID) external view returns (bool);

Checks whether a specified address satisfies the claim conditions associated with an SBT. It returns whether claimer holds the specified certificate and satisfies the defined verification conditions according to the verifier's implementation.

Arguments

  • claimer
    • The address being verified.
  • SBTID
    • The SBT certificate ID.

Return value

  • bool
    • true if the conditions are satisfied; otherwise, false.

Issuer

js
/// @notice getter function to fetch the on-chain identification logic for the given identity holder.
/// @dev it MUST not be defined for address(0). 
/// @param SBTID is the Id of the SBT that the user is the claimer.
/// @return the struct array of all the descriptions of condition metadata that is defined by the administrator for the given KYC provider.
/**
ex: standardClaim(1) --> {
{ "title":"age",
    "type": "uint",
    "description": "age of the person based on the birth date on the legal document",
    },
   "logic": ">=",
"value":"18"  
}
Defines the condition encoded for the identity index 1, defining the identity condition that holder must be equal or more than 18 years old.
**/

function standardClaim(uint256 SBTID) external view returns (Claim[] memory);

/// @notice function for setting the claim requirement logic (defined by Claims metadata) details for the given identity token defined by SBTID.
/// @dev it should only be called by the admin address.
/// @param SBTID is the Id of the SBT-based identity certificate for which the admin wants to define the Claims.
/// @param `claims` is the struct array of all the descriptions of condition metadata that is defined by the administrator. check metadata section for more information.
/**
example: changeStandardClaim(1, { "title":"age",
        "type": "uint",
        "description": "age of the person based on the birth date on the legal document",
        },
    "logic": ">=",
    "value":"18"  
}); 
will correspond to the functionality that admin needs to adjust the standard claim for the identification SBT with tokenId = 1, based on the conditions described in the Claims array struct details.
**/

function changeStandardClaim(uint256 SBTID, Claim[] memory _claims) external returns (bool);

/// @notice function which uses the ZKProof protocol to validate the identity based on the given 
/// @dev it should only be called by the admin address.
/// @param SBTID is the Id of the SBT-based identity certificate for which admin wants to define the Claims.
/// @param claimer is the address that needs to be proven as the owner of the SBT defined by the tokenID.
/**
example: certify(0xA....., 10) means that admin assigns the DID badge with id 10 to the address defined by the `0xA....` wallet.
*/
function certify(address claimer, uint256 SBTID) external returns (bool);

/// @notice function which uses the ZKProof protocol to validate the identity based on the given 
/// @dev it should only be called by the admin address.
/// @param SBTID is the Id of the SBT-based identity certificate for which the admin wants to define the Claims.
/// @param claimer is the address that needs to be proven as the owner of the SBT defined by the tokenID.
/* eg: revoke(0xfoo,1): means that KYC admin revokes the SBT certificate number 1 for the address '0xfoo'. */
function revoke(address certifying, uint256 SBTID) external returns (bool);
standardClaim
javascript
function standardClaim(uint256 SBTID) external view returns (Claim[] memory);

Retrieves the claim conditions defined for the specified SBT ID. It returns the list of claims associated with the certificate, allowing callers to inspect the conditions required for certification.

Arguments

  • SBTID
    • The SBT ID whose conditions are being retrieved.

Return value

  • Claim[]
    • An array of the configured claim structs.
changeStandardClaim
javascript
function changeStandardClaim(uint256 SBTID, Claim[] memory _claims) external returns (bool);

Sets new claim conditions for the specified SBT. An administrator calls this function to define or modify the claim conditions associated with the SBT ID.

Arguments

  • SBTID
    • The ID of the SBT whose conditions are being changed.
  • _claims
    • An array of the new claim structs.

Return value

  • bool
    • Indicates whether the update succeeded.

certify

javascript
function certify(address claimer, uint256 SBTID) external returns (bool);

Grants an SBT certificate to a specified address. The administrator verifies the target address, potentially using mechanisms such as zero-knowledge proofs, and issues the SBT based on the result.

Arguments

  • claimer
    • The address receiving the SBT certificate.
  • SBTID
    • The ID of the SBT being issued.

Return value

  • bool
    • true if issuance succeeds.
revoke
javascript
function revoke(address certifying, uint256 SBTID) external returns (bool);

Revokes the SBT certificate associated with a specified address. The administrator uses this function to invalidate a user's certificate.

Arguments

  • certifying
    • The address whose SBT certificate is being revoked.
  • SBTID
    • The target SBT ID.

Return value

  • bool
    • true if revocation succeeds.

Compatibility

ERC-5851 maintains compatibility as long as the metadata structure of existing SBT certificates, including IDs and claim requirements, is preserved.

Users who previously received certificates can continue using them if the relevant metadata remains unchanged.

However, suppose a DeFi provider uses a modifier to restrict a function to holders of a particular SBT. If an administrator deletes claim definitions or changes verification logic, existing certificates may become invalid for that purpose. Changes to the specification or implementation should therefore account for their effect on existing users.

Reference implementations

ERC-5851 provides reference implementations corresponding to two interfaces.

  • EIP5851 Verifier The verification-side implementation provides a modifier that restricts specific functions to holders of an SBT certificate. The modifier calls the issuer contract to verify that an address holds a valid claim.

  • EIP5851 Issuer The issuance-side implementation allows entities such as KYC controllers to issue identity certificates in the form of SBTs. It implements the issuer interface, including claim definition, certification, and revocation functions.

Separating the verifier and issuer allows developers to build a flexible, extensible identity verification system.

Citation

Yu Liu (@yuliu-debond), Junyi Zhong (@Jooeys), "ERC-5851: On-Chain Verifiable Credentials [DRAFT]," Ethereum Improvement Proposals, no. 5851, October 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5851.

Conclusion

This article covered ERC-5851, a proposal for managing verifiable credentials with Soulbound Tokens (SBTs) to support on-chain KYC verification.

If you have questions, feel free to reach out via Twitter DM.

Twitter @cardene777

I also publish on the following platforms.

https://chaldene.net/