IOTA Rebased

unofficial site

- return to IOTA Rebased Useful Links

Getting Started with the IOTA Rebased CLI

Quick notes on this essential tool for building and deploying IOTA Rebased Smart Contracts. Please use with caution and always check anything important with the very good official IOTA help.

[A] Installing the IOTA Rebased CLI onto a new Macbook

December 2024. This method has many missing steps and is a personal note. You should definitely refer back to the official IOTA Rebased Blog - see Useful Links page.

[1] Install 'homebrew'
to check version: brew --version
At Oct 30th 2025 I have: Homebrew 4.6.19

[2] Install Rust and Cargo
to check version: rustc --version AND cargo --version
At Oct 30th 2025 I have: rustc 1.90.0 (1159e78c4 2025-09-14) AND cargo 1.90.0 (840b83a10 2025-07-30)

[3] As at 29 Oct 2025 the terminal command that worked on my Macbook to update the CLI was:
cargo install --locked --git https://github.com/iotaledger/iota.git --branch mainnet iota

giving: Installed package `iota v1.9.2 (https://github.com/iotaledger/iota.git?branch=mainnet#6fadba1a)` (executable `iota`)

[4] iota --version
At Oct 30th 2025 I have: iota 1.9.2-6fadba1a7908

[B] Preparing the CLI

[1] Use: % iota client envs
This may show a result like this if you have used it before: testnet │ https://api.testnet.iota.cafe

You can add mainnet with: % iota client new-env --alias=mainnet --rpc https://api.mainnet.iota.cafe:443

and switch to it with: % iota client switch --env mainnet

[2] In order to use the CLI to act on an existing IOTA address you need to add its key to the IOTA CLI Keystore. Here is the command showing the options.
Use: % iota keytool import --help

[3] To generate a completely new keypair start with:
% iota keytool generate --help

[C] IOTA Address to Coin structure

One fundamental idea is that an IOTA address can own many coins as shown in the extract below. This is the CLI command:

Not sure what your address is?


          % iota client addresses
          

Have more than one address and wish to switch between them?


        % iota client switch --address goofy-amber
        

This is how to see the balance of your address, including the specific coinIDs associated with it.


          % iota client balance --with-coins
         

This is an extract from a typical listing, in this case from Mainnet. The address 2 coins, one created by the split-coin method explained lower down the page.


           Balance of coins owned by this address  
                                                         
      ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ 
      │ IOTA: 2 coins, Balance: 1296039200 (1.29 IOTA IOTA)                                            │ 
      ├────────────────────────────────────────────────────────────────────────────────────────────────┤ 
      │ coinId                                                              balance (raw)  balance     │ 
      ├────────────────────────────────────────────────────────────────────────────────────────────────┤ 
      │ 0x6fd2fa0b0432f3535e174fad6151760448fc365dd95fcdc16ddbc7c361e917e7  1266039200     1.26 IOTA   │ 
      │ 0xeabe4b72dfe2607fd6cdcc15d6b59847d72bdee7d2f46ff79eabbd1256c6c6d3  30000000       0.03 IOTA   │ 
      ╰────────────────────────────────────────────────────────────────────────────────────────────────╯                           

So if you were to simply ask for the balance of this address you would get 1.29 Iota. You can also enter the coinId into the Iota Explorer for its details as follows: Coin object seen in Iota Explorer.

[C] Merging and Splitting IOTA Coins

If in doubt:


         % iota client help
        

When you transfer an amount of IOTA elsewhere then you are actually transferring ownership of one or more coins. if there isn't already one for the correct value at the sending address, you usually use the transfer command that creates one for you automatically.

On the CLI you can also merge or split iota coins yourself until you have one of the desired size.

For example, this is how to SPLIT A COIN, leading to a new coin with value 0.03 IOTA (tested Oct 2025).


         % iota client split-coin \
        --coin-id 0x6fd2fa0b0432f3535e174fad6151760448fc365dd95fcdc16ddbc7c361e917e7 \
        --amounts 30000000
        

This will do all of the work of selecting and splitting coins as necessary (tested Oct 2025).


        iota client pay-iota \
        --recipients 0xda5f052f5d98d7d6bdbeaff2df40acd1ff7e7e48368de591870d542e2e8eaf48 \
        --amounts 700000000
         

Please see other pages on this site for CLI calls to contracts etc.