Richard
Richard

Reputation: 351

Do I need private key during transaction in web3js (NodeJS)

I currently operate an e-commerce website that sales for shoes. At this time, I'd like to implement an ethereum transaction payment system. Users send their ethereum to our ethereum address.

I really wondering if our visitors try to send ethereum transaction, users have to submit their private key of their ethereum, but what I think that this method is really dangerous situation in our e-commerce website.

Of course we do not save any of private key into our db. However I don't want to use the method to collect users personal keys.

Is there any way users can make a payment without their private key?

Upvotes: 0

Views: 635

Answers (1)

Gor Kotikyan
Gor Kotikyan

Reputation: 723

So, all transactions in Ethereum or in similar cryptocurrency made with private key. I don’t think so that users would agree to send you a private key, since you will be able to manage their wallet and send as many transactions as you want. I think in order to implement payment functionality with Ethereum you should use MetaMask. User should have a MetaMask account and linked wallet in it. It is trusted application that users can insert private keys their. So when they make transaction with MetaMask you simply get Transaction ID (hash) and check the validity of transaction and transferred Ether. If transaction successful, so user transfer enough Ether to your wallet, you just accept payment. You can just read an article, Building-Ethereum Dapps with MetaMask

Upvotes: 3

Related Questions