简体   繁体   English

想在没有元掩码的情况下签署交易,如何保护私钥?

[英]Want to sign transactions without metamask , how to protect private key?

I am building a full stack application which will include react js as front end and node.js as backend and ethereum as blockchain platform.我正在构建一个完整的堆栈应用程序,其中包括作为前端的 React js 和作为后端的 node.js 以及作为区块链平台的以太坊。 I have deployed my smart contract on a test.network and now I want to integrate it with frontend ReactJS but I don't want to use metamask.我已经在 test.network 上部署了我的智能合约,现在我想将它与前端 ReactJS 集成,但我不想使用元掩码。 I want that user just clicks on a button and the transactions gets signed inside the code and no wallet gets prompted on screen.我希望该用户只需单击一个按钮,交易就会在代码中签名,并且不会在屏幕上提示钱包。 But from inte.net resources, I have seen that Private keys are exposed in code so is there any way where I can hide my private keys and still sign transactions without metamask?但是从 inte.net 资源中,我看到私钥暴露在代码中,所以有什么方法可以隐藏我的私钥并仍然在没有元掩码的情况下签署交易?

I want that user just clicks on a button and the transactions gets signed inside the code and no wallet gets prompted on screen.我希望该用户只需单击一个按钮,交易就会在代码中签名,并且不会在屏幕上提示钱包。

That is not how blockchain works.这不是区块链的运作方式。 The user is in control of the key, not you.用户在控制密钥,而不是你。 The wallet protects the private key because poor quality application developers cannot properly do this job.钱包保护私钥,因为质量差的应用程序开发人员无法正确完成这项工作。

I suggest you either我建议你要么

  • Rethink your application so that you pay the gas fees and sign the transactions on behalf of your user重新考虑您的应用程序,以便您支付汽油费并代表您的用户签署交易
  • Accept the fact you should not play around with the users' private keys接受你不应该玩弄用户私钥的事实
  • ... or stop using blockchain for your application ... 或停止在您的应用程序中使用区块链

Please also see xyproblem.info for information how to ask more relevant questions.另请参阅xyproblem.info了解如何提出更多相关问题的信息。

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

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