Skip to content

BCHDEVCON3/desudns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DesuDNS

Hackathon Note: Keep in mind desudns.com will continue to be updated separately. To view as delivered, use this repo.

DesuDNS allows anyone, anywhere in the world to register un-revokable domain names on the Bitcoin Cash blockchain. Version 1.0 supports single-file websites hosted using IPFS in the formats markdown and html.

You can also include other IPFS files by prefixing valid IPFS hashes with ipfs:// like: ![](ipfs://IPFS_HASH) for markdown or <img src="ipfs://IPFS_HASH"> for html.

Definitions

Request/ed: Registration transaction still pending confirmation in the blockchain.

Registered: Registration transaction has been confirmed in the blockchain.

Unique Hash: Generated by combining your transaction id with the hash of the block it was included in using sha256 and removing non-alphabetic (A-Z) characters ( sha256(txid + blk.h).replace(/[^a-z]+/g, "") ).

Registration logic

First-time registration

If you're the first person to Request 'example' as your domain name, you will receive 'example.bch'.

Second-time registration

If you're the second person to Request 'example' as your domain name, you will receive 'example.' followed by the first 3 characters generated from your Unique Hash.

Multiple same-block first-time registrations

If you and one other person Request the same domain name in the same block, no one will be awarded .bch, and you will both have to use the first 3 characters in your Unique Hash:.

Avoiding collisions

If you're the third person to Request 'example' as your domain name and the first 3 characters in Unique Hash: match with one previously registered you will have to add another character from your Unique Hash:.

If this also matches one previously registered, you keep adding one character until your domain is completely unique.

On-chain protocol

Note: When interacting with BitDB Fountainhead you will need to strip the 0x from the H* columns.

Register new domain

If example has never been registered before, the protocol will assign you with example.bch. If it has been registered you will be assigned example followed by the first 3-5 characters of your Unique Hash

H1 H2 S3
0x00444553 0x0110 example

Assign/Update IPFS hash (markdown)

Keep in mind you can only make one update per block or the protocol will not know which update to use. [registration_txid] is the txid from the transaction that created the domain name.

H1 H2 S3 S4
0x00444553 0x0120 [registration_txid] QmeeRNqNqX3Gc1UUdxUNeXcRLtrSTZATjCgUu6CxuwDQnA

Assign/Update IPFS hash (html)

Keep in mind you can only make one update per block or the protocol will not know which update to use. [registration_txid] is the txid from the transaction that created the domain name.

H1 H2 S3 S4
0x00444553 0x0121 [registration_txid] QmeeRNqNqX3Gc1UUdxUNeXcRLtrSTZATjCgUu6CxuwDQnA

Alternative use-cases

On-chain usernames

Bitcoin Cash has long had a system called CashAccounts that allows you to enter for example username#123456 when making a payment as opposed to manually copying or writing down a long address. The main issue with CashAccounts is every block that is mined on the blockchain the number behind the username increases by 1.

This sometimes makes CashAccounts a little hard/cumbersome to remember. With DesuDNS you can always register a new easy to remember unique domain name followed by either .bch or a randomly generated 3-5 letter TLD.

About

Uncensorable DNS on the BCH blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages