Uint8, Uint16, Uint32, Uint64, Uint128, Uint256
Bit, 0 or 1, True or False
"Fixed Length" sequence of elements of same **Type** (homogeneous)
"Variable Length" sequence of elements of the same **Type** (homogenous)
Heterogeneous ordered collection of elements
A "Union Type" containing SSZ Types
A Uint256 that represents the
Bytes32 hash_tree_root of a nested merkle tree
Types can be aliased to more specific types, good use of type aliasing can make a data-structure much clearer.
E.g. BLSSignature
instead of Vector[byte, 96]
.
All SSZ Types have a default "zeroed" value
Uint
: 0Boolean
: FalseVector
: Sequence of default valuesList
: Empty ListContainer
: Default value for each type in containerUnion
: Default value of "Type_0"Default values are recursive; elements in composite types such as containers are initialized with their respective default initializations
Every type deterministically describes the shape of the Merkle Tree representing the type
Most types do so statically: the shape can be constructed on compile time, and navigation is stable (See generalized indices).
or
root
uint256(123)
and uint8(123)
have the same root.Container
with 4 Bytes32
fields can have the same root as a Vector[uint64, 16]
.Serialization: Any two different values of the same type cannot have the same representation.
Deserialization: Any valid representation of a given type cannot be interpreted as two different values of that same type:
Serialization: All type instantiations can be serialized to a unique (to the type) value.
Deserialization: not all byte sequences are a valid representation for a given type, because of constraints such as: