Skip to main content

Getting Started With Rust

The library is published on You can also download the source code from the official GitHub repository.



We recommend you update Rust to the latest stable version rustup update stable.

The library uses cmake and openssl. You may need install additional build tools on your system to run the build process successfully using Cargo.

You can install all needed prerequisites on Windows with Chocolatey. If you have any of the tools already installed just remove them from the command

Install Chocolatey with

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))

and install the needed packages with

choco install visualstudio2022buildtools visualstudio2022-workload-vctools rust-ms msys2 llvm

Include the Library

The only thing you need to do to start using the library is to add it as dependency in your Cargo.toml file:

iota-wallet = { git = "", branch = "develop" }
tokio = "1.21.2"

Use the Library

In order to use the library, you need to create an AccountManager:

Safe Password Storage

In a production setup, do not store passwords in the host's environment variables or in the source code. See our backup and security recommendations for production setups.

// Copyright 2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! cargo run --example create_wallet --release
// In this example we will create a new wallet
// Rename `.env.example` to `.env` first

use std::{env, path::PathBuf};

use dotenv::dotenv;
use iota_wallet::{
secret::{stronghold::StrongholdSecretManager, SecretManager},
ClientOptions, Result,

async fn main() -> Result<()> {
// This example uses dotenv, which is not safe for use in production

// Setup Stronghold secret_manager
let mut secret_manager = StrongholdSecretManager::builder()

// Only required the first time, can also be generated with `manager.generate_mnemonic()?`
let mnemonic = env::var("NON_SECURE_USE_OF_DEVELOPMENT_MNEMONIC").unwrap();

// The mnemonic only needs to be stored the first time

// Create the account manager with the secret_manager and client options
let client_options = ClientOptions::new().with_node(&env::var("NODE_URL").unwrap())?;

let manager = AccountManager::builder()

// Create a new account
let _account = manager

println!("Generated a new account");


What's Next?

Now that you are up and running, you can get acquainted with the library using its how-to guides and the repository's code examples.