Namecoin is an old crypto-currency, one of the original forks of Bitcoin. It still exists today and has good security, primarily because it can be merge-mined with Bitcoin.

This means that Namecoin latches on to the mining power of the Bitcoin blockchain, and in return, Bitcoin miners are rewarded with Namecoin and Bitcoin at the same time. Namecoin isn't worth much, and there is currently only one exchange trading it, the NMC/BTC trading pair on However, it's worth enough to be merge-mined, and that's a good thing, because it enables us to use Namecoin while enjoying the same strong consensus and proof-of-work guarantees that Bitcoin enjoys.

Brief Introduction to Bitcoin and crypto-currency in general

If you are unfamiliar with what Bitcoin is and how it works, the claims I'm about to make might be confusing or hard to believe. If that is the case for you, I would recommend reading the webcomic version of the original Bitcoin whitepaper on first.

Now, if you ARE familiar with Bitcoin, you may know that it's famous for being the 1st solution to a long-standing problem in computer science. In academia, this problem has been known as the Two Generals Problem or Byzantine Fault / Byzantine Generals Problem

Put simply, the problem asks:

How can two or more generals with geographically separated armies coordinate a synchronized attack, even if the generals do not explicitly trust each-other?

Note: The original version of this article had a highly inaccurate description of this problem. I have edited it with a better explanation.

It's a sort of game-theory problem where both self-interested parties have an incentive to cheat, but if they work together, the reward will be bigger.

Bitcoin solved this problem for the first time in 2009 by combining Public Key Cryptography and economically incentivized consensus, implemented as variably difficult Proof of Work that is incentivized, where the incentive "block reward" only continues to exist if others agree that the entire block (and all subsequent blocks) are valid. In general, this construction is referred to as a "Blockchain".

In a modern context, we can express the problem as:

How can we design software that allows multiple self-interested parties to read and write a shared database while eliminating the possibility of lying/cheating?

And that's exactly what Bitcoin does.

Why Namecoin? What problems does it solve?

Before Bitcoin, the Byzantine Generals Problem was unsolved. So all of the development of the internet and web technology that happened before then did not even attempt to guarantee no lying/cheating.

In general, problems where security was important, like

  • How can we make a global registry of domain names, and allow anyone to register a name?
  • How can HTTPS security certificates be proven authentic, while allowing anyone to get a certificate for their server?

were solved with appeals to authority. The scheme was something like,

  1. We will establish an authority organization, like a bank, to act as an intermediary.
  2. Users will ask this authority to enter a record in their database or sign a certificate.
  3. The client software (operating systems, embedded devices, web browsers, etc) will implicitly trust that whatever the authority says is true.

Some of these authority based solutions include:

These authority-solutions, primarily DNS, are used by governments around the world to monitor and censor internet use within and outside of their borders. Protestors in Turkey spray painted the IP addresses of Google's DNS servers on a wall, urging others to configure their computers to trust United States authorities for Domain Name information, rather than Turkish authorities, due to heavy censorship.

Within the United States, domains that host content which the government's corporate constituents don't like are regularly "seized". This means that the government threatens the DNS provider with legal action until the DNS provider (the technical "Authority", in this case) removes control of the DNS entry from the user and hands it over to the government. One government branch boasted over one million domains "seized" in 2018.

Secure Names Without Authority

However, now that we have a working solution to the Byzantine Generals Problem, we can actually do better at the technical level. Namecoin adds extra functionality on top of the payment functionality of Bitcoin, enabling users to participate in a distributed, secure, and global key-value database where keys and values cannot be "seized" or spoofed. Namecoin is a solution to another famous problem known as Zooko's Triangle, roughly expressed as:

Human-meaningful, Secure, and Decentralized. Pick Two.

With Namecoin, we can have all three.

This is a great improvement for modern and emerging web standards that have historically involved displaying large cryptographic numbers to users as a part of the protocol's user experience.

Examples include:

  • BitTorrent Magnet Links: magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcad53426
  • Bitcoin Addresses: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
  • Tor Hidden Services: http://3g2upl4pq6kufc4m.onion/
  • BitMessage Addresses: BM-BcbRqcFFSQUUmXFKsPJgVQPSiFA3Xash
  • IPFS Name Records: /ipns/QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd

These are numbers, similar to IP addresses like and, they are simply longer numbers that are encoded differently.

We can associate those long nonsense strings with human-meaningful names in Namecoin, and then anyone can access our resources by name as long as they have Namecoin-compatible client software on their computer.

Currently, support for Namecoin is being worked on within a number of projects, including the Tor Browser Project and IPFS!

So without further exposition, let's get into it!

Register a Namecoin .bit Domain easily, using Electrum-NMC

I did this on Linux, Ubuntu 19 specifically. If you want to do this on other operating systems, you will probably run into problems. Some processes such as installing packages will be different, or may not work at all. I would recommend installing Linux on your computer or using a Linux virtual machine. You can download a piece of software called VirtualBox for free from Oracle, which will allow you to run a Linux virtual machine from Mac OS or Windows.

Linux is only required because Electrum-NMC is currently (February 2020) in early development and there are no pre-built binaries available, so you have to build it yourself. This may change in the future.

Ingredients List

You are going to need:

  • Bitcoin to trade for NMC
  • A account to do the trade.
  • A computer or virtual machine running Linux, to run/build Electrum-NMC
  • Electrum-NMC (Namecoin fork of Electrum)
  • Lots of time
    • Unfortunately due to software defaults that prioritize security over usability, several steps in this process require approximately two hours of waiting.
    • It's probably best to do this while you are doing something else.

Acquiring Bitcoin

Ask Satoshi Very Very Nicely.

JK. I'm not going to cover this here. There are plenty of other guides online regarding purchasing and storing Bitcoin. If all you want is to register a few names with Namecoin, you aren't going to need very much (Like, less than $10 worth). So security is not a very big deal here.

About Electrum and SPV Wallets

Electrum is one of the best Bitcoin wallets for new users, in my opinion. It is a Simple Payment Verification (SPV) wallet. This means that Electrum is not a Bitcoin "Full Node". It does not participate in the network by downloading and validating the entire bitcoin blockchain (Many gigabytes). Instead, it only downloads block headers and sparse transaction history for transactions that it cares about (addresses that it owns).

There are potential privacy concerns associated with SPV wallets, namely, that the wallet will contact a server in order to operate, and the person who owns that server will get to know that a specific IP address and/or client software profile owns specific addresses. This can be sensitive information, because with Bitcoin, Namecoin, and most other crypto-currencies, all transaction history is perfectly recorded and avaliable to the public forever.

But I don't care about that, I think it's fine for the world to know that I registered sequentialread.bit. Your use case may vary.

Aquiring and running Electrum-NMC

Electrum-NMC is a fork of Electrum which has been modified to support Namecoin instead of Bitcoin.

For more information, see:

Unfortunately it looks like there are no official binaries for Electrum-NMC quite yet. No worries, we can run it from source easily enough, per the instructions on the README.

The master branch is definitely not stable, so you will want to check out the most recent stable version. Currently, that is the tag nc3.3.8 (see

sudo apt-get install -y protobuf-compiler python3-pip python3-pyqt5

git clone git://

cd electrum-nmc

git submodule update --init

git checkout nc3.3.8

git checkout -b master-3.3.8

python3 -m pip install .[fast]

protoc --proto_path=electrum_nmc/electrum --python_out=electrum_nmc/electrum electrum_nmc/electrum/paymentrequest.proto


Creating the Electrum-NMC wallet file

The startup wizard will guide you through this process, I chose:

Wallet file location: /home/forest/Desktop/wallets/electrum_nmc_wallet

Note that if you put a tilde in the file name here, like ~/Desktop/... the file will end up in ~/.electrum/\~/Desktop/....

Similarly, if you enter mywallet, the file will be saved at ~/.electrum/mywallet

What kind of wallet do you want to create?: Standard wallet

Keystore: Create a new seed

Choose Seed type: Legacy

Then you have to write down the seed on paper, which I did. Keep this piece of paper SAFE! If you ever lose your wallet file, you can restore it from those seed words. Being able to read the seed words means you can spend the bitcoin/namecoin. So keep it safe and secure!

After that, you will be prompted to define a wallet password. This password protects the wallet file, making it harder for any potential malware on your computer to steal your Namecoins and your domain. I generated some random words for the password using and wrote them down as well.

Finally, the wallet will open and you can accept NMC to be sent to it (Just use the View -> Show addresses menu)

Trading Bitcoin for NMC

It looks like currently (February 2020) the only trading platform that has an active community of folks trading NMC is the NMC/BTC trading pair on

So I signed up for an account on to trade. They only require an email address to open an account there, if you are only trading crypto for crypto.

Then I used Electrum to deposit a small amount of Bitcoin with the custodial account.

Because requires 3 confirmations (3 blocks to be mined containing your transaction in a row) it takes about 30 minutes for the funds to be available on thier platform.

After that, I executed a trade for NMC on thier platform.

Finally, I transferred the NMC from the custodial account to the Electrum-NMC wallet.

Using Electrum-NMC to register/update a namecoin entry

This is actually super easy and straight forward. Under the Buy Names tab I entered 'd/sequentialread'

(the namecoin name record d/sequentialread represents the domain name sequentialread.bit)

I did notice sometimes the software throws an error while trying to check if a name is available. It looks like it was actually a rate-limiting RPC error from the Electrum-NMC server I was connected to, so definitely want to try again if it happens to you.

When you register a domain it pops up a modal dialog with two fields, Data and Transfer to.

Transfer to can be left blank. You would use Transfer to if you were transferring ownership of a domain to another wallet. (You would enter a Namecoin Address to transfer to).

Data is the JSON object that is specified in the namecoin domain name value specification. You can read more about that here:
(Make sure to view the above link in raw form, not rendered into markdown, because some stuff will be missing when its rendered as markdown on GitHub.)

More details here:

For example, this is the JSON I used:

{"ip":"", "map": {"*": {"ip":""}}}

This JSON instructs Namecoin compatible clients that this domain name (and all subdomains) are pointing to the IP address

After submitting the Name registration request, I saw the Pre-registration transaction show up. But the actual name registration never showed up. I could not get anything to happen, so I gave up.

After a couple of days, a friend actually got me in contact with one of the Electrum-NMC developers, and he set me straight on what had happened:

Basically, when I wrote that code, I assumed that everyone was familiar with multi-step Bitcoin transaction protocols, in which it's typical to wait for quite a few blocks before broadcasting the next step. Obviously this was not a good assumption on my part.

In other words, the Electrum-NMC software was waiting for the 1st transaction (Pre-Registration, aka name_new) to be confirmed by a certain number of blocks being mined on top of it before it broadcasts the second transaction (Name Registration, aka name_firstupdate).

Aparently this process takes a really really long time. Like, hours. So you have to just let the Electrum-NMC application run in the background until the Registration transaction pops up. If you have to close and re-open it, that's fine. The developer told me:

FWIW, Electrum-NMC does save the next step of the registration procedure to its wallet file, so if you exit Electrum-NMC while a registration is pending, and then start it up again, it will still work fine. (At least it should. I don't test that use case often, but I tested it pretty thoroughly when that code was first written.)

Using the Electrum-NMC daemon's API to test your new .bit domain

For more information, see:

I wrote this little bash script to make this easier.


CONFIG_JSON="$(cat $HOME/.electrum-nmc/config)"  
WHICH_JQ_EXITCODE="$(which jq > /dev/null; printf "%d" "$?")"  
RUN_ELECTRUM_NMC_EXISTS="$(test -f run_electrum_nmc; echo "$?")"  
NOT_RUNNING_COUNT="$(./run_electrum_nmc daemon status 2>/dev/null | grep "not running" | wc -l)"  

if [ $WHICH_JQ_EXITCODE == 0 ] && [ $RUN_ELECTRUM_NMC_EXISTS == 0 ] && [ $NOT_RUNNING_COUNT == 0 ] && [ ! -z $NAME_LOOKUP ] && [ ! -z "$CONFIG_JSON" ]; then  
  USERNAME_COLON_PASSWORD="$(echo "$CONFIG_JSON" | jq -r .rpcuser):$(echo "$CONFIG_JSON" | jq -r .rpcpassword)"
  CURL_OPTS="-sS -w \"%{http_code}\" -o /tmp/electrum-nmc-api-result.json -u $USERNAME_COLON_PASSWORD"
  CURL_RPC_BASE="curl $CURL_OPTS localhost:$(echo "$CONFIG_JSON" | jq -r .rpcport)"
  echo "sending: $CURL_RPC_BASE -d $REQUEST_JSON"
  echo "status code: $STATUS_CODE"
  echo "result: $(cat /tmp/electrum-nmc-api-result.json)"
  rm /tmp/electrum-nmc-api-result.json 2>/dev/null

  echo "This script requires the JQ command line JSON processor."
  echo "This script requires the current working directory to contain a file named run_electrum_nmc"
  echo 'This script requires the electrum daemon to be running. Run 

   $ ./run_electrum_nmc daemon 

   first. '

  echo "First argument (namecoin name key, for example 'd/mydomain', is required.) got '$NAME_LOOKUP'"

When I ran this the first time, I saw this:

forest@tower:~/Desktop/git/electrum-nmc$ ./ 'd/sequentialread'  
sending: curl -sS -w "%{http_code}" -o /tmp/electrum-nmc-api-result.json -u user:JVaOY3XQc6D5QjtzWJaboA== localhost:7777 -d {"id":"curltext","method":"name_show","params":["d/sequentialread"]}  
status code: "200"  
result: {  
  "result": null,
  "id": "curltext",
  "error": {
    "code": -32603,
    "message": "Server error: File \"/home/forest/Desktop/git/electrum-nmc/electrum_nmc/electrum/\", line 1180, in name_show_single_try | electrum.commands.NameNotFoundError: Name never existed, is expired, or is unconfirmed\n"

This is similar to the problem we ran into before with the Registration transaction that takes ages to show up. The error message says electrum.commands.NameNotFoundError: Name never existed, is expired, or is unconfirmed

In this case the name is unconfirmed. The Electrum-NMC developer told me:

Namecoin SPV clients such as Electrum-NMC don't trust name updates with fewer than 12 confirmations. The reasoning is that since SPV clients don't check ECDSA signatures (only PoW), we want to require a lot of PoW before we trust a transaction that could be used for, say, verifying a TLS certificate. Basically the danger of accepting an invalid transaction is potentially a lot higher for name lookups, so we're pretty careful about it. At some point (hopefully soon) I do plan to add ECDSA signature checks to Electrum-NMC for name lookups, at which point we probably won't require any confirmations at all for name lookups (we'll just make sure the signature chain goes back to a transaction for that name with at least 12 confirmations).

So, in other words, you have to wait for hours again. The next day when I checked on it, it worked!

forest@tower:~/Desktop/git/electrum-nmc$ bash d/sequentialread  
sending: curl -sS -w "%{http_code}" -o /tmp/electrum-nmc-api-result.json -u user:JVaOY3XQc6D5QjtzWJaboA== localhost:7777 -d {"id":"curltext","method":"name_show","params":["d/sequentialread"]}  
status code: "200"  
result: {  
  "result": {
    "name": "d/sequentialread",
    "name_encoding": "ascii",
    "value": "{\"ip\":\"\", \"map\": {\"*\": {\"ip\":\"\"}}}",
    "value_encoding": "ascii",
    "txid": "64b7fc49f37eefc88a4aa7df41004690bf2a8de20eaee377284e67a9eb0f2246",
    "vout": 0,
    "address": "N6vjZTaztkPab8reFy8ZnEha8FkbVACrff",
    "height": 492103,
    "expires_in": 35442,
    "expired": false,
    "ismine": null
  "id": "curltext",
  "error": null