Skip to main content

Remove Custom Metadata Signature Structure

To authorize the removeCustomMetadata operation within the MNS service, the user who currently owns the username must generate a cryptographic signature compliant with the EIP-191 standard.

This signature proves the current username owner's intent and authorization to remove a specific custom metadata entry (identified by its key/index _key) associated with their username (_username).

Signed Message Format

The message is constructed by concatenating the following components as strings, separated by commas (,):

string.concat(
"8001a999",
",",
_username,
",",
Strings.toString(_key),
",",
Strings.toString(_nonce)
)

1. MNS Remove Custom Metadata Identifier (Hex String):

  • Value: 8001a999
  • Purpose: A specific identifier used within the framework to distinguish MNS removeCustomMetadata messages from other types of signed messages.

2. Target Username (String):

  • Value: The _username string itself.
  • Purpose: Specifies the username from which the custom metadata entry will be removed.

3. Metadata Key/Index (String):

  • Value: The result of Strings.toString(_key). (Assuming _key is a uint256 representing the index or slot of the metadata to remove).
  • Purpose: The string representation of the identifier for the specific metadata entry targeted for removal.

4. MNS Nonce (String):

  • Value: The result of Strings.toString(_nonce).
  • Purpose: The string representation of the current username owner's nonce specific to the MNS contract for this removeCustomMetadata action. This prevents replay attacks of the removal operation initiated by the owner.
tip
  • addressToString converts an address to a lowercase string
  • Strings.toString converts a number to a string
  • AdvancedStrings.bytes32ToString(bytes32 _input) converts a bytes32 value into its lowercase hexadecimal string representation