3

I have a webapp for test, in this web i can do transactions with my smart contracts fro pay and change the states of this contracts.

But for confirm the transactions, i'm using metamask with a testaccount of Ethereum in the ropsten testnet. Like this example:

enter image description here

How i can implemantate this confirmation of transactions in mi webapp? i can do it whit web3.js or with similar API? I need the authentication of the user in the blockchain or a wallet?

2
  • 1
    You will need to import the user’s private key to sign transactions on their behalf in your web page. I would very much doubt anyone will do that :) Metamask does it, but it’s kept on the client only and never transmitted. The app is also open source.
    – Strelok
    Sep 21, 2017 at 14:31
  • Yes, don't worry i just for test. So i need to sign the transactions with my user test and with this i can obtain this confirmations for approve the transactions? You have some code example of this? I will check the metamask code in their git.
    – Gawey
    Sep 21, 2017 at 14:37

1 Answer 1

1

NOT SAFE FOR PRODUCTION !

Option 1: NodeJS server receiving HTTP calls and sending RPC calls to node with unlocked wallet, with NodeJS server returning data (like transaction verification) via HTTP response (to be handled by AJAX or AngularJS)

Option 2. Same as above, but instead of RPC calls to node with unlocked wallet, you would sign and send transactions via Infura.

Option 3. Use a brain wallet like so.

2
  • the option 2 and 1 is similar to use metamask with web3.js ?
    – Gawey
    Sep 26, 2017 at 7:04
  • the only difference is that metamask manages the users keys. in my solution, they would be stored in a running node (Option 1, encrypted key with password) or some server (Option 2, unencrypted key to be safely handled by yourself), which would be used for signing transactions in a way MetaMask does it.
    – n1cK
    Sep 26, 2017 at 10:41

Your Answer

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

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