自定义认证
相较于传统的公钥/私钥签名方式,Interchain Accounts 也可以关联其他类型的认证机制。 如果你希望在使用自定义认证模块的情况下开发或使用 Interchain Accounts,且不需要在数据包回调中执行自定义逻辑,我们建议使用 ibc-go v6 或更高版本,并让你的自定义认证模块通过MsgServer 与 controller 子模块交互。
如果你希望在数据包回调中接收并执行自定义逻辑,请阅读下方的数据包回调部分。
重定向到智能合约
允许智能合约控制一个跨链账户可能是有价值的。 为支持这种操作,可以为 controller 子模块提供一个底层应用,用于将请求重定向到智能合约调用方。 ADR 008 提出了一个更完善的设计,通过中间件来实现这一能力。 建议此类用例的实现者采用 ADR 008 的方式。 在 ADR 008 场景下,底层应用仍可继续作为短期解决方案使用,并且在这种情况下应继续使用旧版 API。数据包回调
如果开发者的用例需要访问数据包回调,则可以选择以下方案:- 编写一个通过 ADR 008 或等效 IBC 应用连接的智能合约(推荐)。
- 使用 controller 的底层应用来实现数据包回调逻辑。
MsgServer。
在第二种情况下,底层应用应使用旧版 API。
The initial version of Interchain Accounts allowed for the controller submodule to be extended by providing it with an underlying application which would handle all packet callbacks. That functionality is now being deprecated in favor of alternative approaches. This document will outline potential use cases and redirect each use case to the appropriate documentation.
Custom authentication
Interchain accounts may be associated with alternative types of authentication relative to the traditional public/private key signing. If you wish to develop or use Interchain Accounts with a custom authentication module and do not need to execute custom logic on the packet callbacks, we recommend you use ibc-go v6 or greater and that your custom authentication module interacts with the controller submodule via theMsgServer.
If you wish to consume and execute custom logic in the packet callbacks, then please read the section Packet callbacks below.
Redirection to a smart contract
It may be desirable to allow smart contracts to control an interchain account. To facilitate such an action, the controller submodule may be provided an underlying application which redirects to smart contract callers. An improved design has been suggested in ADR 008 which performs this action via middleware. Implementers of this use case are recommended to follow the ADR 008 approach. The underlying application may continue to be used as a short term solution for ADR 008 and the legacy API should continue to be utilized in such situations.Packet callbacks
If a developer requires access to packet callbacks for their use case, then they have the following options:- Write a smart contract which is connected via an ADR 008 or equivalent IBC application (recommended).
- Use the controller’s underlying application to implement packet callback logic.
MsgServer.
In the second case, the underlying application should use the legacy API.