Portal LogoPortal Docs

PXP-MANIFEST (Manifest Spec)

Specification for the variable-length global transfer manifest.

PXP-MANIFEST — Transfer Manifest

Parent: PXP
Transport: TCP
Phase: 3 of 4


1. Purpose

Before streaming any file data, the sender MUST transmit a manifest that describes the transfer as a whole. This allows the receiver to:

  • Know how many items to expect.
  • Know the total transfer size.
  • Determine whether the data stream will be compressed.
  • Display transfer metadata to the user before data begins arriving.

2. Wire Format

The manifest is sent on the same TCP connection used for the handshake, immediately after identity verification completes.

+-------------------------------+-------------------------------+
|  Length (4 bytes, big-endian) |  Manifest Payload (Bincode)   |
+-------------------------------+-------------------------------+

2.1 Fields

FieldSizeEncodingDescription
Length4 bytesUnsigned 32-bit, big-endianByte length of the Bincode-encoded manifest payload that follows.
PayloadVariableBincodeThe serialized GlobalTransferManifest structure.

3. Manifest Structure

The manifest is a fixed-schema structure with the following fields:

FieldTypeRequiredDescription
total_filesu32MUSTNumber of top-level files in this transfer.
total_directoriesu32MUSTNumber of top-level directories in this transfer.
total_bytesu64MUSTTotal uncompressed size of all items in bytes.
descriptionstring or nullMAYOptional human-readable description provided by the sender.
sender_usernamestring or nullMAYThe sender's configured username.
compressedboolMUSTIf true, the data stream in PXP-STREAMING is Gzip-compressed. If false, raw TAR.

3.1 Item Count

The total number of top-level items is total_files + total_directories. This value determines how many top-level metadata contracts the receiver should expect in the data stream.

Nested files within directories are NOT counted in total_files. They are tracked separately via nested metadata contracts within the TAR stream.


4. Serialization

The manifest MUST be serialized using Bincode with default configuration (little-endian, variable-length integers, trailing bytes rejected).

Implementations MUST NOT use JSON, MessagePack, or any other serialization format for the manifest.


5. Receiver Behavior

Upon receiving the manifest, the receiver:

  1. MUST deserialize the payload using Bincode.
  2. MUST read the compressed field to determine how to decode the subsequent data stream.
  3. SHOULD display the transfer summary (item count, total size, sender username, description) to the user.
  4. MUST proceed to PXP-STREAMING to begin receiving data.

There is no acceptance/rejection message. The receiver cannot decline a transfer at the protocol level — it either reads the stream or drops the connection.


6. Failure Modes

ConditionBehavior
Length prefix indicates payload > 10 MBReceiver SHOULD reject as malformed.
Bincode deserialization failsReceiver MUST close the connection and report a protocol error.
total_files and total_directories are both 0Valid but degenerate. The data stream phase will contain no items.

On this page