But the properties of ECDSA allows us to skip this public key and by having some address and some signature, it is possible to verify it
To verify an ECDSA signature you do need the public key (R = (x
R, y
R) = u
1G + u
2Q
U where Q
U is the public key).
In fact you need 3 things: signature (r,s), the public key and the message that was signed (ie. the tx).
Then, why storing public keys in the blockchain is needed if they can be safely skipped and calculated from signature and address?
Because:
1. In ECDSA we can recover public key from signature + message but we may end up with more than one possible pubkey (up to 4 for secp256k1 with h=1). So we may have to verify the signature multiple times to see which pubkey is valid and that wastes a lot of time since the verification is an expensive process.
2. Recovering possible public keys is an even more expensive process that would slow down verification of blocks if pubkeys weren't present.