Renew Username Signature Structure
To authorize the renewUsername
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 extend the expiration period for their specified username (_username
), typically involving a renewal fee.
Signed Message Format
The message is constructed by concatenating the following components as strings, separated by commas (,
):
string.concat(
"f1747483",
",",
_username,
",",
Strings.toString(_mateNameServiceNonce)
)
1. MNS Renew Username Identifier (Hex String):
- Value:
f1747483
- Purpose: A specific identifier used within the EIP-191 framework to distinguish MNS
renewUsername
messages from other types of signed messages.
2. Target Username (String):
- Value: The
_username
string itself. - Purpose: Specifies the username whose registration the owner is requesting to renew.
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
renewUsername
action. This prevents replay attacks of the renewal operation initiated by the owner.
tip
addressToString
converts an address to a lowercase stringStrings.toString
converts a number to a stringAdvancedStrings.bytes32ToString(bytes32 _input)
converts abytes32
value into its lowercase hexadecimal string representation