Bitcoin Forum
May 25, 2019, 08:26:45 AM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I do not understand a part of the GETDATA message correctly.  (Read 73 times)
MixMAx123
Newbie
*
Offline Offline

Activity: 29
Merit: 2


View Profile
March 23, 2019, 10:13:02 PM
Merited by ETFbitcoin (1), HeRetiK (1)
 #1

Hello

I do not understand a part of the GETDATA message correctly.

0x01010000405e6f372d50cde73484916321fcef5549b62d7b00317aa36c4fe3f40be2a78ad4

01 01000040 5e6f372d50cde73484916321fcef5549b62d7b00317aa36c4fe3f40be2a78ad4

01 = the number of line in the array. OK
01000040  = do not quite understand this part Huh
5e6f372d50cde73484916321fcef5549b62d7b00317aa36c4fe3f40be2a78ad4 = The Tx hash code. OK


01000040 These 4 bytes should actually be (as in the "inv" the hash code type.)
But in the Protocoll documentation only hashcode type 01,02,03,04 is described. Where does the 04 come from?

Many Thanks
1558772805
Hero Member
*
Offline Offline

Posts: 1558772805

View Profile Personal Message (Offline)

Ignore
1558772805
Reply with quote  #2

1558772805
Report to moderator
1558772805
Hero Member
*
Offline Offline

Posts: 1558772805

View Profile Personal Message (Offline)

Ignore
1558772805
Reply with quote  #2

1558772805
Report to moderator
PLAY OVER 3000 GAMES
LIGHTNING FAST WITHDRAWALS
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 626
Merit: 853


Novice C♯ Coder


View Profile WWW
March 23, 2019, 10:53:06 PM
Merited by ETFbitcoin (1), HeRetiK (1)
 #2

Bitcoin has one of the best documentations but unfortunately it is not updated regularly with new changes. I've been updating it as I go through things but haven't reached that part yet.

To answer your question you have to look at bitcoin-core's code: https://github.com/bitcoin/bitcoin/blob/3f125151998d9fead198fd44243dd64006b5a56b/src/protocol.h#L380
Which is addition of MSG_TX (=1) and MSG_WITNESS_FLAG (=1 << 30) which is basically giving you this:
0b01000000_00000000_00000000_00000001

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

MixMAx123
Newbie
*
Offline Offline

Activity: 29
Merit: 2


View Profile
March 23, 2019, 11:11:06 PM
 #3

many thanks :-)

Is there any other documentation with this information except in the code itself?
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 626
Merit: 853


Novice C♯ Coder


View Profile WWW
March 23, 2019, 11:17:18 PM
 #4

I know two which are pretty much equal but sometimes have little differences:
- The developer's documentation: https://bitcoin.org/en/developer-reference (you can edit this on GitHub if you find something wrong or missing)
- Bitcoin wiki: https://en.bitcoin.it/wiki/Protocol_documentation

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

MixMAx123
Newbie
*
Offline Offline

Activity: 29
Merit: 2


View Profile
March 23, 2019, 11:25:58 PM
 #5

Unfortunately, I could not find this "Wittnes flag" in both.

But now I know it. Thanks for the quick help.  Smiley

I am currently writing a JSON message parser. For that I needed the information.

Thanks  Smiley
darosior
Full Member
***
Offline Offline

Activity: 171
Merit: 177



View Profile WWW
March 24, 2019, 01:23:04 PM
Merited by HeRetiK (1)
 #6

Unfortunately, I could not find this "Wittnes flag" in both.

But now I know it. Thanks for the quick help.  Smiley

I am currently writing a JSON message parser. For that I needed the information.

Thanks  Smiley
Hi,

this flag is part of the services https://en.bitcoin.it/wiki/Protocol_documentation#version.

Github profile ~ Crypto Lyon (french community)  ~ GPG key fingerprint : E13F C145 CD3F 430 ~ LN public key : 03678b4f041fbfbeebcafc076469df75decf81da20a53bd490172e83ce532df1fa
Tutorials/posts : Address from private keyBitcoin smart contracts ~ Setup a Bitcoin node ~ Raw P2PKH transaction in Python ~ P2SH ~ 51% attack
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!