handshake-org / handshake-org/hsd

Name Claim Registration

Open
#454 1 comment 0 reactions 0 assignees View on GitHub
FAQ (Don't close)
Dominant language
JavaScript
Stars
2.1k
Forks
306
PR merge metrics
No merged PRs in 30d

Description

A bug existed in the wallet that prevented any name that was claimed from the reserved name list from being updated. This means that claimed names have been unable to write DNS records to the chain or claim their locked HNS using the wallet `sendupdate` RPC API or `POST /wallet/:id/update` HTTP API. Note that this does not impact the consensus rules, it was always possible to manually create the transaction and submit it to the blockchain. This solely impacts the wallet's bookkeeping and a failed assertion prevented the transaction from being broadcasted after it was created and signed.

This bug was fixed here https://github.com/handshake-org/hsd/pull/438 but requires the wallet holding the name to be recreated. If you update to the latest codebase with and attempt to register the name without recreating the wallet, you will see an error. This does not mean that your name is lost or that it cannot be registered.

A wallet can be recreated using the mnemonic. If you are participating in any auctions with that wallet, it is recommended that you wait until the auction is over with before recreating the wallet. See discussion here https://github.com/handshake-org/hsd/issues/378.

To get the mnemonic for your wallet, use the command:

```bash
$ hsw-cli master
{
"encrypted": false,
"key": {
"xprivkey": "rprvKE8qsHtkmUxUSNxoQq6feh9FS667F4WtV6Rd4auVyrWg4ZnSKudy2iquTygUP2FEFbNdee56pbHcGRn3VXjiANCqZAENcmhDFVepYviExDCd"
},
"mnemonic": {
"bits": 256,
"language": "english",
"entropy": "fc3045263cc3b6a5b46ac61b02d30900bb250fe0fa8bdbb447e1cba3a00c6d17",
"phrase": "wire lion end kangaroo derive fan spider flee brand bird seat accident rather margin loop fabric sweet peasant wear nuclear deliver alert reform train"
}
}
```
The `.mnemonic.phrase` is what you need to recreate the wallet. Be sure to pass the `--id` flag with the name of the wallet as the value if you are not using the primary wallet.

Be sure to back up the mnemonic for each wallet in use because you will need to recreate the entire wallet database. An easy way to do this would be to move `~/.hsd/wallet` into a new directory and then restart `hsd`. It will recreate `~/.hsd/wallet`. I do not recommend deleting the wallet directory and make sure to keep a backup just in case.

You can now use that mnemonic to create a new wallet. The `--id` flag is used to name the wallet.

```bash
$ hsw-cli mkwallet --id newwallet --mnemonic "wire lion end kangaroo derive fan spider flee brand bird seat accident rather margin loop fabric sweet peasant wear nuclear deliver alert reform train"
```

You can now verify that the wallet was created with the correct mnemonic with the command:

```bash
$ hsw-cli --id newwallet master
```

Now to index the name claim, the wallet must rescan the blockchain so that it can index the UTXOs that it owns. This can be done with the command:

```bash
$ hsw-cli --id newwallet rescan 0
```

Now the wallet should recognize the name claim and it should be able to `sendupdate` or `POST /wallet/:id/update` without a problem.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing PR #438 and the wallet's sendupdate and POST /wallet/:id/update paths, then compare the reported bookkeeping failure with that fix. The issue provides no file or test entry point, and the bug is already addressed; any remaining work would need to establish a new reproducible failure beyond the documented wallet recreation and rescan procedure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.