Bitcoin Forum
March 26, 2017, 11:27:21 AM *
News: Latest stable version of Bitcoin Core: 0.14.0  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: DNS Bitcoin Address  (Read 528 times)
Offline Offline

Activity: 7

View Profile
July 24, 2011, 09:19:03 PM

I hosted and event at our farm and had about 20 folks come out to discuss legal and techie issues around bitcoin. We found it really difficult to exchange bitcoins and constructed an idea on a better way to get a bitcoin wallet identifier to one of our friends.

The first solution would be to use DNS TXT records to put a bitcoin address into, much as SPF records did for adding anti-spam capabilities. The second option is to use  NAPTR records but it offers less capability over TXT. My third option is to develop an internet-draft for a WA (wallet-address) record and offer it to the DNS community.

The TXT records could be something like BTC=1; <address> The first label defines the curency and its version, the second is the address. For the label I'm considering _btc.<name> where name would need to be either ASCII-7 or a internationalized punycode label for UTF-8 names.

I'd really like to associate the address with a label under a domain so that sendtoaddress could leverage syntax much like sendto which would cause the client rpc code to lookup the TXT record from and insert the resuting address into the pwalletMain->SendMoneyToBitcoinAddress (line 511 in rpc.h)

My three work items are:
  o simple internet-draft describing the WA (wallet address) record
  o patches for bitcoind and bitcoinJ

I believe that by leveraging wallet addresses in the DNS will allow more folks to feel comfortable by sending money to rather than 1GCVXLfF1TcpnnDLJRHk845NZhuJWQTnUD

Looking for advise, mostly regarding how to get a patch accepted into the mainline.


Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Hero Member
Offline Offline

Activity: 565

Unselfish actions pay back better

View Profile WWW
July 24, 2011, 09:33:28 PM

The second option is to use  NAPTR records but it offers less capability over TXT.

What's the reason you feel that NAPTR ‘offers less capability’?  NAPTRs are far more flexible than TXT, IMHO, although less simple to parse.


Klaus Alexander Seistrup
Offline Offline

Activity: 7

View Profile
July 24, 2011, 10:13:52 PM

Its the logic that would be required to handle all the NAPTR options, then there is the difficulty of getting everyone to use them in a standard way, that would behave consistently. TXT records are easiest from a parsing standpoint.

The internet-draft for a wallet address is just a point to begin a discussion in the IETF if that is the correct route. The WA record I'm proposing could offer a generic wat to represent many virtual currencies.

My first patch to rpc.cpp is to add TXT record lookup and parsing.
Offline Offline

Activity: 7

View Profile
July 24, 2011, 11:51:14 PM

example source for rpc.h to allow sendtoaddress to accept dnsnames in the form of user@domain

The @ is replaced with a dot (.) and _btc. is prepended to the question, which is resolved or an error thrown

Value sendtoaddress(const Array& params, bool fHelp)

; <<>> DiG 9.7.3 <<>> txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43754
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;           IN      TXT

;; ANSWER SECTION:    300     IN      TXT     "BTC=1; 1GCVXLfF1TcpnnDLJRHk845NZhuJWQTnUD"

;; Query time: 143 msec           

    string strAddress = params[0].get_str();
    string dname="_btc.";
       unsigned char answer[255];
       int len=0;
       dname.replace(dname.find("@"), 1, ".");

       if((len = res_query(dname.c_str(), C_IN, T_TXT, answer, PACKETSZ)) < 0) {
         string dnsAnswer=(char*)answer;
         int i=dnsAnswer.find("BTC=1;");
         if( i < 0) throw runtime_error( dname + " is not associated with a bitcoin address");
         i += 6;
         i = dnsAnswer.find("1", 6) ; // address start with a one (1)

    // Amount
    int64 nAmount = AmountFromValue(params[1]);
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!