Skip to content

How Iroha works ‚Äč

To understand how Iroha operates, let's draw parallels between a blockchain and a computer. If the blockchain is the computer, then in this metaphor of ours the client binary (for example: iroha_client_cli) is the keyboard, the blockchain is the hard drive, and the Iroha peer software is the processor. Like a processor, Iroha accepts portable instructions that modify what's written to the blockchain, allow certain users to use the network, and lock others out.

Any operation that is run on-chain is written in terms of Iroha Special Instructions (ISI), and there is no other way of modifying the world state.

Each interaction with the blockchain is done via a transaction. A transaction is a collection of instructions, which are either glued together in sequence or compiled into what we affectionately call a WASM blob. You need these instructions to register an account, remove an account, add X amount of Y currency, and so on.

To read the information encoded in the blocks of a blockchain (the current world state), you use queries. Queries are submitted like instructions, but they're not tracked and recorded in blocks, so they're much more lightweight. If you use queries as part of complicated logic (e.g. inside WASM), they have a non-negligible impact on the size of the blocks. Queries that are only used to get information leave no trace in the blockchain.