18

If a person sends a transaction to another person, and Bitcoin is a peer-to-peer application, how will the transaction get to the rest of the Bitcoin community? How does everyone have the same blockchain?

Does every system know about every other system in the network? If so, how?

15

If a person sends a transaction to another person, and Bitcoin is a peer-to-peer application, how will the transaction get to the rest of the Bitcoin community?

Think of it like how gossip would spread. There are a bunch of people (nodes), and when one of them knows something, they tell it to the few (8 or so) people they are near (connected with), and then those people tell a few more people the message that was told to them, and then... Eventually everyone knows about the original information (transaction).

So when we say bitcoin is peer-to-peer, we mean it's just nodes that have internet connections (on port 8333 usually) with other peers. Not even necessarily the one you're sending the coins to!

How does everyone have the same blockchain?

After peers exchange their information (and validate that all transactions and blocks follow the protocol rules), they store it. Since all of the bitcoin transactions from the beginning of the bitcoin block chain are needed to validate everything that has taken place, essentially all full nodes store the same data (about 27.5 GB of pure block chain data as of now).

Does every system know about every other system in the network? If so, how?

No need to know about every other system on the network, each node just knows about the 8 or so nodes that it is connected to!

  • Is it possible that the message loop happens? e.g., A->B->C->A. – Helin Wang May 19 '18 at 4:19
  • 2
    No. What actually happens is when a node receives a transaction, they advertise the txid to their peers, and then their peer will only request the transaction if they haven't seen a transaction with that txid yet, so it prevents requesting duplicates. – morsecoder May 19 '18 at 13:10
5

The bitcoin daemon makes the transaction with the source address and the destination address then broadcasts the transaction to the network.

The Bitcoin miners confirm the transaction and include it in the next(s) blockchain blocks. The miners receive the transaction fee as the reward for this.

When the receiver downloads a new Bitcoin blockchain block and sees incoming transaction to his/her address, the receiver knows the payment was made.

So all Bitcoin nodes share the same blockchain data (approx. 27.5 GB at the moment). This blockchain as eventually consistent, append-only, database of all Bitcoin transactions.

  • how do they all have the same 20GB blockchain? How can the daemon broadcast the transaction to the network? Would you have to know all the systems on the network? – Patrick W. McMahon Oct 30 '14 at 20:46
  • Each node communicates with neighbouring nodes and they communicate with neighbours and so on. Then the information propagades. For more details please refer to en.bitcoin.it/wiki/Network – Mikko Ohtamaa Oct 30 '14 at 20:54
  • If i just created a wallet after installing the software how would i know of any other nodes to connect to the network? – Patrick W. McMahon Oct 30 '14 at 20:58
  • @PatrickW.McMahon bitcoin.stackexchange.com/questions/3536/… – Nick ODell Oct 30 '14 at 21:16
3

Transactions which are not double spends will be happily relayed by all nodes who receive them to all the people they connect to. This ensures that miners will hear about transactions.

Everyone who is fully synced will share the same blockchain. Bitcoin helps people achieve consensus, which simply means they all agree on the same list.

Generally bitcoin nodes will connect to at least 8 other (random) nodes. This is enough - You pick geographically separate nodes to get a true sense of the network's state. Nodes are responsible for relaying information about new transactions and blocks to their peers.

  • How the wallet know that is fully synced with others ? – Muflix Sep 15 '18 at 17:48
2

According to https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery


DNS Addresses

Upon startup, if peer node discovery is needed, the client then issues DNS requests to learn about the addresses of other peer nodes. The client includes a list of host names for DNS services that are seeded. As of December, 2017 the list (from chainparams.cpp[1]) includes:

seed.bitcoin.sipa.be dnsseed.bluematt.me dnsseed.bitcoin.dashjr.org seed.bitcoinstats.com seed.bitcoin.jonasschnelli.ch seed.btc.petertodd.org A DNS reply can contain multiple IP addresses for a requested name.

Addresses discovered via DNS are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.


Hard Coded "Seed" Addresses

The client contains hard coded IP addresses that represent bitcoin nodes.

These addresses are only used as a last resort, if no other method has produced any addresses at all. When the loop in the connection handling thread ThreadOpenConnections2() sees an empty address map, it uses the "seed" IP addresses as backup.

There is code is move away from seed nodes when possible. The presumption is that this is to avoid overloading those nodes. Once the local node has enough addresses (presumably learned from the seed nodes), the connection thread will close seed node connections.

Seed Addresses are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.

  • Welcome to Bitcoin.SE! Your well-written answer is not complete, it does not address the original question but, it is a good beginning for a detailed answer. – Willtech Feb 3 '18 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.