SigningStargateClient automatically picks
the right one based on the signer you provide.
Direct (Protobuf)
The modern default. The transaction is serialized as Protobuf bytes, hashed with SHA-256, and signed. This is the most compact encoding and supports all message types.- Wallet:
DirectSecp256k1HdWalletfrom@cosmjs/proto-signing - Interface:
OfflineDirectSigner(hassignDirectmethod) - Sign mode:
SIGN_MODE_DIRECT
DirectEthSecp256k1HdWallet, DirectEthSecp256k1Wallet) use the same Direct sign doc and the same SIGN_MODE_DIRECT, but hash the serialized bytes with Keccak-256 before signing to follow Ethereum conventions.
Amino (JSON)
The legacy format. The transaction is serialized as deterministic JSON (sorted keys, escaped special characters), hashed with SHA-256, and signed. Required for Ledger hardware wallets and some older chains.- Wallet:
Secp256k1HdWalletfrom@cosmjs/amino - Interface:
OfflineAminoSigner(hassignAminomethod) - Sign mode:
SIGN_MODE_LEGACY_AMINO_JSON
Automatic Detection
You don’t need to choose manually. Pass anyOfflineSigner to
connectWithSigner and the client determines the mode at signing time:
signDirect and signAmino, Direct signing
takes precedence.