An NFT project I'm working with was recently rugged and I'm setting up a dapp with goal of derugging the project. We are trying to achieve this by destroying all of the NFTs in the old collection and replace them with a new collection of NFTs created with our update authority. With this in mind, the dapp has two basic functions for the user.
- Burn the old NFTs from our collection held in the user's wallet.
- Mint a new copy of old NFT using our update authority.
The problem I've run into is that in order to mint the new NFT using our update authority, our wallet must also sign the transactions along with the user. However, it seems very insecure to sign the transaction from within our dapp because a malicious actor could get ahold of our keypair.
What is best practice for this type of problem? How do we sign for transactions within our dapp without exposing our private keys?
The project code is living here: https://github.com/Giffen-good/fomo-bombs-dapp