I am looking at web3.eth.ens library, I can see methods setText and getText, which allows you to set and get key value pairs against an ENS name. What is the purpose of this? Also is there a way to find all the keys against an ENS name?

1 Answer 1


The functions setText() and text() allow ENS name holders to associate metadata with a ENS name.

Both are functions of the TextResolver.sol contract.

From ENS docs:

function setText(bytes32 node, string calldata key, string calldata value) external authorised(node)

Sets text metadata for node with the unique key key to value, overwriting anything previously stored for node and key. To clear a text field, set it to the empty string.

function text(bytes32 node, string calldata key) external view returns (string memory)

Retrieves text metadata for node. Each name may have multiple pieces of metadata, identified by a unique string key. If no text data exists for node with the key key, the empty string is returned.

Standard values for key

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.