In blockchain, private keys and public keys are used to create a digital signature for each transaction. The private key is used to sign the transaction, while the public key is used to verify the signature. This ensures the authenticity and integrity of the transaction.