I have a desktop app that accepts payment from user in ETH and provides it some service for a certain amount of time depending on the amount.

For that the user needs to sign the transaction in the inbuilt wallet which is not very trustworthy from users perspective because they have to put their private keys in order to sign the transactions.

Also tx id submission is not possible because he can use some other users tx id in a certain timeframe.

How can I solve this in these techniques?

  1. Can I put metamask in my Desktop App (C# Dot Net)?
  2. Can I call metamask from outside application?
  3. How can a dapp solve this problem?
  4. Can I push some intent from my desktop app to Web Browser?

I would like to push the transaction from the desktop app to the browser for signing.

I just don't like to handle the private keys for the user but wanna verify him according to the payment he made.

1 Answer 1


I would recommend handing this off to the browser and have the user interact with the web3 provider of their choice (e.g. MetaMask).

To link the payment to the user, just pass a parameter (user ID or the like) to your smart contract, or if you're not using a smart contract, you could encode the user ID in wei. (Instead of paying 1 ether, they pay 1.000000000000123456 wei, where 123456 is the user ID.)

  • I want to do the exact same thing, but how can push something from another desktop app to the browser? As I know metamask is only available in the browser.
    – user59066
    Jun 23, 2018 at 18:41
  • Are you asking how technically to launch the browser? That's sort of off-topic here, but it should be easy to Google. (Something like "how to open a URL in the browser in <insert language here>.")
    – user19510
    Jun 23, 2018 at 18:45
  • So interacting with metamask is like some regular GET/POST request or something like that? For example I want to do it from one sample webpage.
    – user59066
    Jun 23, 2018 at 18:49
  • The URL you'll load is a web page you've written. That web page will use web3.js to invoke the transaction. It sounds like this may be your first web3 app, so you'll want to find some introductory material first.
    – user19510
    Jun 23, 2018 at 19:08
  • Does the web3 app needs to have node.js or something like that running in the users computer? Can it be a static webpage and still pass the transaction to metamask? I just need to push the transaction to the metamask. Nothing else.
    – user59066
    Jun 23, 2018 at 19:14

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.