Bitcoin Forum
May 06, 2024, 10:54:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: how my wallet contacts the bitcoin network?  (Read 795 times)
errornone (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10

error


View Profile
October 11, 2015, 12:25:57 PM
 #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.

error
1714992872
Hero Member
*
Offline Offline

Posts: 1714992872

View Profile Personal Message (Offline)

Ignore
1714992872
Reply with quote  #2

1714992872
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 11, 2015, 04:39:41 PM
 #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.

errornone (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10

error


View Profile
October 11, 2015, 06: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?

error
jdeepee
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
October 11, 2015, 09: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
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 12, 2015, 01:20:03 AM
 #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

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!