public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Rick Wesson <rick@support-intelligence.com>
To: bitcoin-development@lists.sourceforge.net
Subject: [Bitcoin-development] bitcoin DNS addresses
Date: Mon, 25 Jul 2011 17:29:21 -0700	[thread overview]
Message-ID: <CAJ1JLts5_r6hHoJR-gS-CuuvS00p=RQ6iYbCyOkBDcvgs1xtew@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2050 bytes --]

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 <bitcoinaddress> <amount> [comment]
[comment-to]\n"
           "<amount> 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]);
...

[-- Attachment #2: Type: text/html, Size: 2572 bytes --]

             reply	other threads:[~2011-07-26  1:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  0:29 Rick Wesson [this message]
2011-07-26  1:35 ` [Bitcoin-development] bitcoin DNS addresses Matt Corallo
2011-07-26  3:35   ` Rick Wesson
2011-07-26  4:22     ` Luke-Jr
2011-07-26  4:54       ` Rick Wesson
2011-07-26  6:18         ` Luke-Jr
2011-07-26  8:04           ` John Smith
2011-07-26 13:23     ` Matt Corallo
     [not found]       ` <CAJ1JLtvHubiC_f_a17fnXODs54CCdmxPf8+Zz4M5X9d8VEfFSQ@mail.gmail.com>
     [not found]         ` <1311691885.23041.2.camel@Desktop666>
     [not found]           ` <CAJ1JLtsLXEPFkBuHf6ZKUSVYUnY+NL7TtsEswGvdTYtrZZTXWw@mail.gmail.com>
2011-07-26 16:24             ` Matt Corallo
2011-07-26 16:50               ` Rick Wesson
2011-07-26 17:18                 ` Matt Corallo
2011-07-30 11:34 ` Mike Hearn
2011-07-30 13:42   ` Rick Wesson
2011-07-30 14:07     ` Matt Corallo
2011-07-26 16:32 phantomcircuit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ1JLts5_r6hHoJR-gS-CuuvS00p=RQ6iYbCyOkBDcvgs1xtew@mail.gmail.com' \
    --to=rick@support-intelligence.com \
    --cc=bitcoin-development@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox