Skip to content

Binary Formats

The Partisia Platform utilizes binary formats to optimize the amount of bytes used to send information.

The binary formats describes the different ways data can be serialized to specify information on the chain and in the files created from smart contracts.

The binary formats can also be used to extract info, since the data stored on the chain, will be using a binary format.

  • Transactions and Events: The transactions and events that are executed on the blockchain, are saved according to the Signed Transaction and the Executable Event. These are the definition of what has happened on the chain so far.

  • RPC Format: When an action of the smart function is invoked, the payload is sent to the action as binary data. The payload identifies which action is invoked and the values for all parameters to the action.

  • State Format: The state of a smart contract is stored as binary data in the blockchain state. The state holds the value of all smart contract state variables.

  • ABI Format: Meta-information about the smart contract is also stored as binary data. The ABI holds the list of available actions and their parameters and information about the different state variables.

  • Sectioned bytes: A sectioned byte array can contain specific sections, where each section is specified by a global identifier and the length of the section. There are different types of sectioned bytes such as .pbc-files and wasm results.

Parsers and Generators

We differentiate between parsers and generators.

Generators are systems that produce binary representations, but does not necessarily consume them. This can for example be the CreateTypeSpec trait in the Rust Contract SDK. Generators must produce representations within the most up-to-date specification, without any deprecated features.

Parsers are systems that can consume binary representation. This includes the various clients, such as commandline tools and Partisia Browser. Parsers must parse the most up-to-date specification, and should parse older — even deprecated — features.

Partisia All Rights Reserved © 2023