How public-key cryptography ensures transaction security
It consists of a public-key cryptosystem in the sense that it uses a pair of cryptographic keys-a public key and a private key-to produce and verify digital signatures. In the context of blockchain systems, including Bitcoin, the public key will be for receiving funds, whereas the private key will be the authorization to send the funds from the address. The result is that only the owner of a private key can cause a transaction to fire, providing a safe way to verify ownership without ever exposing the private key itself.
When it is created, a transaction is signed with the sender's private key. The result of that digital signature is not only unique to the transaction but also to the private key-so unique that it is virtually impossible to reproduce without the original private key. Then, that signed transaction may be verified by anybody on the network via the sender's public key to confirm its validity and that the transaction has not been tampered with in any way.
By the use of public-key cryptography, there is no fraud and unauthorized access, as it is only the rightful owner who can generate a valid signature for those transactions emanating from his address. Since the private key is not shared and will never be computationally viable to derive it from the public key, then users can confidently know their funds are safe when engaging in such transactions. The underlying cryptographic model provides a secure, decentralized way of verifying ownership and confirming transactions, which is instrumental to blockchain's trustless environment.
Thanks
~ Nesaty