1

I am developing a website that allows users to put a hash of their data on the Ethereum blockchain - as an NFT.

To make it easier for the users, we don't want users to use a wallet (e.g. metamask). To prevent users from requiring individual Ethereum accounts, we can purchase Ethereum and store in a central Ethereum account. Then all transactions made in the website use this central account when trying to mint the NFTs on the blockchain.

The question: Is there a way which does not require a pop-up wallet for minting NFTs? Can we code our application in such a way that it uses a central account to make all Ethereum transactions wherever users want to mint NFTs on our website?

We still need to charge user's gas fees and this also needs to estimated and informed to the user before the transaction. If there is aa way, how would we inform the gas to be used to the user?

One approach is using a HDWallet where all the transactions will use the one address in the HDwallet to make the payments.

8
  • What's the question?
    – Ismael
    Oct 21, 2021 at 2:11
  • The question: Is there a way which does not require a pop-up wallet for minting NFTs? Can we code our application in such a way that it uses a central account to make all Ethereum transactions to mint the user's NFTs on our website? If so, how do we relate the gas to be used to the user? Oct 21, 2021 at 5:01
  • I suggest to edit the question, use a more descriptive title and make it more clear.
    – Ismael
    Oct 21, 2021 at 5:40
  • 1
    edited my question as per suggestion Oct 21, 2021 at 10:53
  • Can you be more specific? Do you want the users to be the owners of the NFT?
    – antioi
    Oct 21, 2021 at 16:16

1 Answer 1

0

You can't really charge the gas fees from the user if the user's wallet is not activated (or the user doesn't even have a wallet). Unless you plan to ask the payment in some other format (such as in fiat).

Otherwise, it's possible to use a central backend wallet for generating and issuing the transactions. Then the backend wallet pays for gas and the users don't need to have any wallets. Just use something like ethers.js to connect to your backend wallet and to create the required transactions.

If you want the user to pay in fiat before you issue the transaction, you can use the estimateGas functionality, which simulates the transaction and (hopefully) tells you how much it will possibly cost. But note that this is only an estimation - to get the exact cost, you have to execute the transaction and then get the payment from the user afterwards. And this estimation may sometimes fail completely.

8
  • Thanks @Lauri. I think using a central backend wallet is a great idea. Using this approach, how do we handle gas fees? Should we relay the estimated gas fees before the transaction and let them pay beforehand OR would it be possible to somehow retrieve the gas fees after the transaction has been completed? Oct 21, 2021 at 21:38
  • Sorry, I don't understand. I think I explicitly said in the answer that your backend pays for the gas and the users can't pay for it unless they have a wallet Oct 22, 2021 at 8:37
  • No, we basically want to pay the gas fees on the user's behalf. And just as the transaction is ready to be made, we want to let the users know of the estimated gas fees which we would pay on his/hers behalf. Oct 22, 2021 at 9:28
  • Oh, I get what you are asking. We still want to make users pay through a credit/debit card before a transaction. And once that is successful, we will make the Ethereum payment on his/her behalf. Oct 22, 2021 at 9:44
  • We still want the users to pay us the cost of the Ether for each transaction as we would be paying the Ether on his/her behalf. Oct 22, 2021 at 9:53

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.