Skip to main content

Getting Started with C#

Alpha Software

The IOTA SDK is currently in alpha. APIs, interfaces, and behavior may change without notice between releases. It is not yet recommended for production use.

The IOTA SDK C# bindings allow .NET developers to build applications that interact with the IOTA network. These bindings wrap the core Rust SDK via a Foreign Function Interface (FFI).

Prerequisites

Before using the C# bindings, ensure you have:

  • .NET SDK: Version 8.0 or higher.

Installation

Add the IOTA SDK to your project as a NuGet package:

dotnet add package IotaSdk

The package includes pre-built native libraries for macOS (x86_64 and ARM64), Linux (x86_64 and ARM64), and Windows (x86_64 and ARM64).

Quick Start Example

The following example demonstrates how to connect to the IOTA Testnet and retrieve the Chain ID.

1. Create a console project

dotnet new console -o iota-quickstart
cd iota-quickstart
dotnet add package IotaSdk

2. Replace Program.cs

Replace the contents of Program.cs with the following code:

bindings/csharp/examples/ChainId/Program.cs
loading...

3. Run the code

In your terminal, run:

dotnet run

What's Next?

Now that you have connected to the network, you can explore more advanced features:

  • Accounts and Addresses: create a mnemonic, derive addresses, and check coin balances.
  • Transactions: build, sign, and send Programmable Transaction Blocks (PTBs), including staking and reusing command results.
  • Queries: query owned objects, events, and transactions with the GraphQL client.

View more comprehensive examples in the official C# examples directory.