简体   繁体   English

Web3js库对智能合约调用的完整性保证

[英]Integrity assurance of smart contract call by Web3js library

I have a necessity where I want to verify the authenticity and integrity of the data that is returned by the Web3js library methods.mymethod().call() from the smart contract.我有必要验证 Web3js 库methods.mymethod().call()从智能合约返回的数据的真实性和完整性 Something we do in the client-server communication model, the authenticity and integrity of the message/data the client receive could be validated with the Rest API response (Header, Body, signature).我们在客户端-服务器通信模型中所做的事情,客户端接收到的消息/数据的真实性和完整性可以通过 Rest API 响应(标头、正文、签名)进行验证。 Could the same be done on the response we receive from the web3js library?可以对我们从 web3js 库收到的响应做同样的事情吗?

I have a necessity where I want to verify the authenticity and integrity我有必要验证真实性和完整性

The question does not discuss why you want to do this and does not make any sense and feels xy problem .该问题没有讨论为什么要这样做并且没有任何意义并且感觉xy问题

However here is a solution但是,这是一个解决方案

  • Run your own Ethereum node .运行您自己的以太坊节点

  • Ethereum node is guaranteed to have have a valid state, by Etherum block validation rules以太坊节点通过以太坊区块验证规则保证具有有效状态

  • Because you are running your own node, the JSON-RPC replies do not lie to yourself.因为您正在运行自己的节点,所以 JSON-RPC 回复不会欺骗您自己。 Unless you are mad and then this is called Mad General Problem.除非你疯了,否则这被称为疯狂的一般问题。

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

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