1

I think a node sometimes needs to get a information from other nodes.
e.g.

  • get set of UTXO.
  • get main(longest) chain.

I have two questions.

  1. How does a node tell other nodes these requests?
    Like in github, are there commands like 'pull requests'?

  2. Where does a node get information from?
    I believe blockchain is decenterlized and all information is in the hands of all nodes.There must not be centerlized database.
    Then, how does a node decide who is reliable to get information from?

I wish you could understand my poor English...

6

get set of UTXO.

Note: nodes don't download the UTXO set directly, they download the entire blockchain and build their own UTXO set as they verify the blockchain.

How does a node tell other nodes these requests? Like git, are there commands like 'pull requests'?

Nodes communicate with each other directly via a P2P protocol, sending different types of messages to each other to retrieve different types of information. You can take a look here for the specifics of each message, https://bitcoin.org/en/developer-reference

Where does a node get information from? I believe blockchain is decenterlized and all information is in the hands of all nodes.There must not be centerlized database. Then, how does a node decide who is reliable to get information from?

Nodes will ask multiple neighbour nodes for information at once, rather than just trusting a single other node. It can then use the longest chain from all its neighbours, so as long as it connected to just one honest node it will be able to download the blockchain. This is very likely because the nodes it connects to are randomly selected from a set given to it by a DNS server

  • Your answer is exactly what I want. That's very kind of you. Then, can only full nodes validate UTXO, and be miner? – mtdkki Feb 12 '18 at 0:07
  • 1
    @mtdkki no problem, please remember to give it the green tick if it answered your question :) Correct, only full nodes validate the UTXO set, SPV clients can only verify that a particular transaction is part of the blockchain (thereby trusting the other full nodes). Usually miners will all connect to one full node rather than individually running full nodes on every miner – MeshCollider Feb 12 '18 at 4:17
3

Nodes communicate by gossiping about new data to their peers.

For example, whenever a new block is found, a node that hears about it, will tell all its peers "Hey, I've got a new block with the identifier , you want it?". These announcement take the form of "Inventory messages". They consist of two elements: The type of data being offered (i.e. transaction, block, or filtered block), and the identifier (i.e. transaction id, or block hash). The peer receiving the inventory announcement will then request either the block header, or the complete item if they haven't seen it before, or nothing if they know about it already. The same happens in transaction relay.

Naturally, every node checks the validity of the data they receive before using it. This way, every node ends up assembling their own verified complete copy of the blockchain. They don't trust other nodes to tell them about UTXOs or which chain is the longest, but rather they only expect that their set of peers together will tell them about any new data that floats about eventually, while only trusting the data that they have verified and collected themselves.

The chain tip and UTXO set are therefore derived information that the node has calculated themselves from verifying all available information gathered from peers.

  • Thank you for helping me! In your explanation, I understood that the block chain is fully decentralized. By the way, is TXID a hash of digest of a transaction(sender, resipient, amount?) and constitutes a merkle root? – mtdkki Feb 12 '18 at 23:23
  • The txid is the hash of the transaction's data. The Merkle root is the result of a binary tree built from all the transactions: bitcoin.stackexchange.com/a/38399/5406 – Murch Feb 13 '18 at 5:02

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.