Bitcoin Forum
December 08, 2016, 06:09:23 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: DNS Bitcoin Address  (Read 511 times)
wessorh
Newbie
*
Offline Offline

Activity: 7


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

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 rick@wesson.us which would cause the client rpc code to lookup the TXT record from _btc.rick.wesson.us 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 rick@wesson.us rather than 1GCVXLfF1TcpnnDLJRHk845NZhuJWQTnUD

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

-rick


1481220563
Hero Member
*
Offline Offline

Posts: 1481220563

View Profile Personal Message (Offline)

Ignore
1481220563
Reply with quote  #2

1481220563
Report to moderator
1481220563
Hero Member
*
Offline Offline

Posts: 1481220563

View Profile Personal Message (Offline)

Ignore
1481220563
Reply with quote  #2

1481220563
Report to moderator
1481220563
Hero Member
*
Offline Offline

Posts: 1481220563

View Profile Personal Message (Offline)

Ignore
1481220563
Reply with quote  #2

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

Activity: 565


Unselfish actions pay back better


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


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.

Cheers,

Klaus Alexander Seistrup
http://about.me/kseistrup
wessorh
Newbie
*
Offline Offline

Activity: 7


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

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.
wessorh
Newbie
*
Offline Offline

Activity: 7


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

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
Code:

Value sendtoaddress(const Array& params, bool fHelp)
{
...

/**
; <<>> DiG 9.7.3 <<>> _btc.rick.wesson.us 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

;; QUESTION SECTION:
;_btc.rick.wesson.us.           IN      TXT

;; ANSWER SECTION:
_btc.rick.wesson.us.    300     IN      TXT     "BTC=1; 1GCVXLfF1TcpnnDLJRHk845NZhuJWQTnUD"

;; Query time: 143 msec           
**/


    string strAddress = params[0].get_str();
    string dname="_btc.";
    if(strAddress.find("@")){
       unsigned char answer[255];
       int len=0;
       dname.append(strAddress);
       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)
         dnsAnswer.erase(0,i);
         strAddress=dnsAnswer;
       }

    }
    // Amount
    int64 nAmount = AmountFromValue(params[1]);
...
Pages: [1]
  Print  
 
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!