The digital signature is a series of tamper-proof code, which is used in Bitcoin to offer proof that a user owns the private key without having to reveal it.
The digital signature can be generated by the Bitcoin sender only. By verifying this code, it proves that the transaction was initiated by the sender and was not modified by anyone else during the process. After the completion, it groups the transaction message with the signature and sends it to the miners. Miners use the sender’s public key for verification. If it’s valid, it means he did initiate the transaction and it remains unaltered.