Bitcoin Forum
May 09, 2024, 12:32:14 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do wallets connect to nodes?  (Read 771 times)
bitcoinrevelacio (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
April 22, 2013, 04:41:07 AM
 #1

Hello all,
I have been watching and learning about bitcoin for a short while now. I think I understand the basics of bitcoin. However, I do not understand how my wallet (or anyone's for that matter) connects to the network. Is there a default list of connections that the wallet connects to? Or what is going on here?
For some reason this small part is really bugging me.

-bitcoinrevelacio
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715257934
Hero Member
*
Offline Offline

Posts: 1715257934

View Profile Personal Message (Offline)

Ignore
1715257934
Reply with quote  #2

1715257934
Report to moderator
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
April 22, 2013, 05:05:51 AM
 #2

https://en.bitcoin.it/wiki/FAQ#How_does_the_peer_finding_mechanism_work.3F

Current DNS names in the source code:

seed.bitcoin.sipa.be
dnsseed.bluematt.me
dnsseed.bitcoin.dashjr.org
bitseed.xf2.org

There are also hard-coded seed node IP addresses (in hexadecimal form) in case DNS and IRC fail or the user configures not to use them.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
blackriver
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
April 22, 2013, 06:01:33 AM
 #3

and if it is to be changed (the dns), how and who would make such a change?? i don't understand very well
downying
Member
**
Offline Offline

Activity: 68
Merit: 10


View Profile
April 22, 2013, 07:27:20 AM
 #4

The bootstrap process finds nodes in many channels such as irc, dns. They are hardcoded though, if they all are taken down at once, the network dies.
bitcoinrevelacio (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
April 22, 2013, 02:39:43 PM
 #5

https://en.bitcoin.it/wiki/FAQ#How_does_the_peer_finding_mechanism_work.3F

Current DNS names in the source code:

seed.bitcoin.sipa.be
dnsseed.bluematt.me
dnsseed.bitcoin.dashjr.org
bitseed.xf2.org

There are also hard-coded seed node IP addresses (in hexadecimal form) in case DNS and IRC fail or the user configures not to use them.

So, once a wallet connects to the nodes specified in the source code it receives a list of all other known nodes. Does the wallet save all of these addresses or does it just download them each time it connects?
Downying seems to say that if all of the hardcoded nodes leave at once no one can connect? In other words the wallet does not save addresses. Is that accurate?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
April 22, 2013, 03:42:20 PM
 #6

If necessary, I believe you can also configure specific addresses that you want to connect to in a ".conf" file of some sort?
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
April 22, 2013, 08:39:17 PM
 #7

and if it is to be changed (the dns), how and who would make such a change?? i don't understand very well

I think all those DNS names are controlled by core Bitcoin developers sipa, BlueMatt, Luke-Jr, and jgarzik (who seems to own xf2.org).  So they would each have to make the change.  I don't know the procedure, or how often it is updated, which nodes they put on those lists, etc.

The bootstrap process finds nodes in many channels such as irc, dns. They are hardcoded though, if they all are taken down at once, the network dies.

Only people connecting to the network for the first time would be catastrophically affected.  Actually, I just found that IRC seeding has been removed.  It is unlikely that 4 different DNS servers on 3 top-level domains would all be out.  And if they are, there are also dozens of hardcoded seed IP addresses that are contacted, so those would also all have to be down.  I don't know how those seeds were chosen, but I trust it's a pretty solid selection.  Really, if it's that bad, you may as well say there's no Bitcoin network left to connect to anyway.  Also, as long as you can manually find one peer's IP address, you can use that to find everyone else it knows about.

So, once a wallet connects to the nodes specified in the source code it receives a list of all other known nodes. Does the wallet save all of these addresses or does it just download them each time it connects?
Downying seems to say that if all of the hardcoded nodes leave at once no one can connect? In other words the wallet does not save addresses. Is that accurate?

The addresses are saved, in either peers.dat or addr.dat (peers in newer versions).  The bootstrapping/seed process is only used if the file doesn't exist or none of the nodes in it can be connected to.  And once you've connected to a node you get a list of all the nodes it knows about, and you remember them in peers.dat.

If necessary, I believe you can also configure specific addresses that you want to connect to in a ".conf" file of some sort?

Yes, if you run bitcoin-qt --help you can see all the configuration options, which can be specified on the commandline or in the .conf file.  There is -connect (connect only to the specified nodes) and -seednode (use the specified node to get a list of nodes to connect to) that I see being relevant to this, maybe more I missed.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
AprilShowers
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
April 22, 2013, 08:41:34 PM
 #8

https://en.bitcoin.it/wiki/FAQ#How_does_the_peer_finding_mechanism_work.3F

Current DNS names in the source code:

seed.bitcoin.sipa.be
dnsseed.bluematt.me
dnsseed.bitcoin.dashjr.org
bitseed.xf2.org

There are also hard-coded seed node IP addresses (in hexadecimal form) in case DNS and IRC fail or the user configures not to use them.

Would it be possible to DDoS all these and cripple everything?  Or am I missing something
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
April 22, 2013, 09:00:42 PM
 #9

- snip -
Would it be possible to DDoS all these and cripple everything?  Or am I missing something

- snip -

Only people connecting to the network for the first time would be catastrophically affected.

- snip -

The addresses are saved, in either peers.dat or addr.dat (peers in newer versions).  The bootstrapping/seed process is only used if the file doesn't exist or none of the nodes in it can be connected to.  And once you've connected to a node you get a list of all the nodes it knows about, and you remember them in peers.dat.

- snip -

scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
April 22, 2013, 09:42:09 PM
 #10

For accuracy, I just checked the FAQ entry I originally linked, and it also says "each node saves a database of peers that it's aware of, for future use."  So DDoSing those DNS servers wouldn't hurt many users.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
rarkenin
Hero Member
*****
Offline Offline

Activity: 784
Merit: 500



View Profile
April 22, 2013, 09:44:41 PM
 #11

The system still isn't fully decentralized, though. If it was, there would need to be a sort of distributed peer tracker(akin to torrent DHT). Still, there's no true way to bootstrap without a seed node unless one were to try scanning the entire IPv4 internet for nodes.
bitcoinrevelacio (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
April 23, 2013, 12:53:15 AM
 #12

The system still isn't fully decentralized, though. If it was, there would need to be a sort of distributed peer tracker(akin to torrent DHT). Still, there's no true way to bootstrap without a seed node unless one were to try scanning the entire IPv4 internet for nodes.

Well if I am understanding this correctly you do not have to go through the nodes listed in the source code. You can easily specify a different node. This list of nodes however makes it easier for new users to get connected by having several connections ready to connect to. From what I understand it is still completely decentralized. You do not have to use bitcoin-qt. There are other wallets. Therefore, if you think bitcoin-qt is promoting a bad blockchain, then you use a different client. If you think a certain node is promoting a bad blockchain you can specify to connect to a different node.
However, there is no reason to think that any of the nodes or bitcoin-qt are doing anything wrong so it is easier for simplicity. The moment someone discovers something is wrong, there will be a big outcry. Things will get fixed or worked around.

I hope I got it right and it makes sense. Please, correct any mistakes.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!