Flush Username Signature Structure
To authorize the flushUsername
operation within the Name Service, the user who currently owns the username must generate a cryptographic signature compliant with the EIP-191 standard using the Ethereum Signed Message format.
The signature verification process uses the SignatureRecover
library. This signature proves the current username owner's intent and authorization to completely remove and "flush" their username registration from the system.## Signed Message Format
The signature verification uses the SignatureRecover.signatureVerification
function with the following structure:
SignatureRecover.signatureVerification(
Strings.toString(evvmID), // EVVM ID as string
"flushUsername", // Action type
string.concat( // Concatenated parameters
_username,
",",
Strings.toString(_nonce)
),
signature,
signer
);
Internal Message Construction
This results in a message format:
"{evvmID},flushUsername,{username},{nonce}"
Example
Scenario: Owner wants to permanently delete their username "alice"
Parameters:
evvmID
:1
_username
:"alice"
_nonce
:25
Signature verification call:
SignatureRecover.signatureVerification(
"1",
"flushUsername",
"alice,25",
signature,
signer
);
Final message to be signed:
1,flushUsername,alice,25
EIP-191 formatted message hash:
keccak256(abi.encodePacked(
"\x19Ethereum Signed Message:\n23",
"1,flushUsername,alice,25"
))
⚠️ Warning: This operation is irreversible and will permanently delete the username registration and all associated data.
- The function selector
044695cb
is the first 4 bytes of the keccak256 hash of the function signature forverifyMessageSignedForFlushUsername
Strings.toString
converts a number to a string (standard OpenZeppelin utility)- The signature verification uses the EIP-191 standard for message signing
- Only the current owner of the username can flush their own username
- This operation is irreversible and permanently deletes the username registration and all associated data
- The
_nonce
parameter is the user's general nonce, similar to other deletion operations