Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QlWOH-0005K4-ST for bitcoin-development@lists.sourceforge.net; Tue, 26 Jul 2011 01:24:57 +0000 X-ACL-Warn: Received: from mail-gx0-f175.google.com ([209.85.161.175]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-MD5:128) (Exim 4.76) id 1QlWOG-0003u6-Hy for bitcoin-development@lists.sourceforge.net; Tue, 26 Jul 2011 01:24:57 +0000 Received: by gxk3 with SMTP id 3so3259582gxk.34 for ; Mon, 25 Jul 2011 18:24:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.61.4 with SMTP id o4mr4836810ybk.354.1311640161049; Mon, 25 Jul 2011 17:29:21 -0700 (PDT) Received: by 10.151.114.15 with HTTP; Mon, 25 Jul 2011 17:29:21 -0700 (PDT) Date: Mon, 25 Jul 2011 17:29:21 -0700 Message-ID: From: Rick Wesson To: bitcoin-development@lists.sourceforge.net Content-Type: multipart/alternative; boundary=00032555382edf5c3704a8ee05b9 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1QlWOG-0003u6-Hy Subject: [Bitcoin-development] bitcoin DNS addresses X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 01:24:58 -0000 --00032555382edf5c3704a8ee05b9 Content-Type: text/plain; charset=ISO-8859-1 I've just joined the list with the goals of producing a patch to sendtoaddress in rpc.cpp to support DNS lookups so that one could publish a TXT record in the DNS with their wallet address to facilitate sending of coin. I'm proposing something like the code below, which works but needs additional error handling. also working on a internet-draft to describe how to put bitcoin addresses in the DNS which I hope to post the first draft of this week. I'd appreciate comments on issues around annomity, community push back and any other issues you might have with leveraging the DNS for bitcoin transactions. thanks, -rick Value sendtoaddress(const Array& params, bool fHelp) { if (fHelp || params.size() < 2 || params.size() > 4) throw runtime_error( "sendtoaddress [comment] [comment-to]\n" " is a real and is rounded to the nearest 0.00000001"); /** ; <<>> 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]); ... --00032555382edf5c3704a8ee05b9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've just joined the list with the goals of producing a patch to sendto= address in rpc.cpp to support DNS lookups so that one could publish a TXT r= ecord in the DNS with their wallet address to facilitate sending of coin.
I'm proposing something like the code below, which works but needs = additional error handling.

also working on a internet-draft to descr= ibe how to put bitcoin addresses in the DNS which I hope to post the first = draft of this week.

I'd appreciate comments on issues around annomity, community push b= ack and any other issues you might have with leveraging the DNS for bitcoin= transactions.

thanks,

-rick


Value sendtoaddress(c= onst Array& params, bool fHelp)
{
=A0 =A0if (fHelp || params.size() < 2 || params.size() > 4)
= =A0 =A0 =A0 =A0throw runtime_error(
=A0 =A0 =A0 =A0 =A0 =A0"sendt= oaddress <bitcoinaddress> <amount> [comment] [comment-to]\n&quo= t;
=A0 =A0 =A0 =A0 =A0 =A0"<amount> is a real and is rounded= to the nearest 0.00000001");

/**
; <<>> DiG 9.7.3 <<>> _btc.rick.wesson.us txt
;; global options: +cmd<= br>;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOE= RROR, id: 43754
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;_btc.rick.w= esson.us. =A0 =A0 =A0 =A0 =A0 IN =A0 =A0 =A0TXT

;; ANSWER SECTIO= N:
_btc.rick.wesson.us. =A0 = =A0300 =A0 =A0 IN =A0 =A0 =A0TXT =A0 =A0 "BTC=3D1; 1GCVXLfF1TcpnnDLJRH= k845NZhuJWQTnUD"
=A0 =A0
;; Query time: 143 msec
**/


=A0 =A0string strAdd= ress =3D params[0].get_str();
=A0 =A0string dname=3D"_btc.";<= br> =A0 =A0if(strAddress.find("@")){
=A0 =A0 =A0 unsigned cha= r answer[255];
=A0 =A0 =A0 int len=3D0;
=A0 =A0 =A0 dname.append(strAddress);
=A0 =A0 =A0 dname.replace(dname.= find("@"), 1, ".");

=A0 =A0 =A0 if((len =3D res= _query(dname.c_str(), C_IN, T_TXT, answer, PACKETSZ)) < 0) {
=A0 =A0= =A0 =A0 string dnsAnswer=3D(char*)answer;
=A0 =A0 =A0 =A0 int i=3DdnsAnswer.find("BTC=3D1;");
=A0 =A0 = =A0 =A0 if( i < 0) throw runtime_error( dname + " is not associated= with a bitcoin address");
=A0 =A0 =A0 =A0 i +=3D 6;
=A0 =A0 = =A0 =A0 i =3D dnsAnswer.find("1", 6) ; // address start with a on= e (1)
=A0 =A0 =A0 =A0 dnsAnswer.erase(0,i);
=A0 =A0 =A0 =A0 strAddress=3Ddns= Answer;
=A0 =A0 =A0 }

=A0 =A0}
=A0 =A0// Amount
=A0 =A0= int64 nAmount =3D AmountFromValue(params[1]);
... --00032555382edf5c3704a8ee05b9--