Skip to main content

Rust: Getting Started

notareum is the official Rust SDK for the Notareum Protocol, published on crates.io as a single crate. It targets Rust edition 2021 (stable toolchain) and builds on ethers v2 for Ethereum RPC and signing, tokio for the async runtime, and serde for typed serialization. This page adds the crate, wires up a provider and signer, and produces your first signed .nota file.

Install

ethers is a direct dependency of the SDK. Pinning it in your downstream crate keeps provider, signer, and middleware versions aligned with the SDK.

Requirements

  • Rust edition 2021, stable toolchain.
  • A Tokio multi-threaded runtime for the async entry points.
  • An Ethereum JSON-RPC endpoint.
  • Optional: a LocalWallet (or any ethers::signers::Signer) for write operations. Omit the signer to operate in read-only mode.

Create a Notareum instance

Deployed addresses live in Contract Addresses.

Read-only mode

Pass signer: None to operate without a wallet. Read methods work as usual; any write method returns [SdkError::SignerRequired].

Your first .nota file

.nota file signing is fully local, produces byte-identical output to the TypeScript and Python SDKs, and never touches the network. The off-chain primitives backing this flow live under [notareum::core].
The CreateNotaOptions field is named type_ (trailing underscore) because type is a reserved keyword in Rust. A convenience constructor CreateNotaOptions::new(type_, chain_name, chain_id, identifier) is available when you only need the required fields.

Read a contract

Sub-clients are exposed as public fields on Notareum, not method calls.

Write a contract

Write methods submit the transaction with the configured signer and return the transaction hash as a String. Use the underlying provider to wait for a receipt if your workflow requires it.

Next steps