Skip to content

Message Structure

Eric Voskuil edited this page Apr 17, 2017 · 14 revisions

Libbitcoin messages conform to a uniform message structure implemented using ZeroMQ. ZeroMQ imposes its own structure on messages, described at a high level below.

Frame

The fundamental unit of a message is a frame. A frame is a length-specified set of bytes.

[----frame-----]

Message

A message is a set of frames that make up an envelope and body. The envelope is generally hidden from the implementation by ZeroMQ.

[---envelope---]
[-----body-----]

Envelope

An envelope may contain addressing frames (route) and an empty frame (delimiter).

[----route1----]
[----route2----]
[--------------]

Body

A message body may contain any number of frames and may combine any number of logical values into one frame.

[----data1-----]
[----data2-----]
[----data3-----]
Clone this wiki locally