I hope you're doing well. I'm currently working on a React app where users can withdraw rewards to their connected wallet. I want to ensure the security of the process and avoid exposing the private key on the frontend.
Here's the scenario:
Frontend Interaction: When a user clicks a button, I want to initiate the withdrawal process without exposing the private key.
Transaction Signing on Frontend: I'm looking for a secure way to sign the transaction on the frontend and then pass it to the backend.
Backend Handling (Node.js): The signed transaction should be received by the Node.js backend, where the actual transfer of Sol to the designated wallet will occur.
I'm seeking advice on the best practices for achieving this workflow. Any insights into securely signing transactions on the frontend and handling them on the backend in a React app would be greatly appreciated.
Thank you in advance for your help!
Best regards,