Datachain - IBC

QuantstampRepository at commit ca7a56c

Quantstamp reviewed Datachain (Datachain - IBC) on 21 Nov 2024: 8 findings, 0 critical; 7 marked fixed, 1 acknowledged.

No open critical findings
Open the reportOpen Datachain’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings13

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High015
Medium002
Low000

Marked Informational by the firm. Not counted as findings.

Informational`channelCloseConfirm()` Does Not Delete Upgrade Paths of the Channel Being ClosedAcknowledged

[The specs](https://github.com/cosmos/ibc/blob/499818e9c4b136029717a436a04af15113f4424f/spec/core/ics-004-channel-and-packet-semantics/README.md?plain=1#L588) describe that in `channelCloseConfirm()` any upgrade stored at the channel upgrade path should be deleted during this process, however there is no deletion taking place.

InformationalDeviations From ICS-SpecsAcknowledged

Below, we include a non-exhaustive list of all deviations from the ICS-Specs in the ibc-solidity implementatio. These deviations are not standalone issues, however we list these deviations for transparency for all future users of ibc-solidity. Many of these deviations are a result of the limitations of the Solidity language and the EVM environment, such as gas costs or transaction gas limits and are intentional design decisions made by the Datachain team. The team has documented these changes in the files at `docs/adr`. Overall, we note that ibc-solidity does not support multi-hop connections or for the `ORDERED_ALLOW_TIMEOUT` channel ordering mechanism, as described in the ICS-Specs. Therefore, all logic associated with that is not present in the ibc-solidity implementation. Deviations: - `authenticateCapability()` does not exist in the ibc-solidity implementation as a single function, as described in the ICS specs. Instead, the owner of the `IBCHandler` contract will invoke `bindPort()` to assign module address to given ports in the provable store of the `IBCHandler`. Then, throughout conneciton and channel handshakes, capabilities are authenticated through functions such as `IBCModuleManager.lookupModuleByPort()` and `lookupModuleByChannel()`, which proves there is a non-zero address mapped at the port or channel, showing that the module has been bound by an IBC admin, and the channel has been written. During handshakes, module callback functions such as `onRecvPacket()` will only be invoked on the module addresses assigned by the Admin. - `clientConnectionsPath()` providing a reverse mapping from clients to a set of connections is not included in the implementation. - This means, there is no way that `queryClientConnections()` can be implemented and this data will have to be queried using other methods. - `ConnectionEnd` structural deviation: - `delayPeriodBlocks` is not defined to be a field within a Connection. Instead, when this field is needed for message passing, it is calculated during the transaction, as a function of the `delayPeriodTime` and the `expectedTimePerBlock` which is configurable by the IBCHandler admin. - Further, the `ConnectionEnd` doesn't have fields like `counterPartyPrefix` and instead, these fields are defined within a counterparty data structure which is a field within the ConnectionEnd itself - `channelOpenInit()` & `channelOpenTry()` do not confirm that the generated `channelId` is not already stored, as specified in the specs. We recognize that a clash is highly unlikely, as there are 2^64 possible ids. However, a check like this is done in `connectionOpenInit()` and we recommend verifying that there is nothing stored at the generated id for thoroughness. - `emit RecvPacket()` does not include the Order and Connection fields as [specified in ICS-specs](https://github.com/cosmos/ibc/blob/499818e9c4b136029717a436a04af15113f4424f/spec/core/ics-004-channel-and-packet-semantics/README.md?plain=1#L879) - the `_writeAcknowledgement()` function is emitting an event that is missing the following fields, that are otherwise specified in the specs: - `timeoutHeight` - `timeoutTimestamp` - `packet.data` - `sendPacket()` does not check that the connection exists. However, since the connection is stored within the `Channel.Data` itself, and the channel's existence is confirmed, we see no major issue here and include this to note the discrepancy. - Specs allow for a packet to received more than once, with just an identical event being emitted, however, in the implementation, we cannot receive a packet more than once, and the transaction will revert. the Datachain team has already acknowledged this to be a design choice however we note here for thoroughness and transparency. - `counterpartyUpgradePaths()` are not written to the provable store

InformationalNot All Sequence Variables Are Stored in the Provable StoreFixed

The function `initializeSequences()` sets initial values in `channelStorage` for `nextSequenceSend`, `nextSequenceRecv`, and `nextSequenceAck`. However, only `nextSequenceRecv` is stored directly in the provable store: ``` getCommitments()[IBCCommitment.nextSequenceRecvCommitmentKey(portId, channelId)] = keccak256(abi.encodePacked((bytes8(uint64(1))))); ``` The [ICS-024 specification](https://github.com/cosmos/ibc/blob/47fea20d4d400e967721396092c6b43398c65d78/spec/core/ics-024-host-requirements/README.md#path-space) suggests that all three should be committed to the provable store.

InformationalPotential Arbitrary Calls in `updateClient()`Fixed

In `IBCClient.updateClient()`, there is the possibilitiy for a light client supporting arbitrary function calls, in the case where the call to `lc.routeUpdateClient()` were to return an unexpected function selector that would then be invoked on the Light Client itself. The Datachain team has already noted this situation in documentation ADR-001 however we include it here for clarity. There, they mention that this can be mitigated at the relayer level, by relayers including a whitelist of expected functions. Additionally, we trust that the light clients are implemented honestly to not support arbitrary calls.

InformationalValidator Does Not Check for Suggested Identifier Size RestrictionsFixed

The table in [ICS-024](https://github.com/cosmos/ibc/blob/47fea20d4d400e967721396092c6b43398c65d78/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators) suggests that a client identifier should be between 9-64 characters, however no such check occurs in `validateClientType()`. Note that `validatePortIdentifier()` does include checks for the suggested length.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (53)

  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCHostConfigurator.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IIBCConnection.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IIBCClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/OwnableUpgradeableIBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IIBCClientErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IBCModuleManager.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Channel.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Commitment.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IBCConnection.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IBCClientConnectionChannelHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IIBCHostConfigurator.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCHost.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/ILightClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/apps/commons/IBCChannelUpgradableModule.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IBCHeight.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/apps/commons/IBCAppBase.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCCommitment.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelPacketSendRecv.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannelUpgrade.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModuleUpgrade.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Client.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IBCClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/apps/commons/IIBCChannelUpgradableModule.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/GoogleProtobufAny.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/QBFT.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCSelfStateValidator.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannelErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/MockClient.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/IBCClientLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IIBCHostErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IIBCQuerier.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IIBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelPacketTimeout.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelHandshake.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannel.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/ProtoBufRuntime.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IBCConnectionLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCHostLib.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IIBCConnectionErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Connection.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/OwnableIBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModuleErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/03-connection/IBCConnectionSelfStateNoValidation.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModule.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/02-client/ILightClientErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/proto/Localhost.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IBCHandler.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IBCChannelUpgrade.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/26-router/IIBCModuleManager.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/04-channel/IIBCChannelUpgradeErrors.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/25-handler/IBCQuerier.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61
  • https://github.com/hyperledger-labs/yui-ibc-solidity/contracts/core/24-host/IBCStore.sol at commit ca7a56c85749b83d5fb35aae7cd7e0b07e655b61

Part of Datachain’s security record

Datachain
Audits7 audits by 1 firmLast audit Jul 2025, by Quantstamp.
Critical findingsNo open critical findingsAcross 7 reports.
Open Datachain’s security record

Security firm

Quantstamp

240 projects reviewed · 338 reports · latest Nov 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us