public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] bitcoin DNS addresses
@ 2011-07-26  0:29 Rick Wesson
  2011-07-26  1:35 ` Matt Corallo
  2011-07-30 11:34 ` Mike Hearn
  0 siblings, 2 replies; 15+ messages in thread
From: Rick Wesson @ 2011-07-26  0:29 UTC (permalink / raw)
  To: bitcoin-development

[-- 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 --]

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: [Bitcoin-development] bitcoin DNS addresses
@ 2011-07-26 16:32 phantomcircuit
  0 siblings, 0 replies; 15+ messages in thread
From: phantomcircuit @ 2011-07-26 16:32 UTC (permalink / raw)
  To: bitcoin-development

dns resolution is far simpler to implement than properly checking the https certificate chain

Matt Corallo <bitcoin-list@bluematt•me> wrote:

>For some reason my mail client is being thick and not responding
>on-list, sorry about that...
>
>On Tue, 2011-07-26 at 08:34 -0700, Rick Wesson wrote:
>> > Most OSes dont do any resolving at all, they just query upstream
>> > resolvers.  In the case of the coffee shop, that upstream resolver is
>> > the attacker.  This attacker can easily just claim that the zone you
>> > requested is not DNSSEC signed and return their data and the OS will not
>> > be any wiser.  AFAIK, most OSes dont have a mechanism to require the
>> > zone queried is DNSSEC signed meaning you have to implement a full DNS
>> > resolver in Bitcoin in order for it to be secure.
>> 
>> Matt,
>> 
>> The same attack can apply to https with a self signed cert where it is
>> the A record that is replaced by the attacker and the https request is
>> sent to evil.com's server which responds to the request with an answer
>> in the form you expect. This is what lots of malware does on windows
>> to steel bank login credentials, securing http doesn't prevent such an
>> attack.
>If you are using a self-signed cert to do any kind of important data
>transfer you are just being stupid.  Here I am assuming your computer
>isnt actually compromised, but only the network is, which I think is a
>fairly good assumption.
>> 
>> Windows has supported DNSSEC since 2008 as have most of the unix
>> variants, mac osx since 10.3 Android also seems to include DNSSEC
>> capable resolvers.
>> 
>> If this thread is really about DNSSEC then we might move it to a more
>> appropriate forum for discussing how applications leverage DNS
>> security extensions.  Its taken some years to get the specs done and
>> the root signed I expect it to take many more to enable the
>> applications to leverage the deployed infrastructure.
>No, DNSSEC is very well done, this thread is specifically about the
>security implications of using DNSSEC for Bitcoin address communication.
>IMO it is not a good idea, as for it to be secure against a coffee-shop
>network MITMer you have to implement a full resolver with root trust
>anchors and knowledge of root servers in Bitcoin, which does not seem
>like a good idea.
>> 
>> I am interested in working on the issues surrounding usability and I
>> find that remembering and communicating a bitcoin address are current
>> limiting factors in the acceptance and deployment of this software. My
>> goal is for simpler user experience.
>I totally agree, however I don't think DNS-based resolving is a good
>idea here.  HTTPS does have several advantages over a DNSSEC-based
>solution without any significant drawbacks that I can see.
>
>Matt
>
>------------------------------------------------------------------------------
>Magic Quadrant for Content-Aware Data Loss Prevention
>Research study explores the data loss prevention market. Includes in-depth
>analysis on the changes within the DLP market, and the criteria used to
>evaluate the strengths and weaknesses of these DLP solutions.
>http://www.accelacomm.com/jaw/sfnl/114/51385063/
>_______________________________________________
>Bitcoin-development mailing list
>Bitcoin-development@lists•sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/bitcoin-development

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-07-30 14:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-26  0:29 [Bitcoin-development] bitcoin DNS addresses Rick Wesson
2011-07-26  1:35 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox