Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Blockchain ID on Namecoin
Namecoin allows all ascii characters for its key-value entries, but the username specifications for this protocol only allow for lowercase letters, numbers, and underscores, so make sure you only use those characters in usernames. Names with all other characters will be ignored by crawlers.
Registering username/profile pairs as key-value entries
You'll need either a desktop Namecoin client (Namecoin-Qt) or a UNIX Namecoin daemon. Instructions for building namecoind from source are here. Once you have a running version of either Namecoin-Qt or namecoind you will need to buy some namecoins (from exchanges like Kraken or BTC-e) and send them to yourself. Now you're ready to register new names.
- issue a "name new" with the key (the username with "u/" prepended)
- issue a "name first update" with the chunked profile
"Name new" operations
The "name new" operation is the first operation required to register a key-value pair on Namecoin (and by extension, a username/profile pair in accordance with the ONS protocol). This is the operation that communicates intent to register and use a given name. Without "name first update," however, the name registration is not complete.
Current cost: 0.01 NMC
"Name first update" operations
After the "name new" operation is complete, the "name first update" operation completes the name registration.
Current cost: 0.00 NMC
Key-value entries in Namecoin are limited to a maximum of 519 bytes.
As a result, profiles exceeding 519 bytes must be split into several linked components in order to be embedded in the blockchain.
To chunk a JSON object, simply do the following:
- check if all the remaining data fits in one chunk
- if not, choose an unregistered Namecoin key (e.g. "i/username-1" - this will be the key of the "next" chunk) and create an empty JSON object (the current chunk), then add a pointer from this chunk to the next one (e.g. "next": "i/username-1")
- fill the JSON object with as many properties as possible
- go back to 1
Note: we recommend not using the "u/" namespace for linked chunks.