<p>The reason is to prevent <em>frontrunning</em>: When a victim registers <code>abc.com,</code> the attacker might notice the TXN with the <code>name_new abc.com</code> request on Namecoin's P2P network. Then, he might issue the same request but with a higher TXN fee, and "steal" the domain from the victim, who was trying to register.</p>

<p>The solution is simple:</p>

<ol>
<li>Rather than sending <code>name_new abc.com</code> requests that reveal the domain, send a <code>name_new SHA256(r, 'abc.com')</code> request that <em>commits</em> to the domain without revealing it. This way, an attacker learns nothing about what domain is being registered.</li>
<li>Reveal the domain later using a <code>name_firstupdate r, abc.com</code> request which reveals the domain, preventing people from stealing it. By this point, the attacker can do nothing because <code>abc.com</code> has already been assigned ownership using the <code>name_new</code> request.</li>
</ol>

CC BY-SA 3.0
2018-01-31T00:28:31.650Z
2018-01-31T00:28:31.650Z
Alin Tomescu
<p>I am trying to understand the namecoin protocol. As can be read in the <a href="https://wiki.namecoin.org/index.php?title=Register_and_Configure_.bit_Domains" rel="nofollow noreferrer">namecoin documentation</a>, in order to register a domain, you need to execute the following steps:</p>
<ol>
<li>Execute the command <code>name_new</code>, this pre-oders a domain name.</li>
<li>Execute the command <code>name_firstupdate</code>, this finalizes the registration, name becomes public.</li>
</ol>
<p>Why does this second redundant step exist? Wouldn't it make more sense to merge these two commands, and enable users to finalize a registration by updating a domain directly when registering it with <code>name_new</code>?</p>

<namecoin>
Why does namecoin have the redundant name_firstupdate step?
KojoUzochi
# Why does namecoin have the redundant name_firstupdate step?

(Asked by: username_0 on 2018-01-30)

I am trying to understand the namecoin protocol. As can be read in the [namecoin documentation](https://wiki.namecoin.org/index.php?title=Register_and_Configure_.bit_Domains), in order to register a domain, you need to execute the following steps:

1. Execute the command `name_new`, this pre-oders a domain name.
2. Execute the command `name_firstupdate`, this finalizes the registration, name becomes public.

Why does this second redundant step exist? Wouldn't it make more sense to merge these two commands, and enable users to finalize a registration by updating a domain directly when registering it with `name_new`?

**Tags:** namecoin


---

## 1 answers

### Answer by username_1 on 2018-01-31. Score: 0 | Accepted answer

The reason is to prevent *frontrunning*: When a victim registers `abc.com,` the attacker might notice the TXN with the `name_new abc.com` request on Namecoin's P2P network. Then, he might issue the same request but with a higher TXN fee, and "steal" the domain from the victim, who was trying to register.

The solution is simple:

1. Rather than sending `name_new abc.com` requests that reveal the domain, send a `name_new SHA256(r, 'abc.com')` request that *commits* to the domain without revealing it. This way, an attacker learns nothing about what domain is being registered.
2. Reveal the domain later using a `name_firstupdate r, abc.com` request which reveals the domain, preventing people from stealing it. By this point, the attacker can do nothing because `abc.com` has already been assigned ownership using the `name_new` request.


---

