GithubHelp home page GithubHelp logo

eth2.0-ssz's Introduction

Eth 2.0 - Simple Serialize

Simple Serialize (SSZ) is a standard for the encoding and merkleization of structured data, designed for ETH 2.0.

Index

Design

Because of resource constraints (both space and speed) and a niche use-case for many interactions with merkleized data, existing encodings were abandoned in favor of SSZ on the ETH 2.0 stack.

The design choices for SSZ originate from the desire for:

  • Efficiency and Elegance in proof structures with binary trees, and a design that separates opinionated sparse structures from merkleization, learning from issues in ETH 1.0.
  • Consistency in a wide range of use-cases for minimal and efficient encoding and proofs in the core of ETH 2.0, as well as the layers being built on top.
  • Flexibility and Transparency for tracing proofs through history, building shallow variants of types, or proofs to linked data such as between ETH 2.0 shards.
  • Stability of proof data for stateless light clients and smart contracts. These can count on deterministic and stable locations of merkle tree leaves of interest.
  • Fast data reads by making full deserialization optional, data can be retrieved with a very minimal amount of operations, largely pre-computable at compile time.

Minimalism and advanced use cases are almost orthogonal. To work around this, this SSZ specification maintains a strong separation of the different stack elements, and a feature introduction model with stages.

Conceptual dependency graph

The SSZ specification has the following general architecture:

SSZ architecture

Note that for Types and Merkle proof backings, different options exist, and the specifications building for each of the options may not all be complete, or in the same standardization stage.

Feature stages

Features are introduced by progressing through stages, alike to the TC39 Process implemented by EcmaScript.

In summary, this translates to:

  1. Strawperson Allow input into the specification
  2. Proposal
    • Make the case for the addition
    • Describe the shape of a solution
    • Identify potential challenges
  3. Draft Precisely describe the syntax and semantics using formal spec language
  4. Candidate Indicate that further refinement will require feedback from implementations and users
  5. Finished Indicate that the addition is ready for inclusion in the formal ECMAScript standard

Implementations can build on the stable stage, and offer support for unfinished feature stages separately.

The proposals, drafts, candidates and finished documents are discussed through issues and PRs on GitHub, along with the relevant ETH 2.0 communication channels.

Implementations

Language Project Maintainer License Status Implementation
Python Eth 2.0 Ethereum Foundation CC0 Spec
Go Prysm Prysmatic Labs MIT Active prysmaticlabs/go-ssz
Go ZRNT Diederik Loerakker (@protolambda) MIT Active protolambda/zssz
Go - Ferran Borreguero (@ferranbt) MIT Active ferranbt/fastssz
Java Artemis Consensys/PegaSys Eng. Apache-2.0 Active PegaSysEng/artemis/util
Java Harmony Harmony Apache-2.0 Active harmony-dev/beacon-chain-java/ssz
Nim Nimbus Status MIT and Apache-2.0 Active status-im/nim-beacon-chain/ssz.nim
Python Trinity Ethereum Foundation MIT Active ethereum/py-ssz
Rust Lighthouse Sigma Prime Apache-2.0 Active sigp/lighthouse/ssz
Rust Shasper ParityTech GPL-3.0 Active paritytech/shasper/ssz
Typescript Lodestar Chainsafe Systems LGPL-v3.0 Active ChainSafe/lodestar/ssz
C# Cortex Sly Gryphon (@sgryphon) LGPL-v3.0 Under construction sgryphon/cortex-ssz
TypeScript Lodestar ChainSafe Systems Apache-2.0 Archived ChainSafe/ssz-js
Java Cava ConsenSys Apache-2.0 Archived ConsenSys/cava/ssz
Swift Yeeth Dean Eigenmann (@decanus, @yeeth) MIT Incomplete yeeth/SimpleSerialize.swift
C# - Jordan Andrews (@codingupastorm) MIT Discontinued codingupastorm/csharp-ssz
C++ - Jiyun Kim (@NAKsir-melody) - Discontinued NAKsir-melody/cpp_ssz

License

CC0 1.0 Universal. See License file.

eth2.0-ssz's People

Contributors

ferranbt avatar gballet avatar protolambda avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.