Background
Background
Keplr wallet and Ledger hardware wallet use Amino JSON encoding to display and sign transactions. Cosmos SDK supports two signing modes:
SIGN_MODE_LEGACY_AMINO_JSON — used by Keplr + Ledger, human-readable, requires amino registration
SIGN_MODE_DIRECT (protobuf) — used by CLI, not supported by Ledger hardware
Current state in gonka:
inference-chain/x/inference/module/module.go:80:
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}
// empty — no messages registered
All message types are registered via RegisterInterfaces (protobuf/SIGN_MODE_DIRECT only) in inference-chain/x/inference/types/codec.go, but none have amino type names.
Compare with collateral module — also empty:
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {}
Yet MsgDepositCollateral reportedly works with Keplr. Need to verify why and map exact difference.
The --ledger flag exists in Cosmos SDK's key management layer (cosmos-sdk keyring) and is inherited by inferenced CLI automatically via github.com/cosmos/ledger-cosmos-go v0.14.0 (present in inference-chain/go.mod). This is NOT a custom implementation — it's SDK-level. But signing transactions via Ledger requires amino support in the messages being signed.
What to Investigate
1. Why do some transactions work with Keplr/Ledger and others don't
- Trace
MsgDepositCollateral amino path end-to-end: is it registered somewhere, or does Keplr use a workaround?
- Check if
collateral module has amino registration in proto files (look for amino_name option in .proto files under inference-chain/proto/)
- Check
inference-chain/x/*/types/codec.go for all modules — which have RegisterLegacyAminoCodec populated vs empty
- Understand Cosmos SDK amino fallback behavior: does
RegisterImplementations alone enable amino for some message types?
2. What is required to add amino support to inference module messages
- Which proto messages need
option (amino.name) = "..." annotations
- What changes needed in
RegisterLegacyAminoCodec in inference-chain/x/inference/module/module.go
- Whether proto regeneration is needed or manual codec registration in
types/codec.go is sufficient
- Check cosmos-sdk v0.50.x amino registration pattern (the project uses cosmos-sdk, check version in
inference-chain/go.mod)
- List ALL
MsgXxx types in inference-chain/x/inference/types/tx.pb.go that need amino registration
3. Ledger integration via --ledger flag
- How does
inferenced keys add --ledger work (Cosmos SDK keyring, HD derivation path for Cosmos: m/44'/118'/0'/0/0)
- How does
inferenced tx ... --from mykey work when key was added with --ledger — does it auto-use Ledger for signing?
- What signing mode does it use — is it amino or direct?
- Does the current
inferenced binary support Ledger out of the box (given cosmos/ledger-cosmos-go in go.mod)?
- What build tags are needed (cosmos SDK requires
ledger build tag in some versions)
4. Web3 app requirements mapping
Goal: build Keplr + Ledger web app for miner/validator setup and operations.
Map each user-facing operation to its transaction type and amino support status:
- Deposit/withdraw collateral →
MsgDepositCollateral (collateral module)
- Register as participant →
MsgSubmitNewParticipant (inference module)
- Register model →
MsgRegisterModel (inference module)
- Claim rewards →
MsgClaimRewards (inference module)
- Update node config → identify relevant msg
- Governance proposals → standard cosmos gov msgs
For each: document current amino status and what's needed to enable Keplr/Ledger signing.
Key Files
inference-chain/x/inference/types/codec.go — RegisterInterfaces (no amino)
inference-chain/x/inference/module/module.go:80 — empty RegisterLegacyAminoCodec
inference-chain/proto/inference/inference/tx.proto — check for amino_name options
inference-chain/x/collateral/types/codec.go — compare with inference module
inference-chain/go.mod — cosmos-sdk version, ledger-cosmos-go version
inference-chain/x/inference/types/tx.pb.go — all Msg types
Deliverables
- Table: all inference module Msg types + current amino status + what's needed
- Step-by-step: how to add amino registration for a Cosmos SDK v0.50.x module
- Ledger signing flow:
inferenced keys add --ledger → inferenced tx → on-device signing
- Assessment: can all needed transactions support amino, or are there blockers?
- Create implementation task(s) for amino registration if feasible
Focus Areas
- amino codec registration pattern in cosmos sdk v0.50
- why some msgs work with keplr and others don't
- ledger signing flow end-to-end
- proto amino_name options
- web3 app transaction coverage
Background
Background
Keplr wallet and Ledger hardware wallet use Amino JSON encoding to display and sign transactions. Cosmos SDK supports two signing modes:
SIGN_MODE_LEGACY_AMINO_JSON— used by Keplr + Ledger, human-readable, requires amino registrationSIGN_MODE_DIRECT(protobuf) — used by CLI, not supported by Ledger hardwareCurrent state in gonka:
inference-chain/x/inference/module/module.go:80:All message types are registered via
RegisterInterfaces(protobuf/SIGN_MODE_DIRECT only) ininference-chain/x/inference/types/codec.go, but none have amino type names.Compare with collateral module — also empty:
Yet
MsgDepositCollateralreportedly works with Keplr. Need to verify why and map exact difference.The
--ledgerflag exists in Cosmos SDK's key management layer (cosmos-sdk keyring) and is inherited byinferencedCLI automatically viagithub.com/cosmos/ledger-cosmos-go v0.14.0(present ininference-chain/go.mod). This is NOT a custom implementation — it's SDK-level. But signing transactions via Ledger requires amino support in the messages being signed.What to Investigate
1. Why do some transactions work with Keplr/Ledger and others don't
MsgDepositCollateralamino path end-to-end: is it registered somewhere, or does Keplr use a workaround?collateralmodule has amino registration in proto files (look foramino_nameoption in.protofiles underinference-chain/proto/)inference-chain/x/*/types/codec.gofor all modules — which haveRegisterLegacyAminoCodecpopulated vs emptyRegisterImplementationsalone enable amino for some message types?2. What is required to add amino support to inference module messages
option (amino.name) = "..."annotationsRegisterLegacyAminoCodecininference-chain/x/inference/module/module.gotypes/codec.gois sufficientinference-chain/go.mod)MsgXxxtypes ininference-chain/x/inference/types/tx.pb.gothat need amino registration3. Ledger integration via
--ledgerflaginferenced keys add --ledgerwork (Cosmos SDK keyring, HD derivation path for Cosmos: m/44'/118'/0'/0/0)inferenced tx ... --from mykeywork when key was added with--ledger— does it auto-use Ledger for signing?inferencedbinary support Ledger out of the box (givencosmos/ledger-cosmos-goin go.mod)?ledgerbuild tag in some versions)4. Web3 app requirements mapping
Goal: build Keplr + Ledger web app for miner/validator setup and operations.
Map each user-facing operation to its transaction type and amino support status:
MsgDepositCollateral(collateral module)MsgSubmitNewParticipant(inference module)MsgRegisterModel(inference module)MsgClaimRewards(inference module)For each: document current amino status and what's needed to enable Keplr/Ledger signing.
Key Files
inference-chain/x/inference/types/codec.go— RegisterInterfaces (no amino)inference-chain/x/inference/module/module.go:80— empty RegisterLegacyAminoCodecinference-chain/proto/inference/inference/tx.proto— check for amino_name optionsinference-chain/x/collateral/types/codec.go— compare with inference moduleinference-chain/go.mod— cosmos-sdk version, ledger-cosmos-go versioninference-chain/x/inference/types/tx.pb.go— all Msg typesDeliverables
inferenced keys add --ledger→inferenced tx→ on-device signingFocus Areas