0

When deploying a smart contract how can I let users in my own platform (mobile or web) interact with it? Let's say I have the following contract:

contract Test {
    event Log(address addr);

    function logMe () public {
        Log(msg.sender);
    }
}

In order to use it I must have access to the private and public keys of the user. Is it possible to allow users to interact with the blockchain through their own accounts without the need to have their credentials?

1 Answer 1

1

Yes, the typical flow of a decentralized app (DApp) is that users maintain control of their private key.

The most popular means of doing this is MetaMask in the browser. JavaScript on the page attempts to send the transaction, at which point MetaMask prompts the user to authorize the transaction, signs it with their private key, and then sends it along.

Take a look at https://programtheblockchain.com/posts/2017/12/13/building-decentralized-apps-with-ethereum-and-javascript/ for a basic introduction to DApp development.

0

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.