Skip to main content

Questions tagged [p2p]

Peer-to-peer (p2p) network protocols are used to transmit messages between network nodes of identical status in the network. In a p2p network, all participants look the same to each other.

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

Clarification about the decision to only allow outgoing connections flooding in erlay

I was reading the BIP-330 and saw that only the outgoing connections are low-fanout flooded. A major idea is that we want that much of the nodes get the transaction in the first cycle itself, but ...
Prabhat Verma's user avatar
1 vote
1 answer
34 views

Can I tell if my peers enable mempoolfullrbf?

Trying to ensure my node is connected to some fullrbf peers, but it doesn't seem that there is a discoverable service for fullrbf? Am I stupid or missing something?
Lnanon6969's user avatar
1 vote
1 answer
44 views

Using bitcore-p2p and bitcore-lib to get block data

I've prepared a Nodejs javascript script to (attempt to) fetch block information for an example testnet block (3) from the P2P network, using bitcore-p2p library (which uses the getdata P2P protocol, ...
Lee's user avatar
  • 590
1 vote
1 answer
88 views

Why do PinSketch sketches consist of the sum of odd powers?

The following is taken from BIP-330 (aka Erlay): A short ID sketch with capacity c consists of a sequence of c field elements. The first is the sum of all short IDs in the set, the second is the sum ...
Cosmik Debris's user avatar
2 votes
1 answer
46 views

What should the intended purpose of (mempool) policy defaults in a full node implementation like Bitcoin Core be?

There are a couple of Stack Exchange posts on what (mempool) policy is, this from Suhas Daftuar and this from Antoine Poinsot. But what are the policy defaults in say Bitcoin Core trying to achieve ...
Michael Folkson's user avatar
1 vote
1 answer
76 views

What happens to the blocks that do not pass the acceptance rules?

One of the acceptance rule for the blocks is that the block timestamp cannot be more than 2 hours in the future. What happens to blocks whose timestamp does not meet this rule, i.e. blocks that ...
LeaBit's user avatar
  • 940
0 votes
0 answers
41 views

How does Bitcoin Core overcome the condition that chain work in pre-sync must be within one day of the current active chain tip when it is genesis?

Two conditions for the chain we got in the header pre-sync are: to have minimal chain work to be within 1 day worth of work from the active chain tip's work When we start Bitcoin core node for the ...
Cosmos's user avatar
  • 199
0 votes
1 answer
127 views

At what point does a node start downloading blocks in IBD?

What I know so far is that when the node starts for the first time or after some time, the Initial Block Download (IBD) begins. The node chooses one peer (the header sync peer) from 8 outgoing ...
Cosmos's user avatar
  • 199
1 vote
1 answer
108 views

Why are there no responses to signaling messages?

Why are there no responses to signaling messages (sendcmpct, sendheaders, wtxidrelay) that would indicate I offer a certain feature but do not want it applied to me? What if I don't want messages to ...
Cosmos's user avatar
  • 199
16 votes
1 answer
1k views

How does block synchronization work in Bitcoin Core today?

When a Bitcoin (full) node connects to the network, it has to synchronize its blockchain with its peers, i.e. learn about the best chain the network knows. There are many aspects to this (learning ...
Pieter Wuille's user avatar
0 votes
1 answer
88 views

How is the problem of orphan blocks solved in this case?

All nodes are online all the time, they were not offline. What will happen if some of my peers (blue peers) have their chains as follows: ... -> A -> B -> D (main chain) \-> C ...
Hurry Walk's user avatar
0 votes
1 answer
115 views

What should I do about incoming connections if my ISP uses CGNAT?

Unfortunately, my ISP uses CGNAT, so port forwarding doesn't work. What should I do? Can I have incoming connections (since I want to open them) and how? Would a VPN help?
Cosmos's user avatar
  • 199
4 votes
1 answer
376 views

In Bitcoin Core, are blocks sent in parallel or in series?

Are blocks sent in parallel or in series? I would also like to know about the implementation part of Bitcoin Core.
masuda's user avatar
  • 81
1 vote
0 answers
42 views

What methods are used to negotiate between nodes about the features they support?

The version number that is exchanged when establishing a connection between nodes only indicates which features are potentially supported by the nodes (a feature that can be negotiated). In order to ...
Cosmos's user avatar
  • 199
0 votes
2 answers
69 views

What is the purpose of version field in version messages exchanged during establishing a connection?

I thought that the version messages that are exchanged when establishing a connection between two nodes and the version field within them indicate what each node supports. Each version supports some ...
Cosmos's user avatar
  • 199
0 votes
1 answer
103 views

Why do we need sendcmpct for getdata(CMPCT) - Low Bandwidth Relaying?

BIP152 explains two types of block announcing: High Bandwidth Relaying (sendcmpct(1)) Low Bandwidth Relaying (sendcmpct(0)) I understand why we need sendcmpct message for the first case. In this way,...
Cosmos's user avatar
  • 199
0 votes
1 answer
55 views

Does hash_count field exists in getheaders/getblocks messages?

Ava Chow said it does not exist (link). If hash_count does not exist, how will the receiving peer know how many locators are in the message? I am not sure if he maybe thought that hash_count does not ...
Cosmos's user avatar
  • 199
0 votes
1 answer
95 views

What happens when hash_stop in getblocks/getheaders messages has a wrong/nonexistent hash?

What happens when hash_stop contains a hash that the node that receives the getblocks/getheaders message doesn't have, or does, but that hash (that is, the block whose hash it is) is somewhere earlier ...
Cosmos's user avatar
  • 199
0 votes
1 answer
79 views

Does the whole message become invalid when the invalid INV type occurs in the message?

If an INV type unknown to the node appears in an INV message, a GETDATA message or some other message where the INVETORY structure is used (e.g. MSG_WITNESS_TX for non-segWit nodes, MSG_WITNESS_TX in ...
Cosmos's user avatar
  • 199
0 votes
1 answer
75 views

What happens when we send MSG_WITNESS_TX/MSG_WITNESS_BLOCK to non-segWit node?

Unknown services flag are ignored by node that don't know them, but what about GETDATA messages and identifiers? For services flag, if node is not updated e.g to segWit, it will just not check (1<&...
Cosmos's user avatar
  • 199
2 votes
1 answer
237 views

What are outgoing and incoming connections and what is the difference between them?

Why do we have two types of connections, outgoing and incoming? What is the purpose of one and the other? Are outgoing connections the ones where we notify of new blocks/transactions, while incoming ...
Cosmos's user avatar
  • 199
5 votes
1 answer
349 views

How to use Wireshark to identify Bitcoin/Lightning P2P packets

I've seen that Wireshark can detect protocol packets like Bitcoin and Lightning Network, which are identified in the protocol column. However, my Wireshark is not classifying those packets, it just ...
Mani T's user avatar
  • 187
1 vote
0 answers
67 views

Max amount of peers connections on LND

I'm trying to connect to a long list of peers. I'm running a LND(0.17.0) node. My list has almost 1k peers and I can only connect to 6 of them. Is my node limiting the max connections? If so, is it ...
polespinasa's user avatar
2 votes
1 answer
123 views

Is there a way to download blocks from scratch without downloading block headers first?

I would like to know if there's a way to download a blockchain without knowing block headers. This could be achieved by asking NEXT_BLOCK_HASH from the genesis block. But is this even possible ?
Loopite's user avatar
  • 301
4 votes
1 answer
244 views

BIP324 encrypted packet structure

I recently saw the BIP 324 proposal. It shows us there can be some privacy enhancement by using ECDH secrets and encryption algorithms such as ChaCha20 and AEAD-ChaCha20-Poly1305. The proposal ...
Loopite's user avatar
  • 301
1 vote
3 answers
173 views

What protocol do bitcoin nodes use to talk to each other?

I assume it's TCP, but is there some other software used to send and receive data? So how would I program a very simple C++ program that sends a test message to a node?
apchrkey's user avatar
1 vote
1 answer
134 views

What do the files in bitcoin/src/rpc/ do?

I know that RPC stands for Remote Procedure Call. Does Bitcoin Core do RPCs with other nodes on the network?
Eoin's user avatar
  • 335
6 votes
1 answer
282 views

Is FIBRE still in use in 2023?

I have read Can someone please explain FIBRE to me like I'm 5 and why is it useful? then https://bitcoinfibre.org/ and https://github.com/bitcoinfibre/bitcoinfibre. But I still do not understand, ...
WebOrCode's user avatar
  • 353
5 votes
2 answers
147 views

How would an adversary increase the required fee to replace a transaction by up to 500 times?

In the ephemeral anchors draft BIP (also discussed here) it states that without V3 transactions an adversary can increase the required fees to replace a transaction as much as 500 times. That sounds a ...
Michael Folkson's user avatar
3 votes
0 answers
112 views

No answer to my `getdata` message

I am trying to fetch blocks using P2P messages but at block 501500 I never received any block message. Here how I do it : I am connecting to a node version/verack happens smoothly. I instantly answer ...
rllola's user avatar
  • 151
1 vote
2 answers
84 views

Request tx messages from other peers?

I'm trying to request tx messages from known peers but it doesn't appear as though this is supported with bitcoin-cli. Is there a way to do this?
bitcoinluvr6969's user avatar
1 vote
1 answer
71 views

Is the nVersion=3 policy proposal introducing additional policy rules and going against the policy principle to only relax policy rules?

In the PR review club on "nVersion=3 and Package RBF" (February 22nd 2023) glozow stated: But in policy we want to strictly loosen rules. Otherwise we could accidentally censor transaction ...
Michael Folkson's user avatar
3 votes
1 answer
127 views

What is an ephemeral anchor and what problems do they address?

What is an ephemeral anchor and what problem(s) would their introduction address? What is their relation to anchor outputs in Lightning? Are ephemeral anchors a prerequisite for eltoo? V3 and package ...
Michael Folkson's user avatar
0 votes
1 answer
111 views

What issues would changing the default policy in Core to mempoolfullrbf=1 resolve and which of the current policy proposals would be simplified?

What issues would changing the default mempool policy in Core to mempoolfullrbf=1 resolve and which of the current policy proposals (e.g. BIP125 replacement, V3 Policy, package RBF, discussed here) ...
Michael Folkson's user avatar
1 vote
1 answer
226 views

What and where are the current status of the BIP 125 replacement, the V3 Policy proposal, package RBF etc?

Whenever I try to review P2P and mempool (default) policy proposals I end up going round in circles around this maze of docs, mailing list posts and pull requests. Some of them are outdated, some ...
Michael Folkson's user avatar
1 vote
1 answer
126 views

Low number from getconnectioncount

I have been running my bitcoin node for about 24 hours now and I'm hovering at 54 active connections. However, I thought that I would be at 125. Why is it that I'm not exceeding this number? ...
bitcoinluvr6969's user avatar
3 votes
1 answer
119 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 ...
codo's user avatar
  • 31
2 votes
1 answer
65 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 ...
Simon L's user avatar
  • 111
1 vote
1 answer
36 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&...
Zephyrus's user avatar
  • 782
2 votes
1 answer
146 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 ...
noob's user avatar
  • 97
1 vote
0 answers
27 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, ...
Davidson Souza's user avatar
0 votes
1 answer
73 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?
Vinay Shetty's user avatar
3 votes
1 answer
369 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:...
deyw's user avatar
  • 550
3 votes
2 answers
498 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....
Aaron's user avatar
  • 33
1 vote
2 answers
111 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?
Vinay Shetty's user avatar
0 votes
0 answers
125 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 ...
Vinay Shetty's user avatar
1 vote
2 answers
360 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 ...
Amir reza Riahi's user avatar
3 votes
1 answer
197 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, ...
Vinay Shetty's user avatar
5 votes
2 answers
947 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 ...
Rook's user avatar
  • 333
6 votes
1 answer
465 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 ...
drogos86's user avatar
  • 147