Skip to content
Cosmopediaby Unity Nodes
DiscussionsConversationML-DSA-65 support for IBC relaying in HermesForum ↗

ML-DSA-65 support for IBC relaying in Hermes

Conversation6 posts80 views2 likesLast activity 18h ago
FE
fengfengOP
3d ago

Hi, I’m working on ML-DSA-65 compatibility for IBC. When a chain adopts ML-DSA-65 validator keys, the counterparty light client needs to verify those signatures, and Hermes needs to process the signed headers and validator sets to keep relaying packets. Could a Hermes maintainer review the dependency approach in #4437 ? I’ve tested a `tendermint-rs` `0.40.4` backport. Would a published `0.40.x` backport work for Hermes, or should the dependencies be aligned on `0.41` first? I’d also appreciate help approving CI for the three PRs. • #4437 adds CometBFT 0.40 RPC detection, ML-DSA-65 validator key decoding, and commit signature verification. • #4438 adds ML-DSA-65 transaction signing for relayer accounts, configurable per chain. • #4436 fixes an independent account sequence bug found during testing. The patch advances the cached sequence after a successful retry. The experiment used two local test networks, one running Dora Vota and the other running Osmosis. After the Dora Vota validators rotated to ML-DSA-65, transfers settled in both directions on a new channel and on the original channel. The source chains confirmed all acknowledgements. In a separate run, all four…

Excerpt (1197 of 1460 characters). Read the whole post on the forum ↗

ZE
Zealynx
3d ago 1

@fengfeng this closes the gap I wrote up in One validator switching to ML-DSA keys can stop old IBC clients of its chain, where tendermint-rs had no ML-DSA key type, so Hermes, ibc-rs and the Rust light clients couldn’t follow a chain whose validators rotate. The patch in #4437 verifies with fips204’s ML-DSA-65 and an empty context, which is what CometBFT signs.

Misbehaviour is worth its own vector. In 07-tendermint it goes through VerifyCommitLightTrusting on each of the two conflicting headers, while the Osmosis test in #9837 covers a MsgUpdateClient and VerifyCommitLight. Freezing the client on a double sign is what protects the channel, so a test where two ML-DSA-65 headers at the same height freeze the client would cover it.

Size is the other limit. With 1,952-byte keys and 3,309-byte signatures a header is about 7.2 KB per validator, so somewhere near 145 validators a single update passes the 1 MB a CometBFT mempool accepts per transaction by default, and Hermes’ max_tx_size sits in the same path. Worth one run at Dora Vota’s real set size.

FE
fengfeng
3d ago

@Zealynx Thanks for the feedback! Your earlier post raises some important points about ML-DSA compatibility across the Cosmos ecosystem.

I’ll also add a misbehaviour test for conflicting ML-DSA-65 headers and test the transaction size and gas consumption using Dora Vota’s actual validator set size.

A couple of recent updates on ML-DSA compatibility in the Cosmos ecosystem:

  • Osmosis: #9837 was merged on Nov 26, adding ML-DSA-65 IBC header verification support through CometBFT v0.38.26.
  • Cosmos Hub: Gaia v29.2.0, released on Dec 1, also supports ML-DSA-65 for IBC client updates and misbehaviour submissions.
FE
fengfeng
2d ago

@Zealynx Thanks for sharing your write-up. Your estimate of where a client update would hit 1 MiB was close, and your suggestion to test conflicting headers prompted me to check the freeze path separately. I tested locally with 20 validators to match Dora Vota mainnet. With all 20 signing, one ML-DSA-65 client update was 151,366 bytes , used 1.61M gas , and cost the relayer 84,288 uosmo on Osmosis. With 14 of 20 signing under both algorithms, the fee went from 7,546 uosmo with Ed25519 to 73,837 uosmo with ML-DSA-65, about 9.8× as much per update . Multiple transfers can share one update. The fully signed 20-validator update fit within Hermes’s default `max_tx_size` of 180,000 bytes. After raising the relayer limits, a fully signed update with 142 validators still fit under CometBFT’s 1 MiB mempool transaction limit. At 143 validators , it reached 1,052,610 bytes . In a separate test with 20 equal-weight validators, the same header passed with just 14 signatures. That suggests Hermes could explore sending fewer signatures when the light client’s voting-power and trust checks allow it. For the freeze test, I raised `max_tx_size` to 360,000 bytes. The test harness submitted two…

Excerpt (1199 of 1621 characters). Read the whole post on the forum ↗

ZE
Zealynx
1d ago 1

@fengfeng the freeze path runs out of room first. Your update came to about 7.4 KB per validator (1,052,610 bytes at 143), and misbehaviour carries two headers, which is why 20 validators already took 302,488 bytes. At that rate a fully signed misbehaviour passes the default 1 MiB max_tx_bytes somewhere around 70 validators, half of where updates stop, and a double sign is the one transaction you don’t want stuck on a node setting.

Trimming signatures helps less there than your 14 of 20 result suggests. Misbehaviour.ValidateBasic still runs VerifyCommitLight on each header against its own validator set, so each one needs over 2/3, and both full key sets (validator set and trusted validators) stay in every header because they’re checked against the hashes. By my math that moves the limit from about 70 to the low 80s.

FE
fengfeng
18h ago

Thanks, @Zealynx! The size limit for freeze evidence is easy to overlook. That was really helpful. :+1:

← Back to Discussions