Since once a private key is public knowledge, anyone can sign with them, and there are plenty of bots prepared to drain funds added to exposed accounts. My question is, what ways are there to nonetheless fund such an exposed account and do another transaction (e.g. calling a smart contract) via that account? In other words, is there a way to make sure a block only contains a transaction funding said account iff it also contains a transaction directly using (most of) that funding?
2 Answers
There is no way to block transactions, once your private key is public your each deposit will be drained as soon as its sent. Just leave the key and generate new once.
Some MEV bots are set to tarket a minimum account balance amount you can check if that is the case to make some transactions if you're MEVed.
-
Agreed, you cannot block a transaction. The question is whether there are mechanisms to make sure your spending happens first. I wonder if a flashbot can manage this, but that probably requires the funding and spending to happen in the same block yet in the proper order, which I don't know the feasibility of...– ZommuterCommented Oct 26, 2023 at 7:58
Flashbots can be used to fund a compromised account and spend those funds in the same block. But aside from scams and honeypots there probably is no feasible use case to intentionally expose a private key.