Skip to content

modular transaction hashing #6539

@fedekunze

Description

@fedekunze

Context

As an Ethermint user who submits a transaction via JSON-RPC, the transaction hash that I expect to receive should match the one as if I sent the transaction on Ethereum. Transaction hashing on Tendermint relies on sha256.Sum, while Ethereum transactions use an RLP hash of the data they contain (see here).

Problem

Transaction hashing is currently hardcoded on Tendermint (uses ). I propose to allow transactions to define a custom hashing function

type Tx []byte

// Hash computes the TMHASH hash of the wire encoded transaction.
func (tx Tx) Hash() []byte {
	return tmhash.Sum(tx)
}

cc: @ValarDragon @khoslaventures

Metadata

Metadata

Labels

C:cryptoComponent: Cryptostalefor use by stalebot

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions