SSZ
  • Home
  • Visualizer
  • Documentation
    • Specs
    • Merkle Proofs
  • Overview
    • Introduction
    • Typing
    • Serialization
    • Deserialization
    • Merkleization
    • Merkle Proofs
  • Implementations
    • Python
    • TypeScript
    • Go
    • Dafny
    • Java
    • Nim
    • C#
    • Zig
    • Rust
    • Swift
  • GitHub
Site Map
  • Home
  • Visualizer
  • Documentation
    • Specs
    • Merkle Proofs
  • Overview
    • Introduction
      • Development
      • SSZ in Eth2
    • Typing
      • Basic Types
      • Composite Types
      • Bitfields
    • Serialization
      • Simple Objects
      • Composite Objects
    • Deserialization
      • Fixed-Size Objects
      • Variable-Size Objects
    • Merkleization
      • Hashing
      • Merkleize
      • Merkleize Helper Functions
      • hash_tree_root
    • Merkle Proofs
      • Helper Functions
      • Generalized Merkle Tree Indices
      • SSZ object to index
      • Helpers for generalized_indices
      • Merkle Multiproofs
      • Summaries and Expansions
  • Implementations
    • Python
    • TypeScript
    • Go
    • Dafny
    • Java
    • Nim
    • C#
    • Zig
    • Rust
    • Swift

Deserialization


Because serialization is an injective function (i.e. two distinct objects of the same type will serialize to different values) any bytestring has at most one object it could deserialize to.


  • Note that deserialization requires hardening against invalid inputs. A non-exhaustive list:
    • Offsets: out of order, out of range, mismatching minimum element size.
    • Scope: Extra unused bytes, not aligned with element size.
    • More elements than a list limit allows. Part of enforcing consensus.
Previous
Next




    • Deserialization