You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For non-EVM chains integration it may be necessary to use a hash function other than keccak256. For instance, we're working on Cardano integration. Cardano does not have a native support of keccak256, and implementing it in a smart contract is computationally/gas unfeasible. We've opened a CIP for keccak256 support, but it may take several months to a year to make into the Cardano mainnet. For now the only option is to use blake2b (256) for MerkleTree (on-chain and off-chain) on Cardano side.
Description
This task is about refactoring the off-chain agents to make the hash-function customizable. For simplicity, the new hash function must return H256. Returning a different value would require a massive refactoring throughout the whole codebase. So hash functions with a bigger hash size will not be supported for now.
Overview
For non-EVM chains integration it may be necessary to use a hash function other than
keccak256
. For instance, we're working on Cardano integration. Cardano does not have a native support ofkeccak256
, and implementing it in a smart contract is computationally/gas unfeasible. We've opened a CIP forkeccak256
support, but it may take several months to a year to make into the Cardano mainnet. For now the only option is to useblake2b
(256) for MerkleTree (on-chain and off-chain) on Cardano side.Description
This task is about refactoring the off-chain agents to make the hash-function customizable. For simplicity, the new hash function must return
H256
. Returning a different value would require a massive refactoring throughout the whole codebase. So hash functions with a bigger hash size will not be supported for now.hyperlane-monorepo/rust/hyperlane-core/src/accumulator/mod.rs
Line 18 in 1fff74e
hash_concat(left, right)
strictly depends onKeccak256
.Suggestion
I see a couple of ways to resolving this:
Add a trait
HashFunction
Then pass the
HashFunction
trait to thehash_concat
.&dyn HashFunction
— then we need to store the object reference in all dependentstruct
s&HashFunction
— then all the dependent structs need to have a generic parameter and own the functionUsing cargo feature flags
The text was updated successfully, but these errors were encountered: