What is A Bitcoin Node. Step by Step Explanation https://blockgeeks.com/
The bitcoin network consists of a network of nodes, which are just computers or servers running the Bitcoin software. The code ensures the nodes can find and establish connection with other nodes and hence form a network that is used by the various nodes to transfer information, like transactions, blocks and other data. Through this web of interconnecting nodes, bitcoin can send digital cash securely through the network. The underlying bitcoin code implements the bitcoin protocol.
So how does a new node join the bitcoin network? First it must discover at least one peer to connect to and then it can get a list of other peers from that initial peer. There are a few methods a node can use to connect to its first peer. The bitcoin client contains a hardcoded list of well known DNS servers which can return a list of ip addresses of bitcoin nodes. Alternatively, the bitcoin client can be given a static ip address of a peer if one is known. You can pass this ip address as a parameter when starting the bitcoin client software through the command line. It’s important to note that bitcoin’s network topology is not geographically defined, so the physical location of the nodes in relation to one another is irrelevant.This means a node can find and connect to any other node regardless of where it is in the world.
Once a node has the ip address of a peer, it then goes through an initial handshake to establish a connection with a remote node. First the local node will send a version message to the peer which contains some basic information about itself. This will always be the first message sent by any peer to another peer. The remote peer receiving the message will examine if the sender’s version is compatible with its own version. If it is, it will acknowledge the version message and establish a connection by sending a “version acknowledgment” message, which consists only of a message header with the command string “verack”.
Once a node establishes connections with one or more peers, it will exchange some information with these peers. For example, nodes can exchange ip addr of their connected peers, so each node can maintain a list of peers that it can use to re-establish connection in the future since nodes can leave and join the network at anytime. A Node can also ask its peers what the length of their local copy of the blockchain is. It can then determine if it’s own copy of the blockchain is missing any blocks, and if so, can ask its peers to send the missing blocks. Of course it can also send blocks to other nodes who do not have as much data as itself.
Let’s take a closer look at the various nodes in the network. Although all the nodes participate in the network, they have different roles depending on the functionalities they want to support. There are 4 major functions: routing, storage, mining and wallet services. The bitcoin core client implementation in c++ has all four of these functionalities.
Routing is the bare minimum functionality a node must support in order to participate in the bitcoin network. It contains the functionality to discover and connect to other peers in the network and it also validates and propagates transactions and blocks through the network. It serves the purpose of keeping the network connection alive and passing information through the network.
A node is called a full blockchain node if it stores a local copy of the entire blockchain database. A full node can autonomously and authoritatively verify any transactions without any external references. With a full node you get complete independence and freedom from central authority at the cost of hardware storage space.
A mining node serve the special purpose of creating a new block to add to the blockchain. Mining nodes runs special mining software in order to solve a cryptographic puzzle to win mining rewards. They serve the purpose of adding new transactions into the blockchain.
To learn more visit us at blockgeeks.com