Skip to main content

Interactions

Overview

What's an Interaction?

A MOI Interaction refers to any kind of action between participants on the MOI network. It results in a state change on the respective accounts of the interaction participants. For example, if Bob were to send Alice 1 unit of an asset, that asset must be deducted from Bob's balance and credited to Alice; this is known as an Asset Transfer which is facilitated through AssetAction.

Other examples of Interactions in MOI include:

  • The creation of a new participant account
  • The configuration of account keys
  • The creation of a new Asset
  • The transfer of one or more existing Assets between participants
  • The minting/burning of an existing supply adjustable Asset
  • The registration and staking of Guardians
  • The deployment of a new Logic
  • The invocation of a routine on an existing Logic

Just like Transactions in other blockchain networks, Interactions in MOI need to be broadcast to the whole network, and all Guardian nodes in the network compete to finalize them. Any node can attempt to finalize an Interaction by successfully locking the context of the Interaction participants, executing the Interaction and finalizing the state transitions on the participants. Interactions require a fee for the cost incurred by the network to validate & execute them.

Interaction vs Transaction

The primary difference between Interactions in MOI and Transactions in other blockchain protocols is the degree of general-purpose capability and flexibility.

  • An Interaction intrinsically describes unique state transitions based on its type, and thus it is very easy to optimize consensus and design specific zk-proofs for these Interactions because the scope of the state transition is limited.
  • A Transaction, on the other hand, is designed to be a general-purpose wrapper and has a very large scope of state transition, thus limiting the ability of the network to perform advanced validation and other optimisations without relying on the operation execution layer.
  • While Interactions are designed to express transitions between participants, Transactions are intended to express transitions between network state checkpoints and hence better at expressing units of transition on a large-scale peer-to-peer network.
  • Interactions are also capable of being highly customizable with participants being able to choose the parameters and constraints within which they are finalized, allowing for a very flexible modulation of trust.

Structure of an Interaction

ParameterTypeDescription
senderSenderObject containing details of the interaction sender
payerHEX (32 Bytes)Unique identifier of the payer [optional]
fuel_priceHEXFuel price per unit
fuel_limitHEXMaximum fuel to consume
fundsArray<IxFund>List of fund transfers attached to the interaction [optional]
ix_operationsArray<IxOperation>List of one or more interaction operations (1–3 max)
participantsArray<Participant>List of participants involved in the interaction, each defining locking behavior and notary status
preferencesIxPreferencesDefines the compute and consensus preferences for the interaction [optional]
perceptionBytesEncoded representation of the perceived asset value at the time of interaction (e.g., 1 KMOI = 1 USD) [optional]

Sender

The Sender object represents the participant initiating the interaction.

FieldTypeDescription
idHEX (32 Bytes)Unique identifier of the sender
sequence_idNumberSequential identifier used for ordering interactions
key_idNumberIdentifier representing the public key associated with the sender

IxFund

The IxFund object represents a fund transfer attached to the interaction.

FieldTypeDescription
asset_idHEX (32 Bytes)Asset identifier for the fund
amountHEXAmount of the asset being transferred

IxPreferences

The IxPreferences object defines the preferences used for interaction execution, covering compute and consensus behavior.

FieldTypeDescription
computeBytesEncoded data representing compute preferences
consensusIxConsensusPreferenceObject containing consensus-specific preferences for the interaction

IxConsensusPreference

The IxConsensusPreference object defines the consensus-related preferences for an interaction.

FieldTypeDescription
MTQuintModulated trust quotient required for the interaction to be considered valid
TrustNodesArray\<KramaID>List of trusted node identifiers (KramaID) that participate in consensus

Participants and Locking

Participant

The Participant object represents a participant involved in the interaction.

FieldTypeDescription
idHEX (32 Bytes)Unique identifier representing the participant
lock_typeLockTypeDefines the locking mechanism used for the participant's account
notaryBooleanIndicates whether the participant acts as a notary in the interaction

The sender of an interaction is implicitly included as a participant. Additional participants are determined by the interaction type — for example, an AssetAction transfer requires the beneficiary as a participant, and a LogicInvoke requires the logic account as a participant.

LockType

Specifies the type of lock applied to a participant's account during interaction execution.

ValueNameDescription
0MutateLockAllows modification of the participant's account state
1ReadLockGrants read-only access to the participant's account
2NoLockNo locking mechanism; the participant's account remains unaffected

Interaction Types

Each ix_operation within an interaction carries a type field that identifies the kind of interaction being performed, along with a type-specific payload.

TypeNameCategory
1ParticipantCreateAccount
2AccountConfigureAccount
3AccountInheritAccount
4AssetCreateAsset
5AssetActionAsset
6GuardianRegisterGuardian
7GuardianStakeGuardian
8GuardianUnstakeGuardian
9GuardianWithdrawGuardian
10GuardianClaimGuardian
11LogicDeployLogic
12LogicInvokeLogic
13LogicEnlistLogic
14LogicInteractLogic (reserved)
15LogicUpgradeLogic (reserved)

ParticipantCreate

Registers a new participant within the network, establishing their unique identity. It serves as the entry point to interact with the network.

ParticipantCreateOperation

ParameterTypeDescription
typeNUMBERType of interaction (1 for ParticipantCreate)
payloadParticipantCreatePayloadContains the information about the participant to be registered

ParticipantCreatePayload

ParameterTypeDescription
idHEX (32 Bytes)Id of the participant to be registered
addArray<KeyAddPayload>List of new keys to be added to the account
valueAssetActionPayloadOptional payload defining contextual parameters or initialization actions
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 0,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 1,
"payload": {
"id": "0x000000004678e9f5bf2f66362ef5367fbc72efe7b419a5e7d851f57b00000000",
"keys_payload": [
{
"public_key": "0x00000000513b40a069905a1b05bd28d8338ad4a2eff419d7972be75900000000",
"weight": 1000,
"signature_algorithm": 0
}
],
"value": {
"asset_id": "0x108000004cd973c4eb83cdb8870c0de209736270491b7acc99873da100000000",
"callsite": "Transfer",
"calldata": "0x0d6f06659601c502616d6f756e7403138862656e65666963696172790600000000513b40a069905a1b05bd28d8338ad4a2eff419d7972be75900000000"
}
}
}
],
"participants": [
{
"id": "0x108000004cd973c4eb83cdb8870c0de209736270491b7acc99873da100000000",
"lock_type": 2
}
]
}

AccountConfigure

Manages an account's configuration by enabling the addition or revocation of associated cryptographic keys. It ensures that account control and permissions remain flexible and securely maintained over time.

AccountConfigureOperation

ParameterTypeDescription
typeNUMBERType of interaction (2 for AccountConfigure)
payloadAccountConfigurePayloadContains the key management details for account configuration

AccountConfigurePayload

ParameterTypeDescription
addArray<KeyAddPayload>List of new keys to be added to the account
revokeArray<KeyRevokePayload>List of existing keys to be revoked

KeyAddPayload

ParameterTypeDescription
public_keyBYTESPublic key of the account key to be added
weightNUMBERThe weight assigned to the key for multi-signature operations
signature_algorithmNUMBERThe signature algorithm type used by the key

KeyRevokePayload

ParameterTypeDescription
key_idNUMBERThe unique identifier of the key to revoke
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 1,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 2,
"payload": {
"add": [
{
"public_key": "0x000000004678e9f5bf2f66362ef5367fbc72efe7b419a5e7d851f57b00000000",
"weight": 1000,
"signature_algorithm": 0
}
],
"revoke": []
}
}
],
"participants": []
}

AccountInherit

Allows an account to inherit the context or configuration of a specified target account. It is primarily used to instantiate sub-accounts that operate under shared governance or predefined parameters.

AccountInheritOperation

ParameterTypeDescription
typeNUMBERType of interaction (3 for AccountInherit)
payloadAccountInheritPayloadContains information about the inheritance process

AccountInheritPayload

ParameterTypeDescription
target_accountHEX (32 Bytes)The account identifier whose context or configuration will be inherited
valueAssetActionPayloadOptional payload defining contextual parameters or initialization actions
sub_account_indexNUMBERThe index of the sub-account inheriting from the target account
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 2,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 3,
"payload": {
"target_account": "0x20800000a6ba9853f131679d00da0f033516a2efe9cd53c3d54e1f9a00000000",
"value": {
"asset_id": "0x108000004cd973c4eb83cdb8870c0de209736270491b7acc99873da100000000",
"callsite": "Transfer",
"calldata": "0x0d6f06659601c502616d6f756e7403138862656e65666963696172790600000000513b40a069905a1b05bd28d8338ad4a2eff419d7972be75900000000"
},
"sub_account_index": 0
}
}
],
"participants": [
{
"id": "0x108000004cd973c4eb83cdb8870c0de209736270491b7acc99873da100000000",
"lock_type": 2
}
]
}

AssetCreate

Defines and registers a new asset within the Tesseract Lattice. It establishes the foundational metadata, ownership structure, and initial state of the asset.

AssetCreateOperation

ParameterTypeDescription
typeNUMBERType of interaction (4 for AssetCreate)
payloadAssetCreatePayloadContains the information about the asset to be created

AssetCreatePayload

ParameterTypeDescription
symbolSTRINGSymbol of the asset (e.g., KOI)
max_supplyNUMBERMaximum supply of the asset (e.g., 20000)
standardNUMBERStandard of the asset (e.g., 0)
dimensionNUMBERDimension or type classification of the asset (e.g., 0)
enable_eventsBOOLEANWhether events are enabled for the asset
managerSTRINGParticipant id of the asset manager

AssetCreateResult

ParameterTypeDescription
asset_idHEX (32 Bytes)Asset ID of created asset
idHEX (32 Bytes)Account id of asset
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 4,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 4,
"payload": {
"symbol": "KOI",
"max_supply": 20000,
"standard": 0,
"dimension": 0,
"enable_events": true,
"manager": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000"
}
}
],
"participants": []
}

AssetAction

Executes asset-specific routines. It encompasses a wide range of programmable asset behaviors, including transfers, minting, burning, approvals, locking, and other custom interactions defined within the asset logic.

AssetActionOperation

ParameterTypeDescription
typeNUMBERType of interaction (5 for AssetAction)
payloadAssetActionPayloadContains the information about the asset action to execute

AssetActionPayload

ParameterTypeDescription
asset_idHEX (32 Bytes)The asset or context reference identifier
callsiteSTRINGThe function or entry point to invoke on the asset
calldataHEXEncoded call data representing contextual parameters
interfacesmap[HEX]HEX (32 Bytes)The external logic interfaces required for this interaction
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 7,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 5,
"payload": {
"asset_id": "0x10030000d9f12d13c0347a737430cdbcca174164f0823ccc39bedbe800000000",
"callsite": "Transfer",
"calldata": "0x0d6f06659601c502616d6f756e7403138862656e65666963696172790600000000ed434a2ab138e69295e134686d57d80a9aa3325dbbde9bbf00000000"
}
}
],
"participants": [
{
"id": "0x00000000ed434a2ab138e69295e134686d57d80a9aa3325dbbde9bbf00000000",
"lock_type": 0
},
{
"id": "0x10030000d9f12d13c0347a737430cdbcca174164f0823ccc39bedbe800000000",
"lock_type": 2
}
]
}

GuardianRegister

Registers a new Guardian node on the MOI network, allowing it to participate in consensus and interaction finalization.

GuardianRegisterOperation

ParameterTypeDescription
typeNUMBERType of interaction (6 for GuardianRegister)
payloadGuardianRegisterPayloadContains the registration details for the Guardian

GuardianRegisterPayload

ParameterTypeDescription
krama_idKramaIDUnique identifier for the Guardian node
wallet_idHEX (32 Bytes)Wallet identifier associated with the Guardian
consensus_keyBYTESConsensus public key for the Guardian
kyc_proofBYTESKYC proof for Guardian verification
amountHEXAmount to stake during registration
Guardian-specific examples will be provided in a future update.

GuardianStake

Adds additional stake to an already registered Guardian node.

GuardianStakeOperation

ParameterTypeDescription
typeNUMBERType of interaction (7 for GuardianStake)
payloadGuardianActionPayloadContains the staking details

GuardianUnstake

Initiates the unstaking process for a Guardian node, beginning the withdrawal period.

GuardianUnstakeOperation

ParameterTypeDescription
typeNUMBERType of interaction (8 for GuardianUnstake)
payloadGuardianActionPayloadContains the unstaking details

GuardianWithdraw

Withdraws previously unstaked funds after the withdrawal period has elapsed.

GuardianWithdrawOperation

ParameterTypeDescription
typeNUMBERType of interaction (9 for GuardianWithdraw)
payloadGuardianActionPayloadContains the withdrawal details

GuardianClaim

Claims Guardian rewards accrued through network participation.

GuardianClaimOperation

ParameterTypeDescription
typeNUMBERType of interaction (10 for GuardianClaim)
payloadGuardianActionPayloadContains the claim details

GuardianActionPayload

Shared payload structure for GuardianStake, GuardianUnstake, GuardianWithdraw, and GuardianClaim.

ParameterTypeDescription
krama_idKramaIDUnique identifier for the Guardian node
amountHEXAmount relevant to the action

LogicDeploy

Deploys a new logic instance to the network for decentralized execution. It enables the registration of custom routines or smart modules that can be invoked by participants.

LogicDeployOperation

ParameterTypeDescription
typeNUMBERType of interaction (11 for LogicDeploy)
payloadLogicDeployPayloadContains the information about the logic to be deployed

LogicDeployPayload

ParameterTypeDescription
manifestHEXSerialized manifest
callsiteSTRINGRoutine to be executed
calldataHEXSerialized input for logic deploy

LogicDeployResult

ParameterTypeDescription
logic_idHEX (32 Bytes)Logic ID of deployed Logic
errorHEXSerialised error data if deployer execution fails
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 8,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 11,
"payload": {
"manifest": "0x0e6f031ef601ce02...",
"callsite": "Seeder",
"calldata": "0x0def0106458601e501f605d506a60785..."
}
}
],
"participants": []
}

LogicInvoke

Triggers the execution of a predefined routine within a deployed logic instance. It allows participants to invoke specific routines within the deployed logic modules on the network.

LogicInvokeOperation

ParameterTypeDescription
typeNUMBERType of interaction (12 for LogicInvoke)
payloadLogicInvokePayloadContains the information about the specific routine to invoke

LogicInvokePayload

ParameterTypeDescription
logic_idHEX (32 Bytes)The unique identifier of the logic that needs to be invoked
callsiteSTRINGRoutine to be executed
calldataHEXSerialised input for logic execution

LogicInvokeResult

ParameterTypeDescription
outputsHEXSerialised output of logic execution
errorHEXSerialised error data if logic execution failed
{
"sender": {
"id": "0x000000001ec28dabfc3e4ac4dfc2084b45785b5e9cf1287b63a4f46900000000",
"sequence": 9,
"key_id": 0
},
"fuel_price": 1,
"fuel_limit": 10000,
"ix_operations": [
{
"type": 12,
"payload": {
"logic_id": "0x0800008d898ef91ebd8a208855d6d1c98939202cfcb6a067530845993fe6975de1eb84",
"callsite": "BalanceOf",
"calldata": "0x0d2f0645616464720652fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"
}
}
],
"participants": [
{
"id": "0x0800008d898ef91ebd8a208855d6d1c98939202cfcb6a067530845993fe6975de1eb84",
"lock_type": 1
}
]
}

LogicEnlist

Enlists a logic instance for extended network participation. This enables logic modules to be discovered and interacted with across broader network contexts.

LogicEnlistOperation

ParameterTypeDescription
typeNUMBERType of interaction (13 for LogicEnlist)
payloadLogicEnlistPayloadContains the information about the logic to be enlisted

LogicEnlistPayload

ParameterTypeDescription
logic_idHEX (32 Bytes)The unique identifier of the logic to be enlisted
callsiteSTRINGRoutine to be executed
calldataHEXSerialised input for enlistment

Future Interaction Types

The following interaction types are defined but not yet active:

  • LogicInteract (14) — Reserved for cross-logic interaction capabilities.
  • LogicUpgrade (15) — Reserved for upgrading deployed logic instances.

Additional interaction types for native fuel management, governance, and voting are planned for future rollouts.

Execution Fuel

The fuel parameters fuel_price and fuel_limit in the Interaction determine the fuel dynamics and cost of that Interaction. Fuel is paid for with the KMOI asset.

  • Price adjustment of an Interaction is not supported for the Public Devnet, i.e., the fuel_price of an Interaction must always be 0x1 [1 fuel unit = 1 KMOI]. Any other value for this field will result in the Interaction being rejected by the network.
  • The account of the Interaction sender must have sufficient balance of KMOI for the specified fuel_limit of an Interaction. The total cost is calculated as: FuelPrice × FuelLimit + KMOITokenValue.
  • The fuel_limit value must be large enough for the cost of the Interaction execution (based on the Interaction type). For LogicInvoke, additional fuel will be charged based on code execution of the Logic.

Base Fuel Costs

Interaction TypeBase Fuel
ParticipantCreate100
AccountConfigure100
AccountInherit100
AssetCreate100
AssetAction (Transfer)100
AssetAction (Mint)100
AssetAction (Burn)100
AssetAction (Approve)100
AssetAction (Revoke)100
AssetAction (Release)100
AssetAction (Lockup)100
GuardianRegister100
GuardianStake100
GuardianUnstake100
GuardianWithdraw100
GuardianClaim100
LogicDeploy100

For more information about Execution Fuel and KMOI in MOI, refer to Execution Fuel.

Interaction Lifecycle

Once an Interaction has been submitted to the network, the following happens:

  1. An interaction hash is cryptographically generated: 0x43d99bc7729218611a21b12c933c949d4f31684f1d6954ff417d0477538ff032
  2. The interaction is broadcast to the entire network and is added to the interaction pool consisting of other pending network interactions.
  3. Guardians will then attempt to finalize this Interaction (and other Interactions with the same context lock) by forming an ICS (Interaction Consensus Set) Cluster around it. The formation of this cluster indicates the successful locking on the context states of the interaction participants.
  4. Once the ICS is formed, all Guardians in the cluster will execute the Interactions, verify each other's execution, update the participant contexts and agree on the state transition for each of the interaction participants. Once consensus is reached, the Interactions are bundled into a Tesseract for each participant and added to their respective participant Lattices.
  5. Each Interaction when included in a Tesseract is bundled with an Interaction Receipt containing the proof and output of the Interaction. This receipt can be retrieved using the interaction hash.
  6. After successfully transitioning the context state of the interaction participants, the updated state is propagated to the rest of the network and the ICS cluster is dismissed.

At any point in time, millions of Interactions can be finalized in parallel across multiple ICS Clusters around the network that are being dynamically assembled and dismissed based on the context of the Interaction and its Participants.

Interaction Receipt

Every finalized Interaction produces a receipt that can be queried using the interaction hash via the moi.InteractionReceipt API.

Receipt Structure

FieldTypeDescription
ix_hashHEX (32 Bytes)Hash of the interaction
statusReceiptStatusOverall execution status
fuel_usedHEXActual fuel consumed during execution
ix_operationsArray<IxOpResult>Per-operation results
fromHEX (32 Bytes)Sender address
ts_hashHEX (32 Bytes)Tesseract hash the interaction was included in
participantsArrayPost-execution participant states

Receipt Status Codes

ValueNameDescription
0ReceiptOkInteraction executed successfully
1ReceiptStateRevertedExecution caused a state revert
2ReceiptInsufficientFuelInteraction ran out of fuel during execution

Interaction Type Result

Each interaction type within an interaction produces an individual result.

FieldTypeDescription
ix_typeNUMBERThe interaction type that produced this result
statusIxOpStatusExecution status for this specific operation
dataJSONType-specific result data (see each interaction type)
logsArrayLogs emitted during execution

Interaction Type Result Status Codes

ValueNameDescription
0ResultOkOperation executed successfully
1ResultExceptionRaisedAn exception was raised during execution
2ResultDefectRaisedA defect was raised during execution

Validation Constraints

Interactions must satisfy the following constraints to be accepted by the network:

ConstraintValue
Maximum operations per interaction3
Maximum AssetCreate per interaction1
Maximum LogicDeploy per interaction1
Maximum interaction size128 KB
Minimum key weight (ParticipantCreate)1000
Fuel price (Public Devnet)Must be 1
SenderMust not be nil; must not be the genesis account
Sequence IDMust be >= the next expected sequence for the sender
Sender balanceMust have sufficient KMOI to cover total cost
ParticipantsAll non-genesis participants must be registered on the network
SignaturesMust be valid for the sender's registered keys

Packages & SDKs

  • JS MOI SDK — JavaScript/TypeScript library to interact with the MOI Protocol: submit interactions, deploy and invoke logics, and manage participants and assets.
  • JS POLO — JavaScript/TypeScript implementation of the POLO serialization scheme used by MOI.
  • GO POLO — Go implementation of the POLO serialization scheme.
  • Cocolang — Language and toolchain for writing Coco modules (logics), compiling them, and testing with CocoLab.