简体   繁体   English

如何验证交易哈希是否包含在链上区块的 transactionsRoot 中?

[英]How to verify that a transaction hash is included in a block's transactionsRoot on chain?

I am doing some research to see how you would verify that a transaction hash is included in the transactionsRoot for a specific block in Ethereum.我正在做一些研究,看看你将如何验证交易哈希是否包含在以太坊中特定区块的 transactionsRoot 中。 The challenging part for this is that I am trying to do this on chain.具有挑战性的部分是我试图在链上做到这一点。

Can anyone help me figure out what data I would need to pass into a function and how I would verify this?谁能帮我弄清楚我需要将哪些数据传递给函数以及如何验证这一点? It seems like it would be much more complicated than just passing in a merkle root and proofs since the transactionsRoot is a merkle patricia trie.由于 transactionsRoot 是 merkle patricia trie,因此它似乎比仅传递 merkle root 和证明要复杂得多。

This blog post explains merkle trie with examples.这篇博文通过示例解释了 merkle trie。 It explains how transaction root is computed and how proof is generated and verified.它解释了如何计算交易根以及如何生成和验证证明。

https://medium.com/@chiqing/merkle-patricia-trie-explained-ae3ac6a7e123 https://medium.com/@chiqing/merkle-patricia-trie-explained-ae3ac6a7e123

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM