{"id":19011727,"url":"https://github.com/umbracle/go-eth-consensus","last_synced_at":"2025-08-24T01:11:47.349Z","repository":{"id":50499091,"uuid":"519240658","full_name":"umbracle/go-eth-consensus","owner":"umbracle","description":"Lightweight Golang SDK for Ethereum consensus","archived":false,"fork":false,"pushed_at":"2023-06-15T14:31:21.000Z","size":193,"stargazers_count":12,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T23:34:52.718Z","etag":null,"topics":["api","consensus","ethereum","golang","sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umbracle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-07-29T14:16:54.000Z","updated_at":"2024-04-12T17:55:51.000Z","dependencies_parsed_at":"2025-04-17T05:36:22.347Z","dependency_job_id":"53ce914e-f740-40fc-a83d-6312c86f143d","html_url":"https://github.com/umbracle/go-eth-consensus","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/umbracle/go-eth-consensus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbracle%2Fgo-eth-consensus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbracle%2Fgo-eth-consensus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbracle%2Fgo-eth-consensus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbracle%2Fgo-eth-consensus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umbracle","download_url":"https://codeload.github.com/umbracle/go-eth-consensus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbracle%2Fgo-eth-consensus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271778236,"owners_count":24819265,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","consensus","ethereum","golang","sdk"],"created_at":"2024-11-08T19:15:33.125Z","updated_at":"2025-08-24T01:11:47.326Z","avatar_url":"https://github.com/umbracle.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go-eth-consensus [![Godoc](https://godoc.org/github.com/umbracle/go-eth-consensus?status.svg)](https://godoc.org/github.com/umbracle/go-eth-consensus) [![Chat Badge]][chat link]\n\n[chat badge]: https://img.shields.io/badge/chat-discord-%237289da\n[chat link]: https://discord.gg/yCqYxwZNYD\n\nGo-eth-consensus is a suite of Go utilities to interact with the Ethereum consensus layer.\n\nThe core of this library was initially part of [eth2-validator](https://github.com/umbracle/eth2-validator). However, as [other](https://github.com/umbracle/viewpoint) projects started to mature, it became necessary to create a unified library to reduce code duplication and increase consistency.\n\n## Features\n\n**Consensus data types**. Full set of data types (up to Bellatrix) in `structs.go` at root. It includes the SSZ encoding for each one using [`fastssz`](https://github.com/ferranbt/fastssz). Each type is end-to-end tested with the official consensus spec tests.\n\n**Http client**. Lightweight implementation for the [Beacon](https://ethereum.github.io/beacon-APIs) and [Builder](https://ethereum.github.io/builder-specs) OpenAPI spec. For usage and examples see the [Godoc](https://pkg.go.dev/github.com/umbracle/go-eth-consensus/http). The endpoints are tested against a real server that mocks the OpenAPI spec.\n\n**Chaintime**. Simple utilities to interact with slot times and epochs.\n\n**BLS**. Abstraction to sign, recover and store (with keystore format) BLS keys. It includes two implementations: [blst](https://github.com/supranational/blst) with cgo and [kilic/bls12-381](https://github.com/kilic/bls12-381) with pure Go. The build flag `CGO_ENABLED` determines which library is used.\n\n## Installation\n\n```\n$ go get github.com/umbracle/go-eth-consensus\n```\n\n## Bls benchmark\n\nBenchmark for both BLS implementations:\n\n```\n$ CGO_ENABLED=0 go test -v ./bls/... -run=XXX -bench=.\ngoos: linux\ngoarch: amd64\npkg: github.com/umbracle/go-eth-consensus/bls\ncpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz\nBenchmarkBLS_Sign\nBenchmarkBLS_Sign-4     \t    2330\t    515495 ns/op\t   30192 B/op\t     282 allocs/op\nBenchmarkBLS_Verify\nBenchmarkBLS_Verify-4   \t     814\t   1646769 ns/op\t   74048 B/op\t     190 allocs/op\nPASS\nok  \tgithub.com/umbracle/go-eth-consensus/bls\t3.739s\n$ CGO_ENABLED=1 go test -v ./bls/... -run=XXX -bench=.\ngoos: linux\ngoarch: amd64\npkg: github.com/umbracle/go-eth-consensus/bls\ncpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz\nBenchmarkBLS_Sign\nBenchmarkBLS_Sign-4     \t    2833\t    431271 ns/op\t     480 B/op\t       2 allocs/op\nBenchmarkBLS_Verify\nBenchmarkBLS_Verify-4   \t    1282\t    903174 ns/op\t    4545 B/op\t      15 allocs/op\nPASS\nok  \tgithub.com/umbracle/go-eth-consensus/bls\t2.525s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbracle%2Fgo-eth-consensus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbracle%2Fgo-eth-consensus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbracle%2Fgo-eth-consensus/lists"}