> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/protocol/open-standard-api/overview/name-service.md).

# Identity

1. Register a domain name

```solidity
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.

2. Set a resolve record

```solidity
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.

3. Set a profileURI

```solidity
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:

```json
{
  "avatar": "${The avatar of Soul}"
}
```

4. Lookup a domain name

```solidity
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

5. Reverse resolving

```solidity
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

6. Check an address's profileUIR

```solidity
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.
