Prerequisite Readings
Cosmos SDK Encoding
Learn about protobuf and Amino encoding in Cosmos SDK
Ethereum RLP
Understand Recursive Length Prefix encoding
Encoding Formats
- Protocol Buffers
- RLP
- Amino (Legacy)
Primary encoding for Cosmos EVMThe Cosmos Stargate release introduces protobuf as the main encoding format for both client and state serialization.Advantages:
All EVM module types (transaction messages, genesis, query services) are implemented as protocol buffer messages.
- Language-agnostic binary serialization
- Smaller message sizes than JSON
- Faster serialization/deserialization
- Strongly typed with schema validation
Transaction Encoding Implementation
Thex/vm
module handles MsgEthereumTx
encoding by converting to go-ethereum’s Transaction
format and using RLP: