laconicd/docs/basics/transactions.md
Daniel Choi 71090323c0
docs: updates (#590)
* gas docs

* add period

* pending state docs

* format

* fix links

* add more to pendingstate docs

* add more to gas docs

* add hardspoon doc

* minor fix to pendingstate doc

* note on rlp encoding

* usecase doc

* update encoding doc

* gas docs

* hard spoon and reorder

* fix links

* encoding

* pending state

* final touches

* update intro

* use cases and resources

* typo

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-11-12 20:42:24 +01:00

46 lines
2.0 KiB
Markdown

<!--
order: 2
-->
# Transactions
## Routing
Ethermint needs to parse and handle transactions routed for both the EVM and for the Cosmos hub. We
attempt to achieve this by mimicking [Geth's](https://github.com/ethereum/go-ethereum) `Transaction`
structure and treat it as a unique Cosmos SDK message type. An Ethereum transaction is a single
[`sdk.Msg`](https://godoc.org/github.com/cosmos/cosmos-sdk/types#Msg) contained in an
[`auth.StdTx`](https://godoc.org/github.com/cosmos/cosmos-sdk/x/auth#StdTx). All relevant Ethereum
transaction information is contained in this message. This includes the signature, gas, payload,
etc.
Being that Ethermint implements the Tendermint ABCI application interface, as transactions are
consumed, they are passed through a series of handlers. Once such handler, the `AnteHandler`, is
responsible for performing preliminary message execution business logic such as fee payment,
signature verification, etc. This is particular to Cosmos SDK routed transactions. Ethereum routed
transactions will bypass this as the EVM handles the same business logic.
Ethereum routed transactions coming from a Web3 source are expected to be [RLP](./../core/encoding.md#rlp) encoded, however all
internal interaction between Ethermint and Tendermint will utilize one of the supported encoding
formats: [Protobuf](./../core/encoding.md#protocol-buffers) and [Amino](./../core/encoding.md#amino).
## Transaction formats
<!-- TODO: -->
- Cosmos transactions
- Ethereum transaction
## Signatures
Ethermint supports [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md)
signatures. A `Transaction` is expected to have a single signature for Ethereum routed transactions.
However, just as in Cosmos, Ethermint will support multiple signers for non-Ethereum transactions.
Signatures over the `Transaction` type are identical to Ethereum and the signatures will not be
duplicated in the embedding
[`auth.StdTx`](https://godoc.org/github.com/cosmos/cosmos-sdk/x/auth#StdTx).
## Next {hide}
Learn about how [gas](./gas.md) is used on Ethermint {hide}