In a public blockchain, privacy is maintained through the use of encryption techniques. When transactions are recorded on the blockchain, the data is encrypted using cryptographic algorithms. This ensures that the details of the transaction are secure and can only be accessed by authorized parties who possess the necessary encryption keys. Additionally, public blockchains also employ techniques such as pseudonymity, where users are identified by unique alphanumeric addresses instead of their real identities, providing an additional layer of privacy and anonymity.