Skip to main content
Version: IOTA

Generate Addresses

Example Seed

The examples use an example seed b3d7092195c36d47133ff786d4b0a1ef2ee6a0052f6e87b6dc337935c70c531e that is stored in an environment variable called IOTA_SEED_SECRET. This seed serves for training purposes only.

You can generate an IOTA address using the GetAddressesBuilder helper class and calling the GetAddressesBuilder::from(seed: &str) function and respective chaining calls that will return a list of tuples with the generated addresses. You can find more information on the parameters in the Address/Key Space section.

The whole process is deterministic. This means the output is the same as long as the seed is the same:

public static void generateAddresses() {
try {
Client iota = node();

String seed = RustHex.encode("NONSECURE_USE_OF_DEVELOPMENT_SEED_1");
String[] addresses = GetAddressesBuilder.from(seed).withClient(iota).withRange(0, 10).finish();
} catch (ClientException e) {
System.out.println("Error: " + e.getMessage());

Output example:


IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the Chrysalis documentations, but here are parts relevant to this example:

  • If an address starts with atoi then it means it is related to devnet. iota stands for mainnet.
  • Number 1 at the 5th position is just a separator.
  • The last 6 characters are reserved for a checksum.

Addresses can be also represented in a hex format using the Client.bech32ToHex(bech32) function.

If you want to quickly validate any IOTA address, you can use the Client.isAddressValid() function that returns a bool value. You should perform a sanity check on address before using it.