Author

Topic: how my wallet contacts the bitcoin network? (Read 811 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
October 11, 2015, 08:20:03 PM
#5
thanks for that.

yes, i know all that, BUT how my wallet knows which Nodes to contact?


Like bit torrent, when i load a torrent in my Mac, it goes to a server/tracker and that tracker connects me to all the peers sharing that torrent; that tracker knows who are the peers/nodes because i don't!

in bitcoin who is this tracker? who plays this role? how my wallet knows who are the NODES?
The client comes with a large number of nodes hard coded (called seed nodes) which are nodes that are known to have good uptimes and been up for a while. The data is compiled from what are called DNS seeds, which are a set of servers which are also hard coded. The node also keeps its own database of peers to connect to.

On startup, the nodes first checks its own database of nodes. If it cannot connect to any nodes there, it queries the DNS seeds. The DNS seed servers will respond with nodes that are available for the node to connect to. If it happens to not be able to connect to those nodes, it will fallback to the hard coded seed nodes.

The list of DNS seeds can be found here: https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L98
These are the current DNS seeds:
Code:
vSeeds.push_back(CDNSSeedData("bitcoin.sipa.be", "seed.bitcoin.sipa.be")); // Pieter Wuille
vSeeds.push_back(CDNSSeedData("bluematt.me", "dnsseed.bluematt.me")); // Matt Corallo
vSeeds.push_back(CDNSSeedData("dashjr.org", "dnsseed.bitcoin.dashjr.org")); // Luke Dashjr
vSeeds.push_back(CDNSSeedData("bitcoinstats.com", "seed.bitcoinstats.com")); // Christian Decker
vSeeds.push_back(CDNSSeedData("xf2.org", "bitseed.xf2.org")); // Jeff Garzik
vSeeds.push_back(CDNSSeedData("bitcoin.jonasschnelli.ch", "seed.bitcoin.jonasschnelli.ch")); // Jonas Schnelli
newbie
Activity: 26
Merit: 0
October 11, 2015, 04:46:46 PM
#4
thanks for that.

yes, i know all that, BUT how my wallet knows which Nodes to contact?


Like bit torrent, when i load a torrent in my Mac, it goes to a server/tracker and that tracker connects me to all the peers sharing that torrent; that tracker knows who are the peers/nodes because i don't!

in bitcoin who is this tracker? who plays this role? how my wallet knows who are the NODES?

Read this link: http://bitcoin.stackexchange.com/questions/3536/how-do-bitcoin-clients-find-each-other
member
Activity: 98
Merit: 10
error
October 11, 2015, 01:43:07 PM
#3
thanks for that.

yes, i know all that, BUT how my wallet knows which Nodes to contact?


Like bit torrent, when i load a torrent in my Mac, it goes to a server/tracker and that tracker connects me to all the peers sharing that torrent; that tracker knows who are the peers/nodes because i don't!

in bitcoin who is this tracker? who plays this role? how my wallet knows who are the NODES?
staff
Activity: 3458
Merit: 6793
Just writing some code
October 11, 2015, 11:39:41 AM
#2
No, Bitcoin doesn't work like that. Everything is distributed, there is no central server. Every full node will receive every block and transaction and verify and validate to the consensus rules before relaying transactions that pass to its peers. Full nodes store all of the unconfirmed transactions in its mempool, a database in the memory. Miners will query this database (usually through something like getblocktemplate) and select a number transactions to include in a block. Once those transactions are included in the block, the block is broadcast through the node and those transactions are removed from the database. That is how miners know what transactions to mine.

Some wallets are not full nodes, but use what is called Simplified Payment Verification. Some SPV wallets, like those based on bitcoinj, will connect to full nodes. They do not receive every transaction and block and they do not relay transactions. SPV wallets assume that the data given to them by full nodes is valid. They request data from full nodes through bloom filters, which means that they will receive the data that they want and sometimes more than they need just to make sure that the full node cannot actually know what addresses the SPV wallet controls.

Other SPV wallets like electrum connect to a server for their data. It behaves exactly like a full node, but is a dedicated server for electrum. There are many of these servers and the user can choose which one they want to connect to. Those servers are run by volunteers.
member
Activity: 98
Merit: 10
error
October 11, 2015, 07:25:57 AM
#1
when i am sending or receiving bitcoins through my wallet, which server is it contacting?

there must be a server/website/something that every connection goes through. And NODES contact this server/website/whatever to know which transactions they need to mine...

can someone explain me better who is this intermediary ? between NODES and every wallet.
Jump to: