Withdraw Offer Signature Structure
To authorize the withdrawOffer
operation within the MNS service, the user (the original offeror) must generate a cryptographic signature compliant with the EIP-191 standard.
This signature proves the offeror's intent and authorization to withdraw a specific, previously placed offer from a target username.
Signed Message Format
The message is constructed by concatenating the following components as strings, separated by commas (,
):
string.concat(
"21811609",
",",
_username,
",",
Strings.toString(_offerId),
",",
Strings.toString(_mateNameServiceNonce)
)
1. MNS Withdraw Offer Identifier (Hex String):
- Value:
21811609
- Purpose: A specific identifier used within the EIP-191 framework to distinguish MNS
withdrawOffer
messages from other types of signed messages.
2. Target Username (String):
- Value: The
_username
string itself. - Purpose: Specifies the username associated with the offer that is being withdrawn.
3. Offer ID (String):
- Value: The result of
Strings.toString(_offerId)
. - Purpose: The string representation of the unique identifier (
uint256
) assigned to the specific offer when it was created viamakeOffer
. This identifies which offer to withdraw.
4. MNS Nonce (String):
- Value: The result of
Strings.toString(_nonce)
. - Purpose: The string representation of the user's (original offeror's) nonce specific to the MNS contract for this
withdrawOffer
action. This prevents replay attacks.
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