Crypto Burner Bot is a utility that monitors a wallet address and burns any ETH or BNB sent to it, effectively preventing anyone from paying gas fees and withdrawing funds from the target wallet. The primary purpose is to stop a sweeper bot from emptying a compromised wallet.
- NodeJS
- Clone the repository or download the source code.
- Run
npm i
in the root directory of the project to install the required packages. - Create a
.env
file in the root directory of the project and add the following values:NETWORK_RPC_URL
: The RPC URL for the network you are using.PRIVATE_KEY_ZERO_GAS
: The private key of the wallet you are targeting.
- Run
npm run start
in the root directory of the project.
The Crypto Burner Bot listens for new blocks in the blockchain and checks the balance of the target wallet. If there are any funds in the wallet, the bot attempts to burn them by sending a transaction with a gas price higher than the balance divided by 21000 (the gas limit for a simple transfer). This makes it impossible to mine a transaction with enough gas to withdraw the funds.
Here's a high-level overview of the script:
- Import the necessary libraries and load the environment variables.
- Set up a connection to the blockchain using the provided RPC URL.
- Create a wallet object using the provided private key.
- Define the
burn
function, which:- Retrieves the wallet's balance.
- Calculates the gas price required to burn the funds.
- Sends a transaction with the calculated gas price to burn the funds.
- Set up an event listener for new blocks in the blockchain.
- Call the
burn
function whenever a new block is detected.
This application is largely based on code supplied in a Twitter thread by Santiago Palladino.