Skip to main content

Synopsis

Learn how to integrate Interchain Accounts host and controller functionality to your chain. The following document only applies for Cosmos SDK chains. The Interchain Accounts module contains two submodules. Each submodule has its own IBC application. The Interchain Accounts module should be registered as an AppModule in the same way all SDK modules are registered on a chain, but each submodule should create its own IBCModule as necessary. A route should be added to the IBC router for each submodule which will be used. Chains who wish to support ICS-27 may elect to act as a host chain, a controller chain or both. Disabling host or controller functionality may be done statically by excluding the host or controller submodule entirely from the app.go file or it may be done dynamically by taking advantage of the on-chain parameters which enable or disable the host or controller submodules. Interchain Account authentication modules (both custom or generic, such as the x/gov or x/auth Cosmos SDK modules) can send messages to the controller submodule’s MsgServer to register interchain accounts and send packets to the interchain account. To accomplish this, the authentication module needs to be composed with baseapp’s MsgServiceRouter. ica-v6.png

Example integration

If no custom athentication module is needed and a generic Cosmos SDK authentication module can be used, then from the sample integration code above all references to ICAAuthKeeper and icaAuthModule can be removed. That’s it, the following code would not be needed:

Using submodules exclusively

As described above, the Interchain Accounts application module is structured to support the ability of exclusively enabling controller or host functionality. This can be achieved by simply omitting either controller or host Keeper from the Interchain Accounts NewAppModule constructor function, and mounting only the desired submodule via the IBCRouter. Alternatively, submodules can be enabled and disabled dynamically using on-chain parameters. The following snippets show basic examples of statically disabling submodules using app.go.

Disabling controller chain functionality

Disabling host chain functionality