I have read few transaction diagrams about Ethereum and am not seeing use cases to decline a transaction.

If a sender (erroneously) identifies me as the receiving EOA on a transaction, how can I prevent it?
How does this translate for group transactions?

This may be a very naive question.

2 Answers 2

  • Externally Owned Accounts receiving Ether: Anyone can send you Ether, you can't stop them
  • Contracts receiving Ether: You can write a method that checks certain conditions and throws an error rather than receiving funds. However, this function will also consume gas, so if the permitted senders aren't sending enough gas your check function may cause permitted sends to fail. Also note the cases where this won't be enforced mentioned in Matthew Schmidt's answer.
  • EIP 20 tokens: Anyone can send you tokens, you can't stop them
  • How is it about in a PoA network. Could the sealers decline a transaction.
    – heinob
    Feb 6, 2019 at 5:08
  • In theory you could make special code to let sealers decline a transaction if they see it sends funds to a particular address. However, this will create a DoS vector, because people can make complex, expensive-to-execute transactions that get processed by sealers then reverted at no cost to the sender because they send to a blacklisted address, but the sealers don't discover that until after they've done a lot of processing. Feb 7, 2019 at 5:38

Even if you throw an error as @Edmund Edgar suggested, there's two situations which will still allow someone to send ether by force.

  1. The SELFDESTRUCT opcode sends all the remaining ETH of the current account to another. This isn't even an internal transaction, and you can't do anything about it.
  2. Miner rewards (both for blocks and uncles) are directly deposited to the account. There is no transaction, and you can't do anything about it, either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.