How can be proven that a signature is valid with it's public key
When signing the transaction, a sha256 hash of the transaction data is taken, and a ECDSA signature of this hash is generated using the private key.
When validating the signature, we first generate the sha256 hash of the transaction data the same way, then we validate the signature using the ECDSA algorithm by passing in the signature, the public key, and the transaction hash.