Accept Offer Signature Structure
To authorize the acceptOffer
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 accept a specific offer (_offerId
), thereby agreeing to transfer ownership of their username (_username
) in exchange for the offered amount.
Signed Message Format
The message is constructed by concatenating the following components as strings, separated by commas (,
):
string.concat(
"ae36fe72",
",",
_username,
",",
Strings.toString(_offerId),
",",
Strings.toString(_mateNameServiceNonce)
)
1. MNS Accept Offer Identifier (Hex String):
- Value:
ae36fe72
- Purpose: A specific identifier used within the EIP-191 framework to distinguish MNS
acceptOffer
messages from other types of signed messages.
2. Target Username (String):
- Value: The
_username
string itself. - Purpose: Specifies the username that the owner is agreeing to sell by accepting this offer.
3. Offer ID (String):
- Value: The result of
Strings.toString(_offerId)
. - Purpose: The string representation of the unique identifier (
uint256
) of the specific offer (made previously by another user) that the owner is now accepting.
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
acceptOffer
action. This prevents replay attacks of the acceptance 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