{"id":15546778,"url":"https://github.com/alloy-rs/alloy","last_synced_at":"2026-02-18T02:05:21.555Z","repository":{"id":208728652,"uuid":"629243152","full_name":"alloy-rs/alloy","owner":"alloy-rs","description":"Transports, Middleware, and Networks for the Alloy project","archived":false,"fork":false,"pushed_at":"2025-05-15T12:30:52.000Z","size":54665,"stargazers_count":869,"open_issues_count":37,"forks_count":357,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-05-15T13:37:09.854Z","etag":null,"topics":["blockchain","ethereum"],"latest_commit_sha":null,"homepage":"https://alloy.rs","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/alloy-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-17T23:31:47.000Z","updated_at":"2025-05-15T12:29:58.000Z","dependencies_parsed_at":"2024-02-21T23:27:51.062Z","dependency_job_id":"7500d5be-670a-4c4d-b6e3-ccd6e1aff956","html_url":"https://github.com/alloy-rs/alloy","commit_stats":{"total_commits":1050,"total_committers":114,"mean_commits":9.210526315789474,"dds":0.8095238095238095,"last_synced_commit":"aee55796556d5309136a532da1093f85d4c2d9b8"},"previous_names":["alloy-rs/alloy"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloy-rs%2Falloy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloy-rs%2Falloy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloy-rs%2Falloy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloy-rs%2Falloy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloy-rs","download_url":"https://codeload.github.com/alloy-rs/alloy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"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":["blockchain","ethereum"],"created_at":"2024-10-02T13:04:43.348Z","updated_at":"2026-02-18T02:05:21.548Z","avatar_url":"https://github.com/alloy-rs.png","language":"Rust","funding_links":[],"categories":["Core","Rust","🛠️ SDKs \u0026 Client Libraries"],"sub_categories":["Rust"],"readme":"# Alloy\n\nAlloy connects applications to blockchains.\n\nAlloy is a rewrite of [`ethers-rs`] from the ground up, with exciting new\nfeatures, high performance, and excellent [docs](https://docs.rs/alloy).\n\nWe also have a [book](https://alloy.rs/) on all things Alloy and many [examples](https://github.com/alloy-rs/examples) to help you get started.\n\n[![Telegram chat][telegram-badge]][telegram-url]\n\n[`ethers-rs`]: https://github.com/gakonst/ethers-rs\n[telegram-badge]: https://img.shields.io/endpoint?color=neon\u0026style=for-the-badge\u0026url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fethers_rs\n[telegram-url]: https://t.me/ethers_rs\n\n## Installation\n\nAlloy consists of a number of crates that provide a range of functionality essential for interfacing with any Ethereum-based blockchain.\n\nThe easiest way to get started is to add the `alloy` crate with the `full` feature flag from the command-line using Cargo:\n\n```sh\ncargo add alloy --features full\n```\n\nAlternatively, you can add the following to your `Cargo.toml` file:\n\n```toml\nalloy = { version = \"1\", features = [\"full\"] }\n```\n\nFor a more fine-grained control over the features you wish to include, you can add the individual crates to your `Cargo.toml` file, or use the `alloy` crate with the features you need.\n\nA comprehensive list of available features can be found on [docs.rs](https://docs.rs/crate/alloy/latest/features) or in the [`alloy` crate's `Cargo.toml`](https://github.com/alloy-rs/alloy/blob/main/crates/alloy/Cargo.toml).\n\n## Examples\n\n### Connecting to a Provider\n\nHere's a simple example of connecting to an Ethereum node and querying the latest block:\n\n```rust\nuse alloy::providers::{Provider, ProviderBuilder};\n\n# async fn example() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n// Create a provider with the HTTP transport using the `reqwest` crate.\nlet rpc_url = \"https://eth.llamarpc.com\";\nlet provider = ProviderBuilder::new().connect(rpc_url).await?;\n\n// Get the latest block number.\nlet latest_block = provider.get_block_number().await?;\nprintln!(\"Latest block number: {latest_block}\");\n\n// Get chain ID.\nlet chain_id = provider.get_chain_id().await?;\nprintln!(\"Chain ID: {chain_id}\");\n# Ok(())\n# }\n```\n\n### Network generic\n\nAlloy is network-generic, allowing you to work with any Ethereum-compatible chain. Here's an example using Optimism (see [`op-alloy`](https://docs.rs/op-alloy)) to demonstrate this capability:\n\n```rust,ignore\nuse alloy::providers::{Provider, ProviderBuilder};\nuse op_alloy::network::Optimism;\n\n# async fn example() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n// Connect to Optimism mainnet.\nlet rpc_url = \"https://mainnet.optimism.io\";\nlet provider = ProviderBuilder::new_with_network::\u003cOptimism\u003e().connect(rpc_url).await?;\n# Ok(())\n# }\n```\n\nFor more examples, check out the [Alloy examples repository](https://github.com/alloy-rs/examples).\n\n## Overview\n\nThis repository contains the following crates:\n\n- [`alloy`]: Meta-crate for the entire project, including [`alloy-core`]\n- [`alloy-consensus`] - Ethereum consensus interface\n  - [`alloy-consensus-any`] - Catch-all consensus interface for multiple networks\n- [`alloy-contract`] - Interact with on-chain contracts\n- [`alloy-eip5792`] - Types for the `wallet_` Ethereum JSON-RPC namespace\n- [`alloy-eip7547`] - EIP-7547: Inclusion Lists types\n- [`alloy-eips`] - Ethereum Improvement Proposal (EIP) implementations\n- [`alloy-genesis`] - Ethereum genesis file definitions\n- [`alloy-json-rpc`] - Core data types for JSON-RPC 2.0 clients\n- [`alloy-ens`] - Ethereum Name Service (ENS) utilities\n- [`alloy-network`] - Network abstraction for RPC types\n  - [`alloy-network-primitives`] - Primitive types for the network abstraction\n- [`alloy-node-bindings`] - Ethereum execution-layer client bindings\n- [`alloy-provider`] - Interface with an Ethereum blockchain\n- [`alloy-pubsub`] - Ethereum JSON-RPC [publish-subscribe] tower service and type definitions\n- [`alloy-rpc-client`] - Low-level Ethereum JSON-RPC client implementation\n- [`alloy-rpc-types`] - Meta-crate for all Ethereum JSON-RPC types\n  - [`alloy-rpc-types-admin`] - Types for the `admin` Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-anvil`] - Types for the [Anvil] development node's Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-any`] - Types for JSON-RPC namespaces across multiple networks\n  - [`alloy-rpc-types-beacon`] - Types for the [Ethereum Beacon Node API][beacon-apis]\n  - [`alloy-rpc-types-debug`] - Types for the `debug` Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-engine`] - Types for the `engine` Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-eth`] - Types for the `eth` Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-mev`] - Types for the MEV bundle JSON-RPC namespace\n  - [`alloy-rpc-types-tenderly`] - Types for the Tenderly node's Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-trace`] - Types for the `trace` Ethereum JSON-RPC namespace\n  - [`alloy-rpc-types-txpool`] - Types for the `txpool` Ethereum JSON-RPC namespace\n- [`alloy-serde`] - [Serde]-related utilities\n- [`alloy-signer`] - Ethereum signer abstraction\n  - [`alloy-signer-aws`] - [AWS KMS] signer implementation\n  - [`alloy-signer-gcp`] - [GCP KMS] signer implementation\n  - [`alloy-signer-ledger`] - [Ledger] signer implementation\n  - [`alloy-signer-local`] - Local (private key, keystore, mnemonic, YubiHSM) signer implementations\n  - [`alloy-signer-trezor`] - [Trezor] signer implementation\n  - [`alloy-signer-turnkey`] - [Turnkey] signer implementation\n- [`alloy-transport`] - Low-level Ethereum JSON-RPC transport abstraction\n  - [`alloy-transport-http`] - HTTP transport implementation\n  - [`alloy-transport-ipc`] - IPC transport implementation\n  - [`alloy-transport-ws`] - WS transport implementation\n- [`alloy-tx-macros`] - Derive macro for transaction envelopes\n\n[`alloy`]: https://github.com/alloy-rs/alloy/tree/main/crates/alloy\n[`alloy-core`]: https://docs.rs/alloy-core\n[`alloy-consensus`]: https://github.com/alloy-rs/alloy/tree/main/crates/consensus\n[`alloy-consensus-any`]: https://github.com/alloy-rs/alloy/tree/main/crates/consensus-any\n[`alloy-contract`]: https://github.com/alloy-rs/alloy/tree/main/crates/contract\n[`alloy-eip5792`]: https://github.com/alloy-rs/alloy/tree/main/crates/eip5792\n[`alloy-eip7547`]: https://github.com/alloy-rs/alloy/tree/main/crates/eip7547\n[`alloy-eips`]: https://github.com/alloy-rs/alloy/tree/main/crates/eips\n[`alloy-genesis`]: https://github.com/alloy-rs/alloy/tree/main/crates/genesis\n[`alloy-json-rpc`]: https://github.com/alloy-rs/alloy/tree/main/crates/json-rpc\n[`alloy-network`]: https://github.com/alloy-rs/alloy/tree/main/crates/network\n[`alloy-network-primitives`]: https://github.com/alloy-rs/alloy/tree/main/crates/network-primitives\n[`alloy-node-bindings`]: https://github.com/alloy-rs/alloy/tree/main/crates/node-bindings\n[`alloy-provider`]: https://github.com/alloy-rs/alloy/tree/main/crates/provider\n[`alloy-pubsub`]: https://github.com/alloy-rs/alloy/tree/main/crates/pubsub\n[`alloy-rpc-client`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-client\n[`alloy-rpc-types`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types\n[`alloy-rpc-types-admin`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-admin\n[`alloy-rpc-types-anvil`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-anvil\n[`alloy-rpc-types-any`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-any\n[`alloy-rpc-types-beacon`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-beacon\n[`alloy-rpc-types-debug`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-debug\n[`alloy-rpc-types-engine`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-engine\n[`alloy-rpc-types-eth`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-eth\n[`alloy-rpc-types-mev`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-mev\n[`alloy-rpc-types-tenderly`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-tenderly\n[`alloy-rpc-types-trace`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-trace\n[`alloy-rpc-types-txpool`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-txpool\n[`alloy-serde`]: https://github.com/alloy-rs/alloy/tree/main/crates/serde\n[`alloy-signer`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer\n[`alloy-signer-aws`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-aws\n[`alloy-signer-gcp`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-gcp\n[`alloy-signer-ledger`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-ledger\n[`alloy-signer-local`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-local\n[`alloy-signer-trezor`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-trezor\n[`alloy-signer-turnkey`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-turnkey\n[`alloy-transport`]: https://github.com/alloy-rs/alloy/tree/main/crates/transport\n[`alloy-transport-http`]: https://github.com/alloy-rs/alloy/tree/main/crates/transport-http\n[`alloy-transport-ipc`]: https://github.com/alloy-rs/alloy/tree/main/crates/transport-ipc\n[`alloy-transport-ws`]: https://github.com/alloy-rs/alloy/tree/main/crates/transport-ws\n[`alloy-tx-macros`]: https://github.com/alloy-rs/alloy/tree/main/crates/tx-macros\n[`alloy-ens`]: https://github.com/alloy-rs/alloy/tree/main/crates/ens\n[publish-subscribe]: https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern\n[AWS KMS]: https://aws.amazon.com/kms\n[GCP KMS]: https://cloud.google.com/kms\n[Ledger]: https://www.ledger.com\n[Trezor]: https://trezor.io\n[Turnkey]: https://www.turnkey.com\n[Serde]: https://serde.rs\n[beacon-apis]: https://ethereum.github.io/beacon-APIs\n[Anvil]: https://github.com/foundry-rs/foundry\n\n## Supported Rust Versions (MSRV)\n\n\u003c!--\nWhen updating this, also update:\n- clippy.toml\n- Cargo.toml\n- .github/workflows/ci.yml\n--\u003e\n\nThe current MSRV (minimum supported rust version) is 1.91.\n\nAlloy will keep a rolling MSRV policy of **at least** two versions behind the\nlatest stable release (so if the latest stable release is 1.58, we would\nsupport 1.56).\n\nNote that the MSRV is not increased automatically, and only as part of a patch\n(pre-1.0) or minor (post-1.0) release.\n\n## Contributing\n\nThanks for your help improving the project! We are so happy to have you! We have\n[a contributing guide](./CONTRIBUTING.md) to help you get involved in the\nAlloy project.\n\nPull requests will not be merged unless CI passes, so please ensure that your\ncontribution follows the linting rules and passes clippy.\n\n## Note on `no_std`\n\nBecause these crates are primarily network-focused, we do not intend to support\n`no_std` for most of them at this time.\n\nThe following crates support `no_std`:\n\n| Crate               | Version Badge                                                                                                 |\n| ------------------- | ------------------------------------------------------------------------------------------------------------- |\n| **alloy-eips**      | [![Crates.io](https://img.shields.io/crates/v/alloy-eips.svg)](https://crates.io/crates/alloy-eips)           |\n| **alloy-genesis**   | [![Crates.io](https://img.shields.io/crates/v/alloy-genesis.svg)](https://crates.io/crates/alloy-genesis)     |\n| **alloy-serde**     | [![Crates.io](https://img.shields.io/crates/v/alloy-serde.svg)](https://crates.io/crates/alloy-serde)         |\n| **alloy-consensus** | [![Crates.io](https://img.shields.io/crates/v/alloy-consensus.svg)](https://crates.io/crates/alloy-consensus) |\n\nIf you would like to add `no_std` support to a crate, please make sure to update\n`scripts/check_no_std.sh` as well.\n\n## Credits\n\nNone of these crates would have been possible without the great work done in:\n\n| Project | Description |\n|------------|-------------|\n| [`ethers.js`](https://github.com/ethers-io/ethers.js/) | A complete and compact JavaScript library for interacting with the Ethereum blockchain. |\n| [`rust-web3`](https://github.com/tomusdrw/rust-web3/) | Rust library for Ethereum JSON-RPC client communication, including support for async and WASM. |\n| [`ruint`](https://github.com/recmo/uint) | A fast, no-std, const-friendly implementation of fixed-size unsigned integers in Rust. |\n| [`ethabi`](https://github.com/rust-ethereum/ethabi) | Ethereum ABI encoding/decoding in Rust for contracts and transactions. |\n| [`ethcontract-rs`](https://github.com/gnosis/ethcontract-rs/) | Rust library to generate type-safe bindings to Ethereum smart contracts. |\n| [`guac_rs`](https://github.com/althea-net/guac_rs/) | Rust implementation of the GUAC protocol for Ethereum state channels. |\n\n\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in these crates by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloy-rs%2Falloy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloy-rs%2Falloy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloy-rs%2Falloy/lists"}