{"id":15637862,"url":"https://github.com/ralexstokes/ssz-rs","last_synced_at":"2025-05-16T12:06:26.800Z","repository":{"id":39020633,"uuid":"371858646","full_name":"ralexstokes/ssz-rs","owner":"ralexstokes","description":"Implementation of ethereum's `ssz`","archived":false,"fork":false,"pushed_at":"2024-10-04T16:22:37.000Z","size":2340,"stargazers_count":104,"open_issues_count":20,"forks_count":46,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T22:05:53.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralexstokes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-29T01:58:40.000Z","updated_at":"2025-01-10T21:02:22.000Z","dependencies_parsed_at":"2023-02-10T22:01:16.201Z","dependency_job_id":"817955fe-a32a-4f8d-a2fb-f9f433c5d8db","html_url":"https://github.com/ralexstokes/ssz-rs","commit_stats":{"total_commits":490,"total_committers":14,"mean_commits":35.0,"dds":"0.23673469387755097","last_synced_commit":"ec3073e2273b4d0873fcb6df68ff4eff79588e92"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralexstokes%2Fssz-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralexstokes%2Fssz-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralexstokes%2Fssz-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralexstokes%2Fssz-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralexstokes","download_url":"https://codeload.github.com/ralexstokes/ssz-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563929,"owners_count":20958971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T11:13:43.667Z","updated_at":"2025-04-06T23:11:20.611Z","avatar_url":"https://github.com/ralexstokes.png","language":"Rust","funding_links":[],"categories":["Core"],"sub_categories":[],"readme":"# ssz_rs ✂️️\n\n[![build](https://github.com/ralexstokes/ssz-rs/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ralexstokes/ssz-rs/actions/workflows/ci.yml)\n[![crates.io](https://img.shields.io/crates/v/ssz_rs.svg)](https://crates.io/crates/ssz_rs)\n[![docs.rs](https://img.shields.io/docsrs/ssz_rs)](https://docs.rs/ssz_rs/)\n[![codecov](https://codecov.io/gh/ralexstokes/ssz-rs/branch/main/graph/badge.svg)](https://codecov.io/gh/ralexstokes/ssz-rs)\n\nAn implementation of the [`SSZ` serialization scheme defined in the consensus-specs repo](https://github.com/ethereum/consensus-specs/tree/fa09d896484bbe240334fa21ffaa454bafe5842e/ssz).\n\nThis repo aims to remain lightweight and relatively free-standing, rather than coupled to other ethereum consensus code/dependencies. It also supports light client use cases with functionality for Merkle proofs and reasoning about generalized indices.\n\n# 🚧 WARNING 🚧\n\nThis implementation is primarily intended for R\u0026D use cases and comes with no guarantees including those around performance or security.\n\nThat being said, an audit has been completed by [@oak-security](https://github.com/oak-security) you can [find here](https://github.com/oak-security/audit-reports/blob/master/ssz-rs/2023-09-28%20Audit%20Report%20-%20ssz-rs%20v1.0.pdf).\nIt covers this commit of this repository: [b8729699f07f0d348053251dd6ddf838656849d1](https://github.com/ralexstokes/ssz-rs/commit/b8729699f07f0d348053251dd6ddf838656849d1)\n\nIf you need a battle-tested implementation (e.g. for consensus-critical work), refer to the [Lighthouse implementation](https://github.com/sigp/lighthouse).\n\n# Features\n\nTo conform to the `SSZ` spec, a given Rust type should implement the [`SimpleSerialize` trait](https://docs.rs/ssz_rs/latest/ssz_rs/trait.SimpleSerialize.html). Types implementing this trait then obtain:\n\n## Encoding / decoding\n\nThis library provides routines to serialize from and deserialize into a Rust type to/from the corresponding `SSZ` data via the [`Serialize`](https://docs.rs/ssz_rs/latest/ssz_rs/trait.Serialize.html) and [`Deserialize`](https://docs.rs/ssz_rs/latest/ssz_rs/trait.Deserialize.html) traits.\n\n## Merkleization\n\nThis library provides the [hash tree root](https://github.com/ethereum/consensus-specs/blob/fa09d896484bbe240334fa21ffaa454bafe5842e/ssz/simple-serialize.md#merkleization) computation for types implementing [`HashTreeRoot`](https://docs.rs/ssz_rs/latest/ssz_rs/trait.HashTreeRoot.html).\n\n* *NOTE*: The hashing strategies employed are not particularly sophisticated; users may run into memory or performance issues with the current implementation.\n\n## Merkle proofs\n\nThis library provides the ability to reason about [generalized indices](https://github.com/ethereum/consensus-specs/blob/fa09d896484bbe240334fa21ffaa454bafe5842e/ssz/merkle-proofs.md#generalized-merkle-tree-index) for a given `SSZ` definition,\nalong with the ability to generate and verify proofs of data at those indices.\n\n* *NOTE*: Merkle proving is implemented for the \"single\" proof category, with only experimental support for \"multiproofs\" defined in the `SSZ` spec.\n\n## `no-std` feature\n\nThis library is `no-std` compatible. To build without the standard library, disable the crate's default features.\n\nFor example, in `Cargo.toml`:\n\n```toml\nssz_rs = { version = \"...\", default-features = false }\n```\n\n## Custom types\n\nThis library attempts to provide as minimal an interface over the native Rust types as possible when implementing `SSZ` types.\nFor example, the `uint64` type from the `SSZ` spec is represented by Rust's native `u64` type.\n\nThe library also provides custom types for `List`, `Vector`, `Bitlist` and `Bitvector` following the `SSZ` spec.\nEach of these custom types should behave approximately like Rust's `Vec` type.\n\nFor safety, there are only a few ways to construct an instance of each of these custom types:\n\n* `Default::default`\n\n* `TryFrom::try_from`\n\n* `ssz_rs::Deserialize`\n\nMoreover, the `ssz_rs_derive` package provides macros to derive the various trait implementations for `SSZ` containers and unions (represented as Rust `struct`s and `enum`s, respectively).\n\n# Examples\n\nSee the [`examples`](./ssz-rs/examples) for example usage of the facilities of this library. There are additional samples of how to use the code in the tests, if the examples don't capture your use case.\n\n# Testing\n\nThis repo includes a copy of the [`ssz_generic` consensus spec tests](https://github.com/ethereum/consensus-spec-tests) as integration tests for the `ssz_rs` package, along with hand-written unit tests.\nThe integration tests are generated via a utility under `ssz-rs-test-gen` package. See the README there for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralexstokes%2Fssz-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralexstokes%2Fssz-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralexstokes%2Fssz-rs/lists"}