Skip to main content

Getting Started with Go

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 Go bindings allow you to build high-performance applications that interact with the IOTA network using native Go code. These bindings wrap the core Rust SDK via a Foreign Function Interface (FFI).

Prerequisites

Before using the Go bindings, ensure you have:

  • Go: Version 1.21 or higher.
  • CGO: Enabled (required for the Rust-to-Go FFI layer).

Installation

Add the IOTA SDK to your Go project using go get:

go get github.com/iotaledger/iota-sdk-go

The package automatically includes pre-built native libraries for most modern operating systems (Windows, macOS, and Linux).

Quick Start Example

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

1. Create a main.go file

Create a new file named main.go and paste the following code:

bindings/go/examples/chain_id/main.go
loading...

2. Run the code

In your terminal, run:

go run main.go

What's Next?

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

  • Check Balances: Learn how to query coin balances for a specific address.
  • Transactions: Build and sign Programmable Transaction Blocks (PTBs).
  • Key Management: Use the SDK to generate and manage IOTA addresses.

View more comprehensive examples in the official Go examples directory.