--snip--
To perform dust attack, you only need to know the Bitcoin address. public key doesn't matter here.
Can't the attacker just derive the exact Bitcoin address from the raw public key?
Yes, attacker (or anyone else) could generate Bitcoin address from the public key. But in almost all cases, the Bitcoin address is
known first before the public key. Bitcoin address become known after it receive Bitcoin or the owner share it to other people. But public key become known after you spend Bitcoin from the associated address, the owner share signed message to other people or the owner share the public key directly to other people.