Bitcoin Forum
May 27, 2024, 09:55:17 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "relayed_by" addres IP  (Read 235 times)
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 07:49:40 AM
 #1

https://api.blockcypher.com/ has field "relayed_by"
How can be get this information, ZMQ gives me this info?
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 09:25:14 AM
 #2

IP of previous node can be obtained only by standalnone using protocol? Or is way to get that info from Bitcoin client - for exmaple by ZMQ?
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 16, 2019, 09:37:04 AM
 #3

IP of previous node can be obtained only by standalnone using protocol? Or is way to get that info from Bitcoin client - for exmaple by ZMQ?

I believe this is how most block explorers get it (the relay IP of a new transaction that is:) (Not sure if it's still up to date either.)

Blockchain.info lists the first IP address it sees a new transaction from.

If you aren't the one creating the transaction, and aren't accidentally the node right in between the node that does and blockchain.info, it's unlikely that you're the first to do so. Furthermore, they may not even be connected to you the whole time.

To see what transactions are being relayed, start bitcoind with -debug=net, and look for 'inv' messages in the debug.log file.
Basically: the relayed_by stat is pretty darn useless.

I'm not sure if ZMQ actually gives info regarding IP adresses. https://bitcoin.stackexchange.com/a/40755 says only notifications for blocks/tx's.

and https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md

Might very well be wrong though.

Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 12:05:27 PM
 #4

I run bitcoin with -debug=net
in log I have "got inv tx=hash, new peer=1"
peer = 1 or 9 but how get IP address from peer number?
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 16, 2019, 12:13:51 PM
 #5

I run bitcoin with -debug=net
in log I have "got inv tx=hash, new peer=1"
peer = 1 or 9 but how get IP address from peer number?

GetPeerInfo (?) https://bitcoincore.org/en/doc/0.16.0/rpc/network/getpeerinfo/

Again though, you will see which node relayed the transaction to YOU. It's obviously not the node that is the original owner of the tx.

And thus, as others have also stated in the past, the information is rather useless. I don't really understand what you would want this for.

Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 12:27:05 PM
 #6

I think, peers are not constant and must be often called getpeerinfo
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 16, 2019, 12:34:25 PM
 #7

I think, peers are not constant and must be often called getpeerinfo
You can change that by only connecting to certain nodes but then the stat becomes even more useless as you're bound to only get new tx's relayed by those nodes anyway.
So really the question becomes about what you're trying to achieve with this?






I'm not sure how blockcypher and blockchain.com do it, or why they think this stat is useful to add anyway. Are they connected to what, 1000 peers?

franky1
Legendary
*
Offline Offline

Activity: 4228
Merit: 4501



View Profile
August 23, 2019, 08:23:24 PM
 #8

relayed by is about where the node got its tx from(the node directly connected to the node) its not about who created the tx/block

but normally Bitcoin client (such as Bitcoin Core) don't record from whom they receive a block/transaction.

bitcoin core client does.
its done because if it receives bad data, it gives the node that sent it a score and if the score reaches a certain level the node bans the malicious node

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
RHavar
Legendary
*
Offline Offline

Activity: 2557
Merit: 1886



View Profile
August 23, 2019, 10:38:12 PM
Merited by ABCbits (1)
 #9

its done because if it receives bad data, it gives the node that sent it a score and if the score reaches a certain level the node bans the malicious node

Hm? From a 30 second look at the code, I don't think it actually does record the node that gave it a transaction. As in, a mapping from transaction to the peer that gave it.

I'm not sure how blockcypher and blockchain.com do it, or why they think this stat is useful to add anyway. Are they connected to what, 1000 peers?

blockcypher is connected to a pretty significant portion of the network, actually. A couple years ago, I searched for bitcoin transactions it believed were first relayed by my node. Can't remember the exact stat, but it probably had the majority of transactions that I actually made, and quite a lot of false positive's too. [Ever since then, I wrote a small hacky patch to core to increase privacy of transactions that were coming from my node by only sending to a random single outbound peer and then sleeping until it ends up fully propagated]

Check out gamblingsitefinder.com for a decent list/rankings of crypto casinos. Note: I have no affiliation or interest in it, and don't even agree with all the rankings ... but it's the only uncorrupted review site I'm aware of.
franky1
Legendary
*
Offline Offline

Activity: 4228
Merit: 4501



View Profile
August 24, 2019, 07:21:40 AM
 #10

but normally Bitcoin client (such as Bitcoin Core) don't record from whom they receive a block/transaction.

bitcoin core client does.
its done because if it receives bad data, it gives the node that sent it a score and if the score reaches a certain level the node bans the malicious node

I know that, but AFAIK Bitcoin Core don't add information about which node (along with details such as node's IP, version, service, etc.) send a transaction/block on that transaction/block which needed in this case.

hint:
https://github.com/bitcoin/bitcoin/blob/85883a9f8ea09f65092dc822a7ca98e64b96f4ab/src/net_processing.cpp#L120
Quote
    * Sources of received blocks, saved to be able to send them reject
     * messages or ban them when processing happens afterwards.

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
RHavar
Legendary
*
Offline Offline

Activity: 2557
Merit: 1886



View Profile
August 24, 2019, 02:23:43 PM
Merited by ABCbits (1)
 #11

hint:
https://github.com/bitcoin/bitcoin/blob/85883a9f8ea09f65092dc822a7ca98e64b96f4ab/src/net_processing.cpp#L120
Quote
    * Sources of received blocks, saved to be able to send them reject
     * messages or ban them when processing happens afterwards.

I'm not sure that really helps.


a) It's just holding it in memory and not exposing it to outside processes -- so not something you could consider "storing"
b) That's for blocks, not transactions

Check out gamblingsitefinder.com for a decent list/rankings of crypto casinos. Note: I have no affiliation or interest in it, and don't even agree with all the rankings ... but it's the only uncorrupted review site I'm aware of.
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!