laconicd/docs/core/encoding.md

43 lines
1.7 KiB
Markdown
Raw Normal View History

docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
<!--
order: 1
-->
# Encoding
Learn about the encoding formats used on Ethermint. {synopsis}
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
## Pre-requisite Readings
- [Cosmos SDK Encoding](https://docs.cosmos.network/master/core/encoding.html) {prereq}
- [Ethereum RLP](https://eth.wiki/en/fundamentals/rlp) {prereq}
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
## Encoding Formats
### Protocol Buffers
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
The Cosmos [Stargate](https://stargate.cosmos.network/) release introduces
[protobuf](https://developers.google.com/protocol-buffers) as the main encoding format for both
client and state serialization. All the EVM module structs that are used for state and clients
(transaction messages, genesis, query services, etc) will be implemented as protocol buffer messages.
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
### Amino
The Cosmos SDK also supports the legacy Amino encoding format for backwards compatibility with
previous versions, specially for client encoding. Ethermint will not support Amino in the EVM module
once the migration to SDK `v0.40` is finalized.
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
### RLP
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
Recursive Length Prefix ([RLP](https://eth.wiki/en/fundamentals/rlp)), is an encoding/decoding algorithm that serializes a message and
allows for quick reconstruction of encoded data. Ethermint uses RLP to encode/decode Ethereum
messages for JSON-RPC handling to conform messages to the proper Ethereum format. This allows
messages to be encoded and decoded in the exact format as Ethereum's.
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
Each message type defined on the EVM module define the `EncodeRLP` and `DecodeRLP` methods which
implement the `rlp.Encoder` and `rlp.Decoder` interfaces respectively. The RLP encode method is used
to sign bytes and transactions in `RLPSignBytes` and `Sign`.
docs: vuepress setup and section titles (#311) * vuepress * docs: vuepress setup and TODOs * doc scripts * update Makefile and gitignore * more docs updates * gitignore * metamask instructions * update image * updates * updates from call * docs: vuepress config and home.vue (#350) * update uncles return (#337) * x/evm: fix EndBlock consensus failure (#334) * add test for sending tx w/ 21000 gas * improve rpc transfer test * use ctx in EndBlock * UpdateAccounts and ClearStateObjects with passed in context * log ethereum address on error Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * update Ethermint color variables * add header and footer logo * tweak config.js * WIP custom homepage.vue * add layout to docs/README * update color variables * add eth logo black and white * tweak docs/README * update logo and logo-bw svg * bump 1.0.167 * homepage → home * add icon-code, icon-rocket * layout: home, remove configurable frontmatter: label, read, use * clean up config.js * bump 1.0.168 * fix missing comma from resolving conflicts * update sidebar, config nav, path * remove left whitespace on the header and footer logos * clean up home.vue, docs/README * update ethermint forum url in footer.links * comment out custom true to enable searchbar in subpages * remove external link icon for Guides * comments, revert custom true * clean up config.js, add specifications icon Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> * final touches Co-authored-by: Cyrus Goh <hello@lovincyrus.com> Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 08:22:45 +00:00
## Next {hide}
Learn how [pending state](./pending_state.md) is handled on Ethermint. {hide}