In order to unstake itself, an account needs to issue a staking transaction with amount=0
but the format of the staking action requires to also specify a staking public key. Is this public key used for anything during unstaking or is it redundant information which is ignored?
It is redundant information. It is done this way so that we don't have to introduce another type of transaction.