Questions tagged [p2p]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
55 views

ThreadOpenConnections and break versus continue: why the one versus the other?

In the inner loop of ThreadOpenConnections() in net.cpp sometimes there is a break to the outer loop and sometimes a continue. This is my understanding of the decision between break and continue in ...
  • 11
2 votes
1 answer
46 views

Bitcoin P2P network: unable to receive the full block data (witness stripped off)

I wrote a small script to play with the bitcoin P2P network. The script advertises itself as (NODE_NETWORK | NODE_WITNESS), and connects to a full node running on the LAN. Everything seems to work ...
  • 71
1 vote
1 answer
23 views

listchannels returns no results from CLN

CLN 0.12.1 My node has been running for hours now. But it doesn't seem to be aware of the network. This is what I get when I try to run listchannels. $ lightning-cli listchannels { "channels&...
  • 432
2 votes
1 answer
99 views

Why does the bitcoin client send transaction's txid and wtxid in 'inv' process?

I'm reading the source code of Bitcoin Core, and I found that in the inv process, nodes will relay both txid and wtxid to other peer nodes. I have the following questions: Why does the node send ...
  • 97
1 vote
0 answers
18 views

BIP-330 test cases

Are there any test cases for BIP-330 "Transaction announcements reconciliation"? More specifically, I need some test cases for the serialization/deserialization of the new p2p messages, ...
0 votes
1 answer
55 views

Collisions when adding an address entry to the new table

What does the bitcoin protocol do to handle collisions when adding addresses to the new table?
3 votes
0 answers
107 views

Is it bad practice to run full node with all Bitcoin P2P protocol optional services enabled?

I am running my full node /Satoshi:23.0.0/ with all optional services enabled. These are: NETWORK, BLOOM, WITNESS, COMPACT_FILTERS, and NETWORK_LIMITED. My bitcoin.conf file contains following entries:...
  • 41
3 votes
2 answers
253 views

Is it possible to set RBF as always-on in bitcoind?

I can't seem to find any cli commands for this. Is it even possible? Or does RBF need to be opted into on a per transaction basis? I would just like every transaction sent by my node to be RBF enabled....
  • 33
1 vote
2 answers
72 views

Details regarding bitcoin addr messages

What is the frequency of the addr messages in bitcoin? And are the contents of the addr messages from the new or the tried table or both?
0 votes
0 answers
59 views

Sending addr messages to nodes

I came across this resource that can be potentially used to send messages to nodes. How would I go about sending addr messages to nodes? Is there a built in utility that I could use(bitcoin-cli) or do ...
1 vote
2 answers
133 views

What is an inv message?

I was reviewing the PR #25720. This is part of description for the PR: However, if an INV for a block is received before our headers chain is caught up, we'll then start to sync headers from each ...
3 votes
1 answer
109 views

DNS Seeds for TORv3

Does querying the DNS Seeds via TOR return .onion addresses? If not, then if my node is a TOR only node, does it always get the .onion addresses to connect to, from the hard-coded list? Additionally, ...
5 votes
2 answers
820 views

How does bitcoin prevent DDoS amplification via the `addr` p2p message type?

If I am not mistaken the mainline bitcoind will accept unsolicited addr messages, and upon receiving this message - the struct is deserialized, and then verify each address from the unsolicited ...
  • 333
3 votes
1 answer
177 views

What is the different between CompactSize and VarInt encoding?

Pieter Wuille's definition of CompactSize encoding seems to match Greg Walker's definition of VarInt encoding, yet the BitcoinWiki claims that CompactSize is not to be confused with VarInt. What, if ...
  • 107
1 vote
0 answers
59 views

Drastic decrease in peers

Been running a standalone node on the same hardware for some years now. I run this node simply as a supportive node, unlocked bandwidth to facilitate people bootstrapping the blockchain. No settings ...
  • 454
8 votes
1 answer
443 views

What is the difference between blocksonly and block-relay-only in Bitcoin Core?

The terms blocksonly and block-relay-only that are used in Bitcoin Core are very similar. What is the difference between them?
  • 466
1 vote
1 answer
56 views

How does a node get information from the TxID?

If I'm right, segwit TxIDs are composed of the SHA^2(256) hash of the non-segwit data of a transaction. But, how does another node use the TxID to obtain information about the transaction such as the ...
  • 147
3 votes
1 answer
105 views

Does running a node benefit the network?

There is a 10-year old question asking this. The sole answer to that question at the time was essentially a yes, and I've seen people say that running a node makes the network more "secure" ...
7 votes
1 answer
357 views

What is the maximum, realistic P2P message payload size?

In Bitcoin Core, MAX_SIZE defines the maximum valid P2P message payload size to be 32MB. Is it realistic that a peer sends a message payload close to 32MB? What is the maximum, but still realistic ...
  • 1,382
1 vote
0 answers
74 views

Programmatically determining a full node in a peer-to-peer network

So I've found relatively few resources explaining the intricacies of the Bitcoin P2P network internal functionality. Right now, I'm writing a similar sort of peer-to-peer network, in another language ...
1 vote
1 answer
103 views

If we allow zero fee transactions within new policy rules for package relay why not also allow zero satoshi outputs?

In the proposed package relay the requirement that a transaction must meet the minimum relay fee rate is relaxed (the fee rate can be zero by the new policy rules) as long as the package in its ...
0 votes
1 answer
55 views

How do bitcoin nodes rollback state when a higher POW chain is introduced

Let's say the current chain consensus has a total POW of X... this is agreed upon by all 10k+ BTC nodes. A new "magic" node joins and it has mined a chain (privately) with total POW = 2*X. ...
0 votes
1 answer
43 views

What's the specification for Compact Size service messages?

I'm trying to understand the structure of the service and network bytes for compact sizes. what's specification for compressing the bytes for example in addrv2 message encoding? thanks.
  • 141
3 votes
1 answer
184 views

Can "Block" Message send multiple blocks?

Can multiple blocks be sent in a single block message in response to the GetBlocks message, or will a new Block message have to be sent for every block? Thanks.
  • 141
2 votes
2 answers
89 views

What resources are needed to implement an Eclipse attack?

I have read this paper of Eclipse attack. And I want to konw that what resources are needed to implement an Eclipse attack? IP addresses and investing attack time are needed, and is there anything ...
  • 21
0 votes
1 answer
47 views

Maximum number of outbound connections in 2009

Maximum number of outbound full relay connections is 8 and 2 block-only excluding manual connections (8) right now Maximum number of outbound full relay connections What was maximum number of outbound ...
user avatar
2 votes
1 answer
99 views

How does using DNS seeds to find initial peers compare to using seednode?

How does using DNS seeds to find initial peers compare to using -seednode? This was asked by prayank on IRC and has been paraphrased. A related question is here.
2 votes
0 answers
118 views

Version message C++

I learn bitcoin and I am trying to send a version message and get response, respectevily, by using C++. I can not find any examples or articles how to do it in C++. I'm forming request and send it by ...
1 vote
1 answer
347 views

Bind to local IP address and use it in addpeeraddress

Bind local IP (Node 1) bitcoind -regtest=1 -port=18333 -bind=192.168.150.110 Logs: 2021-09-01T13:14:16Z Bound to 192.168.150.110:18333 2021-09-01T13:14:16Z Bound to 127.0.0.1:18445 Trying to add it ...
user avatar
1 vote
2 answers
84 views

What would happen to Bitcoin if GPS/Galileo timing ceased to be available?

According to this web site, the timing from a system like GPS is essential to "financial networks [which] rely on precision timing for synchronization and operational efficiency." Is the ...
5 votes
1 answer
336 views

Is the `mempool` message reliable?

According to https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L3775-L3801, it seems like the mempool message is only responded to in certain cases. Can someone help understand how ...
  • 189
0 votes
0 answers
37 views

Can transactions be held for a long time without being processed?

I am learning a little bit about the bitcoin technology and I have some basic questions about its p2p and transaction processing. First imagine that a bitcoin transaction has included a fee (maybe a ...
  • 101
3 votes
1 answer
80 views

Is it possible to check which nodes banned my node?

I can ban peers with setban and check banned peers with listbanned in Bitcoin Core. Can I check which peers banned me?
user avatar
1 vote
1 answer
118 views

Is Bitcoins' peer-to-peer network unstructured or structured?

I can't find information about if the p2p network of Bitcoin is unstructured (the nodes are not organized in any specific way), or if it is structured (the nodes do have a way to interact with each ...
  • 11
2 votes
1 answer
132 views

What happens if a peer doesn't respond to "getheaders" or "getdata" on time?

Suppose a node receives the same "inv" message from many peers. Will the node send "getheaders" requests to all the peers or only one of them? Does the node keep a timer for ...
  • 161
1 vote
0 answers
30 views

Pseudocode for Bitcoin's P2P block propagation

I am going through Bitcoin's block propagation method at https://developer.bitcoin.org/devguide/p2p_network.html Are you aware of any pseudocode available on how blocks are propagated during the ...
  • 161
0 votes
1 answer
42 views

Do nodes maintain a download window after the initial syncing?

I was going through the Bitcoin P2P guide. https://developer.bitcoin.org/devguide/p2p_network.html It says that the nodes maintain a 1024-block download window during the initial syncing. However, at ...
  • 161
1 vote
1 answer
112 views

How do full nodes get the information about stale blocks?

In Bitcoin, many forks occur when multiple miners mine blocks at the same time. Then there will be multiple blocks at the same block height. I was looking at the Bitcoin P2P developer guide at https://...
  • 161
2 votes
1 answer
385 views

What is `ping` RPC used for?

ping doesn't return anything so what is it used for? If a user wants to ping and check ping time for all peers, getpeerinfo can be used.
user avatar
1 vote
1 answer
63 views

What does unbroadcast mean? What does it mean for a transaction to be successfully broadcast?

What does "unbroadcast" mean? What does it mean for a transaction to be "successfully" broadcast? These questions were asked in this Bitcoin Core PR review club on PR 2261 hosted ...
6 votes
2 answers
830 views

Bitcoin Core uploads much more than it downloads

Since Bitcoin is a peer-to-peer network of mostly identical clients, I would expect each node to upload about as much as it downloads. So I was surprised to see that my Bitcoin Core node has (since ...
1 vote
1 answer
307 views

Can bitcoind listen on both ipv4 and ipv6?

Can bitcoind listen on both ipv4 and ipv6? I know it can make outbound connections on both (onion and i2p) but can it also advertise multiple public hosts if available? This question was asked by ...
5 votes
1 answer
1k views

To run a full node, should I get a static IP address from my ISP?

I have a router connecting my home LAN to the ISP. After opening port 8333 on the router, and forwarding it the computer running the node, bitnodes.io confirmed the node was reachable. However, ...
  • 153
0 votes
1 answer
47 views

What does net_processing cover conceptually in the Bitcoin Core codebase?

What does net_processing (.h and .cpp) cover conceptually in the Bitcoin Core codebase?
3 votes
1 answer
103 views

In Bitcoin Core, are compact blocks pre-filled with more than just the coinbase?

In the "How are expected missing transactions chosen to immediately forward?" section of https://bitcoincore.org/en/2016/06/07/compact-blocks-faq/ it states that "To reduce the number ...
3 votes
1 answer
195 views

Are there any downsides to banning node crawlers?

There are multiple entities and open-source software that crawl the Bitcoin P2P network to discover and monitor nodes for various purposes (statistics, surveys, academic papers etc.) Some of those I ...
1 vote
1 answer
440 views

Maximum number of outbound full relay connections

What is the maximum number of outbound full relay connections a bitcoin core full node can make? I was assuming it's 8 but then realized we can add another 8 connections using addnode while reviewing ...
user avatar
0 votes
1 answer
46 views

What happens if nodes have different P2P versions during discovery?

My understanding is that nodes connecting to each other to exchange messages starts with a version handshake such that each node sends its P2P protocol version and gets an acknowledgement and vice ...
  • 197
9 votes
1 answer
2k views

How can I use Bitcoin Core with the anonymous network protocol I2P?

How can I use Bitcoin Core with the I2P anonymous network protocol?
1 vote
1 answer
114 views

Why does "Hodl Hodl" not seem to... support Bitcoin? [closed]

After listening to this podcast, I got extremely excited for Hodl Hodl: https://www.youtube.com/watch?v=hJe7LIZ6cdI But then I went to their site and see this: https://lend.hodlhodl.com/offers/lend ...
  • 11