Developer Hub
Relation ProtocolRelation ONE APIRelation Graph API
English
English
  • Overview
  • QUICK START
    • Deploy a Semantic SBT contract leveraging Relation Protocol
    • Deploying query services using Graph Indexer
  • KEY CONCEPTS
    • RDF
    • Semantic SBTs
    • Social Graph
  • Architecture
  • Schema Standard
    • Overview
    • How schemas limit smart contracts
    • Store schema
    • List of schemas
  • Contract Open Standard
    • Overview
    • Identity
      • Name Service
    • Relationship
      • Follow
      • Dao
    • Publication
      • Content
      • Privacy Content
  • Open Standard API
    • Introduction
    • EIP-6239
    • Business Interface
      • Identity
      • Relationship
      • Publication
  • Graph Indexer
    • Definition and usage
    • Listen to events
    • To parse RDF data
    • To build a social graph
  • Integrations
    • Quick start
    • Construct a social graph with Relation Protocol
    • List of resources
    • NameService contract guide
    • Follow contract guide
    • Dao contract guide
    • Content contract guide
    • PrivacyContent contract guide
  • Relation Name Service
    • Name Service Api
  • Use Case
  • APPENDIX
    • Deploy a contract using Hardhat
    • SemanticSBT Deployment tool
Powered by GitBook
On this page
  1. Open Standard API
  2. Business Interface

Identity

  1. Register a domain name

register(address owner, string calldata name, bool reverseRecord) external returns (uint);

Register a domain for a specific address. You can set the resolve record upon registration or only register the domain name. The return value is a tokenId relating to the domain name.

Parameters:

  • owner: The address of the user owning the domain name

  • name: The domain name

  • reverseRecord: whether to set a resolve record at this point

Return value:

  • The tokenId related to the domain name.

  1. Set a resolve record

function setNameForAddr(address addr, string calldata name) external;

A user sets a resolve record for a domain name:

Parameters:

  • addr: The owner of the domain name. If the owner is zero address(0x0000000000000000000000000000000000000000) , then this is an operation unbinding a name with an address.

  1. Set a profileURI

function setProfileURI(string memory profileURI) external;

Store the caller's profileURI on the blockchain. The profileURI is a transaction hash on Arweave which can be used to access the user's identity data via an Arweave gateway.

Parameters:

  • profileURI: A resource address pointing to a user's identity data. It is a transaction hash on Arweave, with the data stored on Arweave.

The content uploaded to Arweave is structured as follows:

{
  "avatar": "${The avatar of Soul}"
}
  1. Lookup a domain name

function addr(string calldata name) virtual external view returns (address addr);

Lookup the user address linked to a given domain name

Parameters:

  • name: the domain name

Return value:

  • addr: the resolved address

  1. Reverse resolving

function nameOf(address addr) external view returns (string memory name);

With an address, you can reversely resolve the domain name it binded with.

Parameters:

  • addr: the address

Return value:

  • name: the domain name

  1. Check an address's profileUIR

function profileURI(address addr) external view returns (string memory profileURI);

With an address, you can query the resource address storing a user's identity data.

Parameters:

  • addr: the address

Return value: profileURI, a resource address pointing to a user's identity data.

Last updated 2 years ago