Bitcoin Forum
July 09, 2024, 10:55:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why did not transactions precede a length specification?  (Read 185 times)
MixMAx123 (OP)
Full Member
***
Offline Offline

Activity: 161
Merit: 168


View Profile
March 29, 2019, 07:54:02 PM
Merited by ABCbits (1)
 #1

Raw transactions in the blocks do not have any preceding lengths in the first bytes. Why?
How are the transactions within a block best parsed without the length specification within the transaction?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3444
Merit: 6748


Just writing some code


View Profile WWW
March 30, 2019, 01:14:44 AM
Merited by Foxpup (3), bones261 (2), ABCbits (1)
 #2

Transactions are self descriptive in length. Any field that is variable length contains its length, All other fields are fixed length and a parser knows this. So transactions don't need length prefixes because a parse will know when a transaction ends, and the next bytes are the beginning of the next transaction.

MixMAx123 (OP)
Full Member
***
Offline Offline

Activity: 161
Merit: 168


View Profile
March 30, 2019, 08:31:51 AM
 #3

Ok, I could have come up with that myself.
Many thanks  Smiley
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!