Git Product home page Git Product logo

ssz-rs's Introduction

ssz-rs ✂️️

build crates.io docs.rs

An implementation of the SSZ serialization scheme defined in the consensus-specs repo.

This repo aims to remain lightweight and relatively free-standing, rather than coupled to other ethereum consensus code/dependencies.

🚧 WARNING 🚧

This implementation has not been audited for security and is primarily intended for R&D use cases.

If you need a battle-tested implementation (e.g. for consensus-critical work), refer to the Lighthouse implementation.

Features

To conform to the SSZ spec, a given Rust type should implement the SimpleSerialize trait. Types implementing this trait then obtain:

Encoding / decoding

ssz_rs aims to add as little ceremony over the built-in Rust types as possible. The ssz_rs_derive crate provides macros to derive the encoding and decoding routines for SSZ containers and unions (represented as Rust structs and enums, respectively). See the ssz_rs/examples for example usage.

Merkleization

This library provides the hash tree root computation for types implementing SimpleSerialize.

Multiproofs

  • NOTE: under construction

This library provides tools for generating and verifying multiproofs of SSZ data.

no-std feature

This library is no-std compatible. To build without the standard library, disable the crate's default features.

For example, in Cargo.toml:

ssz-rs = { version = "...", default-features = false }

Testing

This repo includes a copy of the ssz_generic consensus spec tests as integration tests for the ssz_rs crate. The tests are generated from a local clone of the spec tests repo and the generator script under ssz_rs/scripts. Refer to the README there if you need to update/change these tests.

ssz-rs's People

Contributors

bluele avatar claravanstaden avatar ncitron avatar onbjerg avatar ralexstokes 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.