# Basic flow

### **Toggle eth\_sign requests**

To allow dApps to request your signature using 'eth\_sign' requests, you need to turn on this setting. Please note that 'eth\_sign' is an open-ended signing method that allows you to sign an arbitrary hash, which can be a dangerous phishing risk. Only sign 'eth\_sign' requests if you are able to read and understand what you are signing and trust the request's origin.

⚠️ _`If this setting is turned off, your MetaMask will not be able to connect to the Wallet Rescue app. You will need to manually turn on this function.`_ ⚠️&#x20;

The user flow depends on the required actions. For example, if you want to withdraw tokens from a staking contract but your account is hacked, any tokens transferred to your account will go to the hacker's wallet.

Or, your account's (0x1d0fBBc026243b79d27c2FB891002Ccf9bC60EE6) private key was compromised (Ex. 0x7eea14f731c1691b56238e777a67674d40de1bdd544f883e733549f6915d7961), and all funds in your wallet were transferred to the hacker's wallet. Also, the hacked account initiates some stakes, and you want to claim your stake without losing funds.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2Fy3jO55kHUZ9JMFYGd4eN%2FWR-Screen.001.jpeg?alt=media&#x26;token=ce42ebf0-55b2-4966-bff2-afee316b64ad" alt=""><figcaption></figcaption></figure>

To begin, you must transfer native currency to your account by selecting the 'Native Token Transfer' transaction type

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2F2enP4QZiXiiGdFxBungL%2FWR-Screen.002.jpeg?alt=media&#x26;token=de93a86b-5f0e-4012-9bc5-ab76aea0a8f0" alt=""><figcaption></figcaption></figure>

After completing the native token transfer, a new transaction block will appear in the bundle section. Clicking on the block will open a form where you can specify the sender and receiver account addresses, as well as the transfer amount.

<div><figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2F61btqkJZ0KfxgpSbYbel%2FWR-Screen.003.jpeg?alt=media&#x26;token=313ccf63-64cd-41c0-918e-d847beffa1cd" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2F5BCmZdTgam9bgzi0QUof%2FWR-Screen.004.jpeg?alt=media&#x26;token=7c7b66fb-1706-4e1b-9e6d-f3c0c089234b" alt="" width="375"><figcaption></figcaption></figure></div>

After filling required parameters, you should sign a transaction with the sender's wallet.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FwRbC9wOOlwZlDmq1cBX0%2F%D0%91%D0%B5%D0%B7%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.001.jpeg?alt=media&#x26;token=f8a97887-0c21-489c-8879-0fefecbf33e6" alt=""><figcaption></figcaption></figure>

After clicking the “<mark style="color:yellow;">**Sign**</mark>” button, the app will open Metamask wallet with a signature request. You should approve the signing.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FURntAU0DnRGLLiYS5baj%2FWR-Screen.005.jpeg?alt=media&#x26;token=6926653a-bc71-4302-86f2-93d79b938546" alt=""><figcaption></figcaption></figure>

If the signing is successful, the transaction block should display the transaction information, including the sender, receiver, value, gas, gas price, and nonce. Additionally, a green icon should appear to indicate that the transaction was signed successfully.

<div><figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FYOWSF7eeAEFHnqboOaZ7%2FWr-Screen1.002.jpeg?alt=media&#x26;token=ace214b0-680f-4573-9680-05230be6ca3e" alt=""><figcaption></figcaption></figure> <figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FCnB5txtmUHUHLBATfV1y%2FWr-Screen1.001.jpeg?alt=media&#x26;token=8e2f14d9-f3da-4b34-b4e2-2f887c108a5f" alt=""><figcaption></figcaption></figure></div>

After completing this transaction, your hacked account will have sufficient native currency to process other transactions.

\
You should choose the “HEX Data Tx” transaction type to add custom transactions.

<div><figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FQGWTo8tI195ZNmxOJACP%2FWr-Screen1.003.jpeg?alt=media&#x26;token=f88a2866-fe69-4fa7-89a0-152d2716abfb" alt=""><figcaption></figcaption></figure> <figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FtpLcd4ntt1LsMAvCKa7D%2FWR-Screen.008.jpeg?alt=media&#x26;token=d60940ce-843c-47af-aaf1-4524e01b4cd9" alt=""><figcaption></figcaption></figure></div>

To generate hex data for specific transactions, you can use specialized services or copy the hex data from your Metamask wallet during the transaction confirmation.

For example, if you have $CAKE tokens in a pool on a hacked account, you should navigate to the pool website and initiate a withdrawal transaction.

After the transaction request appears in your Metamask wallet, you should navigate to the 'HEX' section and copy the generated hex data.

<div><figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2Fu2JgDWRqVf3LhrCOcgiF%2FWR-Screen.010.jpeg?alt=media&#x26;token=abbac2ec-6857-4621-9215-d99b55301dec" alt=""><figcaption></figcaption></figure> <figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FunAUCVDUhTRt6NHJgMf9%2FWR-Screen.009.jpeg?alt=media&#x26;token=7a8f594d-2724-4499-91e8-2b72dc495635" alt=""><figcaption></figcaption></figure></div>

_`⚠️ Be cautious when processing transactions to a smart contract, as some contracts may contain malicious code. Always ensure that you are interacting with a trusted service.⚠️`_&#x20;

After generating the HEX data, you should specify the parameters in the recently added transaction. The Sender Address should be your compromised wallet, the Smart Contract Address should be the address of the staking smart contract, and the HEX Data should be the data you copied previously from Metamask. This transaction withdraws staked tokens or reward tokens from the staking smart contract to your compromised wallet.

After successfully signing the withdrawal transaction, you should specify the token transfer transaction to protect your claimed stake from hackers. To add this type of transaction, select the 'Token transfer' transaction type.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2F3Xppt1QdzeICDKwdP7lG%2Fhelp.001.jpeg?alt=media&#x26;token=b92b2ca5-ad77-4adc-b57c-6cf86d3487db" alt=""><figcaption></figcaption></figure>

Next, you should specify the transaction details for the token transfer. The Sender should be your compromised wallet, the Receiver should be your safe wallet, the Token Address should be the address of the token being transferred, and the Amount should be the quantity of tokens to be transferred.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FPmXXUeOOaqOgyJBOklrd%2FWR-Screen.012.jpeg?alt=media&#x26;token=924fb1a3-2373-4b2e-adbb-4ac318e5539d" alt=""><figcaption></figcaption></figure>

_`⚠️ If you see a message indicating that the currently connected wallet address and the 'Sender address' are different, simply open Metamask and switch to the correct wallet address.⚠️`_

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FGHsMtwjqTESPOED6Q8fT%2FWR-Screen.011.jpeg?alt=media&#x26;token=3f6a245b-c8f6-4cfb-8d24-e72d076bca82" alt="" width="375"><figcaption></figcaption></figure>

Once you have added all transactions to the bundle and signed them, you must simulate the bundle execution to ensure that each transaction will be processed without errors. To do this, click on the 'Simulate' button located in the upper section.

\
Following the bundle simulation, each transaction should display a simulation result of either 'Simulation success' or ‘Simulation failed’. If a transaction fails to simulate, the simulation error message will be displayed in the transaction's 'Simulation' section.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FieNkiWTOozuoJVVpLtLR%2F%D0%91%D0%B5%D0%B7%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.001.jpeg?alt=media&#x26;token=9084a35f-0276-469f-bee8-f015985fbb16" alt=""><figcaption><p>This error can appear when you try to send more tokens than you have on your account after claiming from staking.</p></figcaption></figure>

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2Fu1tVUfSNIy9r2NiogcvC%2F%D0%91%D0%B5%D0%B7%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.001.jpeg?alt=media&#x26;token=ed6ee167-c7a1-4fdd-b50d-785f850a5275" alt=""><figcaption></figcaption></figure>

Since the generated bundle was simulated successfully, we can now execute the transaction bundle to perform the staked token rescue actions.

\
To begin processing the transaction bundle, click on the Run button. The system will then display an informative pop-up message during bundle mining.

<figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FeBQWNtATch77prSQI0ya%2F%D0%91%D0%B5%D0%B7%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.001.jpeg?alt=media&#x26;token=49f0d777-2339-45b2-a545-9d3322f87b17" alt=""><figcaption></figcaption></figure>

_`⚠️ Please note that transactions may not be mined immediately, as private miners may not cover the entire HASH rate. Typically, it takes 1-2 minutes (or even less) to mine transactions, but this can vary depending on other factors such as network overload and provider response times. That is why Wallet Rescue waits for 100 blocks before aborting transactions.⚠️`_&#x20;

If transactions are not mined within 100 blocks, the bundle can be sent for mining again.

If transactions have not been mined yet, you can manually cancel the process of sending them to private miners by clicking on the 'Cancel' button. Please note that this process can be very quick, so double-check your transaction data before running the bundle.

<div><figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2F1CrUJf7czHdjilJ4wYLW%2F%D0%91%D0%B5%D0%B7%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.001.jpeg?alt=media&#x26;token=2f84569f-0a57-47c5-a70a-3982b78de1f9" alt=""><figcaption></figcaption></figure> <figure><img src="https://3525564716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6O8hzTCYYJcyzhLT0YBA%2Fuploads%2FORLIRnpMRDVZVq93GC1P%2F%D0%91%D0%B5%D0%B7%20%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F.002.jpeg?alt=media&#x26;token=69ae4ad2-c563-455f-bdd9-7d582db787e4" alt=""><figcaption></figcaption></figure></div>

After the bundle transactions are included in a block, the system will display links to the transaction explorer for each transaction.

```
// Some code
```

<mark style="color:yellow;">**This flow is a basic example of how our system can be used. You can perform more complex sequences to protect your funds or send private transactions**</mark>\
\
