Rust Integration

Connect to 256 Blocks using Rust

256 Blocks provides full compatibility with Rust applications through the Ethereum Rust ecosystem. Choose the library that best fits your project's needs.

Available Libraries

LibraryDescription
AlloyModern, high-performance library (recommended for new projects)
ethers-rsEstablished library with comprehensive features

Choosing a Library

  • Alloy is the recommended choice for new projects. It's a complete rewrite with improved performance, better documentation, and is actively maintained by the same team that created ethers-rs.
  • ethers-rs is a mature library that many existing projects use. While still functional, new projects should prefer Alloy.

Authentication

All Rust integrations use the X-API-Key header for authentication. Use your Endpoint Key from the endpoint settings screen. This is configured via custom HTTP headers on the reqwest client.

RPC Endpoint

Use the following endpoint format:

https://rpc.256blocks.com/{chain}

Supported chains include ethereum, base, arbitrum, optimism, polygon, and bsc.

Rust Integration | 256 Blocks