Bitcoin Forum
May 12, 2024, 12:18:51 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Version message not getting a response  (Read 167 times)
stav5 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 4


View Profile
May 12, 2019, 12:45:58 AM
Last edit: May 12, 2019, 01:03:57 AM by stav5
Merited by Foxpup (2), bones261 (1), Coding Enthusiast (1)
 #1

Hi
I'm in the beginning stages of learning the bitcoin protocol.
Ive been reading about the specification from here.

So far i've made a small c program that generates a "version" message (of protocol version < 106) and sends it to another node via a socket.
But for whatever reason i'm not getting any response (i'm expecting a "verack" message).

I'm setting the following fields:


Header:
------------
[uint32_t] Magic value: 0xD9B4BEF9
[char[12]] Command: "version" (followed by 5 zero bytes of padding)
[uint32_t] Length: 46
[uint32_t] Checksum: 0xCDA4C5D9

Payload:
------------
[int32_t]   Version: 1
[uint64_t] Services: 0
[int64_t]   Timestamp: 1557620555
[uint64_t] Addr_recv->Services: 0
[char[16]] Addr_recv->IP (str): ::ffff:93.175.204.121 (i'm converting this to big endian before i send)
[uint16_t] Addr_recv->Port: 8333 (i'm converting this to big endian before i send)



Here is a dump of the exact message im sending (24 byte header, 46 byte payload - 70 bytes total).

I was hoping maybe someone with experience in this area could look at it and tell me if there is something wrong with it?

I know this is kind of a wired thing to ask but i really dont know what else to do, i've been reading the protocol specification so many times now and i cant tell whats wrong.
Thanks for reading.
1715473131
Hero Member
*
Offline Offline

Posts: 1715473131

View Profile Personal Message (Offline)

Ignore
1715473131
Reply with quote  #2

1715473131
Report to moderator
1715473131
Hero Member
*
Offline Offline

Posts: 1715473131

View Profile Personal Message (Offline)

Ignore
1715473131
Reply with quote  #2

1715473131
Report to moderator
1715473131
Hero Member
*
Offline Offline

Posts: 1715473131

View Profile Personal Message (Offline)

Ignore
1715473131
Reply with quote  #2

1715473131
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715473131
Hero Member
*
Offline Offline

Posts: 1715473131

View Profile Personal Message (Offline)

Ignore
1715473131
Reply with quote  #2

1715473131
Report to moderator
1715473131
Hero Member
*
Offline Offline

Posts: 1715473131

View Profile Personal Message (Offline)

Ignore
1715473131
Reply with quote  #2

1715473131
Report to moderator
1715473131
Hero Member
*
Offline Offline

Posts: 1715473131

View Profile Personal Message (Offline)

Ignore
1715473131
Reply with quote  #2

1715473131
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
May 12, 2019, 12:59:11 AM
Merited by Foxpup (3), bones261 (2), ABCbits (1), Coding Enthusiast (1)
 #2

Protocol version 106 is incredibly old. Bitcoin Core (the most commonly used node software) will not respond to anything older than version 31800.

Why aren't you using the modern version message (which is largely the same format) with a higher version number?

stav5 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 4


View Profile
May 12, 2019, 01:02:52 AM
 #3

Protocol version 106 is incredibly old. Bitcoin Core (the most commonly used node software) will not respond to anything older than version 31800.

Oh i didn't know that. On further inspection the node i was trying to contact (93.175.204.121) is indeed using bitcoin core, so that is probably the reason.
I will update my code to work with protocol version > 31800 and see if it works.

Thank you for the quick response Smiley
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
May 12, 2019, 03:13:20 AM
 #4

Take a look at protocol versions and what they do here: https://bitcoin.org/en/developer-reference#protocol-versions

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
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!