hyperlane-xyz / hyperlane-monorepo

The home for Hyperlane core contracts, sdk packages, and other infrastructure
https://hyperlane.xyz
Other
295 stars 313 forks source link

Add "Why incremental merkle tree?" to FAQ #1803

Open asaj opened 1 year ago

asaj commented 1 year ago

See replies to https://discord.com/channels/935678348330434570/961710804011458621/1073448156471238726

Ash-code183 commented 7 months ago

Here is the updated content for FAQ

Question: Why use an incremental Merkle tree in smart contracts?

Answer: Using an incremental Merkle tree in smart contracts offers significant advantages, particularly in terms of portability and security across different blockchain environments.

Firstly, an incremental Merkle tree is highly adaptable to various execution environments or blockchain platforms. While storage proofs for mapping slots are feasible and effective in Ethereum/EVM-specific contexts, they may not be as efficient or even possible in other blockchain environments, such as Solana. By implementing a Merkle tree at the smart contract level, we ensure a uniform approach that simplifies maintenance and enhances compatibility with new and diverse chains. This homogeneity is crucial for expanding and integrating across different blockchain ecosystems.

Secondly, the use of an incremental Merkle tree enhances the ability to detect and respond to fraudulent activities by validators. In scenarios where validators sign a blockchain's state root, it can be challenging for smart contracts to access and verify this information, making it difficult to identify and penalize fraudulent actions. However, with a Merkle tree, it becomes much easier to report and prove any fraudulent signing of the Merkle root to the origin chain. This capability is essential for maintaining the integrity and security of the blockchain network, ensuring validators are held accountable for their actions.