consensus-specs icon indicating copy to clipboard operation
consensus-specs copied to clipboard

SSZ implementations list

Open protolambda opened this issue 4 years ago • 8 comments
trafficstars

A non-exhaustive list of SSZ implementations. Not officially endorsed, but maintained by client teams and other members of the ethereum community. Comment in this issue if you like to add/update an entry.

Maintained here to avoid continuous changes to the spec (and not delay table updates till spec release).

Language Project Maintainer License Status Features / Notes Implementation
C++ Prysm Offchain Labs Apache-2.0 Active No dynamic dispatching, minimal memory alloc. OffchainLabs/sszpp
Dafny Eth2 spec/verif. with Dafny ConsenSys Software And Ethereum Foundation (grant) Apache-2.0 Active Formal spec., correctness proofs ConsenSys/eth2.0-dafny
Go ZRNT Diederik Loerakker (@protolambda) MIT Active Generic, caching, datasharing protolambda/ztyp
Go Prysm Ferran Borreguero (@ferranbt) MIT Active Code-gen, fast ferranbt/fastssz
Go SSZ-15 / Go-ethereum Péter Szilágyi (@karalabe) BSD 3-Clause Active Code-gen, fast, 0-alloc karalabe/ssz
Go EF-devops / pk910 @pk910 Apache-2.0 Active Dynamic using type reflection pk910/dynamic-ssz
Java Teku Consensys/PegaSys Eng. Apache-2.0 Active Caching, datasharing PegaSysEng/teku/ssz
Nim Nimbus Status MIT and Apache-2.0 Active In-place decode, Caching status-im/nim-ssz-serialization
Python Trinity Ethereum Foundation MIT Active Pyrsistent, partial caching ethereum/py-ssz
Python Pyspec / Eth2.py Diederik Loerakker (@protolambda) MIT Active Datasharing, caching, streaming protolambda/remerkleable
Rust - Alex Stokes (@ralexstokes) MIT Active Built for light-client usage ralexstokes/ssz-rs
Rust Lighthouse Sigma Prime Apache-2.0 Active Partial caching, fast sigp/ethereum_ssz
Typescript Lodestar Chainsafe Systems Apache-2.0 Active Both Tree & structural, caching ChainSafe/ssz
Typescript Micro-eth-signer Paul Miller (@paulmillr) MIT Active Minimalist paulmillr/micro-eth-signer/src/ssz.ts
Zig - Guillaume Ballet (@gballet) Unlicense Active Zig gballet/ssz.zig
C# - @hexafluoride MIT Active Experimental, serialization only hexafluoride/SszSharp
C# - Nethermind ? Early draft Code-gen, draft NethermindEth/ssz-codegen
C++ Mammon Potuz GPL-3.0 Paused Optimized hash function potuz/mammon
Go Prysm Prysmatic Labs MIT Deprecated Generic, reflection, known bugs prysmaticlabs/go-ssz
Go ZRNT Diederik Loerakker (@protolambda) MIT Deprecated Unsafe Go, fast, streaming protolambda/zssz
Go Go-ethereum @rjl493456442 BSD 3-Clause Discontinued Code-gen, encoding-only rjl493456442/sszgen
Java Harmony Harmony Apache-2.0 Deprecated Partially merged into Teku harmony-dev/beacon-chain-java/ssz
TypeScript Lodestar ChainSafe Systems Apache-2.0 Archived See new Lodestar SSZ ChainSafe/ssz-js
C# Cortex Sly Gryphon (@sgryphon) LGPL-v3.0 Discontinued Experimental sgryphon/cortex-ssz
Rust Shasper ParityTech GPL-3.0 Discontinued No updates paritytech/shasper/ssz
Swift Yeeth Dean Eigenmann (@decanus, @yeeth) MIT Discontinued Incomplete yeeth/SimpleSerialize.swift
Java Cava ConsenSys Apache-2.0 Discontinued Outdated, incomplete ConsenSys/cava/ssz

protolambda avatar Nov 22 '20 04:11 protolambda

@protolambda Thanks for starting this list. BTW what is the order chosen for the list? It does not seem be sorted against languages, or alphabetical ... or license. And what is the difference between archived/deprecated/discontinued?

There is a formal specification and implementations of the SSZ functions in Dafny here. The functional style of the implementations does not prescribe any particular language, but rather identifies the pre/post-condutions of each function. The Dafny implementations are executable, can be translated into C#, Go, Java. More importantly the code is proved correct against some desirable properties, e.g., deserialise(serialise(x)) == x (proof here) and injectiveness of serialise (proof here).

There is also an SSZ wiki. (WIP)

Entry proposal: Language: Dafny Project: Specification and Verification of Eth2.0 in Dafny Maintainer: ConsenSys Software And Ethereum Foundation (grant) License: Apache-2.0 Status: Active Features: Formal specification of each function with pre-post-conditions, correctness proofs Link: link to repo

franck44 avatar Nov 22 '20 22:11 franck44

@franck44 no particular order, but roughly ordered by "status" (active being the highest ranking), then grouped by "language" (alphabetical), and then any order how I happened to build the list. The deprecated/discontinued etc. libraries are at the bottom so they are not as noisy. Happy to re-order if you've a suggestion.

My interpretation here: archived: not maintained, only there to keep the code public. Not recommended to use. May be replaced with something else. GitHub has a nice archive function, which makes a repo read-only. deprecated: code that mostly works, but is considered legacy and not recommended for production. discontinued: code that mostly works, but end-of-life without replacement, nor any archival guaranteed.

In the end most users should just pick an active implementation, of which there are plenty options.

Dafny entry proposal sounds good, will add it. Will need to summarize the "Features" to fit in the table though. Hope I don't butcher it.

protolambda avatar Nov 22 '20 23:11 protolambda

@protolambda could you please add gballet/ssz.zig, the ziglang implementation that I am maintaining? No project in particular (or "geth" if you must have one) and the license is "The Unlicense".

gballet avatar Dec 30 '20 16:12 gballet

Proposing SszSharp be added to this list, as the other C# implementations are quite incomplete compared to mine. Currently, serialization and deserialization is supported well enough that it can roundtrip a BeaconState, and merkleization support is planned. Licensed under MIT.

hexafluoride avatar Oct 13 '22 03:10 hexafluoride

Thanks for the cooperation

amirkhan7javi avatar Oct 27 '22 11:10 amirkhan7javi