If you had wrapped your name on the Goerli testnet in a previous test deployment of the Name Wrapper, then the v3 alpha manager UI will not allow you to unwrap it. Instead, you will need to unwrap it manually via contract. Hopefully this guide will help.
Also see this thread for additional context on the Name Wrapper: NameWrapper updates (including testnet deployment addresses)
1. Determine Wrapper Contract
Look at your name on https://alpha.ens.domains/. If it was wrapped with an older version of the Name Wrapper, then both the manager and owner will be set to that address.
For example, 0x23d86f0bf4900978B191378B134519371Da52f75
is an old (3/3/23) deployment of the wrapper.
Primary Method - Calling Upgrade
The Goerli testnet Name Wrapper deployments use a dummy “upgrade contract” that simply unwraps any name. This will work even if your name is Locked (in other words, if you have revoked the permission to unwrap the name).
However, this method will only work if the Name Wrapper contract actually has the upgrade contract set. As of this writing, the Name Wrapper from 3/3/23 (0x23d86f0bf4900978B191378B134519371Da52f75
) does not have one set, so you will not be able to use this method with that contract. See the Alternate Method - Calling Unwrap section below instead.
2. Calculate parent nodehash / name bytes
Different deployments of the Name Wrapper have different upgrade methods. Depending on which one your name is wrapped in, you may need the parent nodehash. If you’re not sure what this is, see here.
Go here: https://npm.runkit.com/
2a. Using the 31/1/23 or earlier contract
If you are unwrapping a .eth 2LD, then you don’t need to calculate anything. Go to Step #3 - Call Upgrade.
If you are unwrapping any other name / subname, then you will need to calculate the parent nodehash.
If your name is sub.myname.eth
, then calculate the nodehash for the parent myname.eth
.
If your name is mydomain.com
, then calculate the nodehash for the parent com
.
Run this code (replace myname.eth
as needed):
require('@ensdomains/eth-ens-namehash').hash('myname.eth')
2b. Using the 3/3/23 or newer contract
If your name is wrapped in the contract from 3/3/23 or newer, then you will need to calculate the DNS-encoded bytes for your name.
Run this code to get the DNS-encoded version of your name (replace myname.eth
as needed):
'0x' + require('dns-packet').name.encode('myname.eth').toString('hex');
3. Call Upgrade
As long as the contract is verified on Etherscan, then you can invoke methods there directly.
Go to https://goerli.etherscan.io/ and enter the address of the Name Wrapper contract you originally wrapped in (from Step #1).
Go to the Contract tab → Write Contract. Click on “Connect To Web3” to connect your wallet.
3a. Using the 31/1/23 or earlier contract
In this case, there are two separate methods: upgrade
and upgradeETH2LD
.
If you are unwrapping a .eth 2LD, then expand the upgradeETH2LD
method, and fill in the parameters:
- label: Your name, minus the .eth.
- wrappedOwner: The owner of the .eth name / NFT. Enter your address.
-
resolver: Currently unused by the dummy upgrade contract. You can just enter
0x0000000000000000000000000000000000000000
.
If you are unwrapping any other name, then expand the upgrade
method, and fill in the parameters:
- parentNode: The parent nodehash you created from Step #2.
-
label: Your name, only up to the first period (
.
).- Example: label of
sub.myname.eth
issub
- Example: label of
mydomain.com
ismydomain
- Example: label of
- wrappedOwner: The owner of the .eth name / NFT. Enter your address.
-
resolver: Currently unused by the dummy upgrade contract. You can just enter
0x0000000000000000000000000000000000000000
.
3b. Using the 3/3/23 or newer contract
In this case, there is just a single upgrade
method. Expand that method, and fill in the parameters:
- name: The DNS-encoded version of your name that you created in Step #2.
-
extraData: Currently unused by the dummy upgrade contract. You can just enter
0x
.
3c. Execute the transaction
Click “Write” to send the transaction to your wallet.
After the transaction is confirmed, then your name will be unwrapped again, and you can rewrap it in the new version of the Name Wrapper if you wish.
Alternate Method - Calling Unwrap
Use this method if the Name Wrapper contract does not have an upgrade contract set. As of this writing, the Name Wrapper from 3/3/23 (0x23d86f0bf4900978B191378B134519371Da52f75
) does not have one set, so you will need to use this method instead.
Note that you will only be able to use this method if your name is not Locked (in order words, if you have not revoked the permission to unwrap the name).
2. Calculate node/labelhash
If you are unwrapping a .eth 2LD (second-level domain), you will need just the labelhash. Otherwise, you will need both the parent nodehash, and the labelhash. If you’re not sure what these are, see here.
Go here: https://npm.runkit.com/
2a. Unwrapping a .eth 2LD
If your name is myname.eth
, then calculate the labelhash for myname
.
Run this code to get the labelhash (replace myname
as needed):
'0x' + require('js-sha3').keccak_256('myname')
2b. Unwrapping any other name / subname
Parent Nodehash
If your name is sub.myname.eth
, then calculate the nodehash for the parent myname.eth
.
If your name is mydomain.com
, then calculate the nodehash for the parent com
.
Run this code (replace myname.eth
as needed):
require('@ensdomains/eth-ens-namehash').hash('myname.eth')
Labelhash
If your name is sub.myname.eth
, then calculate the labelhash for sub
.
If your name is mydomain.com
, then calculate the labelhash for mydomain
.
Run this code (replace sub
as needed):
'0x' + require('js-sha3').keccak_256('sub')
3. Call Unwrap Method
As long as the contract is verified on Etherscan, then you can invoke methods there directly.
Go to https://goerli.etherscan.io/ and enter the address of the Name Wrapper contract you originally wrapped in (from Step #1).
Go to the Contract tab → Write Contract. Click on “Connect To Web3” to connect your wallet.
Then, invoke either unwrapETH2LD
or unwrap
, depending on whether you’re unwrapping a .eth 2LD or not.
3a. Unwrapping a .eth 2LD
Expand the unwrapETH2LD
method, and fill in the parameters:
- labelhash: The labelhash you created from Step #2.
- registrant: The owner of the .eth name / NFT. Enter your address.
- controller: The manager of the name. Enter your address.
Click “Write” to send the transaction to your wallet.
After the transaction is confirmed, then your name will be unwrapped again, and you can rewrap it in the new version of the Name Wrapper if you wish.
3b. Unwrapping any other name / subname
Expand the unwrap
method, and fill in the parameters:
- parentNode: The parent nodehash you created from Step #2.
- labelhash: The labelhash you created from Step #2.
- controller: The manager of the name. Enter your address.
Click “Write” to send the transaction to your wallet.
After the transaction is confirmed, then your name will be unwrapped again, and you can rewrap it in the new version of the Name Wrapper if you wish.