Bitcoin Forum
May 12, 2024, 11:21:04 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How message propagation works in bitcoin? - help me please :)  (Read 164 times)
the_big_feet (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 4


View Profile
June 23, 2018, 10:54:20 AM
Merited by ABCbits (1)
 #1

Hello,

Basically I know how message propagation works in peer-to-peer bitcoin network. But I need a clarification on three points below:

QUESTION 1: In bitcoin network every node relays every message it received to it's peers. If node A received message X and relayed it to his peers, and those peers relayed it to theirs, can we take for granted that finally this message X will return to node A like a boomerang? Because if every node relays every message, it should finally.

QUESTION 2: I know there is no feature in bitcoin client for this, but let's suppose there was one. If node A would like to know if message X was ever relayed on the network, and there would be a feature that allowed to ask it's peers if they had ever received X, and once enough number of peers answered that they do indeed relayed such X, would it imply that all connected (at the time when X was relayed on network) nodes received X? Because if some originator node originates X, than one of his peers relays this X, and their peers also relay X (or at least most of them, which acts honestly), then eventually X should reach all connected nodes, right?

And reversing this, if node A would ask enough number of his peers if they received/relayed X and enough number of them answered that no, they haven't, could node A deduct that X was never relayed on the network, for the same reason as stated above?

QUESTION 4: If theoretically at a given time all nodes participating in the network were connected to network, then a message X send at that time should reach (after some time) all nodes, right?

Please somebody answer this.
1715512864
Hero Member
*
Offline Offline

Posts: 1715512864

View Profile Personal Message (Offline)

Ignore
1715512864
Reply with quote  #2

1715512864
Report to moderator
1715512864
Hero Member
*
Offline Offline

Posts: 1715512864

View Profile Personal Message (Offline)

Ignore
1715512864
Reply with quote  #2

1715512864
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715512864
Hero Member
*
Offline Offline

Posts: 1715512864

View Profile Personal Message (Offline)

Ignore
1715512864
Reply with quote  #2

1715512864
Report to moderator
1715512864
Hero Member
*
Offline Offline

Posts: 1715512864

View Profile Personal Message (Offline)

Ignore
1715512864
Reply with quote  #2

1715512864
Report to moderator
1715512864
Hero Member
*
Offline Offline

Posts: 1715512864

View Profile Personal Message (Offline)

Ignore
1715512864
Reply with quote  #2

1715512864
Report to moderator
monsterer2
Full Member
***
Offline Offline

Activity: 351
Merit: 134


View Profile
June 23, 2018, 11:26:23 AM
Merited by achow101 (2), ABCbits (2)
 #2

Hello,

Basically I know how message propagation works in peer-to-peer bitcoin network. But I need a clarification on three points below:

QUESTION 1: In bitcoin network every node relays every message it received to it's peers. If node A received message X and relayed it to his peers, and those peers relayed it to theirs, can we take for granted that finally this message X will return to node A like a boomerang? Because if every node relays every message, it should finally.

Basically, yes. It's the gossip protocol. https://en.wikipedia.org/wiki/Gossip_protocol

Quote
QUESTION 2: I know there is no feature in bitcoin client for this, but let's suppose there was one. If node A would like to know if message X was ever relayed on the network, and there would be a feature that allowed to ask it's peers if they had ever received X, and once enough number of peers answered that they do indeed relayed such X, would it imply that all connected (at the time when X was relayed on network) nodes received X? Because if some originator node originates X, than one of his peers relays this X, and their peers also relay X (or at least most of them, which acts honestly), then eventually X should reach all connected nodes, right?

And reversing this, if node A would ask enough number of his peers if they received/relayed X and enough number of them answered that no, they haven't, could node A deduct that X was never relayed on the network, for the same reason as stated above?

No. Nodes can lie about the receipt of any message.

Quote
QUESTION 4: If theoretically at a given time all nodes participating in the network were connected to network, then a message X send at that time should reach (after some time) all nodes, right?

Please somebody answer this.

Basically, yes - again its the gossip protocol.
the_big_feet (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 4


View Profile
June 24, 2018, 07:46:22 AM
 #3

Thank you for the answer. But I am still unclear on your answer to question 2. You said any node can lie and it's true. But gossip protocol is based on psychological implication that at least some peers on the network WILL relay message (if everybody kept messages to themselves, gossip protocol wouldn't work, but it works). So, let's presume a message X needs to be asymmetrically signed by sender and I can verify that signature. Then if I will ask my peers did they received X, and:

a) they said (or most of them) they didn't - I couldn't deduct with 99.999% confidence that there was no X on network, because if there was X, at least some of peers would respond me in the positive (because of gossip psychology).
b) they said they did - I could deduct with 99.999% confidence that there was X on network, because I can check the signature of X.

In this scenario peers cannot lie about positive answer (because they would need to forge signature), but they can lie about negative (they received X, but said no, we didn't). But, if networks would act like that, gossip protocol would not work in bitcoin too - for example block propagation would be impossible if almost all peers would keep info about new blocks for themselves without relaying. So, in practice, I could deduct that if many nodes said they didn't received X, then almost certainly there was no X on network?

Many thanks.
monsterer2
Full Member
***
Offline Offline

Activity: 351
Merit: 134


View Profile
June 24, 2018, 08:12:01 AM
 #4

Thank you for the answer. But I am still unclear on your answer to question 2. You said any node can lie and it's true. But gossip protocol is based on psychological implication that at least some peers on the network WILL relay message (if everybody kept messages to themselves, gossip protocol wouldn't work, but it works). So, let's presume a message X needs to be asymmetrically signed by sender and I can verify that signature. Then if I will ask my peers did they received X, and:

a) they said (or most of them) they didn't - I couldn't deduct with 99.999% confidence that there was no X on network, because if there was X, at least some of peers would respond me in the positive (because of gossip psychology).
b) they said they did - I could deduct with 99.999% confidence that there was X on network, because I can check the signature of X.

In this scenario peers cannot lie about positive answer (because they would need to forge signature), but they can lie about negative (they received X, but said no, we didn't). But, if networks would act like that, gossip protocol would not work in bitcoin too - for example block propagation would be impossible if almost all peers would keep info about new blocks for themselves without relaying. So, in practice, I could deduct that if many nodes said they didn't received X, then almost certainly there was no X on network?

Many thanks.

Peers cannot lie about the positive answer but they could lie about the negative if there was any incentive for them to do so. In bitcoin, there is no incentive to lie about receipt of transactions, so likelihood of them lying is small.
the_big_feet (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 4


View Profile
June 24, 2018, 09:14:30 AM
 #5

Ok, now all is clear. Thank you so much.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!