This paper defines the implementation of the IBC protocol on the Cosmos SDK, the changes made to the specification and where to find each specific ICS spec within the module.
For the general specification please refer to the Interchain Standards.
# Implementation Details
As stated above, the IBC implementation on the Cosmos SDK introduces some changes
to the general specification, in order to avoid code duplication and to take
advantage of the SDK architectural components such as the
transaction routing through
# Interchain Standards reference
The following list is a mapping from each Interchain Standard to their implementation
in the SDK's
- ICS 002 - Client Semantics: Implemented in
- ICS 003 - Connection Semantics: Implemented in
- ICS 004 - Channel and Packet Semantics: Implemented in
- ICS 005 - Port Allocation: Implemented in
- ICS 006 - Solo Machine Client: Implemented in
- ICS 007 - Tendermint Client: Implemented in
- ICS 009 - Loopback Client: Implemented in
- ICS 018- Relayer Algorithms: Implemented in it's own relayer repository
- ICS 020 - Fungible Token Transfer: Implemented in
- ICS 023 - Vector Commitments: Implemented in
- ICS 024 - Host Requirements: Implemented in
- ICS 025 - Handler Interface: Handler interfaces are implemented at the top level in
x/ibc/handler.go, which call each ICS submodule's handlers (i.e
- ICS 026 - Routing Module: Replaced by ADR 15 - IBC Packet Receiver.
# Architecture Decision Records (ADR)
The following ADR provide the design and architecture decision of IBC-related components.
- ADR 10 - Modular AnteHandler: Introduces a decorator pattern for the
AnteHandler, making it modular.
- ADR 15 - IBC Packet Receiver: replaces the ICS26 routing module with
AnteHandlerlogic within IBC. This is implemented using the
AnteDecoratorsdefined in ADR10
- ADR 17 - Historical Header Module: Introduces the ability to introspect past consensus states in order to verify their membership in the counterparty clients.
- ADR 19 - Protobuf State Encoding: Migration from Amino to Protobuf for state encoding.
- ADR 020 - Protocol Buffer Transaction Encoding: Client side migration to Protobuf.
- ADR 021 - Protocol Buffer Query Encoding: Queries migration to Protobuf.
# SDK Modules
x/capability: The capability module provides object-capability keys support through scoped keepers in order to authenticate usage of ports or channels. Check ADR 3 - Dynamic Capability Store for more details.
x/evidence: The evidence module provides the interfaces and client logic to handle light client misbehaviour. Check ADR 09 - Evidence Module for more details.
# IBC module architecture
NOTE for auditors: If you're not familiar with the overall module structure from the SDK modules, please check this document as prerequisite reading.
For ease of auditing, every Interchain Standard has been developed in its own
package. The development team separated the IBC TAO (Transport, Authentication, Ordering) ICS specifications from the IBC application level
specification. The following tree describes the architecture of the directories that
ibc (TAO) and
ibc-transfer (ICS20) modules: