Rust SDK
Installing the Rust SDK
Section titled “Installing the Rust SDK”Aptos provides an official Rust SDK in the
aptos-rust-sdk GitHub repository
and on crates.io. Add it to your
Cargo.toml:
[dependencies]aptos-sdk = "0.7"tokio = { version = "1", features = ["full"] }anyhow = "1"To use the latest unreleased changes:
[dependencies]aptos-sdk = { git = "https://github.com/aptos-labs/aptos-rust-sdk", package = "aptos-sdk" }The SDK requires Rust 1.95+. Unlike the legacy crate in aptos-core, this
SDK does not need git patches or a .cargo/config.toml tokio_unstable flag.
Feature flags
Section titled “Feature flags”| Feature | Default | Description |
|---|---|---|
ed25519 | Yes | Ed25519 signature scheme |
secp256k1 | Yes | Secp256k1 ECDSA signatures |
secp256r1 | Yes | Secp256r1 (P-256) ECDSA signatures |
mnemonic | Yes | BIP-39 mnemonic phrase support |
indexer | Yes | GraphQL indexer client |
faucet | Yes | Faucet integration for testnets |
bls | No | BLS12-381 signatures |
macros | No | Proc macros for type-safe contract bindings |
Minimal build:
[dependencies]aptos-sdk = { version = "0.7", default-features = false, features = ["ed25519"] } Fetching Data Learn how to fetch data with the Rust SDK
Submitting Transactions Learn how to submit transactions with the Rust SDK
Examples Explore Rust examples provided in the SDK