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.

  • What's the question? – Ismael Oct 21 '21 at 02: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? – Paul Groove Oct 21 '21 at 05:01
  • I suggest to edit the question, use a more descriptive title and make it more clear. – Ismael Oct 21 '21 at 05:40
  • 1
    edited my question as per suggestion – Paul Groove Oct 21 '21 at 10:53
  • Can you be more specific? Do you want the users to be the owners of the NFT? – antioi Oct 21 '21 at 16:16
  • Not really, as long as our website users can mint a hash value representing their assets. – Paul Groove Oct 21 '21 at 21:38
  • That goes against the philosophy of the Web3 space. At that point you might as well "mint" on a centralized database, why even bother with ETH? Sounds like a cash grab and a bad attempt at slapping "Blockchain" on a project – antioi Oct 21 '21 at 21:58
  • we want to allow the users to store a hash value representing their assets to be stored on the blockchain - without having to use an external wallet such as metamask as it would be too complicated. – Paul Groove Oct 21 '21 at 23:53

1 Answers1

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.

Lauri Peltonen
  • 29,391
  • 3
  • 20
  • 57
  • 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? – Paul Groove Oct 21 '21 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 – Lauri Peltonen Oct 22 '21 at 08: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. – Paul Groove Oct 22 '21 at 09: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. – Paul Groove Oct 22 '21 at 09: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. – Paul Groove Oct 22 '21 at 09:53
  • Ok, added a section to explain gas estimations – Lauri Peltonen Oct 22 '21 at 11:34
  • Hi Lauri, I searched for solutions, but could not find. Could you please shows some links that show how to use a central backend wallet and ethers.js. Thanks in advance. – Paul Groove Oct 25 '21 at 18:19
  • Hi Lauri, I have another questions I asked months ago. Could you please have a look?https://ethereum.stackexchange.com/questions/113187/ethereum-nft-minting-successful-but-still-gives-this-error?noredirect=1&lq=1 – Paul Groove Apr 28 '22 at 12:42