banner

There’s a overlap with this post and others but I’ll try to directly correct a couple of things here.

Why do we have two types of connections, outgoing and incoming?

To risk stating the obvious sometimes our node will make a request to connect to another node (outbound) whilst other times a node will make a request to connect to our node (inbound). In a healthy peer to peer (P2P) protocol you can’t really avoid having both outgoing and incoming requests. The extent to which outbound and inbound connections are treated differently by your full node is a more interesting question. These Bitcoin Core PR review club notes (June 8th 2022) on inbound block-relay-only connections stated:

Once the connection is established, the relationship is largely symmetric (the protocol works the same in both directions), although we treat outbound peers with some preference.

If you are concerned about malicious full nodes you might have some trusted or semi trusted full nodes you choose to connect to (outbound) whilst presumably all inbound connection requests are from nodes you know very little about.

Are outgoing connections the ones where we notify of new blocks/transactions, while incoming connections are the ones where they notify us of new blocks/transactions?

No, both outbound and inbound connections can notify your node of new blocks and transactions and vice versa. That PR review club I referred to does discuss block-relay-only peers which is where you decide to only relay blocks to certain peers and not transactions, IP addresses. Inbound connections can also indicate they don’t want to receive transactions etc.

When we do the initial synchronization (IBD) or completely randomly want to ask about a block or transaction or something third, is it done with outgoing connections or incoming connections?

Both. If we aren’t aware of any peers/connections (ie we have no connections at all) at the beginning of IBD we might need to utilize DNS seeds to learn of potential peers.

banner

Converter

Source: CurrencyRate
Top Selling Multipurpose WP Theme

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

banner

Leave a Comment

Layer 1
Your Crypto & Blockchain Beacon

CryptoInsightful

Welcome to CryptoInsightful.com, your trusted source for in-depth analysis, news, and insights into the world of cryptocurrencies, blockchain technology, NFTs (Non-Fungible Tokens), and cybersecurity. Our mission is to empower you with the knowledge and understanding you need to navigate the rapidly evolving landscape of digital assets and emerging technologies.