1

I create raw transaction and sign with owner privatekey to send transaction. For now, owner privateKey is just simply stored to variable but this is not safety so I want to encrypt or decrypt the owner privateKey in my javascript code. I'm also wondering that the way of get owner PrivateKey safely in my client code not to expose in plain text or binary or everything hacker can recognize. Is there a function supported by WEB3 right now? How do you guys dealing with this problem if someone who's developing a service like me?

I know this is not a technical question but I want to get an idea how to access it. Thanks.

1

1 Answer 1

1

Private keys are never meant to be stored in javascript, not even encrypted. Web3 allows you to call sendTransaction, which requires a node with an unlocked account. This way, your provider (injected metamask/web3 browser) will sign the request. It keeps private keys out of your javascript and out of reach of any potential hacker.

1
  • You mean that I can run the node with unlocked (owner) account locally using Go-ethereum (geth)? And then, It's possible to do sendTransaction on my client code (javascript) without signing by owner's private key? For the last, I'm testing on the Ropsten testnet for demo which some users have to make transactions on their app. It seems impossible to sign transaction on every other clients' apps. Commented Apr 16, 2018 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.