Repository navigation
Conversation
v0.38.26 backports the `mldsa65` (tag 4) case of `tendermint.crypto.PublicKey` so v0.38 nodes can verify counterparties on v0.40 with ML-DSA-65 validators. Regenerating adds `Sum::Mldsa65` (JSON type `cometbft/PubKeyMlDsa65`) and the Go-only `blocksync::SigCount*` messages; no other proto changes between v0.38.12 and v0.38.26. Only the v0_38 output is committed. Running the tool also adds `#[allow(clippy::all)]` throughout and touches v0_34/v0_37, which the committed code on main does not have; those changes were left out. Also: - p2p: treat an ML-DSA-65 peer key like secp256k1 (unsupported key). - proto-compiler: replace deprecated `TempDir::into_path` with `keep()` (tempfile >= 3.20), which otherwise fails the build under -D warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds ML-DSA-65 (FIPS 204) validator keys for verification, matching
CometBFT v0.40 and the v0.38.26 verification backport, so light clients
(and IBC relayers built on them) can follow chains whose validators use
ML-DSA-65. Signing is out of scope.
Behind a new `mldsa65` feature (RustCrypto `ml-dsa` 0.1.2, Rust 1.87+):
- `PublicKey::MlDsa65`, holding the 1952-byte packed key inline so
`PublicKey` stays `Copy`; JSON type `cometbft/PubKeyMlDsa65`, the
protobuf `Sum` wrapper form, v0_38 proto field 4, ordering, bytes,
bech32 (amino prefix derived from the registered name).
- Addresses are SHA256(pubkey)[:20], both from `PublicKey` and from the
raw proto key used when decoding validator sets.
- The default verifier checks pure ML-DSA signatures with an empty
context (`verify_with_context(msg, &[], sig)`), as circl does in Go.
- `tendermint-light-client-verifier` gets a passthrough `mldsa65` feature.
Independent of the feature, so ML-DSA chains' data parses:
- `Algorithm::MlDsa65` ("ml_dsa_65") in consensus params, JSON and proto.
- `Signature` accepts 3309-byte signatures.
The larger `PublicKey` trips `clippy::large_enum_variant` on it and on two
error enums that embed a validator set; those are allowed with a comment.
Tests use fixtures generated by CometBFT v0.40.0 (generator and README in
tendermint/tests/support/mldsa65): key JSON/proto/address, a validator-set
hash, Go-signed messages (including a non-empty-context signature that
must be rejected), and a mixed Ed25519/ML-DSA-65 commit that Go's
VerifyCommitLight accepts and the Rust light-client verifier must accept,
and reject once tampered. Also covers no_std (build-std core,alloc).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This PR does not match any of the 1 configured review trigger rule. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 7 tasks
JayT106
added a commit
to crypto-org-chain/hermes
that referenced
this pull request
Nov 16, 2026
Patches tendermint-rs to a backport of cometbft/tendermint-rs#1533 and enables its mldsa65 feature. ml-dsa needs Rust 1.87, so the MSRV moves from 1.85 to 1.87.
JayT106
added a commit
to crypto-org-chain/hermes
that referenced
this pull request
Nov 18, 2026
…ort (#11) * feat: verify ML-DSA-65 validator keys via tendermint-rs v0.40.4 backport Patches tendermint-rs to a backport of cometbft/tendermint-rs#1533 and enables its mldsa65 feature. ml-dsa needs Rust 1.87, so the MSRV moves from 1.85 to 1.87. * docs: state MSRV 1.87 in README and changelog, note client update size * ci: pin cargo-doc to a nightly with stable cfg(true) and doc_auto_cfg * ci: apply the tendermint-rs patch to the standalone check-guide workspace * ci: drop the unused testgen patch from check-guide and run its check on root manifest changes * test: verify an ML-DSA-65 signed header after Any encoding * fix(test-framework): skip wasmvm version check when starting injectived (cherry picked from commit 9c63cd1606cdeac8de5c43222618b27d7d0da439) * test: lower injective max_msg_num to keep relay txs under max_gas (cherry picked from commit eac8cd8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1532 (proto regeneration). This branch contains that commit too; review only the last commit,
tendermint: verify ML-DSA-65 validator signatures.Adds ML-DSA-65 (FIPS 204) validator keys for verification, matching CometBFT v0.40.0 (cometbft#5875) and the verification-only backport in v0.38.26 (cometbft#6028). This lets light clients, and the IBC relayers built on them, follow chains whose validators use ML-DSA-65. Signing and
priv_validator_key.jsonare out of scope.Behind a new
mldsa65featureUses RustCrypto
ml-dsa0.1.2 (Apache-2.0 OR MIT, no_std). It needs Rust 1.87, above the workspace MSRV of 1.82, which is why it is opt-in.PublicKey::MlDsa65: JSON typecometbft/PubKeyMlDsa65, the protobufSumJSON wrapper form, v0.38 proto field 4, ordering and bytes.SHA256(pubkey)[:20], as CometBFT computes them, both fromPublicKeyand from the raw proto key used when decoding validator sets.verify_with_context(msg, &[], sig)), as circl'smldsa65.Verify(pk, msg, nil, sig)does in Go.tendermint-light-client-verifiergets a passthroughmldsa65feature.Without the feature
So that data from ML-DSA chains parses whether or not the feature is on:
Algorithm::MlDsa65("ml_dsa_65"). Before, consensus params with this key type failed to parse from JSON and were read as Ed25519 from protobuf.Signatureaccepts 3309-byte signatures.Design choices to look at
PublicKeystaysCopy. The 1952-byte key is stored inline. Boxing it would removeCopyand make enabling the feature a breaking change. The cost is that the enum grows to about 2 KB when the feature is on, which tripsclippy::large_enum_variantonPublicKeyand on two error enums that hold a validator set (Verdict,CompareError). Those are allowed with a comment.PublicKeyyields an emptysum, which fails to decode rather than producing a wrong key.to_bech32uses a derived prefix. CometBFT defines no bech32 form for ML-DSA. The amino prefix is derived from the registered namecometbft/PubKeyMlDsa65with the same rule that gives the Ed25519 and secp256k1 prefixes.Testing
Expected values come from fixtures produced by CometBFT v0.40.0 (generator and README in
tendermint/tests/support/mldsa65/):VerifyCommitLightaccepts is accepted byProdVerifier::verify_commit, and rejected once the ML-DSA signature is tampered with.validator::Infodeserializes from RPC-style JSON.AlgorithmandValidatorParamsround-trip through JSON and protobuf.Results, for
tendermint,tendermint-proto,tendermint-light-client-verifier,tendermint-p2pandtendermint-rpc:tendermint,light-client-verifier): 117 passed, 0 failed.tools/no-std-checkbuilds with-Z build-std=core,allocandmldsa65enabled..changelog/🤖 Generated with Claude Code