An implementation of the Simple Serialize (SSZ) specification written in the Zig programming language.
This library provides an implementation of the Simple Serialize (SSZ) specification, written in Zig.
This follows Typescript implementation of Lodestar team https://github.com/ChainSafe/ssz
- generic: If you have an application struct, just write a respective ssz struct and create a ssz type then you have an ssz implementation. More on that in the example below.
- batch hash designed to support batch hash through
merkleize
function - HashFn by type support generic
HashFn
as a parameter when creating a new type
Clone the repository and build the project using Zig git clone https://github.com/twoeths/ssz-z.git
cd packages/ssz && zig build test:unit
to run all unit testscd packages/ssz && zig build test:lodestar
to run all lodestar testscd packages/ssz && zig build test:int
to run all integration tests (tests across types)cd packages/persistent-merkle-tree && zig test --dep util -Mroot=src/merkleize.zig -Mutil=../common/src/root.zig
run tests in merkleize.zigcd packages/ssz && zig test --dep util --dep persistent_merkle_tree -Mroot=src/type/container.zig -Mutil=../common/src/root.zig -Mpersistent_merkle_tree=../persistent-merkle-tree/src/root.zig
to run tests insrc/type/container.zig
zig build test:unit --verbose
to see how to map modules to run unit tests in a filecd packages/ssz && zig test --dep ssz --dep persistent_merkle_tree --dep util -Mroot=test/int/type/container.zig -Mutil=../common/src/root.zig -Mpersistent_merkle_tree=../persistent-merkle-tree/src/root.zig --dep util --dep persistent_merkle_tree -Mssz=src/root.zig
to run int tests intest/int/type/container.zig
zig build test:int --verbose
to see how to map modules to run int tests in a file
- Zig
- SSZ
- Ethereum
- Serialization
- Consensus