Skip to main content

Flush Custom Metadata Signature Structure

To authorize the flushCustomMetadata 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 all custom metadata entries associated with their username (_username).

Signed Message Format

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

string.concat(
"3e7899a1",
",",
_username,
",",
Strings.toString(_nonce)
)

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

  • Value: 3e7899a1
  • Purpose: A specific identifier used within the EIP-191 framework to distinguish MNS flushCustomMetadata messages from other types of signed messages.

2. Target Username (String):

  • Value: The _username string itself.
  • Purpose: Specifies the username for which all associated custom metadata entries will be removed.

3. 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 flushCustomMetadata action. This prevents replay attacks of the 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